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)

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


All times are GMT. The time now is 02:15 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.01852 seconds
  • Memory Usage 1,759KB
  • 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
  • (4)bbcode_html_printable
  • (3)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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