Simple Colored Usergroups

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

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
29
66%
Very Good
8
18%
Good
3
7%
Fair
1
2%
Poor
3
7%
 
Total votes: 44

finlay
Registered User
Posts: 31
Joined: Tue Mar 04, 2003 5:07 pm

Re: Simple Colored Usergroups

Post by finlay »

Here is another instance of the problem outlined in 4 above. Duplicate code reference with contradictory instructions in scu_global.mod

Code: Select all

#-----[ OPEN ]------------------------------------------
#
viewforum.php


<snip>

#
#-----[ FIND ]------------------------------------------
#
		$last_post_author = ( $topic_rowset[$i]['id2'] == ANONYMOUS ) ? ( ($topic_rowset[$i]['post_username2'] != '' ) ? $topic_rowset[$i]['post_username2'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '='  . $topic_rowset[$i]['id2']) . '">' . $topic_rowset[$i]['user2'] . '</a>';

#
#-----[ BEFORE, ADD ]------------------------------------------
#
		$style_color = ($user_color = color_groups_user($topic_rowset[$i]['id2'])) ? 'style="font-weight:bold;color: #' . $user_color . '" ' : '';

#
#-----[ IN-LINE FIND ]------------------------------------------
#
href="

#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
' . $style_color . '

#




<snip circa 300 lines later>

#-----[ OPEN ]------------------------------------------
#
viewforum.php

#
#-----[ FIND ]------------------------------------------
#
		$last_post_author = ( $topic_rowset[$i]['id2'] == ANONYMOUS ) ? ( ($topic_rowset[$i]['post_username2'] != '' ) ? $topic_rowset[$i]['post_username2'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '='  . $topic_rowset[$i]['id2']) . '">' . $topic_rowset[$i]['user2'] . '</a>';

#
#-----[ BEFORE, ADD ]------------------------------------------
#
		$last_post_author_color = ($user_color = color_groups_user($topic_rowset[$i]['id2'])) ? 'style="font-weight:bold;color: #' . $user_color . '" ' : '';

#
#-----[ IN-LINE FIND ]------------------------------------------
#
href="

#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
' . $last_post_author_color . '

#
User avatar
A_O_C
Registered User
Posts: 2383
Joined: Sun Jul 01, 2007 11:26 pm
Location: phpbb_

Re: Simple Colored Usergroups

Post by A_O_C »

i havent used this MOD in awhile, but that first set of instructions i remember. i dont ever recall seeing the last set. i think i deleted that set from the MOD.
THDInfernos
Registered User
Posts: 57
Joined: Sun Nov 25, 2007 10:31 pm

Re: Simple Colored Usergroups

Post by THDInfernos »

Hi

I installed Simple Colored Usegroups with the addon Global Coloring addon, once i created a new group called "Moderators" and i have assigned some moderator permissions onto it i followed by adding a user into the group

Then something went wrong, the user's colour appeared as the green default colour of moderators on phpbb, i assigned a different color on this group and its not doing it

Can someone help, thanks
THDInfernos
Registered User
Posts: 57
Joined: Sun Nov 25, 2007 10:31 pm

Re: Simple Colored Usergroups

Post by THDInfernos »

Sorry for the double post but this is quite urgent, can someone please help me :roll:
finlay
Registered User
Posts: 31
Joined: Tue Mar 04, 2003 5:07 pm

Re: Simple Colored Usergroups

Post by finlay »

I think your problem is impossible to diagnose from what you've written (at least for me), but maybe the following will help.

This mod does actually work, despite the shortcomings I noted above (poor documentation, duplicate and conflicting coding).

Therefore, if yours isn't working, I suspect you've made a mistake in installation (something that's very easy to do with documentation like this!).

In your place, I'd re-install the mod from scratch using another copy of your backup files, methodically ticking off each code change as it's made. In doing so, don't forget that the code changes listed in the instructions actually reference MORE files than are shown in the mod file list!

For the benefit of you and other readers, I can confirm that I've resolved the duplicate code references I listed above. The first instances should be ignored in both cases, and the latter ones used. The problem with this is that it requires special vigilance, because those people who implement the first change will then not be able to do a 'search and replace' for the second instance because the code will have changed and will not be found in the form shown in the documentation!

Final tip:

When you get to instructions like this

Code: Select all

#
#-----[ IN-LINE FIND ]------------------------------------------
#
href="

#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
' . $last_post_author_color . '

#

Do not forget to insert a 'space' after the <a in addition to the one before teh href=" so that it looks like this:

Code: Select all

<a ' . $last_post_author_color . ' href="
rather than like this

Code: Select all

<a' . $last_post_author_color . ' href="
otherwise you'll end up with links that don't work
Rikonen
Registered User
Posts: 27
Joined: Sat May 17, 2008 1:25 pm

Re: Simple Colored Usergroups

Post by Rikonen »

Does it works on phpBB 2.0.23???
User avatar
A_O_C
Registered User
Posts: 2383
Joined: Sun Jul 01, 2007 11:26 pm
Location: phpbb_

Re: Simple Colored Usergroups

Post by A_O_C »

yes...
Rikonen
Registered User
Posts: 27
Joined: Sat May 17, 2008 1:25 pm

Re: Simple Colored Usergroups

Post by Rikonen »

Question:
When I installed the mod I had subsilver. Now I have subsilver and I want to change the theme. Will mod works on that theme???
User avatar
A_O_C
Registered User
Posts: 2383
Joined: Sun Jul 01, 2007 11:26 pm
Location: phpbb_

Re: Simple Colored Usergroups

Post by A_O_C »

you will need to make the template changes to your new theme
Rikonen
Registered User
Posts: 27
Joined: Sat May 17, 2008 1:25 pm

Re: Simple Colored Usergroups

Post by Rikonen »

I must modify in the new theme the files for the mod???
User avatar
A_O_C
Registered User
Posts: 2383
Joined: Sun Jul 01, 2007 11:26 pm
Location: phpbb_

Re: Simple Colored Usergroups

Post by A_O_C »

yes
User avatar
Demon of Darkness
Registered User
Posts: 136
Joined: Fri Jul 04, 2008 4:53 am
Location: In a house
Contact:

Re: Simple Colored Usergroups

Post by Demon of Darkness »

Is this the MOD that changes the "User Legend" also?
STMike
Registered User
Posts: 4
Joined: Tue Jul 10, 2007 3:17 pm

Re: Simple Colored Usergroups

Post by STMike »

Guys can one point me in the right direction on a small problem with this mod, i had it working perfect but recently lost my server drives and back ups and had to start again. Got my forum back to how it was and come to install this mod, checked the code a few times and seems fine but i can get colours on last visited users but not on whos online. posted a screenshot below. I am a novice so to speak but try to work these things out but struggling now. Any help would be appreciated

http://s250.photobucket.com/albums/gg24 ... urprob.jpg
STMike
Registered User
Posts: 4
Joined: Tue Jul 10, 2007 3:17 pm

Re: Simple Colored Usergroups

Post by STMike »

Heres the code for Index_body.tpl as this is a morpheus dark blue theme and it may help to identify the problem, thanks guys ;)

Code: Select all

<!-- IF C_PM --><!-- DEFINE $CA_NEW_MSGS = true --><!-- ENDIF -->
<style type="text/css">
<!--
.style1 {
	font-family: Geneva, Arial, Helvetica, sans-serif;
	width: 70%;
	margin: 15px auto;
	padding: 5px;
	text-align: center;
	border: solid 3px #3b6dca;
	background-color: #FFFFFF;
	color: #FF0000;
	font-size: 14px;
	font-weight: bold;
	vertical-align: top;
}
.style6 {color: #0033FF; font-size: 16; }
.style8 {font-size: 24px}
-->
</style>


{TPL_CONTENT_TOPNAV1}<table border="0" cellspacing="1" cellpadding="0" width="100%">
<tr>
  <td colspan="2" align="center" valign="middle" class="navbar-links"><div align="center">
    <div class="style1"><a href="http://www.fordownersclubs.com/"><a href="http://www.fordownersclubs.com/"><a href="http://www.fordownersclubs.com/"><a href="http://www.fordownersclubs.com/">
<img src="http://www.fordownersclubs.com/button.php?u=stmike&style=banners1" alt="Ford Owners Clubs" border="0" /></a></div>
  </div></td>
  </tr>
<tr>
	<td align="left" class="navbar-links"><a href="{U_INDEX}">{L_INDEX}</a></td>
	<td align="right" class="navbar-text">{CURRENT_TIME}</td>
</tr>
</table>
{TPL_CONTENT_TOPNAV2_PM}
<!-- IF $CA_NEW_MSGS --><!-- INCLUDE newpm.tpl --><!-- ENDIF -->


<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
  <tr> 
	<td align="left" valign="bottom"><span class="gensmall">
	<!-- IF S_LOGGED_IN -->
	{PRIVATE_MESSAGE_INFO}<br />
	{LAST_VISIT_DATE}<br />
	<!-- ELSE -->
	<a href="{U_SEARCH_UNANSWERED}" class="gensmall">{L_SEARCH_UNANSWERED}</a><br />
	<!-- ENDIF -->
	{CURRENT_TIME}<br />
	{S_TIMEZONE}<br />
	</span></td>
	<td align="right" valign="bottom" class="gensmall">
		<!-- IF S_LOGGED_IN -->
		<table border="0" cellspacing="0" cellpadding="1">
		<tr>
			<td align="right" class="gensmall" nowrap="nowrap"><a href="{U_MARK_READ}">{L_MARK_FORUMS_READ}</a></td>
			<td class="moderators">|</td>
			<td align="left" class="gensmall" nowrap="nowrap"><a href="{U_SEARCH_NEW}" class="gensmall">{L_SEARCH_NEW}</a></td>
		</tr>
		<tr>
			<td align="right" class="gensmall" nowrap="nowrap"><a href="{U_SEARCH_SELF}" class="gensmall">{L_SEARCH_SELF}</a></td>
			<td class="moderators">|</td>
			<td class="gensmall" align="left" nowrap="nowrap"><a href="{U_SEARCH_UNANSWERED}" class="gensmall">{L_SEARCH_UNANSWERED}</a></td>
		</tr>
		</table>
		<!-- ENDIF -->
		<form action="{CA_SEARCH_INDEX}" method="post" class="inline-form">
			<input type="hidden" name="show_results" value="topics" />
			<input type="text" name="search_keywords" class="post" size="15" />
			<input type="submit" value="{L_SEARCH}" class="mainoption" />
		</form>	</td>
  </tr>
</table>


<?php

/* check for new messages */
$catrow_count = ( isset($this->_tpldata['catrow.']) ) ?  sizeof($this->_tpldata['catrow.']) : 0;
for($catrow_i = 0; $catrow_i < $catrow_count; $catrow_i++)
{
	$catrow_item = &$this->_tpldata['catrow.'][$catrow_i];
	// check for new messages
	$new_msg = false;
	$forumrow_count = ( isset($catrow_item['forumrow.']) ) ? sizeof($catrow_item['forumrow.']) : 0;
	for ($forumrow_i = 0; $forumrow_i < $forumrow_count; $forumrow_i++)
	{
		$forumrow_item = &$catrow_item['forumrow.'][$forumrow_i];
		$new_item = strpos($forumrow_item['FORUM_FOLDER_IMG'], '_new') > 0 ? true : false;
		if($new_item)
		{
			$new_msg = true;
			$forumrow_item['XS_NEW'] = '-new';
			$forumrow_item['LAST_POST'] = str_replace('icon_latest_reply.gif','icon_newest_reply.gif', $forumrow_item['LAST_POST']);
		}
		if(strlen($forumrow_item['L_MODERATOR']) && $forumrow_item['L_MODERATOR'] !== '&nbsp;')
		{
			$forumrow_item['L_MODERATOR'] .= ':';
		}
	}
	// add xs switch
	$catrow_item['TPL_HDR1'] = $new_msg ? $this->vars['TPL_HDR1_ORANGE'] : $this->vars['TPL_HDR1_BLUE'];
	$catrow_item['TPL_HDR2'] = $new_msg ? $this->vars['TPL_HDR2_NEW'] : $this->vars['TPL_HDR2'];
	$catrow_item['TPL_FTR'] = $new_msg ? $this->vars['TPL_FTR_NEW'] : $this->vars['TPL_FTR'];
}

?>

<!-- BEGIN catrow -->
{catrow.TPL_HDR1}<a href="javascript:ShowHide('cat_{catrow.CAT_ID}','cat2_{catrow.CAT_ID}','catrow_{catrow.CAT_ID}');">{catrow.CAT_DESC}</a>{catrow.TPL_HDR2}<div id="cat_{catrow.CAT_ID}" style="display: ''; position: relative;"><table width="100%" cellpadding="2" cellspacing="1" class="forumline">
<tr> 
	<th colspan="2" height="25" nowrap="nowrap"> {L_FORUM} </th>
	<th nowrap="nowrap"> {L_TOPICS} </th>
	<th nowrap="nowrap"> {L_POSTS} </th>
	<th nowrap="nowrap"> {L_LASTPOST} </th>
</tr>
<!-- BEGIN forumrow -->
<tr> 
	<td class="row4" align="center" valign="middle" width="30" height="30"><img src="{catrow.forumrow.FORUM_FOLDER_IMG}" width="28" height="32" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" /></td>
	<td class="row1h{catrow.forumrow.XS_NEW}" width="70%" {T_ONCLICK}="window.location.href='{catrow.forumrow.U_VIEWFORUM}'"><a class="forumlink{catrow.forumrow.XS_NEW}" href="{catrow.forumrow.U_VIEWFORUM}">{catrow.forumrow.FORUM_NAME}</a><br />
	  <span class="genmed">{catrow.forumrow.FORUM_DESC}<br />
	  </span><span class="moderators">{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}</span></td>
	<td class="row2" align="center" valign="middle"><span class="gensmall">{catrow.forumrow.TOPICS}</span></td>
	<td class="row2" align="center" valign="middle"><span class="gensmall">{catrow.forumrow.POSTS}</span></td>
	<td class="row3" align="center" valign="middle" width="130"><span class="gensmall">{catrow.forumrow.LAST_POST}</span></td>
</tr>
<!-- END forumrow -->
</table></div>{catrow.TPL_FTR}
<script language="javascript" type="text/javascript">
<!--
tmp = 'catrow_{catrow.CAT_ID}';
if(GetCookie(tmp) == '2')
{
	ShowHide('cat_{catrow.CAT_ID}','cat2_{catrow.CAT_ID}','catrow_{catrow.CAT_ID}');
}
//-->
</script>
<!-- END catrow -->


{TPL_HDR1}<a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a>{TPL_HDR2}
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
  <tr>
    <td class="row4" align="center" valign="middle" rowspan="2">&nbsp;</td>
    <td class="row1" align="left" width="100%"><span class="gensmall">{TOTAL_POSTS}<br />
      {TOTAL_USERS}<br />
      {NEWEST_USER}</span> </td>
  </tr>
  <tr>
    <!-- SIMPLE COLORED USERGROUPS MOD BY Afterlife_69 (http://www.ugboards.com) AND kkroo (http://phpbb-login.sourceforge.net) START -->
    <td class="row1" align="left"><span class="gensmall">{TOTAL_USERS_ONLINE}<br />
      {RECORD_USERS}<br />
      {LOGGED_IN_USER_LIST}<br />
      {L_ONLINE_EXPLAIN}</span></td>
  </tr>
  
  <!-- SIMPLE COLORED USERGROUPS MOD END START -->
</table>
<table width="100%" border="0" cellpadding="3" cellspacing="1" class="forumline">
  <tr>
    <td align="left" class="row1"><span class="gensmall">{GROUP_LEGEND}</span></td>
  </tr>
  <tr>
    <td align="left" class="row1"><span class="gensmall">{LAST_VISIT_USER_LIST}</span></td>
  </tr>
  <!--
// ****************************
// MOD: Show last visited users
// END: AFTER, ADD
// ****************************
//-->
</table>
<p>{TPL_FTR}</p>
<table cellspacing="3" border="0" align="center" cellpadding="0" class="forumline-empty row4">
  <tr> 
	<td width="20" align="center"><img src="{T_IMAGESET_PATH}/folder_new_big.gif" alt="{L_NEW_POSTS}"/></td>
	<td><span class="gensmall">{L_NEW_POSTS}</span></td>
	<td>  </td>
	<td width="20" align="center"><img src="{T_IMAGESET_PATH}/folder_big.gif" alt="{L_NO_NEW_POSTS}" /></td>
	<td><span class="gensmall">{L_NO_NEW_POSTS}</span></td>
	<td>  </td>
	<td width="20" align="center"><img src="{T_IMAGESET_PATH}/folder_locked_big.gif" alt="{L_FORUM_LOCKED}" /></td>
	<td><span class="gensmall">{L_FORUM_LOCKED}</span></td>
  </tr>
</table>


{TPL_CONTENT_BOTTOMNAV1}<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
	<td align="left" class="navbar-links"><a href="{U_INDEX}">{L_INDEX}</a></td>
	<td align="right" class="navbar-text">{CURRENT_TIME}</td>
</tr>
</table>{TPL_CONTENT_BOTTOMNAV2}
User avatar
Ornette
Registered User
Posts: 56
Joined: Thu Mar 06, 2008 3:53 pm

Re: Simple Colored Usergroups

Post by Ornette »

There was a number of problems I found with this mod. Although it is certainly a very good one, much better than the other 'group color' mods out there.

As a couple of people noted, the SCU_Global.mod file has some errors in it, not least the duplicate viewforum.php edits in it!
A_O_C wrote:
Ishimaru Chiaki wrote:More, the "viewforum.php" appears twice in the files modification directions.

yes, for some reason, the mod author thought it would be "creative" to do it twice, but they are two different sets of directions, so just follow them both.
When using with EasyMOD, this actually makes for errors if you install and then deinstall. The first set of changes get stuck in the viewtopic.php causing an error if you try to install it again. As already mentioned, only the second set of viewtopic.php changes need following! >>>
finlay wrote:For the benefit of you and other readers, I can confirm that I've resolved the duplicate code references I listed above. The first instances should be ignored in both cases, and the latter ones used.
...those people who implement the first change will then not be able to do a 'search and replace' for the second instance because the code will have changed...!
* note - thats because they do a bit extra the first bit don't - add colour to the forum moderators bit at the top.
Ishimaru Chiaki wrote:In the addon install file, the search.php and the templates/subSilver/privmsgs_body.tpl don't appear in the "files to modify" list on top of the page.
yeah that as well! - oh, memberlist.php too. I also found a small change was needed to make it compatible with phpBB 2.0.23.



As for the actual mod, there's an error I found with it. When you edit a users profile from the ACP, and make an error, the returning page doesn't display the priority group drop down box. I'm not sure exactly why, but I did make a change putting the drop down box function higher up in admin_users.php and it seemed to fix problem. The drop down box could also do with having a 'none' option, so that the user's group can follow the default as defined by the main group ordering.
darkcloudinc wrote:I'm getting this error when I'm in the edit window:

Code: Select all

Warning: Invalid argument supplied for foreach() in /mnt/w0401/d31/s30/b02b7700/www/gods/includes/usercp_register.php on line 884
anyone care to help?
Nevermind, the solution was as simple as creating a group for the user to be in.
Hmm did anyone resolve this? I see Ishimaru experienced a similar problem:
Ishimaru Chiaki wrote:I tested my MODs on my local board (installed with WAMP) and I keep them installed. Recently, I had to turn off the colors on my two test groups (removed the color hexa code and unchecked the checkbox to apply the color). But I kept my founder account as the moderator of the groups.
Then, when I edited my profile to look at something, I saw this warning line :

Code: Select all

Warning: Invalid argument supplied for foreach() in C:\wamp\www\Tests\phpBB-2.0.22\phpBB2\includes\usercp_register.php on line 947
It would seem that for some reason the bit in usercp_register.php (the profile edit page) is not getting an array passed to it. I'll try and have a look at that one.

phorum.ws wrote: I just added a new group, suppose to displayed AFTER elite mod, it showed up where elite mod is suppose to be (2nd place - so new group is 3rd) but elite mod is actually last on the legend and will not change no matter what, thats cos there is a bug in the DB if you delete an existing group, or add a new one, and try and move the order around it screws everything up... read me and another users posts 2 pages back... is the author still supporting this? (they all seem to run away after a while, not that this guy has, but 90% of my mods authors have run away).
Yeah this is another pain, the group ordering system is not solid at all. Ideally, each time you submit a group change, some SQL should be devised to update the group_order value of each of the groups to ensure that the ordering is correct, im not too sure if this :
A_O_C wrote:may i suggest that instead of using the "display after" option, you use a numbering system like in
this mod.
is it or not. Should be looked into.
squeek wrote:I have an issue concerning the Admin and Moderator and i am not sure about it.
Obviously there is already group for the Moderator and Admin so when i install this MOD do i have to re-create these groups again? if so then what happens to the 'already created' Admin and Moderator groups?
Yeah, this could do with being something to add to the mod - provision to keep the existing Admin & Moderator colouring, with some sort of option to set what colour gets what priority... Perhaps adding these to the group order drop down box? Something or the other anyway. I also think the original board style for the colour legends is better as well, rather than a 'new' line at the bottom of the page. But thats just a preference i think!
DizzyDazzle wrote:1: as phorum.ws stated, it seems to put the groups in alphebetical order on the legend, regardless of where you state in the ACP...

2: like anton1o suggested, is there any way to have a hidden group and still color its members? i have different clans on my forums and would like all clan members to be colored, but dont want to list ALL of the clan groups in the legend, it would be silly. anyone who can give a quick fix for this will be very appreciated!
This could do with a fix too. I shouldn't think this would be too hard to change. The SQL logic has a bit in it to not return group data that is hidden for non-mod users. The logic ought to be taken out of that and moved to the group legend display where hidden groups can be prevented from displaying.

Other than that I needed to make a simple change to one of the find commands to make it compatible with the Attach Mod.


But, as for some other suggestions,
jalaln wrote:
squeek wrote: its a shame this mod doesnt add the user's rank next to their name as well as the colour everywhere or at lease offer a choice in the acp to do so.
You mean by rank the usergroup?
This would be an excellent feature for this mod to have! Currently this mod works very well with the Group Rank Hack, even, amazingly, seeming to follow the same group ordering too. But, integration of this feature would be excellent
Cheesemaker wrote:Does this mod also colour the names in the user profile? Because I don't want that. I only want it in the index.php and in viewforum and viewtopic
Yes - I agree - that bit of the SCU_global.mod is just silly and looks truely ugly! I just cut out the usercp_viewprofile.php edit section out of it, much better now.
figo wrote:oh i was also able to figure out how to put the link the profile mod back in.
This sounds like something simple and would be another good change to this mod
HCP wrote:In the following pages, the underline of usergroup links is not coloured (eg. the text is in the colour you specified in the ACP, but the underline is still in the default link colour):

viewonline.php
memberlist.php
groupcp.php

How do I edit those three PHP files and their corresponding TPL files so that the underline is coloured too, like in index.php and viewforum.php?
yes, this is something ugly and ought to be changed. If you look at SCU_global.mod you will see that the changes to usercp_viewprofile.php actually address this problem - by making change also to privmsgs_body.tpl. The style colour needs to be added to the <a> tag rather than putting in a <span> tag - this is what makes the non matching underline colour appear.
DJ Ornsman - Back To 93
Tuesday 9-11pm GMT on Stress Factor

http://www.stressfactor.co.uk
Post Reply

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