[2.0.14] Add Multiple Ranks And Staff View

The cleanup is complete. This forum is now read only.
Post Reply

Rating:

Excellent!
27
53%
Very Good
10
20%
Good
10
20%
Fair
3
6%
Poor
1
2%
 
Total votes: 51

Extensions Robot
Extensions Robot
Extensions Robot
Posts: 29220
Joined: Sat Aug 16, 2003 7:36 am

[2.0.14] Add Multiple Ranks And Staff View

Post by Extensions Robot »

MOD Name: Add Multiple Ranks And Staff View
Author: Mighty Gorgon
MOD Description: This MOD allows the admin to select more than one special rank for each user. The ranks selected will be shown in the profile, on each topic and in the memberlist. This MOD also allows to have a Staff and Online View in Memberlist (using Sort function). Username in Memberlist are colored respecting to their level.


MOD Version: 1.3.5 (Updated 04/26/05)

Download File: add_multiple_ranks_1_3_5.zip
mods overview page: View
File Size: 6615 Bytes

Security Score: 0
Last edited by Extensions Robot on Mon Apr 30, 2007 12:31 am, edited 1 time in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)
ycl6
Registered User
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

MOD Validated/Released

Notes:
Allows multiple ranks for users set by admins.
battsturd
Registered User
Posts: 43
Joined: Mon Jun 07, 2004 12:18 pm

Post by battsturd »

I have installed this mod on my forum and it "almost" works.

When I have a specialized rank, the second rank shows up fine in the viewtopic. When I have a dynamic rank, the second rank does not appear.
(I am not worrying about the third one now)

I have tried this in both Sub-silver and my main template. I get the same exact results in both. Here is a pic of what it looks like in subsilver.

You can also see it in my regular theme at http://www.kindredclan.org/alliance/forum/
TerraFrost
Former Team Member
Posts: 5957
Joined: Sun Dec 26, 2004 3:40 am
Location: Austin, TX

Post by TerraFrost »

When I have a specialized rank, the second rank shows up fine in the viewtopic. When I have a dynamic rank, the second rank does not appear.

I'm a little confussed - you say that when you have a specialized rank, the second rank shows up fine. What's the second rank? Shouldn't it be the dynamic rank (I'm assuming that's the same thing as the "normal rank")?

Anyway, when testing the MOD, I noted the following...

Display normal rank text for special ranked members - replaces special rank text with normal rank text.
Display normal rank images for special ranked members - displays both the special rank iamges and the normal rank images.

In both cases, the normal behavior is for the special rank to take precedence.

I don't know if that bit of info. helps you, though...
User avatar
Mighty Gorgon
Registered User
Posts: 616
Joined: Thu May 23, 2002 2:56 pm
Location: Italy
Name: Luca Libralato
Contact:

Multiple Ranks

Post by Mighty Gorgon »

ADDED ON 2006/04/29
__________________________________________________
Mod has been updated to version 2.0.3 which is now compatible with phpBB 2.0.20.

Here is the link:

http://www.mightygorgon.com/viewtopic.php?p=2169#2169

ADDED ON 2006/01/26
__________________________________________________

Mod has been updated to version 2.0.1 which should fix some small bugs.

I need some feedback on this package before submitting it to MOD DB for validation.

If anyone is going to install it, could please tell me if everything is ok?

Thank you.

http://www.mightygorgon.com/viewtopic.php?t=454

ADDED ON 2005/09/03
__________________________________________________

I'm glad to announce that I've finished coding the new release of this mod.

At the moment is a RC1 version, but I hope that after a very short period of beta testing I can release the final version.

If you're interested in testing this new version, please, take a look here:

http://www.mightygorgon.com/viewtopic.php?p=2169#2169

I hope that with this version every old bugs are gone.

The code has been completely rewritten, and new features implemented.

More info in the linked page.

__________________________________________________

battsturd wrote: When I have a specialized rank, the second rank shows up fine in the viewtopic. When I have a dynamic rank, the second rank does not appear.

