View Full Version : Looking for help with template conditionals
SBlueman
10-30-2010, 08:16 PM
I'd like to show the Zoints topic tag threadform when creating a new thread but ONLY to certain usergroups in certain forums AND those usergroups see one out of two options in certain forums (the modification already activates this threadform via the ACP but does not make the difference of a template to show different usergroups in different forums). What template conditionals would I use?
I am using vBulletin 3.6.12 and Zoints Thread Tags 1.2.2.
I think maybe you want something like:
<if condition="in_array($foruminfo[forumid], array(1, 2, 3)) AND is_member_of($bbuserinfo, 4, 5, 6)">
<else />
</if>
(of course you want to replace "1, 2, 3" with your list of forum id and "4, 5, 6" with your list of user groups).
SBlueman
10-30-2010, 10:11 PM
So would this be correct?
<if condition="in_array($foruminfo[forumid], array(109, 217)) AND is_member_of($bbuserinfo, 5,6,7,74,78,90)">
<!-- zoints tags field -->
the original code is here for (usergroups) and in the (forumid)
<!-- / zoints tags field -->
</if>
<else />
<if condition="in_array($foruminfo[forumid], array(207,110,195,183,184,185,186,187,188,189,190, 191,192,193,194)) AND is_member_of($bbuserinfo, 5,6,7,74,78,90)">
<!-- zoints tags field -->
the modified code is here for (usergroups) and in the (forumid) only
<!-- / zoints tags field -->
</if>
Hmm...I'm not quite sure - what happens if neither of those condtions is true, is there a default for every other case? (Or maybe the default is to show nothing?)
Anyway, ignoring that issue - I moved a couple tags around:
<if condition="in_array($foruminfo[forumid], array(109, 217)) AND is_member_of($bbuserinfo, 5,6,7,74,78,90)">
<!-- zoints tags field -->
the original code is here for (usergroups) and in the (forumid)
<!-- / zoints tags field -->
<else />
<if condition="in_array($foruminfo[forumid], array(207,110,195,183,184,185,186,187,188,189,190, 191,192,193,194)) AND is_member_of($bbuserinfo, 5,6,7,74,78,90)">
<!-- zoints tags field -->
the modified code is here for (usergroups) and in the (forumid) only
<!-- / zoints tags field -->
</if>
</if>
SBlueman
10-30-2010, 10:30 PM
No, it needs to be either option A or option B. Is there something missing from the code that would facilitate that?
I guess I don't quite understand. I've reread the first post but I get lost at the part that says "Plus when both these requirements are met ..." because what you say after that sounds like the same thing that you said before.
ETA: How about this: someone hits the "New Thread" button, how many different possibilities are there? (or I can let someone else take a shot at if, if you'd prefer).
SBlueman
10-30-2010, 11:12 PM
I edited my first post, I think I misspoke (or is it mistyped?). Either way, this is what I changed it to:
I'd like to show the Zoints topic tag threadform when creating a new thread but ONLY to certain usergroups in certain forums AND those usergroups see one out of two options in certain forums (the modification already activates this threadform via the ACP but does not make the difference of a template to show different usergroups in different forums). What template conditionals would I use?
I am using vBulletin 3.6.12 and Zoints Thread Tags 1.2.2.
BirdOPrey5
10-30-2010, 11:34 PM
If you want to show ONE thing OR the other then you don't need 2 IF statements, that is what <else /> is for...
<if condition="...">
SHOW THIS
<else />
SHOW THAT
</if>
SBlueman
10-31-2010, 02:36 AM
Looks like this code fixed this issue for me:
<if condition="in_array($foruminfo[forumid], array(109, 217))">
<br>
<!-- zoints tags field -->
<fieldset class="fieldset" style="margin:0px 0px 0px 0px">
<legend>You Must Click Once On The Applicable Topic Tags:</legend>
<div style="padding:$stylevar[formspacer]px">
<table cellpadding="0" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
<tr>
<td><input type="hidden" class="bginput" id="tags" name="zointstags" value="$zointstags" size="40" tabindex="1" /></td>
</tr>
<tr>
<td><!-- BEGIN Topic Tags - TMO -->
<td width="100%" class="row1"><span class="gen">
<style type="text/css">
.selected { background-color: #7777FF; }
.unselected { background-color: transparent; }
#popularTags span { font-size: 11px; font-family: monospace; }
#popularTags {width: 100%;}
</style>
<table id="popularTags">
<tr>
<td colspan=4><span onClick="doTag(this)">afc</span></td>
<td colspan=4><span onClick="doTag(this)">nfc</span></td>
</tr>
<tr>
<td><span onClick="doTag(this)">afceast</span></td>
<td><span onClick="doTag(this)">afcnorth</span></td>
<td><span onClick="doTag(this)">afcsouth</span></td>
<td><span onClick="doTag(this)">afcwest</span></td>
<td><span onClick="doTag(this)">nfceast</span></td>
<td><span onClick="doTag(this)">nfcnorth</span></td>
<td><span onClick="doTag(this)">nfcsouth</span></td>
<td><span onClick="doTag(this)">nfcwest</span></td>
</tr>
<tr>
<td><span onClick="doTag(this)">bills</span></td>
<td><span onClick="doTag(this)">bengals</span></td>
<td><span onClick="doTag(this)">colts</span></td>
<td><span onClick="doTag(this)">broncos</span></td>
<td><span onClick="doTag(this)">cowboys</span></td>
<td><span onClick="doTag(this)">bears</span></td>
<td><span onClick="doTag(this)">buccaneers</span></td>
<td><span onClick="doTag(this)">49ers</span></td>
</tr>
<tr>
<td><span onClick="doTag(this)">dolphins</span></td>
<td><span onClick="doTag(this)">browns</span></td>
<td><span onClick="doTag(this)">jaguars</span></td>
<td><span onClick="doTag(this)">chargers</span></td>
<td><span onClick="doTag(this)">eagles</span></td>
<td><span onClick="doTag(this)">lions</span></td>
<td><span onClick="doTag(this)">falcons</span></td>
<td><span onClick="doTag(this)">cardinals</span></td>
</tr>
<tr>
<td><span onClick="doTag(this)">jets</span></td>
<td><span onClick="doTag(this)">ravens</span></td>
<td><span onClick="doTag(this)">texans</span></td>
<td><span onClick="doTag(this)">chiefs</span></td>
<td><span onClick="doTag(this)">giants</span></td>
<td><span onClick="doTag(this)">packers</span></td>
<td><span onClick="doTag(this)">panthers</span></td>
<td><span onClick="doTag(this)">rams</span></td>
</tr>
<tr>
<td><span onClick="doTag(this)">patriots</span></td>
<td><span onClick="doTag(this)">steelers</span></td>
<td><span onClick="doTag(this)">titans</span></td>
<td><span onClick="doTag(this)">raiders</span></td>
<td><span onClick="doTag(this)">redskins</span></td>
<td><span onClick="doTag(this)">vikings</span></td>
<td><span onClick="doTag(this)">saints</span></td>
<td><span onClick="doTag(this)">seahawks</span></td>
</tr>
<tr>
<td><span onClick="doTag(this)">nfl</span></td>
<td><span onClick="doTag(this)">draft</span></td>
<td><span onClick="doTag(this)">injury</span></td>
<td><span onClick="doTag(this)">legal</span></td>
<td><span onClick="doTag(this)">rumor</span></td>
<td><span onClick="doTag(this)">score</span></td>
<td><span onClick="doTag(this)">topstory</span></td>
<td><span onClick="doTag(this)">transaction</span></td>
</tr>
</table>
<br/>
<b>NOTE:</b> The 'NFL' tag is required on all National Football League stories. <!-- END Topic Tags - TMO --></td>
</tr>
</table></fieldset>
<!-- / zoints tags field -->
</if>
<else />
<if condition="in_array($foruminfo[forumid], array(183)) AND is_member_of($bbuserinfo, 5,6,7,74,78,90)">
<br>
<!-- zoints tags field -->
<fieldset class="fieldset" style="margin:0px 0px 0px 0px">
<legend>You Must Click Once On The Applicable Topic Tags:</legend>
<div>
<table border="0" cellpadding="0" cellspacing="$stylevar[cellspacing]" width="100%">
<tbody>
<tr> </tr>
</tbody>
</table>
</div>
<div style="padding:$stylevar[formspacer]px">
<table cellpadding="0" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
<tr>
<td><input type="hidden" class="bginput" id="tags" name="zointstags" value="$zointstags" size="100%" tabindex="1" /></td>
</tr>
<tr>
<td><!-- BEGIN Topic Tags - TMO -->
<td width="100%" class="row1"><span class="gen">
<style type="text/css">
.selected { background-color: #7777FF; }
.unselected { background-color: transparent; }
#popularTags span { font-size: 11px; font-family: monospace; }
#popularTags {width: 100%;}
</style>
<table id="popularTags">
<tr>
<td colspan=6><span onclick="doTag(this)">ACC</span></td>
</tr>
<tr>
<td><span onclick="doTag(this)">Boston-College</span></td>
<td><span onclick="doTag(this)">Clemson</span></td>
<td><span onclick="doTag(this)">Duke</span></td>
<td><span onclick="doTag(this)">Florida-State</span></td>
<td><span onclick="doTag(this)">Georgia-Tech</span></td>
<td><span onclick="doTag(this)">Maryland</span></td>
</tr>
<tr>
<td><span onclick="doTag(this)">Miami [Florida]</span></td>
<td><span onclick="doTag(this)">North-Carolina</span></td>
<td><span onclick="doTag(this)">NC-State</span></td>
<td><span onclick="doTag(this)">Virginia</span></td>
<td><span onclick="doTag(this)">Virginia-Tech</span></td>
<td><span onclick="doTag(this)">Wake-Forest</span></td>
</tr>
<tr>
<td colspan=6><span onclick="doTag(this)">NCAA</span></td>
</tr>
</table>
<br/>
<b>NOTE:</b> The 'NCAA' tag is required on all College Football stories. <!-- END Topic Tags - TMO --></td>
</tr>
</table></fieldset>
<!-- / zoints tags field -->
</if>
<if condition="in_array($foruminfo[forumid], array(185)) AND is_member_of($bbuserinfo, 5,6,7,74,78,90)">
<br>
<!-- zoints tags field -->
<fieldset class="fieldset" style="margin:0px 0px 0px 0px">
<legend>You Must Click Once On The Applicable Topic Tags:</legend>
<div>
<table border="0" cellpadding="0" cellspacing="$stylevar[cellspacing]" width="100%">
<tbody>
<tr> </tr>
</tbody>
</table>
</div>
<div style="padding:$stylevar[formspacer]px">
<table cellpadding="0" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
<tr>
<td><input type="hidden" class="bginput" id="tags" name="zointstags" value="$zointstags" size="100%" tabindex="1" /></td>
</tr>
<tr>
<td><!-- BEGIN Topic Tags - TMO -->
<td width="100%" class="row1"><span class="gen">
<style type="text/css">
.selected { background-color: #7777FF; }
.unselected { background-color: transparent; }
#popularTags span { font-size: 11px; font-family: monospace; }
#popularTags {width: 100%;}
</style><table id="popularTags">
<tr>
<td colspan=6><span onclick="doTag(this)">Big 12</span></td>
</tr>
<tr>
<td><span onclick="doTag(this)">Baylor</span></td>
<td><span onclick="doTag(this)">Colorado</span></td>
<td><span onclick="doTag(this)">Iowa-State</span></td>
<td><span onclick="doTag(this)">Kansas</span></td>
<td><span onclick="doTag(this)">Kansas-St</span></td>
<td><span onclick="doTag(this)">Missouri</span></td>
</tr>
<tr>
<td><span onclick="doTag(this)">Nebraska</span></td>
<td><span onclick="doTag(this)">Oklahoma</span></td>
<td><span onclick="doTag(this)">Oklahoma-St</span></td>
<td><span onclick="doTag(this)">Texas</span></td>
<td><span onclick="doTag(this)">Texas-A&M</span></td>
<td><span onclick="doTag(this)">Texas-Tech</span></td>
</tr>
<tr>
<td colspan=6><span onclick="doTag(this)">NCAA</span></td>
</tr>
</table> <br/>
<b>NOTE:</b> The 'NCAA' tag is required on all College Football stories. <!-- END Topic Tags - TMO --></td>
</tr>
</table></fieldset>
<!-- / zoints tags field -->
</if>
<if condition="in_array($foruminfo[forumid], array(186)) AND is_member_of($bbuserinfo, 5,6,7,74,78,90)">
<br>
<!-- zoints tags field -->
<fieldset class="fieldset" style="margin:0px 0px 0px 0px">
<legend>You Must Click Once On The Applicable Topic Tags:</legend>
<div>
<table border="0" cellpadding="0" cellspacing="$stylevar[cellspacing]" width="100%">
<tbody>
<tr> </tr>
</tbody>
</table>
</div>
<div style="padding:$stylevar[formspacer]px">
<table cellpadding="0" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
<tr>
<td><input type="hidden" class="bginput" id="tags" name="zointstags" value="$zointstags" size="100%" tabindex="1" /></td>
</tr>
<tr>
<td><!-- BEGIN Topic Tags - TMO -->
<td width="100%" class="row1"><span class="gen">
<style type="text/css">
.selected { background-color: #7777FF; }
.unselected { background-color: transparent; }
#popularTags span { font-size: 11px; font-family: monospace; }
#popularTags {width: 100%;}
</style><table id="popularTags"><tr><td><table id="popularTags2">
<tr>
<td colspan=6><span onClick="doTag(this)">Big East</span></td>
</tr>
<tr>
<td><span onClick="doTag(this)">Cincinnati</span></td>
<td><span onClick="doTag(this)">Connecticut</span></td>
<td><span onClick="doTag(this)">Louisville</span></td>
<td><span onClick="doTag(this)">Pittsburgh</span></td>
<td><span onClick="doTag(this)">Rutgers</span></td>
</tr>
<tr>
<td><span onClick="doTag(this)">South-Florida</span></td>
<td><span onClick="doTag(this)">Syracuse</span></td>
<td><span onClick="doTag(this)">West-Virginia</span></td>
</tr>
<tr>
<td colspan=6><span onClick="doTag(this)">NCAA</span></td>
</tr>
</table> <span onclick="doTag(this)"></span></td>
</tr>
</table>
<br/>
<b>NOTE:</b> The 'NCAA' tag is required on all College Football stories. <!-- END Topic Tags - TMO --></td>
</tr>
</table></fieldset>
<!-- / zoints tags field -->
</if>
<if condition="in_array($foruminfo[forumid], array(184)) AND is_member_of($bbuserinfo, 5,6,7,74,78,90)">
<br>
<!-- zoints tags field -->
<fieldset class="fieldset" style="margin:0px 0px 0px 0px">
<legend>You Must Click Once On The Applicable Topic Tags:</legend>
<div>
<table border="0" cellpadding="0" cellspacing="$stylevar[cellspacing]" width="100%">
<tbody>
<tr> </tr>
</tbody>
</table>
</div>
<div style="padding:$stylevar[formspacer]px">
<table cellpadding="0" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
<tr>
<td><input type="hidden" class="bginput" id="tags" name="zointstags" value="$zointstags" size="100%" tabindex="1" /></td>
</tr>
<tr>
<td><!-- BEGIN Topic Tags - TMO -->
<td width="100%" class="row1"><span class="gen">
<style type="text/css">
.selected { background-color: #7777FF; }
.unselected { background-color: transparent; }
#popularTags span { font-size: 11px; font-family: monospace; }
#popularTags {width: 100%;}
</style><table id="popularTags">
<tr>
<td colspan=6><span onclick="doTag(this)">Big Ten</span></td>
</tr>
<tr>
<td><span onclick="doTag(this)">Illinois</span></td>
<td><span onclick="doTag(this)">Indiana</span></td>
<td><span onclick="doTag(this)">Iowa</span></td>
<td><span onclick="doTag(this)">Michigan</span></td>
<td><span onclick="doTag(this)">Michigan-St</span></td>
<td><span onclick="doTag(this)">Minnesota</span></td>
</tr>
<tr>
<td><span onclick="doTag(this)">Northwestern</span></td>
<td><span onclick="doTag(this)">Ohio-St</span></td>
<td><span onclick="doTag(this)">Penn-State</span></td>
<td><span onclick="doTag(this)">Purdue</span></td>
<td><span onclick="doTag(this)">Wisconsin</span></td>
</tr>
<tr>
<td colspan=6><span onclick="doTag(this)">NCAA</span></td>
</tr>
</table> <br/>
<b>NOTE:</b> The 'NCAA' tag is required on all College Football stories. <!-- END Topic Tags - TMO --></td>
</tr>
</table></fieldset>
<!-- / zoints tags field -->
</if>
<if condition="in_array($foruminfo[forumid], array(187)) AND is_member_of($bbuserinfo, 5,6,7,74,78,90)">
<br>
<!-- zoints tags field -->
<fieldset class="fieldset" style="margin:0px 0px 0px 0px">
<legend>You Must Click Once On The Applicable Topic Tags:</legend>
<div>
<table border="0" cellpadding="0" cellspacing="$stylevar[cellspacing]" width="100%">
<tbody>
<tr> </tr>
</tbody>
</table>
</div>
<div style="padding:$stylevar[formspacer]px">
<table cellpadding="0" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
<tr>
<td><input type="hidden" class="bginput" id="tags" name="zointstags" value="$zointstags" size="100%" tabindex="1" /></td>
</tr>
<tr>
<td><!-- BEGIN Topic Tags - TMO -->
<td width="100%" class="row1"><span class="gen">
<style type="text/css">
.selected { background-color: #7777FF; }
.unselected { background-color: transparent; }
#popularTags span { font-size: 11px; font-family: monospace; }
#popularTags {width: 100%;}
</style><table id="popularTags">
<tr>
<td colspan=1><span onclick="doTag(this)">Conf USA</span></td>
</tr>
<tr>
<td><span onclick="doTag(this)">East-Carolina</span></td>
<td><span onclick="doTag(this)">Houston</span></td>
<td><span onclick="doTag(this)">Marshall</span></td>
<td><span onclick="doTag(this)">Memphis</span></td>
<td><span onclick="doTag(this)">Rice</span></td>
<td><span onclick="doTag(this)">Southern-Methodist</span></td>
<td><span onclick="doTag(this)">Southern-Miss</span></td>
</tr>
<tr>
<td><span onclick="doTag(this)">Tulane</span></td>
<td><span onclick="doTag(this)">Tulsa</span></td>
<td><span onclick="doTag(this)">UAB</span></td>
<td><span onclick="doTag(this)">UCF</span></td>
<td><span onclick="doTag(this)">UTEP</span></td>
</tr>
<tr>
<td><span onclick="doTag(this)">NCAA</span></td>
</tr>
</table> <br/>
<b>NOTE:</b> The 'NCAA' tag is required on all College Football stories. <!-- END Topic Tags - TMO --></td>
</tr>
</table></fieldset>
<!-- / zoints tags field -->
</if>
<if condition="in_array($foruminfo[forumid], array(189)) AND is_member_of($bbuserinfo, 5,6,7,74,78,90)">
<br>
<!-- zoints tags field -->
<fieldset class="fieldset" style="margin:0px 0px 0px 0px">
<legend>You Must Click Once On The Applicable Topic Tags:</legend>
<div>
<table border="0" cellpadding="0" cellspacing="$stylevar[cellspacing]" width="100%">
<tbody>
<tr> </tr>
</tbody>
</table>
</div>
<div style="padding:$stylevar[formspacer]px">
<table cellpadding="0" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
<tr>
<td><input type="hidden" class="bginput" id="tags" name="zointstags" value="$zointstags" size="100%" tabindex="1" /></td>
</tr>
<tr>
<td><!-- BEGIN Topic Tags - TMO -->
<td width="100%" class="row1"><span class="gen">
<style type="text/css">
.selected { background-color: #7777FF; }
.unselected { background-color: transparent; }
#popularTags span { font-size: 11px; font-family: monospace; }
#popularTags {width: 100%;}
</style><table id="popularTags3">
<tr>
<td colspan=1><span onClick="doTag(this)">MAC</span></td>
</tr>
<tr>
<td><span onClick="doTag(this)">Akron</span></td>
<td><span onClick="doTag(this)">Ball-State</span></td>
<td><span onClick="doTag(this)">Bowling-Green</span></td>
<td><span onClick="doTag(this)">Buffalo</span></td>
<td><span onClick="doTag(this)">Central-Michigan</span></td>
<td><span onClick="doTag(this)">Eastern-Michigan</span></td>
<td><span onClick="doTag(this)">Kent-State</span></td>
</tr>
<tr>
<td><span onClick="doTag(this)">Miami-[Oh]</span></td>
<td><span onClick="doTag(this)">Northern-Illinois</span></td>
<td><span onClick="doTag(this)">Ohio</span></td><td><span onClick="doTag(this)">Temple</span></td>
<td><span onClick="doTag(this)">Toledo</span></td>
<td><span onClick="doTag(this)">Western-Michigan</span></td>
</tr>
<tr>
<td><span onClick="doTag(this)">NCAA</span></td>
</tr>
</table>
<br/>
<b>NOTE:</b> The 'NCAA' tag is required on all College Football stories. <!-- END Topic Tags - TMO --></td>
</tr>
</table>
</fieldset>
<!-- / zoints tags field -->
</if>
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.