Support Forum

Edit profile button – change text

SS Sebastian Schimpf
Sebastian Schimpf
Member

Hi there,

if I just want to change the text of the “Profile” button in the forum header, how do I achieve this?

I found this function: sp_ProfileEditButton
But I am not sure how to use it. Do I put this function in my functions.php file and make the changes I need. It would be awesome if you could provide the code.

Another change I want to make is that the breadcrumb does not show the link to the homepage in the beginning. Shall I open another topic for this?
I found the function as well:

sp_BreadCrumbs(

'tagClass=spLeft spBreadCrumbs&tree=0'

);

 
But I don't know where to place it. 🙂


Any help is appreciated!

11 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

before you do any editing of templates can I recommend you establish a child theme? Download the appropriate child theme framework (free from the store) and then switch your theme to using that. You can rename it – which is also recommended. Then come back and tell me which theme you are actually using (the parent) and I can talk you through those changes.

https://simple-press.com/documentation/codex/themes/theme-basics/creating-a-child-theme/

SS Sebastian Schimpf
Sebastian Schimpf
Member

Thank you Yellow Swordfish!

That makes perfect sense.
I am actually already working on the customization of a reboot child theme. Until now I did all just via CSS but the changes I just mentioned than need to happen in the template files I guess.

So is it true that if I want to change the text of a button I will have to touch the template files? There is no quicker way through a hook or something?

SS Sebastian Schimpf
Sebastian Schimpf
Member

Another thing I want to do is to bring the information of the time zone of the forum and the information about the user timezone into one paragraph, just “separated” by a line break.
Like this:
Forum Timezone: America/New_York
Your Timezone: UTC

And I would like to bring the Admin info and the Moderator Info into one paragraph as well.
The footer layout is quite to scattered in my opinion. The functionalities are great, just the layout needs a lot of fixes to be more consistent if you ask me.

I have hidden some elements by css because I believe that for most users it will just be overwhelming to see all those details.

As you can see it looks already much simpler but the changes I mentioned will make it look much cleaner.

screenshot_5.png
YS Yellow Swordfish
Yellow Swordfish
Member

Al right. Sounds good.

So for the profile question you had the right function – sp_ProfileEditButton() and you can see that the lable used on the button is the second parameter (1: arguments, 2: label, 3: tooltip). So you can change the label as you please.

But I am not sure why you should be missing the home link in the breadcrumbs. The code checks that:

  1. There is a home label passed (in the function call sp_BreadCrumbs() – last/second parameter which defaults to the work ‘Home’.
  2. A valid home url is available which defaults to the site url as set in your Wp settings
  3. The forum page is not a page that is set to be the front/home page of your website.

If they all check out the home button should just be displayed. So – are they all set?

YS Yellow Swordfish
Yellow Swordfish
Member

For the timezone one then you need to now edit the spFoot templates. Look for the function sp_UserTimeZone() and of you want it over on the left change the spRight class to an spLeft class in the passed arguments.

More info: https://simple-press.com/documentation/codex/api/template-functions-and-the-api/display-template-functions/common-view/sp_usertimezone/

I am unsure why your ;’moderators’ list is over on the right like that as you can see from ours (also reboot) that they run one after the other which I assume is what you want. Did you change something?

SS Sebastian Schimpf
Sebastian Schimpf
Member

Thanks!
I will go more into details tomorrow. Just finishing my work for today, actually.
Hey, I think you misread my question about the breadcrumbs. I do not want the button to the website’s homepage. I have only one forum group and would like the first button to go to that forum “homepage” so to speak, which is right now the second button. So basically I just want to get rit of the home button.

Many thanks!

SS Sebastian Schimpf
Sebastian Schimpf
Member

I could not leave my fingers from the keyboard and came up with this but I have the problem that when I add the parameter “get” in the end with value 1, I just get the output “array” and not the actual list of names.
Can you tell me what I am doing wrong?

sp_SectionStart('tagClass=spPlainSection', 'adminstuff1');
 echo 'Administrator: ' . 
 sp_AdminsList('tagClass=whatever&spanClass=adminlist&postCount=0&echo=0') . 
 '   Moderator: ' . 
 sp_ModsList('tagClass=whatever&spanClass=modlist&postCount=0&echo=0');
sp_SectionEnd('', 'adminstuff1');
YS Yellow Swordfish
Yellow Swordfish
Member

Breadcrumbs:
You should just be able to remove the ‘home’ label in the template function call. That should be enough I think.

Mods: Well the return value if the moderators IS an array. But you have no code that deals with an array – like a foreach or something. It needs assigning to an array variable and then dealing with. I am still curious as to what is displaying it in the middle of the column like that…

SS Sebastian Schimpf
Sebastian Schimpf
Member

Thank you!
The breadcrumbs look good now.
And I was able to solve most of the other issues just by trying and seeing what happens 😀

The Footer:

screenshot_7.png

I am almost happy with the looks of the footer.
I still think the “toggle” button for the “statistics” is wayyy to small for users who are not experienced with this kinda interfaces.

How does the timezone feature actually work?
I just used the forum from another laptop, using the same wifi connection and with the time zone (UTC+08:00) Kuala Lumpur, Singapore set in Windows but the forum it showed me that I were in the same time zone like the forum. That was confusing.
Edit: Just check on my girl-friends Android phone and it showed the same thing:
Your timezone is: America/New_York
There is something not working as expected. Please help!

Another question:
I would like to show the notification about the time zone only when the time zone of the user is different from the time zone of the forum – because only than it is relevant – in my opinion.

Would something like this work:

if(sp_ForumTimeZone() === sp_UserTimeZone()) :
    do something ... 
else:
    do something else ...
endif;
SS Sebastian Schimpf
Sebastian Schimpf
Member

Here is my code for the timezone (that has issues being displayed with correct timezone:

sp_SectionStart('tagClass=spPlainSection timezoneinfo', 'adminstuff2');
 echo '
 <p><span class="interface-note">Please note that the forum timezone is:</span> <strong>' . 
 sp_ForumTimeZone('echo=0&get=1') . 
 '</strong><span class="interface-note"> ~ Your timezone is:</span> <strong>' . 
 sp_UserTimeZone('echo=0&get=1') . 
 '</strong></p>';
sp_SectionEnd('', 'adminstuff2');
YS Yellow Swordfish
Yellow Swordfish
Member

Using UTC timezones is WordPress is a really bad idea. They really only support them for backwards compatibility to the days when php had pretty bad timezone support. I have argued that they should nopt even do this. It is not well supported.

Please see this FAQ for how this works and what you should be doing. Note we also have a plugin available that adds the timezone selection to the wp registration form so new users are encouraged to get it right.

http://simple-press.dev/documentation/codex/faq/troubleshooting/why-do-my-new-posts-show-as-posted-minus-seconds-ago/

I can’t say that I agree with you on the relevance of showing the users timezone only if different but that;’s your call. If you add the ‘get’ argument to your code then it should work.