Welcome, Guest. Please Login or Register.
May 19, 2024, 06:32:55 AM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Completed mods  |  [DONE: 1.4.1]Who's Online Name Highlighter « previous next »
Pages: [1] Reply Ignore Print
Author Topic: [DONE: 1.4.1]Who's Online Name Highlighter  (Read 1887 times)
1979Z28
Sr. Member
****
Posts: 324


WWW
[DONE: 1.4.1]Who's Online Name Highlighter
« on: September 13, 2002, 10:07:41 AM »
Reply with quote

This is my first 'mod' so bear with me ;)
As always, backup any files edited, so you can replace it easily, if you break anything.
Originally done by Delinquently Insane, and found at http://yabbse.sourceforge.net/community/index.php?board=158;action=display;threadid=7350;start=0, I decided to bring this up to date for 1.4.1. Now, I'm by no means a PHP expert, nor YaBB knowledgeable, but I am fairly good at HTML ;)

Remember that this IS technically a direct 'rip-off' of Delinquently Insane's coding, though I just went through, made it work for 1.4.1, as well as made it so that you can click on the person's name to view their profile, *in the old version I believe, you couldn't* I also made it, just for the sake of doing it, so that every name on the 'Who's Online' is highlighted in the fun, default color. By looking at the code itself, you can disable this by putting a </table> after every </a> in the code. You can also, obviously, change to what color you would like the 'highlight' color to be, for each different user group :)
Anyways, it's very easy to do, and full credit should go out to Delinquently Insane, I just went through and brought it up to date with 1.4.1 ;D

<id>
Highlighted Board Crew-Written By Mcguire
</id>
<mod info>
This Mod Gives A Little Extra Life In Your Site
This Is Not A Full Releases Of This Mod.. In The
Full Release This Modw Will Be Feasable To The
Admin Panel For Altering Colors...... Tell Me
What You Think.....
</mod info>
<author>
By MCguire
Contact:[email protected]
website:visionportal.3utilities.net
or reach me at the yabb forums
http://yabb.info/community
</author>

<homepage>
http://www.visionware.sytes.net/
</homepage>

<edit file>
Sources/BoardIndex.php
</edit file>

<search for>
         if ($tmp['memberGroup']=="Administrator")
   $tmpusers[] = "<a href=\"$scripturl?action=viewprofile;user=$euser\"><font color=\"red\">$tmp[realName]</font></a>";
elseif ($tmp['memberGroup']=="Global Moderator")
   $tmpusers[] = "<a href=\"$scripturl?action=viewprofile;user=$euser\"><font color=\"blue\">$tmp[realName]</font></a>";
elseif ($tmp['memberGroup']=="YaBB SE Developer")
   $tmpusers[] = "<a href=\"$scripturl?action=viewprofile;user=$euser\"><font color=\"green\">$tmp[realName]</font></a>";
elseif ($tmp['memberGroup']=="Mod Team")
   $tmpusers[] = "<a href=\"$scripturl?action=viewprofile;user=$euser\"><font color=\"orange\">$tmp[realName]</font></a>";
else
   $tmpusers[] = "<a href=\"$scripturl?action=viewprofile;user=$euser\">$tmp[realName]</a>";
</search for>
               
<replace>
         if ($tmp['memberGroup']=="Administrator")
   $tmpusers[] = "<table style=\"filter:glow(color=red, strength=8)\"><a href=\"$scripturl?action=viewprofile;user=$euser\"><font size='-1' color='white'><b>$tmp[realName]</b></font></a></table>";
elseif ($tmp['memberGroup']=="Global Moderator")
   $tmpusers[] = "<table style=\"filter:glow(color=blue, strength=8)\"><a href=\"$scripturl?action=viewprofile;user=$euser\"><font size='-1' color='white'><b>$tmp[realName]</b></font></a></table>";
elseif ($tmp['memberGroup']=="YaBB SE Developer")
   $tmpusers[] = "<table style=\"filter:glow(color=purple, strength=8)\"><a href=\"$scripturl?action=viewprofile;user=$euser\"><font size='-1' color='white'><b>$tmp[realName]</b></font></a></table>";
elseif ($tmp['memberGroup']=="Mod Team")
   $tmpusers[] = "<table style=\"filter:glow(color=yellow, strength=8)\"><a href=\"$scripturl?action=viewprofile;user=$euser\"><font size='-1' color='white'><b>$tmp[realName]</b></font></a></table>";
else
   $tmpusers[] = "<a href=\"$scripturl?action=viewprofile;user=$euser\">$tmp[realName]</a>,";
</replace>

To remove the commas after the 'special groups' names, and only have it so that 'normal members' put the comma down, do the following:
<search for>
   $users = "<font size=1>".implode(", ",$tmpusers)."</font>";
</search for>

<replace>
   $users = "<font size=1>".implode(" ",$tmpusers)."</font>";
</replace>

<search for>
   $tmpusers[] = "<a href=\"$scripturl?action=viewprofile;user=$euser\">$tmp[realName]</a>";
</search for>

<replace>
   $tmpusers[] = "<a href=\"$scripturl?action=viewprofile;user=$euser\">$tmp[realName]</a>";
</replace>

Doing it this way, having the normal members using a comma, with the member groups not, makes it look a little better in my opinion. But only with this mod. Having the commas, and the highlights, tends to make it kind of..bleed. Unfortunately, if you do this, it will include a comma after ALL normal members. If there's only one signed on, it will show their name, and then a comma right after. It's best just to remove the comma entirely, in my opinion.

If, for some reason, you want to give the 'normal' users / visitors to the page a color, then do this:

<search for>
else
   $tmpusers[] = "<a href=\"$scripturl?action=viewprofile;user=$euser\">$tmp[realName]</a>";
</search for>

<replace>
else
   $tmpusers[] = "<table style=\"filter:glow(color=YOURCOLORHERE, strength=8)\"><a href=\"$scripturl?action=viewprofile;user=$euser\"><font size='-1' color='white'><b>$tmp[realName]</b></font></a>,</table>";
</replace>

Obviously, replace the YOURCOLORHERE with the name of your chosen color :)

I do believe, that with this current setup, the names are displayed one after the other, and if the 'normal' quests do not have a color chosen for them, then they will have a highlighted color about them, by default as a result of bleeding. More testing on my part fill prove or disprove that, as well as a fix for that. But for now I just wanted to get this up there before I forgot all of what I did :)

You can see it in action here: http://www.ufba.org/forum/index.php

Just out of curiousity, anybody know why the member groups YaBB SE Developer, and Mod Team, are still around? ;) I could've sworn that the only member groups in a normal download, are Admin, and Global Mods.. yet there's 'support' for them in the boardindex.. Another Easter Egg, perhaps? ;D ;)
Since my board doesn't have any of those member groups, and I'm guessing most normal boards don't, you can simply remove that part of the coding.


Changed to DONE status, as it seems like nobody's really complained about it, so I guess it works. ;)
« Last Edit: September 18, 2002, 09:45:07 AM by 1979Z28 » Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  [DONE: 1.4.1]Who's Online Name Highlighter « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.030 seconds with 18 queries.