Hi battsturd,
I'm not sure to have understood what your problem is, however in standard phpBB when you assign a Special Rank to a user, you didn't get the normal rank image anymore for that user. If you need the normal rank image to be always shown, just leave the first rank empty, and set only the second rank as special rank.
TerraFrost wrote: Anyway, when testing the MOD, I noted the following...

Display normal rank text for special ranked members - replaces special rank text with normal rank text.
Display normal rank images for special ranked members - displays both the special rank iamges and the normal rank images.

In both cases, the normal behavior is for the special rank to take precedence.

TerraFrost you're right, thanks for having reported this.

The normal rank will be always shown if the First Rank is set to "No special rank assigned". If someone still wants the normal rank to be shown even when a special rank is assigned, then the Second Rank must be set as the special rank and the First Rank left to "not assigned".

Thank you.
Last edited by Mighty Gorgon on Sat Apr 29, 2006 9:38 am, edited 3 times in total.
battsturd
Registered User
Posts: 43
Joined: Mon Jun 07, 2004 12:18 pm

Post by battsturd »

Thats my problem.

When the first rank is set for no special rank assigned AND the second rank is set for a Special rank, the second one does not show up.

I have updated my pic to add notes

Image

Here is what the ACP looks like for the site admin:

Image

And this is what the ACP looks like for all others.

Image

Added note...I have reinstalled this mod 3 times. I get the same results each time.
User avatar
Mighty Gorgon
Registered User
Posts: 616
Joined: Thu May 23, 2002 2:56 pm
Location: Italy
Name: Luca Libralato
Contact:

Fix!

Post by Mighty Gorgon »

Sorry, you're right.

I've missed a part in rewriting the mod to be EasyMOD compliant.

Apply this patch and you should fix it.

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
				$rank_image = ( $ranksrow[$j]['rank_image'] ) ? '<img src="' . $ranksrow[$j]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '';
			}
#
#-----[ REPLACE WITH ]------------------------------------------
#
				$rank_image = ( $ranksrow[$j]['rank_image'] ) ? '<br /><img src="' . $ranksrow[$j]['rank_image'] . '" alt="' . $poster_rank . '" title="' . $poster_rank . '" border="0" /><br />' : '<br />';
			}
			// Mighty Gorgon - Multiple Ranks - BEGIN
			if ( $postrow[$i]['user_rank2'] == $ranksrow[$j]['rank_id'] && $ranksrow[$j]['rank_special'] )
			{
				$poster_rank2 = $ranksrow[$j]['rank_title'];
				$rank2_image = ( $ranksrow[$j]['rank_image'] ) ? '<br /><img src="' . $ranksrow[$j]['rank_image'] . '" alt="' . $poster_rank2 . '" title="' . $poster_rank2 . '" border="0" /><br />' : '<br />';
			}
			if ( $postrow[$i]['user_rank3'] == $ranksrow[$j]['rank_id'] && $ranksrow[$j]['rank_special'] )
			{
				$poster_rank3 = $ranksrow[$j]['rank_title'];
				$rank3_image = ( $ranksrow[$j]['rank_image'] ) ? '<br /><img src="' . $ranksrow[$j]['rank_image'] . '" alt="' . $poster_rank3 . '" title="' . $poster_rank3 . '" border="0" /><br />' : '<br />';
			}
			// Mighty Gorgon - Multiple Ranks - END
Let me know.
:roll:

P.S.: Here is a link to download the mod fixed.
http://www.mightygorgon.com/viewtopic.php?t=454
battsturd
Registered User
Posts: 43
Joined: Mon Jun 07, 2004 12:18 pm

Post by battsturd »

That did the trick...thank you so much
User avatar
Mighty Gorgon
Registered User
Posts: 616
Joined: Thu May 23, 2002 2:56 pm
Location: Italy
Name: Luca Libralato
Contact:

Fixed

Post by Mighty Gorgon »

You're welcome :wink: !
EelcoH
Registered User
Posts: 17
Joined: Thu Mar 24, 2005 2:53 pm
Location: The Netherlands
Contact:

Post by EelcoH »

Is it possible to add a "rank" image to guests?
User avatar
Mighty Gorgon
Registered User
Posts: 616
Joined: Thu May 23, 2002 2:56 pm
Location: Italy
Name: Luca Libralato
Contact:

Rank For Guests!

Post by Mighty Gorgon »

Nice idea... I didn't know what to do tonight :lol: , so here is the code...
...let me know if it will works! :wink:

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
	$ranksrow[] = $row;
#
#-----[ AFTER, ADD ]------------------------------------------
#
	// Mighty Gorgon - Multiple Ranks - BEGIN
	if ($row['rank_special'] == 2)
	{
		$rank_guest = $row['rank_title'];
		$rank_guest_image = ( $row['rank_image'] ) ? '<br /><img src="' . $row['rank_image'] . '" alt="' . $rank_guest . '" title="' . $rank_guest . '" border="0" /><br />' : '<br />';
	}
	// Mighty Gorgon - Multiple Ranks - END
#
#-----[ FIND ]------------------------------------------
#
	if ( $postrow[$i]['user_id'] == ANONYMOUS )
	{
#
#-----[ AFTER, ADD ]------------------------------------------
#
		// Mighty Gorgon - Multiple Ranks - BEGIN
		$poster_rank = $rank_guest;
		$rank_image = $rank_guest_image;
		// Mighty Gorgon - Multiple Ranks - END
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_ranks.php
#
#-----[ FIND ]------------------------------------------
#
		$rank_is_special = ( $rank_info['rank_special'] ) ? "checked=\"checked\"" : "";
		$rank_is_not_special = ( !$rank_info['rank_special'] ) ? "checked=\"checked\"" : "";
#
#-----[ REPLACE WITH ]------------------------------------------
#
		// Mighty Gorgon - Multiple Ranks - BEGIN
		$rank_is_not_special = ( $rank_info['rank_special'] == 0 ) ? "checked=\"checked\"" : "";
		$rank_is_special = ( $rank_info['rank_special'] == 1 ) ? "checked=\"checked\"" : "";
		$rank_is_guest = ( $rank_info['rank_special'] == 2 ) ? "checked=\"checked\"" : "";
		// Mighty Gorgon - Multiple Ranks - END
#
#-----[ FIND ]------------------------------------------
#
			"MINIMUM" => ( $rank_is_special ) ? "" : $rank_info['rank_min'],
#
#-----[ REPLACE WITH ]------------------------------------------
#
			// Mighty Gorgon - Multiple Ranks - BEGIN
			"MINIMUM" => ( $rank_info['rank_special'] == 0 ) ? $rank_info['rank_min'] : "",
			"GUEST_RANK" => $rank_is_guest,
			"L_GUEST" => $lang['Guest'],
			// Mighty Gorgon - Multiple Ranks - END
#
#-----[ FIND ]------------------------------------------
#
		$special_rank = ( $HTTP_POST_VARS['special_rank'] == 1 ) ? TRUE : 0;
#
#-----[ REPLACE WITH ]------------------------------------------
#
		// Mighty Gorgon - Multiple Ranks - BEGIN
		$special_rank = $HTTP_POST_VARS['special_rank'];
		// Mighty Gorgon - Multiple Ranks - END
#
#-----[ FIND ]------------------------------------------
#
		if( $special_rank == 1 )
#
#-----[ REPLACE WITH ]------------------------------------------
#
		// Mighty Gorgon - Multiple Ranks - BEGIN
		if( $special_rank == 1 || $special_rank == 2 )
		// Mighty Gorgon - Multiple Ranks - END
#
#-----[ FIND ]------------------------------------------
#
			if (!$special_rank)
#
#-----[ REPLACE WITH ]------------------------------------------
#
			// Mighty Gorgon - Multiple Ranks - BEGIN
			if ($special_rank == 0)
			// Mighty Gorgon - Multiple Ranks - END
#
#-----[ FIND ]------------------------------------------
#
			if($special_rank)
#
#-----[ REPLACE WITH ]------------------------------------------
#
			// Mighty Gorgon - Multiple Ranks - BEGIN
			if( !$special_rank == 0 )
			// Mighty Gorgon - Multiple Ranks - END
#
#-----[ FIND ]------------------------------------------
#
				"SPECIAL_RANK" => ( $special_rank == 1 ) ? $lang['Yes'] : $lang['No'],
#
#-----[ REPLACE WITH ]------------------------------------------
#
				// Mighty Gorgon - Multiple Ranks - BEGIN
				"SPECIAL_RANK" => ( !$special_rank == 0 ) ? $lang['Yes'] : $lang['No'],
				// Mighty Gorgon - Multiple Ranks - END
#
#-----[ FIND ]------------------------------------------
#
		if( $special_rank == 1 )
#
#-----[ REPLACE WITH ]------------------------------------------
#
		// Mighty Gorgon - Multiple Ranks - BEGIN
		if( !$special_rank == 0 )
		// Mighty Gorgon - Multiple Ranks - END
#
#-----[ FIND ]------------------------------------------
#
		$rank_is_special = ( $special_rank ) ? $lang['Yes'] : $lang['No'];
#
#-----[ REPLACE WITH ]------------------------------------------
#
		// Mighty Gorgon - Multiple Ranks - BEGIN
		$rank_is_special = ( !$special_rank == 0) ? $lang['Yes'] : $lang['No'];
		// Mighty Gorgon - Multiple Ranks - END
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/admin/ranks_edit_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<input type="radio" name="special_rank" value="1" {SPECIAL_RANK} />{L_YES} &nbsp;&nbsp;<input type="radio" name="special_rank" value="0" {NOT_SPECIAL_RANK} /> {L_NO}
#
#-----[ REPLACE WITH ]------------------------------------------
#
<input type="radio" name="special_rank" value="1" {SPECIAL_RANK} />{L_YES}&nbsp;&nbsp;<input type="radio" name="special_rank" value="0" {NOT_SPECIAL_RANK} />{L_NO}&nbsp;&nbsp;<input type="radio" name="special_rank" value="2" {GUEST_RANK} /> {L_GUEST}
EelcoH
Registered User
Posts: 17
Joined: Thu Mar 24, 2005 2:53 pm
Location: The Netherlands
Contact:

Post by EelcoH »

Works perfectly :) Thanks.
User avatar
Mighty Gorgon
Registered User
Posts: 616
Joined: Thu May 23, 2002 2:56 pm
Location: Italy
Name: Luca Libralato
Contact:

