Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
  #1  
Old 05-12-2011, 11:14 PM
SimpleFTA SimpleFTA is offline
 
Join Date: Feb 2008
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 05-16-2011, 10:17 PM
Da-Vinci Da-Vinci is offline
 
Join Date: Mar 2010
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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




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.
Attached Images
File Type: png navbit.png (137.9 KB, 0 views)
Reply With Quote
  #3  
Old 05-16-2011, 10:25 PM
Da-Vinci Da-Vinci is offline
 
Join Date: Mar 2010
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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



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>
Reply With Quote
  #4  
Old 05-18-2011, 04:30 AM
SimpleFTA SimpleFTA is offline
 
Join Date: Feb 2008
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #5  
Old 05-20-2011, 05:10 AM
SimpleFTA SimpleFTA is offline
 
Join Date: Feb 2008
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Attached Images
File Type: jpg thread_info.jpg (13.0 KB, 0 views)
Reply With Quote
  #6  
Old 05-23-2011, 05:57 AM
SimpleFTA SimpleFTA is offline
 
Join Date: Feb 2008
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #7  
Old 05-23-2011, 06:11 PM
Da-Vinci Da-Vinci is offline
 
Join Date: Mar 2010
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Glad you got it sorted, good to know how you done it as well
Reply With Quote
Reply

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 11:51 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.11324 seconds
  • Memory Usage 2,240KB
  • 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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_code
  • (2)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (2)postbit_attachment
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (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_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • 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
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete