Back to vBulletin 3.7 Template Modifications

Moderator Column Javascript Menu
Mod Version: 1.00, by rukia

This modification is in the archives.
vB Version: 3.7.x Rating: (1 vote - 5.00 average) Installs: 10
Released: 15 Sep 2008 Last Update: Never Downloads: 0
Not Supported Template Edits Re-usable Code  

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.

Download

No files for download.

Screenshots


vblts.ru supports vBulletin®, 2022-2024