Guests Rank Addon

Post by Mighty Gorgon »

You're welcome :wink: !

I will include this code in the next releases.
User avatar
cubechris
Registered User
Posts: 138
Joined: Fri Aug 13, 2004 9:54 am
Location: Lincoln, UK
Contact:

Post by cubechris »

Code: Select all

 SQL-query:

ALTER TABLE phpbb_users ADD user_rank2 INT( 11 ) AFTER user_rank DEFAULT '0'

MySQL said: Documentation
#1064 - You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT '0'' at line 1 
Got that when trying to alter the tables in MySql, resulting in:
http://www.hayesmates.co.uk/forum/viewtopic.php?t=591

Any Ideas?
joebert
Registered User
Posts: 224
Joined: Mon Jan 24, 2005 5:50 am
Location: Kenneth City, FL USA
Name: Joe

Post by joebert »

cubechris, you'll need to swap two things in that query around, just like when using WHERE in sql,the AFTER needs to go after all field attribute declarations.

I haven't dug that line out of the mod to tell you where to put it, but that line needs to be,

Code: Select all

ALTER TABLE phpbb_users ADD user_rank2 INT( 11 ) DEFAULT '0' AFTER user_rank
Note the DEFAULT is behind the AFTER now.
//edit, damn my dyslexia.. I mean before the AFTER :oops:
Post Reply

Return to “[2.0.x] MOD Database Cleanup”