Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
Moderator Dropdown Listing Details »»
Moderator Dropdown Listing
Version: 1.00, by Feran Feran is offline
Developer Last Online: Nov 2004 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 01-19-2004 Last Update: Never Installs: 11
 
No support by the author.

Yeah, I found it kinda annoying how having multiple moderators for one forum would make things rather ugly and cluttery and jumble up my front page. So, I made this nifty little hack ^_^

Features:
- Upon choosing a moderator, it will link to that moderator's profile
- A link to showgroups.php

Download, install, enjoy. Only one edit!! 8)

PHP Code:
Open includes/functions_forumlist.phpfind this:

//////////////////////////////////////////////////////////////////

                // get moderators ( this is why we needed cache_moderators() )
                
if ($vboptions['showmoderatorcolumn'])
                {
                    
$showmods = array();
                    
$listexploded explode(','$forum['parentlist']);
                    foreach (
$listexploded AS $parentforumid)
                    {
                        if (!isset(
$imodcache["$parentforumid"]))
                        {
                            continue;
                        }
                        foreach(
$imodcache["$parentforumid"] AS $moderator)
                        {
                            if (
$showmods["$moderator[userid]"] === true)
                            {
                                continue;
                            }

                            
$showmods["$moderator[userid]"] = true;
                            if (!isset(
$forum['moderators']))
                            {
                                eval(
'$forum[\'moderators\'] = "' fetch_template('forumhome_moderator') . '";');
                            }
                            else
                            {
                                eval(
'$forum[\'moderators\'] .= ", ' fetch_template('forumhome_moderator') . '";');
                            }
                        }
                    }
                    if (!isset(
$forum['moderators']))
                    {
                        
$forum['moderators'] = '';
                    }
                }


//////////////////////////////////////////////////////////////////

Replace it with this:

//////////////////////////////////////////////////////////////////

                // get moderators ( this is why we needed cache_moderators() )
                
if ($vboptions['showmoderatorcolumn'])
                {
                    
$showmods = array();
                    
$listexploded explode(','$forum['parentlist']);
                    foreach (
$listexploded AS $parentforumid)
                    {
                        if (!isset(
$imodcache["$parentforumid"]))
                        {
                            continue;
                        }
                        foreach(
$imodcache["$parentforumid"] AS $moderator)
                        {
                            if (
$showmods["$moderator[userid]"] === true)
                            {
                                continue;
                            }

                            
$forum['moderators'] .= "<option value='{$moderator[userid]}'>{$moderator[username]}</option>";
                        }

                    }

$modhack_head = <<< CONTENT

<script>
<!--
function moddrophack_redir(tparam)
{
    if (tparam != -1) {
        location.href = 'member.php?userid=' + tparam;
    }
    else {
        location.href = 'showgroups.php';
    }
}
// -->
</script>

<form method="post">

<select id="moddrophack" onchange="moddrophack_redir(this.options[selectedIndex].value)">
<option value="-1">--------------</option>

CONTENT;

$modhack_foot '<option value="-1">View All Mods</option></select></form>';

                    if (!isset(
$forum['moderators']))
                    {
                        
$forum['moderators'] = '';
                    }
                    else {
                        
$forum['moderators'] = $modhack_head $forum['moderators'] . $modhack_foot;
                    }
                } 

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 01-20-2004, 07:56 PM
Exero's Avatar
Exero Exero is offline
 
Join Date: Jun 2003
Location: Australia
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hey cool
i could use this for my new style on my forum
thanks
Reply With Quote
  #3  
Old 01-20-2004, 08:51 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You really shouldn't hard code all that HTML into the file.
Reply With Quote
  #4  
Old 01-20-2004, 09:20 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i was planning on releasing this as a template mod ... lmao guess i still will
have it done just didnt get to releasing it today
Reply With Quote
  #5  
Old 01-20-2004, 10:47 PM
Feran's Avatar
Feran Feran is offline
 
Join Date: Oct 2003
Location: San Diego, CA (USA)
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by NTLDR
You really shouldn't hard code all that HTML into the file.
Everyone's a critic -.- I swear I can't release one hack here without some negative commentary.

I admit that repeating the <script> tag so many times is silly (I'm lazy, remember!), but the <option value="x"> is contingent upon the moderator userid! I don't see how I'm going to incorporate for loops into the template, and remember that the moderator template is for every moderator name listing on your forums, meaning that if I threw <option> into the template it would appear that way.. in wayyy too many places

If you're going to complain, at least do me the decency of providing the solution for the benefit of the users
Reply With Quote
  #6  
Old 01-21-2004, 12:01 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can this be done in the forums manager where we choose a mod for that forum? Right now you have to enter a name manually and sometimes the name isn't spelled as we think it is.
Reply With Quote
  #7  
Old 01-21-2004, 12:11 AM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Feran
I don't see how I'm going to incorporate for loops into the template, and remember that the moderator template is for every moderator name listing on your forums, meaning that if I threw <option> into the template it would appear that way.. in Way too many places
You don't, you eval the template multiple times from within the for loop, just like the existing moderator template is evaled multiple times in the loop. vB3 has Template Conditionals too, which make it very simple to only use the option code in the places you want it to appear

Quote:
If you're going to complain, at least do me the decency of providing the solution for the benefit of the users
If I wanted this hack I'd have coded it myself I was just providing constructive criticism like I do with many hacks.
Reply With Quote
  #8  
Old 01-22-2004, 08:22 PM
Merjawy's Avatar
Merjawy Merjawy is offline
 
Join Date: Sep 2002
Location: USA
Posts: 505
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have tried it but I get errors and forum won't load

I made sure I did it right few times, but no luck here

usinin vB3.0 RC3

Parse error: parse error, unexpected T_SL in D:\home\public_html\forums\includes\functions_foru mlist.php on line 373

Fatal error: Call to undefined function: construct_forum_bit() in D:\home\public_html\forums\index.php on line 387
Reply With Quote
  #9  
Old 01-24-2004, 07:04 AM
Allan's Avatar
Allan Allan is offline
 
Join Date: Jun 2003
Location: France
Posts: 1,513
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Merjawy
I have tried it but I get errors and forum won't load

I made sure I did it right few times, but no luck here

usinin vB3.0 RC3

Parse error: parse error, unexpected T_SL in D:\home\public_html\forums\includes\functions_foru mlist.php on line 373

Fatal error: Call to undefined function: construct_forum_bit() in D:\home\public_html\forums\index.php on line 387
idem
Reply With Quote
  #10  
Old 01-24-2004, 07:45 PM
SunderlandJ SunderlandJ is offline
 
Join Date: Dec 2003
Location: UK
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm a complete newbie, and I keep getting parse errors on line 373. I have no idea as to what to do with scripts, so I can't edit this myself, and I don't know anyone that is good with php.

I really want this script, but have no idea how I can install it without getting all these errors - Please can someone help?
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:42 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04778 seconds
  • Memory Usage 2,331KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete