View Full Version : Online.php with colors

26 Oct 2002, 00:56
Well I noticed that there wasn't a hack for online.php to have colors(or I didn't look right) Well I decided to make it so other people that have the who's online on index.php with colors so it will match with the online.php If you install this hack please click install (http://www.vbulletin.org/forum/misc.php?s=&action=install&threadid=45002).

Go Here (http://www.vbulletin.org/forum/showthread.php?s=&threadid=32149) for the version on the forum home.


File edits:
2 file
1 template

Pics on the next two post!

26 Oct 2002, 01:00
Pic 1:

26 Oct 2002, 01:01
Pic 2:

26 Oct 2002, 03:05
Nice... :D

26 Oct 2002, 03:14
thanks if anyone has problems just post it here.

26 Oct 2002, 03:32
I will install it tomorrow... Too tired now :D

26 Oct 2002, 03:47
BTW any comments are welcome.

26 Oct 2002, 13:25
/me installs...

26 Oct 2002, 15:43
Good to hear four people installed it! And no problems so far.

26 Oct 2002, 16:27
works well. Worked for me

27 Oct 2002, 01:23
Good to hear! :)

28 Oct 2002, 02:15
Edit members are blue now

28 Oct 2002, 08:34
Installed... ;)

28 Oct 2002, 21:23
So no problems good!

Dark Jim
28 Oct 2002, 22:27
Tip: Use replacements instead of colors in online.php. That way you can use it with more themes. :)

28 Oct 2002, 23:05
okay >_< you got me confused there.

Dark Jim
29 Oct 2002, 08:27
Instead of something like:
if ($user['usergroupid'] == 6 and $highlightadmin) {
$userinfo["$key"]['username'] = "<font color=red><b><i>$user[username]</i></b></font>";
} else if (($user['usergroupid'] == 7)and $highlightadmin) {
$userinfo["$key"]['username'] = "<font color=green><b>$user[username]</b></font>";
if ($user['usergroupid'] == 6 and $highlightadmin) {
$userinfo["$key"]['username'] = "<font color={admincolor}><b><i>$user[username]</i></b></font>";
} else if (($user['usergroupid'] == 7)and $highlightadmin) {
$userinfo["$key"]['username'] = "<font color={modcolor}><b>$user[username]</b></font>";
Then create replacements {admincolor} and {modcolor}. If you have a white or black theme for example, coloring the admin color red is fine but what if you add another theme that is red? In that case you'll set the {admincolor} to something else for that theme. ;)

29 Oct 2002, 19:00
ah okay I'll be updating the file soon I just gotta test it on my own ^^

30 Oct 2002, 03:05
Hack edited thanks for the suggestion Dark Jim :)

30 Oct 2002, 21:19
anyone understand the file? About the replacements?

Dark Jim
31 Oct 2002, 23:14
The who's online legend should also use those replacements. ;)

31 Oct 2002, 23:16
I forgot that let me edit it thanks for the reminder.

31 Oct 2002, 23:18
Attachment edited.

Dynamic One
01 Nov 2002, 19:57
Thanks was searching for this hack. Nice job m8.

01 Nov 2002, 22:13
No Problem :)

03 Nov 2002, 17:05
We will be installing this soon... let you know how it goes!

05 Nov 2002, 05:59
This is very similar to a hack that I've put in place on the boards that I help run. If I may be so bold, here's a suggestion that makes it easier to configure the colors in the admin cp. If you'd like to make it so that you can go into fonts/colors/etc for your styles and edit the colors from there (in the same manner that main colors and calendar colors are set), try this out:

Edit admin/style.php

find.makelinkcode("calendar colors","#calendarcolors")just after that add.makelinkcode("who's online colors","#whoonlinecolors")

Then find // *** calendar colors ************************************************
maketableheader("Calendar Colors","calendarcolors");
makestyleeditor("calbgcolor","Background Color",1);
makestyleeditor("caltodaycolor","Today Background Color",1);
makestyleeditor("caldaycolor","Calendar Date Font Color",1);
makestyleeditor("calbirthdaycolor","Birthday Font Color",1);
makestyleeditor("calprivatecolor","Private Event Font Color",1);
makestyleeditor("calpubliccolor","Public Event Font Color",1);
restarttable();just after that add // *** who's online colors ************************************************
maketableheader("Who's Online Colors","whoonlinecolors");
makestyleeditor("admincolor","Administrator Color",1);
makestyleeditor("supermodcolor","Super Moderator Color",1);
makestyleeditor("modcolor","Moderator Color",1);
makestyleeditor("membercolor","Regular Member Color",1);
restarttable();Now you (and your admins) don't have to fiddle with the replacements to set the who's online colors :)

It also helps to insert default values for these replacements into the replacement table. That way when a new style is created, you'll have some standard colors for the who's online ready to go. I've always done this by just running the SQL statements myself in phpMyAdmin. Anything with a replacementsetid of -1 is considered a default value and will be used if the replacementset you're using doesn't have a value set for that replacement, so something like
INSERT INTO `replacement` (replacementsetid,findword,replaceword) VALUES("-1","{admincolor}","#FF0000");
INSERT INTO `replacement` (replacementsetid,findword,replaceword) VALUES("-1","{supermodcolor}","#FF9900");
INSERT INTO `replacement` (replacementsetid,findword,replaceword) VALUES("-1","{modcolor}","#FFFF00");
INSERT INTO `replacement` (replacementsetid,findword,replaceword) VALUES("-1","{membercolor}","#000000");with the hex values for the colors you want in place of the ones I used. (Red, Orange, Yellow, Black). There's probably a way to do that all in one SQL statement but my SQL knowledge is somewhat lacking so I use four ;)

Hope somebody finds this useful. :D

06 Nov 2002, 02:49
Thanks for that I might be adding that to the hack.

10 Nov 2002, 17:08
Hack has been updated :)

10 Nov 2002, 18:37
Cool hack

* Seph clicks install

16 Nov 2002, 16:54
:) Thanks