Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Reboot framework
Avatar
Alex T
Member
sp_UserOfflineSmall Offline
Mar 23, 2015 - 2:39 pm

How do I actually make the changes in the theme editor?  Let's take this request for instance: https://simple-press.com/suppo.....avatars-1/

What am I supposed to place inside this empty space?  The question in that thread was how I could change the avatars in forum view to reflect the author.  This is what I was advised to do:

In Reboot you will need to edit the spForumViewDesktop.php template in the theme folders or – in other themes the spForumView,php template. Preferably add the template to your child theme and edit that.

Look for the display function named sp_TopicIndexIcon() and comment it out. It is about two-thirds of the way down the file.

Underneath the commented out function add the following call:

 
1 sp_UserAvatar('tagClass=spRowIcon spLeft&context=user', $spThisTopic->first_user_id);

and that will display the avatar of the user who started the topic.

This will, of course, remove all use of custom icons so it will no longer show when new, unread posts have been made to a forum

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Mar 23, 2015 - 4:20 pm

Hey Alex,

Sorry what empty space are you referring to? As Steve said in the other thread Reboot's file structure is a little different.. Sorry if I'm missing something but could you elaborate?

Avatar
Alex T
Member
sp_UserOfflineSmall Offline
Mar 23, 2015 - 7:18 pm

Sorry, I meant when you activate the reboot child and then you go to the editor. There are only two files in there, spfunctions.php and the reboot-child.css.

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Mar 23, 2015 - 7:37 pm

That is because when using the child theme, anything you want to change template wise you will need to firstly add. So - you will need to copy spForumViewDesktop.php from the reboot > templates > desktop folder into your child theme's templates > desktop folder.

But as Steve said - the theme editor wont see the 'desktop' or 'mobile' folders, so you will need to make the changes in an external editor.

Avatar
Alex T
Member
sp_UserOfflineSmall Offline
Mar 25, 2015 - 9:51 am

Ike said
That is because when using the child theme, anything you want to change template wise you will need to firstly add. So - you will need to copy spForumViewDesktop.php from the reboot > templates > desktop folder into your child theme's templates > desktop folder.

But as Steve said - the theme editor wont see the 'desktop' or 'mobile' folders, so you will need to make the changes in an external editor.

So I copied the spForumViewDesktop.php from reboot, then added it into the desktop folder in the reboot child folder, made the changes necessary in noteped, yet the changes did not take?  Am I missing a step here?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 25, 2015 - 12:09 pm

Did you also make the child theme your current theme in the forum admin?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Alex T
Member
sp_UserOfflineSmall Offline
Mar 25, 2015 - 12:24 pm

Yellow Swordfish said
Did you also make the child theme your current theme in the forum admin?

Yes, I have the reboot-child framework as my theme.  I know it works as I have uploaded my overlay and have it working.  I just can't get this specific code to work.  

When you copy the spForumViewDesktop.php and place it in the desktop folder in the child folder, doesn't the whole document have to be re-read?  Does this slow loading?  Does every single line of code have to be there, or can I delete everything and just add this?

/*sp_TopicIndexIcon('tagClass=spRowIcon spLeft');*/
sp_UserAvatar('tagClass=spRowIcon spLeft&context=user', $spThisTopic->first_user_id);

 
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 25, 2015 - 12:48 pm

No it requires the whole page of code. This is then used instead of the one in the main Reboot theme. It really is about as close as you can get with WordPress...!

What about caching? Could the old page be cached anywhere? This is nothing different to what we do here only we do it with the Group View and not the Topic View template

andy-signature.png
YELLOW
SWORDFISH
Avatar
Alex T
Member
sp_UserOfflineSmall Offline
Mar 25, 2015 - 1:41 pm

So I just tried adding the thanks reputation.  I copied the sptopicviewdesktop.php and added this line of code:

sp_PostIndexUserRegistered('tagClass=spPostUserRegistered spCenter', __sp('Member Since:<br /> %DATE%'));
 sp_thanks_user_stats('tagClass=spCenter spThanksUserStats', $spThisPostUser->user_id, 'Thanked %THANKED% times');
sp_thanks_post_user_reputation('tagClass=spCenter spPostUserThanksReputation', 'Reputation:');
 sp_PostIndexUserStatus('tagClass=spCenter spPostUserStatus', __sp('Online'), __sp('Offline'));

I added the file into the mobile folder in the reboot-child and nothing changed.  

Avatar
Ike
Sawtry, UK
Member
Free Members
sp_UserOfflineSmall Offline
Mar 25, 2015 - 7:00 pm

Hey Alex,

Really sorry - Seems we are still working out the kinks!

Because Reboot uses a different folder structure to make for a clearer definition between desktop and mobile as far as templates go, you also need the parent template.

So if you are changing spHeadDesktop.php, you will also need spHead.php in your reboot-child > templates folder - i.e

reboot-child > templates > spHead.php
reboot-child > templates > spForumView.php
reboot-child > templates > Desktop > spHeadDesktop.php
reboot-child > templates > Desktop > spForumViewDesktop.php

If you take a look at the plain spHead.php or any other parent template (one that also exists in the desktop or mobile folder) you will see why - it's only a couple of lines but it includes the important if mobile check. Without that it doesn't know spHeadDesktop.php or others exists.

Again - sorry for the delay in getting this right, it's actually an easy one to overlook!

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625