Support Forum

Remove Forum Rank Text and Usergroup in Post Profile

WE Wendell
Wendell
Member

since i already have a forum rank badge, would like to remove the forum rank text and the usergroup as well in the post profile (under the avatar)… how do i do it?

 

     

remove the text ‘Reserve’ and ‘Members’.

would also like to rename ‘Forum Posts’ to simply ‘Posts’.

 

thanks. 🙂

38 Answers

New Answer

IK Ike
Ike
Member

Hey Wendell,

It’s pretty straight forward to remove these elements but it does involve you setting up a child theme so these changes are not lost next time Reboot theme updates. Start off by downloading the free Reboot Child Theme Framework from the store and installing it following the instructions on the Creating a Child Theme page – Scroll down and see the section ‘Child Theme Frameworks’.

You will then need to copy in the template spTopicViewDesktop.php from:

sp-resources > forum-themes > reboot > templates > desktop > spTopicViewDesktop.php

to your child themes templates folder i.e:

sp-resources > forum-themes > yourchildtheme > templates > desktop > spTopicViewDesktop.php

So, working from your child themes spTopicViewDesktop.php template – To remove the user rank text you will need to locate the function ‘sp_PostIndexUserRank’ roughly on line 137 and add the ‘showTitle’ argument set to 0. The function should then look like:

sp_PostIndexUserRank('tagClass=spPostUserRank spCenter&showBadge=1&hideIfSpecialRank=1&showTitle=0');

To remove the usergroup memberships display you will need to comment out the following function directly after ‘sp_PostIndexUserMemberships’ with a hash so it will then appear as:

#sp_PostIndexUserMemberships('tagClass=spPostUserMemberships spCenter');

And lastly, 2 lines down from there you should find ‘sp_PostIndexUserPosts’, and you can then change the label at the end of the argument removing the word ‘Forum’ so it should then appear:

sp_PostIndexUserPosts('tagClass=spPostUserPosts spCenter', __sp('Posts: %COUNT%'));

That should do it!

WE Wendell
Wendell
Member

@ike 

thanks so much for explaining it to me in great detail, got what i wanted. 🙂

 

just a follow-up question, is it possible to have image custom fields inserted there? i run a sports forum and members want to have their team logos in their post profiles.

MP Mr Papa
Mr Papa
Member

you might look at the custom profile fields plugin which allows users to add info for custom fields you define… then you can show it where ever you want…  though not sure it does an image per se… you might have to add the logic when displaying for converting their team to an image…

WE Wendell
Wendell
Member

hi @ike 

just have a follow-up question, still with regards to the user profile in posts.

for mobile view, how do i arrange the fields so that the rank is underneath the username and number of posts is underneath the rank – with no empty spaces.

 

 

the ‘Admin’ should be under ‘Kapitan’ and the ‘Posts: 25’ under the rank (Admin) – with no empty spaces.

what should i do? thanks.

IK Ike
Ike
Member

For starters I take it you’re using Unified for mobile? If so you will have to create a child theme for Unified using the same method detailed above.

Next you will need the Unified spTopicView.php copied over to your Unified child themes templates folder. Now you have to be more careful in Unified as the templates are not split into ‘Desktop’ and ‘Mobile’, and instead both desktop and mobile code is in the template.

The rule you need to follow here is that anything under:

if($spDevice == ‘mobile’) {

Is mobile.

Anything under

if($spDevice != ‘mobile’) {

Is NOT mobile.

Navigate to line 163 and you have the start of the mobile topic view user area but you will have to be careful as underneath the username you have location. If you are happy to loose location you can replace it with the rank function from line 195. The whole column should then look like:

sp_ColumnStart('tagClass=spAvatarSection spLeft&width=76%&height=15px');
    sp_UserAvatar('tagClass=spPostUserAvatar spLeft&context=user', $spThisPostUser);
    sp_PostIndexUserName('tagClass=spPostUserName spLeft');
    sp_InsertLineBreak();
    sp_PostIndexUserRank('tagClass=spPostUserRank spRight&showBadge=0&hideIfSpecialRank=1');
    sp_InsertLineBreak();
    sp_PostIndexUserPosts('tagClass=spPostUserPosts spLeft', __sp('Forum Posts: %COUNT%'));
sp_ColumnEnd();
HA Hari
Hari
Member

I have an additional question in above context.

Btw, as a general comment, I personally would prefer to have the “display on/off” function of existing Standard-Options like “group membership” in the admin section, instead of coding it via a child-theme, because I dont want to become a programmer again. But anyway, it is how it is, I accept your general design decision, although I dont like it.

My special problem is:

I use “Reboot” and have now configured and activated (reluctantly) a child theme per your instructions above.

It worked, as I successfully was able to remove the usergroup memberships display per your description above. Thanks.

But in addition, I want to have the normal Ranks (in terms of number of posts) *always shown* and not be overwritten by the special rank.

(I dont really understand from a design-viewpoint why you mix both, because couting numbers of posts and general ranks because of status are seperate concepts to me)

For two special ranks it works, they are displayed both one after the after, but the combination of “normal” rank and “special” rank just shows the special one.

Reason is, that I want to use the “special rank” as an additional display of some “status” of members, for example the members of the first hour as “Founders”. But this display should be “in addition” to the number of posts.

I identified line 139

sp_PostIndexUserRank(‘tagClass=spPostUserRank spCenter&showBadge=1&hideIfSpecialRank=1’);

and thought that even as a non-programmer I could assume that by removing the “&hideIfSpecialRank=1” string the user rank would be displayed always – together with the special rank.

But it didnt work. What do I need to change?

Also I would like to know, if I dont want the text of the “special rank” be displayed too, is it done by adding “&showTitle=0″ in line 140?

Thanks!

YS Yellow Swordfish
Yellow Swordfish
Member

For the first question do not remove the ‘hideIfSpecialRank‘ argument. Instead change the 1 to a zero (i.e., false).

And for the second then yes – add exactly what you have there – ‘&showTitle=0‘.

Prior to version 5 of Simple:Press we offered far more options than we do now for the display and, to be frank, it seemed to confuse more people than it helped; it made the display code more and more difficult to maintain; it created an even more bloated admin side than is the case now and somewhere along the line you have to decide where to stop!

Opting for a templating system has allowed for non-programmers to change and customise their display and has resulted in far greater flexibility than any other methodology.

HA Hari
Hari
Member

Thanks, it worked!

In the general case, I understand your argument and accept it. It is just my preference that I want as much “standard-code” as possible and in the ideal case no code-customization at all. But I am not center of the universe. 😉

Thanks again.

YS Yellow Swordfish
Yellow Swordfish
Member

You’re welcome. Glad it worked OK…

HA Hari
Hari
Member

Well, there is always a followup problem in coding …. here it is ;):

My spTopicViewDesktop in the child theme now looks as follows in lines 136-141:

sp_UserAvatar(‘tagClass=spPostUserAvatar spCenter&context=user’, $spThisPostUser);
sp_PostIndexUserName(‘tagClass=spPostUserName spCenter’);
#sp_PostIndexUserLocation(‘tagClass=spPostUserLocation spCenter’);
sp_PostIndexUserRank(‘tagClass=spPostUserRank spCenter&showBadge=1&showTitle=0&hideIfSpecialRank=0’);
sp_PostIndexUserSpecialRank(‘tagClass=spPostUserSpecialRank spCenter&showTitle=0’);
#sp_PostIndexUserMemberships(‘tagClass=spPostUserMemberships spCenter’);

Everything looks good on the desktop side for normal members

But …. on the mobile side, the sequence between “normal” rank and “special rank” seems inverted.

The “special rank” icon is show first (on top) now, followed by the “normal rank” (below). As my icons differ vastly in size and orientation, things look strange that way.

I looked into spTopicViewMobile myself, but I am not sure where and how to change the display sequence.

What do I need to change, to have the standard sequence in mobile too?

Meaning “normal rank” first and than all “special ranks” one after another?

Thanks in advance

 

PS: Also: how can I define the sequence of the “special ranks” shown in the rank info overview of the “ranks  plugin” one under the other? They are mixed without a system – at least I cant identify a system. It seems to be neither the alphabet nor the last time of edit.