vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Usergroup Legend for ForumHome page (https://vborg.vbsupport.ru/showthread.php?t=92149)

amykhar 07-13-2005 10:00 PM

Usergroup Legend for ForumHome page
 
This little plugin shows a legend of what the various styles mean for the names on the who's online section of your forumhome page.

A big thank you to Link14716 for getting rid of the query.

Some people prefer different colors in the template changes. Their suggestions are posted below. I've posted what I am using on my board.

More advanced users may prefer: https://vborg.vbsupport.ru/showpost....0&postcount=61

bigcurt 07-14-2005 05:30 AM

Ya know and I just made a simple template mod yesterday for this for 3.0.X :P https://vborg.vbsupport.ru/showthread.php?p=735383

Good job amy

kall 07-14-2005 07:27 AM

Quote:

Originally Posted by bigcurt
Ya know and I just made a simple template mod yesterday for this for 3.0.X :P https://vborg.vbsupport.ru/showthread.php?p=735383

Good job amy

Simple? With yours, you have to insert the style information for each and every Usergroup you want to display.

This one appears to be a lot more automated.

Nice one amy. :)

xxskullxx 07-14-2005 07:41 AM

Looks good

/me hits install

kall 07-14-2005 08:06 AM

Umm...
HTML Code:

<td class="alt1" colspan="2" class="smallfont">
You can't do that...can you? (Declare class attribute twice).

Jenta 07-14-2005 10:14 AM

Quote:

Originally Posted by kall
Umm...
HTML Code:

<td class="alt1" colspan="2" class="smallfont">
You can't do that...can you? (Declare class attribute twice).

don't think so myself
move smallfont to a span tag after the td

kall 07-14-2005 10:25 AM

Indeed. And changing the upper td attribute to thead makes it fit in nicely (IMO).

I have it running on my forumhome if anyone wants to take a peek.

bigcurt 07-14-2005 10:36 AM

lol I just meant simple as in html wise, I am not smart enough yet to be fancy :P.

kall 07-14-2005 10:46 AM

Heh, sorry dude. No offense meant. :)

amykhar 07-14-2005 02:02 PM

Template stuff is always just a "starter" to get you going. ;) Tweak to your heart's desire.

Amy

Chris M 07-14-2005 02:22 PM

Nice idea amy :)

Edit: I was just thinking - Is there any way you can create a "spacer" element for the usergroup titles? :)

What I mean is that "Administrator Super Moderator Moderator" etc looks a bit odd - I know how to add commas or dashes or other ascii characters to space the names out, but the problem is the last one listed will always have that character on the end of the name :ermm:

I added a "legendorder" field and ordered the groups by it, and tried calling $usergroups['legendorder'] and making it so that if the number was greater than or equal to 9, there was no "spacer" but it didn't work :ermm:

Satan

amykhar 07-14-2005 05:07 PM

OK. I just released 2.0. It has the span tag for the smallfont and it has the separator to separate the usergroups.

I'll grab a new screenshot and post it in a second.

Wayne Luke 07-14-2005 05:50 PM

Thanks for this... Will be installing this in my test installation today. Definately makes it much easier than editing templates directly.

Link14716 07-14-2005 06:08 PM

I did a few changes. First, in the template, I used
HTML Code:

<td class="thead" colspan="2">
instead of
HTML Code:

<td class="tcat" colspan="2">
It looks a lot better that way. Also, I changed to plugin code to save the query. (Feel free to use this, Amy.)
PHP Code:

// Get all usergroups that have style changes.

foreach ($vbulletin->usergroupcache AS $group)
{
    if (!
$group['opentag'] AND !$group['closetag']) {
        continue;
    }

    if (!isset(
$legend))
    {
        
$legend $group['opentag'] . $group['title'] . $group['closetag'];
    }
    else
    {
        
$legend .= " | " $group['opentag'] . $group['title'] . $group['closetag'];
    }


I would attach the plugin file, but xml attachments aren't allowed anymore.

Good job, Amy. :)

amykhar 07-14-2005 06:28 PM

Quote:

Originally Posted by Link14716
I did a few changes. First, in the template, I used
HTML Code:

<td class="thead" colspan="2">
instead of
HTML Code:

<td class="tcat" colspan="2">
It looks a lot better that way. Also, I changed to plugin code to save the query. (Feel free to use this, Amy.)
PHP Code:

// Get all usergroups that have style changes.

foreach ($vbulletin->usergroupcache AS $group)
{
    if (!
$group['opentag']) {
        continue;
    }

    if (!isset(
$legend))
    {
        
$legend $group['opentag'] . $group['title'] . $group['closetag'];
    }
    else
    {
        
$legend .= " | " $group['opentag'] . $group['title'] . $group['closetag'];
    }


I would attach the plugin file, but xml attachments aren't allowed anymore.

Good job, Amy. :)

Doh on using the cache! I'll update that and give you credit for catching my brain-fart ;)

Amy

Chris M 07-14-2005 06:31 PM

Quote:

Originally Posted by amykhar
Doh on using the cache! I'll update that and give you credit for catching my brain-fart ;)

Amy

Is there any way of making that display it based on a usergroup field? :p

Because I want it to display it by "legendorder" the field I created :p

I'm stuck using the query because I can't figure out how I can make it order it how I want :p

Satan

amykhar 07-14-2005 06:37 PM

Thinking out loud. I would add each group and tag and legend order field to an array. I would sort the array based on the legendorder and then I would explode the whole thing out to the legend string.

hotrod1 07-14-2005 06:38 PM

