Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 22 Jul 2015, 18:20
Kwikms Kwikms is offline
 
Join Date: Jul 2004
Conditional only if in childforum

Lets say I have 6 forums:

Main-1
- Sub -2
Another-Main-3
- Other-Sub-4
- Another-Sub-5
-- Sub-of-Another-Sub-6


I am looking for a way to check, if a forum is a childforum of a certain forum.

Like this, but I only want to put in the main forum.

<vb:if condition="in_array($forum['forumid'], array(3))"></vb:if>
<vb:if condition="$forum[forumid] == 3"></vb:if>

In this excample if I say ID 3 (which is "Another-Main-3") I want the conditional also be true if the user is in forum 4,5 and 6.

Any ideas how I can achive this?
Reply With Quote
  #2  
Old 22 Jul 2015, 18:25
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
Try using $foruminfo['parentlist'] to check to see if the forum is a child of forumid = 3.
Reply With Quote
  #3  
Old 22 Jul 2015, 18:34
Kwikms Kwikms is offline
 
Join Date: Jul 2004
You mean like this?

<vb:if condition="$foruminfo['parentlist'] == 3"></vb:if>
Reply With Quote
  #4  
Old 22 Jul 2015, 19:24
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
No, the variable $foruminfo['parentlist'] is an array, so you need:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #5  
Old 22 Jul 2015, 19:40
Kwikms Kwikms is offline
 
Join Date: Jul 2004
Thanks, but doesnt work for me

I can access {vb:raw $foruminfo['parentlist']} but I cant use it in a conditional.

--------------- Added 22 Jul 2015 at 19:45 ---------------

I want to modify the title in some subforums. I guess I have to write a plugin anyway...
Reply With Quote
  #6  
Old 22 Jul 2015, 21:16
squidsk's Avatar
squidsk squidsk is offline
 
Join Date: Nov 2010
Because you don't use {vb:raw . . . } inside a conditional, use the code Mark provided in his post.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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


New To Site? Need Help?

All times are GMT. The time now is 09:32.

Layout Options | Width: Wide Color: