Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
Prev Previous Post   Next Post Next
  #9  
Old 10-18-2010, 09:19 PM
BigJohnny's Avatar
BigJohnny BigJohnny is offline
 
Join Date: Jun 2006
Location: Canada
Posts: 500
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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&amp;f=$foruminfo[forumid]" rel="nofollow"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a><else />&nbsp;</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 />&nbsp;
                </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&amp;type=single&amp;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&amp;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&amp;type=recur&amp;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&amp;f=$foruminfo[forumid]" rel="nofollow"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a><else />&nbsp;</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&amp;type=single&amp;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&amp;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&amp;type=recur&amp;c=$calendarinfo[calendarid]">Recurring Event</a>
        </td>
    </tr>
    </table>
</div>
<!-- / Add Event Menu -->
                <else />&nbsp;
                </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.
Reply With Quote
 

Thread Tools
Display Modes

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 12:06 AM.


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.09616 seconds
  • Memory Usage 2,613KB
  • Queries Executed 12 (?)
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
  • (5)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (11)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)showthread_list
  • (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_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • 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_threaded
  • showthread_threaded_construct_link
  • 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