Great hack! Thanks

Link14716 07-14-2005 06:40 PM

Quote:

Originally Posted by hellsatan
Is there any way of making that display it based on a usergroup field? :p

Because I want it to display it by "legendorder" the field I created :p

I'm stuck using the query because I can't figure out how I can make it order it how I want :p

Satan

I'll give it a shot.

PHP Code:

// Get all usergroups that have style changes.

foreach ($vbulletin->usergroupcache AS $group)
{
    if (!
$group['opentag'] AND !$group['closetag']) {
        continue;
    }

    
$legend_array[$group['legendorder']] = $group['opentag'] . $group['title'] . $group['closetag'];
}
ksort($legend_arraySORT_NUMERIC);
$legend implode(" | "$legend_array); 


Chris M 07-14-2005 06:52 PM

I'll give it a try ;)

It works well :)

Satan

Sovereign 07-14-2005 07:03 PM

Sovereign installs. amykhar, you are quite prolific with your hacking, good job, your hacks/plugins rock!

amykhar 07-14-2005 07:09 PM

Thank you :)

Amy

Rover416 07-14-2005 07:31 PM

*Clicks Install*

Thank you amy. :D

Wayne Luke 07-14-2005 08:03 PM

Has the download been updated with these changes or are those still coming?

amykhar 07-14-2005 08:04 PM

Yes. The download is updated to use the cache Wayne.

ack 07-20-2005 11:51 PM

I think it looks great. And it uploaded just fine. Thanks!

Boofo 07-25-2005 01:07 PM

Quote:

Originally Posted by amykhar
OK. I just released 2.0. It has the span tag for the smallfont and it has the separator to separate the usergroups.

I'll grab a new screenshot and post it in a second.

You have

Quote:

<span="smallfont">
Shouldn't that be this?

Quote:

<span class="smallfont">
;)

Dan 07-25-2005 01:15 PM

Awsome job Amy :D I'll certaintly use this!

akanevsky 08-01-2005 08:07 PM

Just a small optimization:

Replace
PHP Code:

    if (!isset($legend))
    {
        
$legend $group['opentag'] . $group['title'] . $group['closetag'];
    }
    else
    {
        
$legend .= " | " $group['opentag'] . $group['title'] . $group['closetag'];
    } 

With

PHP Code:

    $legend .= " | " $group['opentag'] . $group['title'] . $group['closetag']; 

This is safe to do because vBulletin unsets all the globals in init.php...

Other than that - nice job :)

amykhar 08-01-2005 08:13 PM

Dark, doesn't your version end up with a | before the first group? I did it the way I did to put the | between the group names.

Amy

Neal-UK 08-01-2005 08:23 PM

Quote:

Originally Posted by amykhar
Dark, doesn't your version end up with a | before the first group? I did it the way I did to put the | between the group names.

Amy

Installing on rc1, hope it works, excellent hack

akanevsky 08-01-2005 08:39 PM

Yes, it does sorry. But here is a fix:

PHP Code:

$legend .= (!empty($legend) ? " | " "") . $group['opentag'] . $group['title'] . $group['closetag']; 

;)

amykhar 08-01-2005 11:44 PM

OK. I 'm going to stick with mine then, simply for clarity for newer coders. People who understand optimization will probably grab your code. But, people who want to tinker with my base hack will do better working with more readable code.

Amy

akanevsky 08-02-2005 12:23 AM

Okay. Your code is as good as mine. :)

Chris M 08-02-2005 12:48 AM

Quote:

Originally Posted by Dark Visor
Okay. Your code is as good as mine. :)

Both work - Thats all that they are required to do...

Satan

akanevsky 08-02-2005 01:42 AM

Quote:

Both work - Thats all that they are required to do...
If it's all they are required to do, then how come you have installed vBulletin 3.0? Why didn't you stay on vB2? Why are you writing hacks at all? vBulletin "works and it's all it is required to do."... Now, why did you install vBulletin at all? Your computer works without it. It does not to need no vBulletin sh*t loaded in a browser full of viruses. I am sure you do not have an antivirus because your computer works without it and "it's all it's required to do". On the second thought, you don't even need a computer. Your brain can live and work without it and "it's all it is required to do".

Boofo 08-02-2005 02:16 AM

We all need to calm down and respect Amy. This is her thread. ;)

Chris M 08-02-2005 08:29 AM

Quote:

Originally Posted by Dark Visor
If it's all they are required to do, then how come you have installed vBulletin 3.0? Why didn't you stay on vB2? Why are you writing hacks at all? vBulletin "works and it's all it is required to do."... Now, why did you install vBulletin at all? Your computer works without it. It does not to need no vBulletin sh*t loaded in a browser full of viruses. I am sure you do not have an antivirus because your computer works without it and "it's all it's required to do". On the second thought, you don't even need a computer. Your brain can live and work without it and "it's all it is required to do".

Can you say childish overreaction?

In respect for amy's thread and boobfoo's pointing out, I'll leave it at this:

It's just a hack - Chill :p

Satan

Boofo 08-02-2005 09:12 AM

boobfoo? I may switch sides. ;)

akanevsky 08-02-2005 09:17 AM

Quote:

Can you say childish overreaction?

In respect for amy's thread and boobfoo's pointing out, I'll leave it at this:

It's just a hack - Chill

Satan
Can you say a need to say something stupid even after a moderator told you to quiet down? Chill.


All times are GMT. The time now is 06:12 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01642 seconds
  • Memory Usage 1,853KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_html_printable
  • (6)bbcode_php_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete