Page 1 of 1

Add "User Rank" Column to groupcp.php

Posted: Thu Jul 19, 2007 7:34 pm
by taifunbrowser
I'd really like to add a "user rank" column to the "view the members of this user group" page.

http://taif.selfip.com/forums/groupcp.php?g=5

If someone could describe, or even make an entire mod, that achieved this feat, I would be indebted to him muchly. Thank you!


I want this because I've got a single group for "Staff members" (and thereby I can use the group lookup page as the "staff list") but I want the viewer to see each member's "job' (which is their user rank.)

So, you could see which of the staff members are "graphics artists" and which are "steppers" or "judges". However, I find that the "location" column is frivolous, so it would be great if I could remove that.

Re: Add "User Rank" Column to groupcp.php

Posted: Fri Jul 20, 2007 5:42 pm
by taifunbrowser
bump. Please is the magic word?

edit: forgot to mention that I had previously tried to use this mod: http://david.smigit.com/mdd/?keyword=ra ... opment=yes

but it just didn't seem to apply... the things it wanted me to find (of course couldn't be found), but I didnt' even find anything that looked remotely like it! it looks like groupcp.php handles the members differently :(

I mean, I don't think this is such a complex mod compared to some others I've seen... I'm sure if you had an in depth knowledge of phpbb you could do this in < 5 minutes...

Re: Add "User Rank" Column to groupcp.php

Posted: Sat Jul 21, 2007 1:07 pm
by taifunbrowser
I'm not giving up on this <_<

Come on guys, its a simple enough request. There's a mod that does it for memberlist.php. Just tell me what to do get it working in groupcp.php!

Thank you.

Re: Add "User Rank" Column to groupcp.php

Posted: Sat Jul 21, 2007 10:42 pm
by taifunbrowser
3rd bump. This is pretty important to me, guys... At the moment, when people click "staff list", they dont see who does what... just that we're all staff...

Re: Add "User Rank" Column to groupcp.php

Posted: Mon Jul 23, 2007 12:12 am
by taifunbrowser
4th bump. I tried again today, and throuroughly killed my local copy, twice. Thankfully, I always have backups.

Come on guys, I have no idea how to do this.

Re: Add "User Rank" Column to groupcp.php

Posted: Mon Jul 23, 2007 2:28 am
by Josh18657
open templates/subSilver/groupcp_info_body.tpl

find

<th class="thTop">{L_USERNAME}</th>

after add

<th class="thTop">Rank</th>

find

<td class="row1" align="center"><span class="gen"><a href="{U_MOD_VIEWPROFILE}" class="gen">{MOD_USERNAME}</a></span></td>

after add

<td class="row1" align="center"><span class="gen">{MOD_RANK}</span></td>

find

<td class="{member_row.ROW_CLASS}" align="center"><span class="gen"><a href="{member_row.U_VIEWPROFILE}" class="gen">{member_row.USERNAME}</a></span></td>

after add

<td class="{member_row.ROW_CLASS}" align="center"><span class="gen">{RANK}</span></td>

--------------------------------------------

open groupcp.php

find

//
// Add the moderator
//
$username = $group_moderator['username'];
$user_id = $group_moderator['user_id'];

after add

$sql = "SELECT user_rank FROM phpbb_users WHERE user_id=$user_id";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$mod_rank = $row['user_rank'];

$sql = "SELECT rank_title FROM phpbb_ranks WHERE rank_id=$mod_rank";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$mod_rank = $row['rank_title'];

find

'MOD_USERNAME' => $username,

after add

'MOD_RANK' => $mod_rank,

find

$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];

after add

$sql = "SELECT user_rank FROM phpbb_users WHERE user_id=$user_id";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$user_rank = $row['user_rank'];

$sql = "SELECT rank_title FROM phpbb_ranks WHERE rank_id=$user_rank";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$user_rank = $row['rank_title'];

find

'USERNAME' => $username,

after add

'RANK' => $user_rank,

Re: Add "User Rank" Column to groupcp.php

Posted: Mon Jul 23, 2007 3:21 am
by taifunbrowser
One problem, in the:

Code: Select all


find

