vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Moving thread_controls to navbar (https://vborg.vbsupport.ru/showthread.php?t=263303)

wonderfulwat 05-07-2011 07:59 PM

Moving thread_controls to navbar
 
1 Attachment(s)
The end goal is to move the thread_controls toolbar into the navbar beside the "Quick Links". I think we might even be able to use a hook location for this. Take a look at the 2nd image for an idea of what I'm talking about.

The first thing I did, was add the "thread_controls" code to the navbar template (1st image) to see if it works properly. It doesn't. All the links don't relate to the thread you're in.

ie. Show Printable Thread is coming up: http://www.wonderfulwaterloo.com/printthread.php?t=
when it should be: http://www.wonderfulwaterloo.com/pri...&pp=20&page=95

Live example: http://www.wonderfulwaterloo.com/sho...=95&styleid=57

Here's the code I inserted into the navbar template, directly after "</div><!-- closing div for above_body -->"

HTML Code:

<div id="thread_controls" class="thread_controls toolsmenu">
                <div>
                <ul id="postlist_popups" class="postlist_popups popupgroup">
                        <vb:if condition="$show['firstunreadlink']">
                        <li class="popupmenu"><h6><a class="firstunread" href="{vb:raw firstunread}">{vb:rawphrase view_first_unread} </a></h6></li>
                        </vb:if>
                        {vb:raw template_hook.threadtoolbar}
                        <li class="popupmenu" id="threadtools">
                                <h6><a class="popupctrl" href="javascript://">{vb:rawphrase thread_tools}</a></h6>
                                <ul class="popupbody popuphover">
                                        <li><a href="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}printthread.php?{vb:raw session.sessionurl}t={vb:raw threadid}<vb:if condition="$perpage">&amp;pp={vb:raw perpage}</vb:if><vb:if condition="$pagenumber">&amp;page={vb:raw pagenumber}</vb:if>" accesskey="3"
                                                rel="nofollow">
{vb:rawphrase show_printable_version}</a></li>
                                        <li><a href="sendmessage.php?{vb:raw session.sessionurl}do=sendtofriend&amp;t={vb:raw threadid}"
                                                rel="nofollow">
{vb:rawphrase email_this_page}&hellip;</a></li>
                                        <li>
                                                <vb:if condition="$show['subscribed']">
                                                        <a href="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}subscription.php?{vb:raw session.sessionurl}do=removesubscription&amp;t={vb:raw threadid}"
                                                                rel="nofollow">
{vb:rawphrase unsubscribe_from_this_thread}</a>
                                                <vb:else />
                                                        <a href="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}subscription.php?{vb:raw session.sessionurl}do=addsubscription&amp;t={vb:raw threadid}"
                                                                rel="nofollow">
{vb:rawphrase subscribe_to_this_thread}&hellip;</a>
                                                </vb:if>                                       
                                        </li>
                                        <vb:if condition="$show['addpoll']">
                                                <li><a href="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}poll.php?{vb:raw session.sessionurl}do=newpoll&amp;t={vb:raw threadid}">{vb:rawphrase add_a_poll_to_this_thread}&hellip;</a></li>
                                        </vb:if>
                                        <li><ul class="blockrow" style="width:100%;">{vb:raw bookmarksites}</ul></li>
                                </ul>
                        </li>

                        <vb:if condition="$show['adminoptions']">
                                <li class="popupmenu" id="moderationtools">
                                        <h6><a class="popupctrl" href="javascript://">{vb:rawphrase administrative}</a></h6>
                                        <form action="{vb:raw $vboptions.vbforum_url}{vb:if "$vboptions['vbforum_url']", '/', ''}postings.php" method="post">
                                                <ul class="popupbody popuphover">
                                                        <vb:if condition="$show['openclose']">
                                                                <li><label>
                                                                        <input type="radio" name="do" value="openclosethread" checked="checked" tabindex="1" />
                                                                        <vb:if condition="$show['closethread']">{vb:rawphrase close_thread}<vb:else />{vb:rawphrase open_thread}</vb:if>
                                                                </label></li>
                                                        </vb:if>

                                                        <vb:if condition="$show['moderatethread']">
                                                                <li><label>
                                                                        <input type="radio" name="do" value="moderatethread" tabindex="2" />
                                                                        <vb:if condition="$show['approvethread']">{vb:rawphrase approve_thread}<vb:else />{vb:rawphrase unapprove_thread}</vb:if>
                                                                </label></li>
                                                        </vb:if>

                                                        <vb:if condition="$show['movethread']">
                                                                <li><label><input type="radio" name="do" value="movethread" tabindex="3" /> {vb:rawphrase move_thread}&hellip;</label></li>
                                                                <li><label><input type="radio" name="do" value="copythread" tabindex="4" /> {vb:rawphrase copy_thread}&hellip;</label></li>                                       
                                                        </vb:if>

                                                        <vb:if condition="$show['editthread']">
                                                                <li><label><input type="radio" name="do" value="editthread" tabindex="5" /> {vb:rawphrase edit_thread}&hellip;</label></li>
                                                        </vb:if>
                       
                                                        <vb:if condition="$show['deletethread']">
                                                        <li><label><input type="radio" name="do" value="deletethread" tabindex="6" /> {vb:rawphrase delete_thread}&hellip;</label></li>
                                                        </vb:if>

                                                        <vb:if condition="$show['managethread']">
                                                                <li><label>
                                                                        <input type="radio" name="do" value="stick" tabindex="7" />
                                                                        <vb:if condition="$show['unstick']">{vb:rawphrase unstick_thread}<vb:else />{vb:rawphrase stick_thread}</vb:if>
                                                                </label></li>
                                                                <li><label><input type="radio" name="do" value="mergethread" tabindex="8" /> {vb:rawphrase merge_threads}&hellip;</label></li>
                                                                <li><label><input type="radio" name="do" value="removeredirect" tabindex="9" /> {vb:rawphrase remove_redirects}</label></li>
                                                        </vb:if>

                                                        <li class="formsubmit">
                                                                <input type="submit" class="button" value="{vb:rawphrase proceed_ellipsis}" tabindex="10" />
                                                                <input class="button" type="reset" value="{vb:rawphrase reset}" tabindex="11" />
                                                        </li>
                                                </ul>
                                                <input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
                                                <input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
                                                <input type="hidden" name="t" value="{vb:raw threadid}" />
                                                <input type="hidden" name="pollid" value="{vb:raw pollid}" />
                                        </form>
                                </li>
                        </vb:if>

                        <vb:if condition="$show['search']">
                                <li class="popupmenu searchthread menusearch" id="searchthread">
                                        <h6><a class="popupctrl" href="javascript://">{vb:rawphrase search_thread}</a></h6>
                                        <form action="search.php" method="post">
                                                <ul class="popupbody popuphover">
                                                        <li>
                                                                <input type="text" name="query" class="searchbox" value="{vb:rawphrase search_dots}" tabindex="13" />
                                                                <input type="submit" class="button" value="{vb:rawphrase search}" tabindex="14" />
                                                        </li>
                                                        <li class="formsubmit">
                                                                <div class="submitoptions">&nbsp;</div>
                                                                <div class="advancedsearchlink"><a href="search.php?{vb:raw session.sessionurl}search_type=1&amp;searchthreadid={vb:raw thread.threadid}&amp;contenttype=vBForum_Post">{vb:rawphrase advanced_search}</a></div>
                                                        </li>
                                                </ul>
                                                <input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
                                                <input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
                                                <input type="hidden" name="do" value="process" />
                                                <input type="hidden" name="searchthreadid" value="{vb:raw thread.threadid}" />
                                                <input type="hidden" name="search_type" value="1" />
                                                <input type="hidden" name="contenttype" value="vBForum_Post" />

                                        </form>
                                </li>
                        </vb:if>

                        <vb:if condition="$show['inlinemod']">
                                <li class="popupmenu" id="post_imodsel">
                                        <h6><a class="popupctrl" href="javascript://">{vb:rawphrase inline_mod}</a></h6>
                                        <ul class="popupbody popuphover">
                                                <li><a href="javascript://" id="post_imodsel:all">{vb:rawphrase select_all}</a></li>
                                                <li><a href="javascript://" id="post_imodsel:none">{vb:rawphrase deselect_all}</a></li>
                                                <li><a href="javascript://" id="post_imodsel:invert">{vb:rawphrase invert_selection}</a></li>
                                                <li>&nbsp;</li>
                                                <li><a href="javascript://" id="post_imodsel:flag:1">{vb:rawphrase select_unapproved_posts}</a></li>
                                                <li><a href="javascript://" id="post_imodsel:flag:2">{vb:rawphrase select_deleted_posts}</a></li>
                                                <li><a href="javascript://" id="post_imodsel:flag:4">{vb:rawphrase select_posts_with_attachments}</a></li>
                                                <li><a href="javascript://" id="post_imodsel:flag:8">{vb:rawphrase select_posts_from_guests}</a></li>
                                        </ul>
                                </li>
                        </vb:if>
                </ul>
                </div>
</div>


wonderfulwat 05-29-2011 09:29 AM

Anyone? Here's a live example of "Merged Tools"

Normal: http://www.wonderfulwaterloo.com/sho...=258&styleid=2

Merged: http://www.wonderfulwaterloo.com/sho...258&styleid=63

This might not make complete sense right now, but I'm going for a "Clean Look" , so I'll also be moving the 'Reply to Thread' button and 'Page Navigation' to the right.

As you can see, I've managed to move the tools to the right location (from the showthread template to the navbar template), the issue is they don't work. Try to "Show Printable Version" and you'll see the url is incorrect. What would be the plugin code to get this working properly?

Here's a test account: WonderfulWaterloo | password: test


All times are GMT. The time now is 02:09 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.02279 seconds
  • Memory Usage 1,804KB
  • 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
  • (1)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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