1 (edited by Mediator 2005-03-20 21:54)

Topic: Colored Usergroups - 1.0.2

##
##
##        Mod title:  Usergroup Coloring 
##
##      Mod version:  1.0.2
##   Works on PunBB:  1.2.3,1.2.4 
##     Release date:  3-18-05 
##           Author:  Caleb Champlin (Mediator) [med_mediator@hotmail.com] 
##
##      Description:  Adds coloring to the usernames of group members. 
##
##       Affects DB:  Yes 
##
##   Affected files:  index.php 
##                    userlist.php 
##                    admin_groups.php 
##                    extern.php 
##                    viewtopic.php 
##                    include/functions.php 
##                    profile.php 
##
##            Notes:    None   
##
##     Generated By:  Auto Read-Me(by Caleb Champlin) - http://www.rscheatnet.com/Auto_Readme.zip
##
##       DISCLAIMER:  Please note that 'mods' are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##

Please note this is the first version of this modification and although it should work it has not been heavily tested by myself. If you find any bugs please post them. Thanks

Download: http://www.punres.org/viewtopic.php?id=270
Mirror: http://www.rscheatnet.com/Colored_Usergroups-1.0.2.zip

I enjoy pie :)

2

Re: Colored Usergroups - 1.0.2

ah ha cool thx ill let you know if it works

Re: Colored Usergroups - 1.0.2

nice work

4

Re: Colored Usergroups - 1.0.2

ok i made the change but i dont see where to set the color for the user and if those color are set by default well it does not work as all the user still have the same color
and if the question was coming to your mind i flushed the forum cache before checking my website to see if the mod had worked

Re: Colored Usergroups - 1.0.2

You can set the colors from Administration>User Groups>Edit the usergroup of choice>Bottom of the page.

However I just noticed you don't get to change the administrator color, I'll fix asap.

Also, for the colors to take effect in the whos online list, the user needs to login and logout if they already have a session.

I enjoy pie :)

6 (edited by Ataxy 2005-03-19 23:17)

Re: Colored Usergroups - 1.0.2

edit ok i figured it out you can change all the user except the admin

edit could you post what you have changed to make the admin modification this way i wont have to go true it all over

7 (edited by Mediator 2005-03-19 23:48)

Re: Colored Usergroups - 1.0.2

Upgrade from 1.0 to 1.0.1

Find in admin_groups.php

<tr>
    <th scope="row">Group color</th>
    <td>
        <input type="text" name="group_color" size="9" maxlength="7" value="<?php echo $group['g_color'] ?>" tabindex="25" />
        <span>The color that will show for users in this group in the who's online list, and in posts..</span>
    </td>
</tr>

Remove it

Then following the new readme

#
#---------[ 5. FIND (line:94) ]---------------------------------------------------
#

<tr>
    <th scope="row">User title</th>
    <td>
        <input type="text" name="user_title" size="25" maxlength="50" value="<?php echo pun_htmlspecialchars($group['g_user_title']) ?>" tabindex="2" />
        <span>This title will override any rank users in this group have attained. Leave blank to use default title or rank.</span>
    </td>
</tr>


#
#---------[ 6. AFTER, ADD ]---------------------------------------------------
#

<tr>
    <th scope="row">Group color</th>
    <td>
        <input type="text" name="group_color" size="9" maxlength="7" value="<?php echo $group['g_color'] ?>" tabindex="25" />
        <span>The color that will show for users in this group in the who's online list, and in posts..</span>
    </td>
</tr>
I enjoy pie :)

8

Re: Colored Usergroups - 1.0.2

where is the usergroups.php file

Re: Colored Usergroups - 1.0.2

Sorry, I wasn't paying attention. What was ment was admin_groups.php

I enjoy pie :)

10

Re: Colored Usergroups - 1.0.2

ok cool seem to have work ill let you know if the color apply right later it supper time here

11 (edited by Ataxy 2005-03-20 00:07)

Re: Colored Usergroups - 1.0.2

doesnt work the option are all there but ounce saved and me logingout and then reloging in the name do not change and when i go back to edit the usergroup the color box is blank
oh and i have used color code like : #0033FF

Re: Colored Usergroups - 1.0.2

wow I came back after installing the mod and just went to test it and had the questions that were answered here smile

I like it

Re: Colored Usergroups - 1.0.2

Ataxy, can you link me to the forums where you have installed, my guess is that you either didn't run the install_mod.php or you missed a step in the readme

I enjoy pie :)

14 (edited by Ataxy 2005-03-20 00:19)

Re: Colored Usergroups - 1.0.2

yep the site is right under my name and i did run the installer for the 1.0 but running the installer for the installer 1.0.1 result in conflict as the db allready as a section named the same wich is normal

Re: Colored Usergroups - 1.0.2

Ataxy wrote:

doesnt work the option are all there but ounce saved and me logingout and then reloging in the name do not change and when i go back to edit the usergroup the color box is blank
oh and i have used color code like : #0033FF

same thing happened to me and I ran install_mod.php

Re: Colored Usergroups - 1.0.2

Bah, I'm very sorry I appear to be the one who missed the step. I was working on 5 mods at once which is never a good idea. 1.0.2 will be released in a moment.

I enjoy pie :)

Re: Colored Usergroups - 1.0.2

thanks

I just went to my database and edited that way

nice mod by the way wink

18

Re: Colored Usergroups - 1.0.2

Mediator wrote:

Bah, I'm very sorry I appear to be the one who missed the step. I was working on 5 mods at once which is never a good idea. 1.0.2 will be released in a moment.

hey no problem its totally understandable

Re: Colored Usergroups - 1.0.2

Upgrading from 1.0.1 to 1.0.2

In admin_groups accourding to readme.txt

#
#---------[ 11. FIND (line:236) ]---------------------------------------------------
#

$db->query('INSERT INTO '.$db->prefix.'groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood) VALUES(\''.$db->escape($title).'\', '.$user_title.', '.$read_board.', '.$post_replies.', '.$post_topics.', '.$edit_posts.', '.$delete_posts.', '.$delete_topics.', '.$set_title.', '.$search.', '.$search_users.', '.$edit_subjects_interval.', '.$post_flood.', '.$search_flood.')') or error('Unable to add group', __FILE__, __LINE__, $db->error());

#
#---------[ 12. REPLACE WITH ]---------------------------------------------------
#

$db->query('INSERT INTO '.$db->prefix.'groups (g_title, g_user_title, g_read_board, g_post_replies, g_post_topics, g_edit_posts, g_delete_posts, g_delete_topics, g_set_title, g_search, g_search_users, g_edit_subjects_interval, g_post_flood, g_search_flood, g_color) VALUES(\''.$db->escape($title).'\', '.$user_title.', '.$read_board.', '.$post_replies.', '.$post_topics.', '.$edit_posts.', '.$delete_posts.', '.$delete_topics.', '.$set_title.', '.$search.', '.$search_users.', '.$edit_subjects_interval.', '.$post_flood.', '.$search_flood.', \''.$group_color.'\')') or error('Unable to add group', __FILE__, __LINE__, $db->error());

#
#---------[ 13. FIND (line:250) ]---------------------------------------------------
#

$db->query('UPDATE '.$db->prefix.'groups SET g_title=\''.$db->escape($title).'\', g_user_title='.$user_title.', g_read_board='.$read_board.', g_post_replies='.$post_replies.', g_post_topics='.$post_topics.', g_edit_posts='.$edit_posts.', g_delete_posts='.$delete_posts.', g_delete_topics='.$delete_topics.', g_set_title='.$set_title.', g_search='.$search.', g_search_users='.$search_users.', g_edit_subjects_interval='.$edit_subjects_interval.', g_post_flood='.$post_flood.', g_search_flood='.$search_flood.' WHERE g_id='.$_POST['group_id']) or error('Unable to update group', __FILE__, __LINE__, $db->error());

#
#---------[ 14. REPLACE WITH ]---------------------------------------------------
#

$db->query('UPDATE '.$db->prefix.'groups SET g_title=\''.$db->escape($title).'\', g_user_title='.$user_title.', g_read_board='.$read_board.', g_post_replies='.$post_replies.', g_post_topics='.$post_topics.', g_edit_posts='.$edit_posts.', g_delete_posts='.$delete_posts.', g_delete_topics='.$delete_topics.', g_set_title='.$set_title.', g_search='.$search.', g_search_users='.$search_users.', g_edit_subjects_interval='.$edit_subjects_interval.', g_post_flood='.$post_flood.', g_search_flood='.$search_flood.', g_color=\''.$group_color.'\' WHERE g_id='.$_POST['group_id']) or error('Unable to update group', __FILE__, __LINE__, $db->error());

That should be it, all should work and hopefully I won't have to update again soon.

I enjoy pie :)

20

Re: Colored Usergroups - 1.0.2

ok it does work now after reloging

Re: Colored Usergroups - 1.0.2

works like a charm now smile

22 (edited by cows 2005-03-23 22:46)

Re: Colored Usergroups - 1.0.2

im running punbb 1.2.4

and i get an error in the index.php

Here is the error word for word

Parse error: parse error, unexpected T_ELSE in /home/infern79/public_html/forums/index.php on line 192

and it only dost work when i

#---------[ 33. FIND (line:187) ]---------------------------------------------------
#

$users[] = "\n\t\t\t\t".'<dd><a href="profile.php?id='.$pun_user_online['user_id'].'">'.pun_htmlspecialchars($pun_user_online['ident']).'</a>'

#
#---------[ 34. REPLACE WITH ]---------------------------------------------------
#

$users[] = "\n\t\t\t\t".'<dd><a href="profile.php?id='.$pun_user_online['user_id'].'"><span style="color: '.$pun_user_online['color'].'">'.pun_htmlspecialchars($pun_user_online['ident']).'</span></a>';

#

help please
Cows

Re: Colored Usergroups - 1.0.2

My guess is that you put an extra ; or you are missing an ;. The code should look like this

    while ($pun_user_online = $db->fetch_assoc($result))
    {
        if ($pun_user_online['user_id'] > 1)
            $users[] = "\n\t\t\t\t".'<dd><a href="profile.php?id='.$pun_user_online['user_id'].'"><span style="color: '.$pun_user_online['color'].'">'.pun_htmlspecialchars($pun_user_online['ident']).'</span></a>';
        else
            ++$num_guests;
    }
I enjoy pie :)

24

Re: Colored Usergroups - 1.0.2

alright it works but now i got one more problem....  The names are underlined in blue...  Sign up and see what i mean

www.infernocc.net/forums/index.php

Re: Colored Usergroups - 1.0.2

Is that really that bad of a problem? I mean I guess you could change it to remove the underline, but I never really felt it was that bad.

I enjoy pie :)