<td class="{member_row.ROW_CLASS}" align="center"><span class="gen"><a href="{member_row.U_VIEWPROFILE}" class="gen">{member_row.USERNAME}</a></span></td>

after add

<td class="{member_row.ROW_CLASS}" align="center"><span class="gen">{RANK}</span></td>
it should be:

Code: Select all

find

<td class="{member_row.ROW_CLASS}" align="center"><span class="gen"><a href="{member_row.U_VIEWPROFILE}" class="gen">{member_row.USERNAME}</a></span></td>

after add

<td class="{member_row.ROW_CLASS}" align="center"><span class="gen">{member_row.RANK}</span></td>
THANK YOU THANK YOU THANK YOU!!!!

The final product: http://taif.selfip.com/forums/groupcp.php?g=5

I think in thanks I may learn the .mod format to help others with my same problem. First though, I'm going to try to figure out how to order the members on Rank...

Re: Add "User Rank" Column to groupcp.php

Posted: Mon Jul 23, 2007 3:44 am
by Josh18657
looks good, to list by user rank I think you need to change, in groupcp.php

$sql = "SELECT u.username, u.user_id, u.user_viewemail, u.user_posts, u.user_regdate, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_msnm
FROM " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug, " . USERS_TABLE . " u
WHERE ug.group_id = $group_id
AND g.group_id = ug.group_id
AND ug.user_pending = 1
AND u.user_id = ug.user_id
ORDER BY u.username";

to

$sql = "SELECT u.username, u.user_id, u.user_viewemail, u.user_posts, u.user_regdate, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_msnm
FROM " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug, " . USERS_TABLE . " u
WHERE ug.group_id = $group_id
AND g.group_id = ug.group_id
AND ug.user_pending = 1
AND u.user_id = ug.user_id
ORDER BY u.user_rank";

but I'm not positive since we don't use ranks on any of my boards

and of course this will only work if the first ranks you added in the acp are the ones you want displayed first

Re: Add "User Rank" Column to groupcp.php

Posted: Mon Jul 23, 2007 2:33 pm
by taifunbrowser
Well, I tried to replace the whoole block you gave me? and the indenting was all off int he file then (which I thought was fine), but so I refreshed it in the forums and it said "You have no members". So i freaked, and UNDO! UNDO! UNDO!

but so then, all I did was replace

ORDER BY u.username";

with

ORDER BY u.user_rank";

, and then it worked fine.

Thanks! *doo dee doooo*

Re: Add "User Rank" Column to groupcp.php

Posted: Mon Jul 23, 2007 7:53 pm
by Josh18657
glad to help

Re: Add "User Rank" Column to groupcp.php

Posted: Fri Jul 27, 2007 11:11 pm
by taifunbrowser
Err, one more quick request still in the groupcp.php:

Image

Can I get rid of the row that says to log in to change group memberships if you're a guest? We have a lot of guests see that page, and It would mean alot to me.

Re: Add "User Rank" Column to groupcp.php

Posted: Fri Jul 27, 2007 11:16 pm
by taifunbrowser
K. did it myself:

In templates/subsilver/groupcp_info_body.tpl:
FIND:

Code: Select all

	<tr> 
		<td class="row1" width="20%"><span class="gen">{L_GROUP_MEMBERSHIP}:</span></td>
		<td class="row2"><span class="gen">{GROUP_DETAILS} &nbsp;&nbsp;
		<!-- BEGIN switch_subscribe_group_input -->
		<input class="mainoption" type="submit" name="joingroup" value="{L_JOIN_GROUP}" />
		<!-- END switch_subscribe_group_input -->
		<!-- BEGIN switch_unsubscribe_group_input -->
		<input class="mainoption" type="submit" name="unsub" value="{L_UNSUBSCRIBE_GROUP}" />
		<!-- END switch_unsubscribe_group_input -->
		</span></td>
	</tr>
And delete it.

Now, once again, my forums are special, because I manually put my staff members on staff... I handle applications through a recruitment email account, where people can send me their past works.

Anyway, thanks to subsilver for being to simple to modify!~

it looks like now: http://taif.selfip.com/forums/groupcp.php?g=5 (guest viewable)