Support Forum

Reboot framework

AT Alex T
Alex T
Member

How do I actually make the changes in the theme editor?  Let’s take this request for instance: https://simple-press.com/support-forum/sp5-general-topics/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

21 Answers

New Answer

IK Ike
Ike
Member

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?

AT Alex T
Alex T
Member

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.

IK Ike
Ike
Member

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.

AT Alex T
Alex T
Member

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?

YS Yellow Swordfish
Yellow Swordfish
Member

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

AT Alex T
Alex T
Member

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);
 
YS Yellow Swordfish
Yellow Swordfish
Member

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

AT Alex T
Alex T
Member

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.  

IK Ike
Ike
Member

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!

AT Alex T
Alex T
Member

Got it.  By the way, you also have to have the same file in the your child for mobileview.  My forum would not load on mobile unless I added the same file that I modded for desktopview.  

Now my next issue is that I added the thanks stats, however the color is white and you can’t see it except for the stars.  This had happened previously: https://simple-press.com/support-forum/sp5-general-topics/thanks-plugin-2/

Also, the signature color is white and can’t be seen.  

MP Mr Papa
Mr Papa
Member

plan is to get an update out to the framework in next day or two hopefully…

AT Alex T
Alex T
Member

I cant seem to make changes to reboot.php.  I want to change the blockquote and add a box shadow around it, though when I add the code in reboot.php and place it in the child folder nothing happens.  

IK Ike
Ike
Member

That is probably due to the child theme using a .css file rather than the .php file in the original.

You can specify your own child stylesheet, just open spTheme.txt in the root of the child theme and change the line:

Stylesheet: reboot-child.css

to

Stylesheet: reboot.php

Or – alternatively keep it as .css

If the stylesheet uses overlay variables it needs to be a .php file, if it just has plain CSS then it should be .css file. The reason why the child framework comes with a .css file is because for the most part people just want to add the odd change. Anything more extensive then as mentioned above you have the option to change it.

AT Alex T
Alex T
Member

So I copied reboot.php, added this code, and then added reboot.php in my child style folder.

#spMainContainer .spTopicPostSection .spPostSection .spPostContentSection .spPostContent blockquote {
 overflow: hidden;
 background: <?php echo($postQuoteBackGroundColor); ?>;
 color: <?php echo($postQuoteColor); ?>;
 border: <?php echo($postQuoteBorder); ?>;
 margin: 0 0 1em;
 padding: 10px;
 <?php echo($smallRadius); ?>
 word-wrap: break-word;
 box-shadow: 0px 1px 1px 0px #99a3ad, 0px 0px 10px #eeeeee;
}

I then went ahead and edited the sptheme.txt to this:

Simple:Press Theme Title: Reboot Child Framework
Parent: reboot
Version: 1.0.0
Theme URI: https://simple-press.com
Description: A Simple:Press cross-device/responsive based theme featuring traditional forum layout with numerous colour layout options
Author: Ike Staines, Andy Staines & Steve Klasen
Author URI: https://simple-press.com
Stylesheet: reboot.php
Screenshot: spTheme.jpg
Simple:Press Versions: 5.5.5 and above

Though the block quotes did not change?