Special and Normal Rank Images

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
Locked
User avatar
[o0]
Registered User
Posts: 23
Joined: Sat Apr 25, 2009 10:04 am
Location: Germany
Contact:

Re: Special and Normal Rank Images

Post by [o0] »

IBBoard wrote:That sounds like exactly what this MOD does - lets users with "special" ranks have both their normal rank (like the one you linked to) and their "special" rank. The default template changes won't lay it out exactly how you showed, but that's just a case of personalisation of the templates.

There's currently a bug with the members list if you set the "show special as extra" option to true, which I'll try to fix soon in a dev build. Nothing catastrophic, it just ends up only showing ranks for users with special ranks and blanks for other users.
Okay thanks, I'll try this mod in the next couple of days. I wasn't sure if that's possible because normally you can't use a rank image without a ranktitle/text. But changing this directly in the template sounds a good idea.. do you know what I've to change there? I'm using revolution, a prosilver based style.

Mh I don't care if the ranks are shown in the memberlist.. the viewtopic thing is much more important.

Thank you ;]
User avatar
IBBoard
Registered User
Posts: 542
Joined: Wed May 25, 2005 9:02 pm
Location: Worcestershire, UK
Contact:

Re: Special and Normal Rank Images

Post by IBBoard »

The standard template (Prosilver at least) supports just rank images or just rank names from what I remember. Even if it doesn't, it is quite simple to change it so that it is set up that way. All you need to do to get just the rank image is delete the bit of the template that says "put the rank text here".

As for the changes you need to make, I don't know as it depends entirely on how modified it is. I'm only planning to support Prosilver (as it is a modern template using divs and CSS) and subsilver if people force me (because it is an ugly template using tables for layout). People should generally be able to pick up their templating needs from there.
User avatar
[o0]
Registered User
Posts: 23
Joined: Sat Apr 25, 2009 10:04 am
Location: Germany
Contact:

Re: Special and Normal Rank Images

Post by [o0] »

It works :D

I just had to replace

Code: Select all

<!-- IF postrow.RANK_TITLE or postrow.RANK_IMG --><dd>{postrow.RANK_TITLE}<!-- IF postrow.RANK_TITLE and postrow.RANK_IMG --><br /><!-- ENDIF -->{postrow.RANK_IMG}</dd><!-- ENDIF -->

<!-- IF postrow.EXTRA_RANK_TITLE or postrow.EXTRA_RANK_IMG --><dd>{postrow.EXTRA_RANK_TITLE}<!-- IF postrow.EXTRA_RANK_TITLE and postrow.EXTRA_RANK_IMG --><br /><!-- ENDIF -->{postrow.EXTRA_RANK_IMG}</dd><!-- ENDIF -->
in the viewtopic_body.php with this

Code: Select all

<!-- IF postrow.RANK_TITLE and postrow.EXTRA_RANK_TITLE --><dd>{postrow.RANK_TITLE}<!-- IF postrow.EXTRA_RANK_IMG --><br />{postrow.EXTRA_RANK_IMG}<!-- ENDIF --></dd>
<!-- ELSE --><dd>{postrow.RANK_IMG}</dd><!-- ENDIF -->
The only problem I found with this change is that you can't use an image for the special rank. I don't know why, but I guess there's something wrong with the if things.. but okay, I don't need these images anyway.
User avatar
IBBoard
Registered User
Posts: 542
Joined: Wed May 25, 2005 9:02 pm
Location: Worcestershire, UK
Contact:

Re: Special and Normal Rank Images

Post by IBBoard »

If you get your IF statements and conditions right then you should be able to do any combination of rank title, rank image, extra rank title and extra rank image (where the user has them). What you have currently says "If you have a rank title and an extra rank image then show that, else show the rank image". That also means that your inner IF is a bit pointless, since it must be true if you've reached that point :)
flexsingh
Registered User
Posts: 15
Joined: Thu Jun 11, 2009 7:57 pm

Re: Special and Normal Rank Images

Post by flexsingh »

Hi,

I'm fairly new to this, so please accept my apologies in advance if I'm asking some silly questions...

I setup a forum www.flexingh.com and tried to install this mod, but I cant seem to get the special ranks to display.

The normal ranks which come up depending on how many posts you do is ok, but cant get the admin or any other special ranks to display.

Is there anyone that can help me please?

Thanks
User avatar
[o0]
Registered User
Posts: 23
Joined: Sat Apr 25, 2009 10:04 am
Location: Germany
Contact:

Re: Special and Normal Rank Images

Post by [o0] »

Mh, yeah, you're right^^ Anyway, thanks for this great mod :]
youngjediknight
Registered User
Posts: 385
Joined: Wed Apr 22, 2009 2:58 pm

Re: Special and Normal Rank Images

Post by youngjediknight »

IBBoard wrote:That also means that your inner IF is a bit pointless, since it must be true if you've reached that point :)
I always find myself struggling with my Inner IF. :( :D
User avatar
IBBoard
Registered User
Posts: 542
Joined: Wed May 25, 2005 9:02 pm
Location: Worcestershire, UK
Contact:

Re: Special and Normal Rank Images

Post by IBBoard »

We start with ranks and we get on to philosophy :D

flexsingh: You missed an "s" from your domain name there ;) After you've installed the MOD, have you refreshed your template cache (one of the options in the ACP)? If you don't refresh the cache then it'll still be using the old templates. Also, check your template to make sure that you made the correct modifications, and check the error log on your server to see if PHP is generating any warnings about incorrect code that are being logged that might be caused by errors applying the MOD.
User avatar
edgar davids
Registered User
Posts: 376
Joined: Mon Jan 19, 2009 7:15 am

