Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-16-2010, 07:01 AM
vexxy's Avatar
vexxy vexxy is offline
 
Join Date: Aug 2007
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How can I condition which thread belongs to which forum?

When I user visits a thread, I want to highlight the parent forum of the respective thread...what's the condition?

tnx in advance

edit: I found how can i condition if is a forum what forum belongs in the x parent forum with:

Code:
<vb:if condition="$foruminfo[forumid] == 'x' OR $foruminfo[parentid] == 'x'">
the problem is, if I visit a thread from that parent id, it acts wierd...it verifies the condition and the else branch...i'm puzzled

the forum structure is like this:

Forum A (parent)
- Forum B
-- Forum C

If I visit forum A, it's all good, if I visit forum B it's all good...forum C does not verify the condition (probably because can't verify the master parent condition). Any threads i visit from any of those forums, both verify and deny this condition...i don't get it.
Reply With Quote
  #2  
Old 03-17-2010, 02:13 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know of a variable that looks at all the parents of a forum. Whoops, scratch that! It looks like there is a string called parentlist which would have what you want. It' a string, so you'd have to convert it to an array in a plugin and then you can just use in_array to see if it is in there. I'd do a search in the files for "parentlist" and see if maybe it already gets turned into an array for you to use.
Reply With Quote
  #3  
Old 03-17-2010, 07:50 AM
vexxy's Avatar
vexxy vexxy is offline
 
Join Date: Aug 2007
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i have resolved this issue more elegantly..i think...you can include $foruminfo[forumid] in an array and check all the id's there...the problem is, you must enter all parents manually, but hey! :P

Code:
<vb:if condition="in_array($foruminfo[forumid], array(1,14,24,25,26,27))">
edit: while this thing works for any forumid from that array, if I visit any thread from these forums, it validates both if's, I don't understand why. ex...if I visit the thread "This is a thread" from any of the forums, both home and the forum button stay "selected"

Code:
<vb:if condition="in_array($foruminfo[forumid], array(1,14,24,25,26,27,19,20,21,22,23,13,15,61,17,62,63))">
<li class="selected"><a class="navtab" href="http://www.forum.com/f1/">Software</a></li>
<vb:else />
<li><a class="navtab" href="http://www.forum.com/f1/">Software</a></li>
</vb:if>
Reply With Quote
  #4  
Old 03-23-2010, 08:22 AM
vexxy's Avatar
vexxy vexxy is offline
 
Join Date: Aug 2007
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

now the only challenge I have is to test if a thread belongs to the x parent forum or its parent parent. Can I do this in some array..or is there a condition? I've noticed that the showthread doesn't have any variable linked to its parent forum
Reply With Quote
  #5  
Old 03-27-2010, 10:25 AM
vexxy's Avatar
vexxy vexxy is offline
 
Join Date: Aug 2007
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

resolved the issue....i just conditioned it that on certain pages, will not be displayed ex ( AND THIS SCRIPT !='showthread')
Reply With Quote
Reply


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 01:55 PM.


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.03810 seconds
  • Memory Usage 2,197KB
  • Queries Executed 11 (?)
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
  • (3)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete