oh, maybe str_replace would work too.
I only have half of this sorted at the moment.
I want to replace this
Code:
<!-- controls above thread list -->
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin-bottom:3px">
<tr valign="bottom">
<td class="smallfont"><if condition="$show['newthreadlink']"><a href="newthread.php?$session[sessionurl]do=newthread&f=$foruminfo[forumid]" rel="nofollow"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a><else /> </if></td>
<if condition="$pagenav"><td align="$stylevar[right]">$pagenav</td></if>
</tr>
</table>
<!-- / controls above thread list -->
With this
Code:
<!-- controls above thread list -->
<!-- NEW EVENT BUTTON DROP DOWN -->
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin-bottom:3px">
<tr valign="bottom">
<td id="add_event" width="6%">
<if condition="$show['newthreadlink']"><a href="#goto_newevent" rel="nofollow"><img src="$stylevar[imgdir_button]/newevent.gif" alt="$vbphrase[add_new_event]" border="0" /></a><script type="text/javascript"> vbmenu_register("add_event", true); </script>
<else />
</if>
</td>
<if condition="$pagenav"><td align="$stylevar[right]" width="94%">$pagenav</td></if>
</tr>
</table>
<!-- Add Event Menu -->
<div class="vbmenu_popup" id="add_event_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr>
<td class="thead">Add New Event</td>
</tr>
<tr>
<td class="vbmenu_option">
<img class="inlineimg" src="$stylevar[imgdir_misc]/calendar_icon.gif" alt="Single, All Day Event" border="0" />
<a href="calendar.php?$session[sessionurl]do=add&type=single&c=$calendarinfo[calendarid]">Single, All Day Event</a>
</td>
</tr>
<tr>
<td class="vbmenu_option">
<img class="inlineimg" src="$stylevar[imgdir_misc]/calendar_icon.gif" alt="Ranged Event" border="0" />
<a href="calendar.php?$session[sessionurl]do=add&c=$calendarinfo[calendarid]">Ranged Event</a>
</td>
</tr>
<tr>
<td class="vbmenu_option">
<img class="inlineimg" src="$stylevar[imgdir_misc]/calendar_icon.gif" alt="Recurring Event" border="0" />
<a href="calendar.php?$session[sessionurl]do=add&type=recur&c=$calendarinfo[calendarid]">Recurring Event</a>
</td>
</tr>
</table>
</div>
<!-- / Add Event Menu -->
<!-- / NEW EVENT BUTTON DROP DOWN -->
<!-- / controls above thread list -->
Then I need to replace this
Code:
<!-- controls below thread list -->
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin-top:3px">
<tr valign="top">
<td class="smallfont"><if condition="$show['newthreadlink']"><a href="newthread.php?$session[sessionurl]do=newthread&f=$foruminfo[forumid]" rel="nofollow"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a><else /> </if></td>
<if condition="$show['pagenav'] OR $show['inlinemod']">
<td align="$stylevar[right]">$pagenav
<if condition="$show['inlinemod']">
<div class="smallfont" style="text-align:$stylevar[left]; white-space:nowrap; float:$stylevar[right]">
<if condition="$show['pagenav']"><br /></if><strong>$vbphrase[moderation]</strong><br />
<select name="do">
<if condition="$show['deletethread'] OR $show['spamctrls'] OR $show['openthread'] OR $show['approvethread'] OR $show['movethread'] OR $template_hook['inlinemod_thread_bottom']">
<optgroup label="$vbphrase[option]">
<if condition="$show['deletethread']">
<option value="deletethread">$vbphrase[delete_threads]</option>
<option value="undeletethread">$vbphrase[undelete_threads]</option>
</if>
<if condition="$show['spamctrls']">
<option value="spamthread">$vbphrase[delete_threads_as_spam]</option>
</if>
<if condition="$show['openthread']">
<option value="open">$vbphrase[open_threads]</option>
<option value="close">$vbphrase[close_threads]</option>
</if>
<if condition="$show['approvethread']">
<option value="approvethread">$vbphrase[approve_threads]</option>
<option value="unapprovethread">$vbphrase[unapprove_threads]</option>
</if>
<if condition="$show['movethread']">
<option value="stick">$vbphrase[stick_threads]</option>
<option value="unstick">$vbphrase[unstick_threads]</option>
<option value="movethread">$vbphrase[move_threads]</option>
<option value="mergethread">$vbphrase[merge_threads]</option>
</if>
$template_hook[inlinemod_thread_bottom]
</optgroup>
</if>
<optgroup label="____________________">
<option value="viewthread">$vbphrase[view_selected_threads]</option>
<option value="clearthread">$vbphrase[clear_thread_list]</option>
</optgroup>
</select><input type="submit" class="button" id="inlinego" value="$vbphrase[go]" />
</div>
<script type="text/javascript">
<!--
inlineMod = new vB_Inline_Mod('inlineMod', 'thread', 'inlinemodform', '$vbphrase[go_x]');
//-->
</script>
</if>
</td>
</if>
</tr>
</table>
<!-- / controls below thread list -->
With this, Except this doesn't quite work. The menu doesn't open in the correct spot if you can see the inline moderation options.
Code:
<!-- controls below thread list -->
<!-- NEW EVENT BUTTON DROP DOWN -->
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="margin-top:3px">
<tr valign="top">
<td id="add_event" width="6%">
<if condition="$show['newthreadlink']"><a href="#goto_newevent" rel="nofollow"><img src="$stylevar[imgdir_button]/newevent.gif" alt="$vbphrase[add_new_event]" border="0" /></a><script type="text/javascript"> vbmenu_register("add_event", true); </script>
<!-- Add Event Menu -->
<div class="vbmenu_popup" id="add_event_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr>
<td class="thead">Add New Event</td>
</tr>
<tr>
<td class="vbmenu_option">
<img class="inlineimg" src="$stylevar[imgdir_misc]/calendar_icon.gif" alt="Single, All Day Event" border="0" />
<a href="calendar.php?$session[sessionurl]do=add&type=single&c=$calendarinfo[calendarid]">Single, All Day Event</a>
</td>
</tr>
<tr>
<td class="vbmenu_option">
<img class="inlineimg" src="$stylevar[imgdir_misc]/calendar_icon.gif" alt="Ranged Event" border="0" />
<a href="calendar.php?$session[sessionurl]do=add&c=$calendarinfo[calendarid]">Ranged Event</a>
</td>
</tr>
<tr>
<td class="vbmenu_option">
<img class="inlineimg" src="$stylevar[imgdir_misc]/calendar_icon.gif" alt="Recurring Event" border="0" />
<a href="calendar.php?$session[sessionurl]do=add&type=recur&c=$calendarinfo[calendarid]">Recurring Event</a>
</td>
</tr>
</table>
</div>
<!-- / Add Event Menu -->
<else />
</if>
</td>
<if condition="$show['pagenav'] OR $show['inlinemod']">
<td align="$stylevar[right]">$pagenav
<if condition="$show['inlinemod']">
<div class="smallfont" style="text-align:$stylevar[left]; white-space:nowrap; float:$stylevar[right]">
<if condition="$show['pagenav']"><br /></if><strong>$vbphrase[moderation]</strong><br />
<select name="do">
<if condition="$show['deletethread'] OR $show['spamctrls'] OR $show['openthread'] OR $show['approvethread'] OR $show['movethread'] OR $template_hook['inlinemod_thread_bottom']">
<optgroup label="$vbphrase[option]">
<if condition="$show['deletethread']">
<option value="deletethread">$vbphrase[delete_threads]</option>
<option value="undeletethread">$vbphrase[undelete_threads]</option>
</if>
<if condition="$show['spamctrls']">
<option value="spamthread">$vbphrase[delete_threads_as_spam]</option>
</if>
<if condition="$show['openthread']">
<option value="open">$vbphrase[open_threads]</option>
<option value="close">$vbphrase[close_threads]</option>
</if>
<if condition="$show['approvethread']">
<option value="approvethread">$vbphrase[approve_threads]</option>
<option value="unapprovethread">$vbphrase[unapprove_threads]</option>
</if>
<if condition="$show['movethread']">
<option value="stick">$vbphrase[stick_threads]</option>
<option value="unstick">$vbphrase[unstick_threads]</option>
<option value="movethread">$vbphrase[move_threads]</option>
<option value="mergethread">$vbphrase[merge_threads]</option>
</if>
$template_hook[inlinemod_thread_bottom]
</optgroup>
</if>
<optgroup label="____________________">
<option value="viewthread">$vbphrase[view_selected_threads]</option>
<option value="clearthread">$vbphrase[clear_thread_list]</option>
</optgroup>
</select><input type="submit" class="button" id="inlinego" value="$vbphrase[go]" />
</div>
<script type="text/javascript">
<!--
inlineMod = new vB_Inline_Mod('inlineMod', 'thread', 'inlinemodform', '$vbphrase[go_x]');
//-->
</script>
</if>
</td>
</if>
</tr>
</table>
<!-- / NEW EVENT BUTTON DROP DOWN -->
<!-- / controls below thread list -->
Then I need to make some changes to showthread to either modify the "new thread" button in the same way or I need to remove the code for the "new thread" button which is probably what I will do.
The complications come into play because these buttons only need to be modified for certain forums, which are subject to change, so I need to be able to have it done through plugins to avoid having to modify a ton of templates if I want to add a new event forum or remove one etc.