Re: Special and Normal Rank Images

Post by edgar davids »

Great MOD!
User avatar
manuxtreme
Registered User
Posts: 48
Joined: Tue Aug 23, 2005 11:54 am

Re: Special and Normal Rank Images

Post by manuxtreme »

This mod works fine, however when I move a member from a group with special rank to a normal group, his special rank remains. Any idea why?
User avatar
IBBoard
Registered User
Posts: 542
Joined: Wed May 25, 2005 9:02 pm
Location: Worcestershire, UK
Contact:

Re: Special and Normal Rank Images

Post by IBBoard »

I'll have to investigate. This MOD doesn't do anything extra in terms of querying or caching data, so it'd seem a bit odd if the MOD caused it.

phpBB has a "get_user_rank" function call that takes the user's post count and the special rank associated with them (which is 0 for no special ranks). If the user has a special rank value > 0 then the function returns the special rank, otherwise it returns the normal rank. All this MOD really does is add an extra wrapper function that calls "get_user_rank" a second time but passes 0 to make sure it gets the normal rank (so for users with special ranks the normal call gets their special rank using an unchanged phpBB method and the extra call gets their special rank).

It could be an error from phpBB caching something, but I'm not sure, it'd need checking on an un-modded board.
User avatar
manuxtreme
Registered User
Posts: 48
Joined: Tue Aug 23, 2005 11:54 am

Re: Special and Normal Rank Images

Post by manuxtreme »

Aye thanks :)

Just for your information, I got these mods installed on PHPBB 3.05

Code: Select all

1. Board3 Portal v1.0.3
2. Buttons Menu v1.1.0
3. Categorize Announcements and Stickies v1.0.0
4. Genders v1.0.1
5. Universal No Avatar v1.1.0
6. User Notes and Warnings in Viewtopic v1.0.2
7. NV Advanced Last Topic Titles v1.2.8
8. NV Recent Topics v1.0.4
9. phpBB Statistics v1.0.0
10. Prime Multi-Quote 1.0.1b
11. Prime Quick Reply v1.0.7
12. Special and Normal Rank Images 1.0.1
13.Topic Text Hover v1.0.5
14. ReIMG Image Resizer v0.0.10
15. View or Mark Unread Posts v1.0.5c
16. phpbb Arcade v1.0 RC8
17. User Reminder v1.0.1
18. Anti Double Post v2.0.3
19. User Status v1.0.5
20. Welcome PM on Log-In v1.0.0
21. Expand Categories v1.2.1
22. Prime Ban to Group v1.0.0
User avatar
IBBoard
Registered User
Posts: 542
Joined: Wed May 25, 2005 9:02 pm
Location: Worcestershire, UK
Contact:

Re: Special and Normal Rank Images

Post by IBBoard »

Quite a collection then! None of those look obvious as the cause. I did just trigger similar behaviour on my forums though.

If the user still has the special rank showing, can you look in the database for me, find the user in the phpbb_users table (modified as appropriate if you changed the table name prefix) and see what the value is in their "user_rank" field. Either that or going in to the ACP, "Manage User" and then "Rank" should tell us whether the rank has been set as the user's rank for some reason.


[edit] That appears to be a bug someone introduced in the code so that it passes the wrong group ID at one point and so doesn't remove the rank. To fix it (until phpBB 3.0.6 or a hot-fix is released) open includes/function_user.php then find:

Code: Select all

		if (isset($sql_where_ary[$gid]) && sizeof($sql_where_ary[$gid]))
		{
			remove_default_rank($gid, $sql_where_ary[$gid]);
then find inline:

Code: Select all

($gid
and replace inline with:

Code: Select all

($group_id
That'll undo the breaking change and fix the problem :) I've also posted a bug report about it, so it should get fixed in the core code as well.
Last edited by IBBoard on Sat Jun 13, 2009 7:42 pm, edited 1 time in total.
User avatar
manuxtreme
Registered User
Posts: 48
Joined: Tue Aug 23, 2005 11:54 am

Re: Special and Normal Rank Images

Post by manuxtreme »

Ah ok right. Thanks mate for looking into it :)

EDIT: Oh yeah I will do the changes and report back :D

EDIT2: Ok which one of those inline should I replace. I count three instances there lol
User avatar
IBBoard
Registered User
Posts: 542
Joined: Wed May 25, 2005 9:02 pm
Location: Worcestershire, UK
Contact:

Re: Special and Normal Rank Images

Post by IBBoard »

Oddly enough, you need to change the fourth occurrence that you didn't count as part of those three :D (well, the third one in that code but a fourth one to add to the three you counted).

I've fixed my previous post now :) It won't solve the user who you've already removed (you'll need to edit them individually) but it will fix it for anyone else you remove in future. The only down side with patching it is that it'll cause one of the patch instructions to fail to apply when it is officially fixed, but given the amount of MODs you've got installed I'm assuming you can handle that!
Locked

Return to “[3.0.x] MOD Database Releases”