vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=229)
-   -   Forum Home Enhancements - Moderator Column Javascript Menu (https://vborg.vbsupport.ru/showthread.php?t=190947)

rukia 09-14-2008 10:00 PM

Moderator Column Javascript Menu
 
This hack will change the moderator column previewed on forum home and on subforums into a clickable javascript menu using vBulletin's own menu control API. Each moderator will have it's own column in the menu, and will be a clickable link leading to the moderator's profile page; in addition, there will be a link to allow the user easy access to send a new PM. This hack will automatically use the old style moderator column separated by commas if the viewer's browser has javascript disabled. :)

Demo: http://www.giveupalready.com/index.php

Included in the post is the image for the Send PM button, you will need to place it in your images/buttons directory for it to work.

First, find and open up forumhome_forumbit_level1_post and locate:

Code:

<if condition="$vboptions['showmoderatorcolumn']">
        <td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
</if>

You want to replace the previous lines with:

Code:

<if condition="$vboptions['showmoderatorcolumn']">
        <td class="alt1">
        <if condition="$show['popups']">
                <if condition="$forum[moderators]">
                        <div id="moderators$forum[forumid]" class="smallfont">
                                <a href="#"><strong>Moderators</strong></a>
                                <script type="text/javascript">
                                        vbmenu_register("moderators$forum[forumid]");
                                </script>
                        </div>
                        <div class="vbmenu_popup" id="moderators$forum[forumid]_menu" style="display:none">
                                <table cellpadding="4" cellspacing="1" border="0">
                                        <tr><td class="thead">$forum[title] Moderators</td></tr>
                                        $forum[moderators]
                                </table>
                        </div>
                </if>
                <else />
                        <div class="smallfont">$forum[moderators]</div>
                </if>
        </td>
</if>

Now find forumhome_forumbit_level2_post and locate the following lines:

Code:

<if condition="$vboptions['showmoderatorcolumn']">
        <td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
</if>

You want to replace those lines with the following code:

Code:

<if condition="$vboptions['showmoderatorcolumn']">
        <td class="alt1">
        <if condition="$show['popups']">
                <if condition="$forum[moderators]">
                        <div id="moderators$forum[forumid]" class="smallfont">
                                <a href="#"><strong>Moderators</strong></a>
                                <script type="text/javascript">
                                        vbmenu_register("moderators$forum[forumid]");
                                </script>
                        </div>
                        <div class="vbmenu_popup" id="moderators$forum[forumid]_menu" style="display:none">
                                <table cellpadding="4" cellspacing="1" border="0">
                                        <tr><td class="thead">$forum[title] Moderators</td></tr>
                                        $forum[moderators]
                                </table>
                        </div>
                </if>
                <else />
                        <div class="smallfont">$forum[moderators]</div>
                </if>
        </td>
</if>

Now for the final step, open up forumhome_moderator and delete the code in there. Replace it with the following:

Code:

<if condition="$show['popups']">
                <tr><td class="vbmenu_option"><div class="smallfont" style="float: left" /><a href="member.php?$session[sessionurl]u=$moderator[userid]">$moderator[musername]</a></div><div style="float: right" /><a href="private.php?$session[sessionurl]do=newpm&amp;u=$moderator[userid]" rel="nofollow"><img src="$stylevar[imgdir_button]/sendpm.png" alt="<phrase 1="$moderator[username]">$vbphrase[send_private_message_to_x]</phrase>" border="0" /></a></div></td></tr>
<else />
<if condition="$show['comma_leader']">, </if><a href="member.php?$session[sessionurl]u=$moderator[userid]">$moderator[musername]</a>
</if>

If you do not wish to use an image for Send PM, change:

Code:

<img src="$stylevar[imgdir_button]/sendpm.png" alt="<phrase 1="$moderator[username]">$vbphrase[send_private_message_to_x]</phrase>" border="0" />
To your text of choice.

If you followed these steps correctly, you should now be able to click "Moderators" in the moderator column to open a javascript menu similar to the ones featured in your very own forum. :)

If you want to disable the arrow icon associated with the menu, locate vbmenu_register("moderators$forum[forumid]"); and change it to vbmenu_register("moderators$forum[forumid]",true);


- September 15:
Added: Send PM link next to moderator username.

SEOvB 09-15-2008 01:37 AM

nice addition

haothiencz 09-15-2008 06:18 AM

Good idea, ;)

RvG2 09-15-2008 02:00 PM

cool! thanks for sharing!

RobbieZ 09-15-2008 03:25 PM

Makes it look more professional. I like it.

rukia 09-15-2008 05:47 PM

Updated to include a "Send PM" link next to the moderator's name, image for the button is included in the post, but you may opt to use your own; demo has been updated to reflect the addition.


All times are GMT. The time now is 04:30 PM.

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.01082 seconds
  • Memory Usage 1,742KB
  • 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_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete