vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   How do I link to parent forum? (https://vborg.vbsupport.ru/showthread.php?t=263538)

SimpleFTA 05-12-2011 11:14 PM

How do I link to parent forum?
 
Hi guys,
I'm trying to add a nav link to the parent forum of the thread being viewed. I've already added a "Home" link but I can't figure out the link structure for the parent forum. This is what I currently have...

and I'm looking for it to be...
<<Prev Thread | Home | [Parent_forum_name] | Next Thread >>

any ideas? Thanks in advance.

-James

Da-Vinci 05-16-2011 10:17 PM

1 Attachment(s)
This may help, here is the code used for the Navbit in the Navbar template.

https://vborg.vbsupport.ru/external/2011/05/33.jpg


HTML Code:

<vb:if condition="$show['breadcrumb']">
        <li class="navbit"><a href="{vb:raw nav_url}">{vb:raw nav_title}</a></li>
<vb:else />
        <li class="navbit lastnavbit"><span>{vb:raw nav_title}</span></li>
</vb:if>

Let me know how you get on with this, I might add this to my own forum.

Da-Vinci 05-16-2011 10:25 PM

This may help, here is the code used for the Navbit in the navbar_link template.

https://vborg.vbsupport.ru/attachmen...1&d=1305587782

HTML Code:

<vb:if condition="$show['breadcrumb']">
        <li class="navbit"><a href="{vb:raw nav_url}">{vb:raw nav_title}</a></li>
<vb:else />
        <li class="navbit lastnavbit"><span>{vb:raw nav_title}</span></li>
</vb:if>


SimpleFTA 05-18-2011 04:30 AM

Hi Da-Vinci, I appreciate the response but I haven't been able to achieve this as of yet. I tried the recommendation you provided (I had already tried it but I tried it again anyways) but for some reason it doesn't work. I might be missing something. FYI I'm editing the following code in the SHOWTHREAD template;

Code:

        <vb:if condition="$nextthreadinfo">
        <a href="{vb:link thread, {vb:raw nextthreadinfo}}">{vb:raw nextthreadinfo.title}</a>
        <strong>&raquo;</strong>
        </vb:if>
        <vb:else />
        <strong>&laquo;</strong>
        <a href="{vb:link thread, {vb:raw thread}, "goto=nextoldest"}" rel="nofollow">{vb:rawphrase prev_thread}</a>
        | <a href="{vb:link forumhome}">Home</a> |
        <a href="{vb:link thread, {vb:raw thread}, "goto=nextnewest"}" rel="nofollow">{vb:rawphrase next_thread}</a>
        <strong>&raquo;</strong>
        </vb:if>

--------------- Added [DATE]1305700943[/DATE] at [TIME]1305700943[/TIME] ---------------

I think I found the problem but I don't know how to fix it. This code should work...
Code:

<a href="forumdisplay.php?{vb:raw session.sessionurl}&amp;f={vb:raw foruminfo.forumid}">Parent Forum</a>

but for some reason... {vb:raw foruminfo.forumid} ...isn't replacing the forum id. Any thoughts?

SimpleFTA 05-20-2011 05:10 AM

1 Attachment(s)
I got this to work as seen below. However, I was unable to figure out how to display the title of the parent forum so I'm simply using "Thread List". Would really like to fix this if anyone has ideas.

Code:

        <vb:if condition="$nextthreadinfo">
        <a href="{vb:link thread, {vb:raw nextthreadinfo}}">{vb:raw nextthreadinfo.title}</a>
        <strong>&raquo;</strong>
        </vb:if>
        <vb:else />
        <strong>&laquo;</strong>
        <a href="{vb:link thread, {vb:raw thread}, "goto=nextoldest"}" rel="nofollow">{vb:rawphrase prev_thread}</a>
        | <a href="{vb:link forumhome}">Home</a> | <a href="forumdisplay.php?{vb:raw session.sessionurl}&amp;f={vb:raw thread.forumid}">Thread List</a> |
        <a href="{vb:link thread, {vb:raw thread}, "goto=nextnewest"}" rel="nofollow">{vb:rawphrase next_thread}</a>
        <strong>&raquo;</strong>
        </vb:if>


SimpleFTA 05-23-2011 05:57 AM

Hi all, I was able to accomplish my original idea by simply preregistering the variable 'foruminfo' for the SHOWTHREAD template and using the following code;

Code:

<a href="forumdisplay.php?{vb:raw session.sessionurl}&amp;f={vb:raw thread.forumid}">{vb:raw foruminfo.title}</a>
-James

Da-Vinci 05-23-2011 06:11 PM

Glad you got it sorted, good to know how you done it as well ;)


All times are GMT. The time now is 05:48 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.01009 seconds
  • Memory Usage 1,736KB
  • 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
  • (4)bbcode_code_printable
  • (2)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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