PDA

View Full Version : Online.php with colors


LOD-squa
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.

Quiries:
4

File edits:
2 file
1 template

Pics on the next two post!

LOD-squa
26 Oct 2002, 01:00
Pic 1:

LOD-squa
26 Oct 2002, 01:01
Pic 2:

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

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

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

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

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

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

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

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

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

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

LOD-squa
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. :)

LOD-squa
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>";
Use:
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. ;)

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

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

LOD-squa
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. ;)

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

LOD-squa
31 Oct 2002, 23:18
Attachment edited.

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

LOD-squa
01 Nov 2002, 22:13
No Problem :)

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

Shadowblazer
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

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

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

Graphics
10 Nov 2002, 18:37
Cool hack

* Seph clicks install

LOD-squa
16 Nov 2002, 16:54
:) Thanks