Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Moderator Column Javascript Menu Details »»
Moderator Column Javascript Menu
Version: 1.00, by rukia rukia is offline
Developer Last Online: Oct 2008 Show Printable Version Email this Page

Category: Forum Home Enhancements - Version: 3.7.x Rating:
Released: 09-14-2008 Last Update: Never Installs: 10
Template Edits
Re-useable Code  
No support by the author.

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.

Show Your Support

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

Comments
  #2  
Old 09-15-2008, 01:37 AM
SEOvB's Avatar
SEOvB SEOvB is offline
 
Join Date: May 2007
Location: Indianapolis
Posts: 2,451
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice addition
Reply With Quote
  #3  
Old 09-15-2008, 06:18 AM
haothiencz haothiencz is offline
 
Join Date: Jan 2008
Posts: 223
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good idea,
Reply With Quote
  #4  
Old 09-15-2008, 02:00 PM
RvG2 RvG2 is offline
 
Join Date: Jan 2007
Posts: 457
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

cool! thanks for sharing!
Reply With Quote
  #5  
Old 09-15-2008, 03:25 PM
RobbieZ RobbieZ is offline
 
Join Date: Jul 2008
Posts: 1,117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Makes it look more professional. I like it.
Reply With Quote
  #6  
Old 09-15-2008, 05:47 PM
rukia rukia is offline
 
Join Date: Aug 2008
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


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 05:45 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.04795 seconds
  • Memory Usage 2,252KB
  • Queries Executed 19 (?)
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
  • (6)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (6)postbit_onlinestatus
  • (6)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete