Quote:
|
Quote:
|
Quote:
|
1 Attachment(s)
I am trying to insert a an unique image heard for each of main page, HOME, Forum, What's New etc. How would you do that with condition?
Fore example: If you are on the Home page include home heard image, If you are on the Forum page include Forum image, and so on. Please see attachments. |
Quote:
Code:
<vb:if condition="THIS_SCRIPT == 'calendar'">Show this only on calendar.php</vb:if> So basically... Code:
--------------- Added [DATE]1285699615[/DATE] at [TIME]1285699615[/TIME] --------------- NEW POST HERE-- Stupid Auto Merge:rolleyes: FYI This is a useful conditional if you want to hide the Facebook Like button in forums that aren't open to the public. If someone "Likes" a thread in a private forum people will be greeted with a no-permission "have to register" message which usually people will just get annoyed at rather than register. In fact if it's a private forum they may not even have access even after registering. To use this conditional edit the SHOWTHREAD template... find the code: Code:
<vb:if condition="$show['fb_likebutton']"> Code:
<vb:if condition="$show['fb_likebutton'] AND !in_array($threadinfo['forumid'], array(3,4,5))"> |
any "if condition" to show text/html only once on a certain place?
I am using CMS on my live site, and it has 1x2 content column on front page. I tried to place text/html/adsense code after first column however it always displays the text on all columns. Any recommendations for that? |
<vb:if condition="is_member_of($bbuserinfo, 1,2,3)">Show this to user group 1, 2, and 3</vb:if>
what if I move someone to a group and then i wanted to show an image in the postbit for everyone to see IF that member is in a certain group. |
In postbit you can use this to see if a member is in usergroup x.
Code:
<vb:if condition="$post['usergroupid'] == x"> |
<font color="DarkGreen">Great work i love it
</font> |
I have tried this code below in my footer ad location and it display in all my usergroups. Is there something wrong with the code?
Code:
<vb:if condition="is_member_of($bbuserinfo, 1,2,3)">Show this to user group 1, 2, and 3</vb:if> |
Quote:
|
Quote:
|
Damn, my bad. this web site that I am trying to get it to work on is VB3. Sorry guys. Thanks for the help anyways. It will have to wait until i upgrade to VB4.
Thnaks |
Quote:
Code:
<if condition="is_member_of($bbuserinfo, 1,2,3)">Show this to user group 1, 2, and 3</if> |
BirdOPrey5
Thank you very much. that will hold me over until I update to VB4. |
How can I insert a banner after X posts in vb4 ?
Thanks . |
Assuming you mean in the postbit you'd use:
Code:
<vb:if condition="($post['postcount'] % 3) == 0"> % is the modulus operator, it basically is the remainder in division- what you are saying in English is "when the post count is evenly divisible by 3, show the code." |
Well I'm really scratching my head I'm trying to get a conditional to work only if in a certain forum if but also by postcount.
Code:
<vb:if condition="!in_array($postinfo['forumid'], array(2,4))"> Any clues - I'm working on the postbit template. |
You're using the exclamation point "!" before "in_array" - the exclamation point means "NOT" so your first conditional reads "If NOT in forums 2 or 4, do something"
Just delete the !'s and you should be ok... also I'm not sure if $postinfo['forumid'] or just $post['forumid'] but one or the other should work. |
Found out which conditional works...in postbit
Code:
<vb:if condition="in_array($GLOBALS[forumid], array(2,4))"> |
Code:
<vb:if condition="$bbuserinfo[field7] == 'No'"> This doesn't seem to be working (it's in my postbit) Any ideas? :) |
In your postbit, you would use $post, not $bbuserinfo. $bbuserinfo is for showing you your own information anyway.
|
I'm attempting to create a tab with sublinks, with appropriate security.
I have the tab (Special access), with the drop down box (sublink 1, 2, 3) using this code: I had to create a plugin with this code: Code:
global $template_hook; Code:
<li class="popupmenu"> My question is how can I use a conditional where only those in the admin group can access it? |
Quote:
|
Subbed
|
Quote:
i have in my plugin the following code: Code:
$rkc_getobject = $vbulletin->input->clean_gpc('r', 'rkc_object', TYPE_UINT); Code:
<vb:if condition"($rkc_variable1['class_1']) == ClassType1"> Code:
{vb:raw rkc_variable1.class_1} |
When displaying the output of a variable you use:
Code:
{vb:raw rkc_variable1.class_1} Code:
$rkc_variable1['class_1'] |
I have tried many combinations using that, including what seems to be the most likely (for comparing a string to a string)
Code:
<vb:if condition"($rkc_variable1['class_1']='ClassType1')">Success <vb:else />Failure </vb:if> My goal is to use a <select> menu for set options when editing an object currently saved to the database. Example: Code:
Choose Class Type: if it helps, i have the following code in the plugin to register it: Code:
$templater = vB_Template::Create('rkc_customtemplate'); |
You definitely need equal signs in the conditionals...
Code:
<select name="set_class1" id="set_class1" value="{vb:raw rkc_variable.class_1}"> |
i apologize for the inaccurate entry in my code. the code in my template did have the "=". However, the same problem exists. if i put the conditional only on the ClassType2 option, then no matter what ClassType is actually in the database, ClassType2 will always be the selected option.
Example: say the options range from 1-5. If i put the conditional on 2, and then choose 4, 4 will be stored in the database, but when bringing up that object to edit, option 2 will be the default choice in the select menu. Clicking to edit the object should show all default data currently stored, so that if you choose to edit and then 'save' without making any changes, no changes will be made. in this scenario, option 4 is in the database, but if you choose edit and then save w/o physically making any changes, option 2 will replace option 4. Code:
<select type="text" name="set_class1" id="set_class1" value="{vb:raw rkc_variable1.class1}" class="primary"> |
Hello there :) Thank you Digital Jedi!
I'm currently running a board under vB3.8 and will be upgrading shortly to the vB4.1.x series. Right now, we use a fluid banner. We would like to approach our upgrade with a new design but still retain certain features that our members love, one of which - the fluid banner. I've created a radio button in the user profile fields, so members can switch between which header style they'd like. This is the code I've edited/changed in the header template. Code:
<vb:if condition="$post[field8] == 'Yes'"> Any help appreciated! :) Greg |
$post won't work in the header, $post is only defined inside a post... Also it the value of the poster not the value of the person viewing.
What you want is $bbuserinfo[field8], that holds the value of field8 for the user currently logged in. As for the logic it would show Code:
<div id="headerFill"><div id="headerL"></div><div id="headerR"> Code:
<div><a name="top" href="{vb:raw vboptions.forumhome}.php{vb:raw session.sessionurl_q}" class="logo-image"><img src="{vb:stylevar titleimage}" alt="{vb:rawphrase x_powered_by_vbulletin, {vb:raw vboptions.bbtitle}}" /></a></div> This is good logic if you want users to have to "opt in" to this. If you wan't them to "opt-out" though (that is, display the first line unless they specifically said "No" then you'd be better off using the condition: Code:
<vb:if condition="$bbuserinfo[field8] != 'No'"> |
I would like to thank Valter for his contribution to solving my problem, even though he does not realize he helped! (I will PM him a thank you, as i found my working solution while browsing through a plugin written by him), and to you BirdOfPrey for your help as well.
My Solution: First, i added another table with the data for the <select>. This will actually serve 2 purposes, 1st being solving my issue, and the 2nd allows me to create another admin page that will allow me to update the data in that table. Inside the plugin code i added Code:
... Code:
<td> |
Thank you so much, BirdOPrey5 - That worked perfect :)
|
Nice post, very useful thank you very much
I just updated again to vb 4 and things got a little complicated, thanks for this great post |
How would you clean this up into an array?
Code:
<vb:if condition="$vbulletin->nodeid != 1 AND THIS_SCRIPT != 'blog' AND THIS_SCRIPT != 'entry' AND THIS_SCRIPT != 'misc' AND THIS_SCRIPT != 'group' AND THIS_SCRIPT != 'calendar' AND THIS_SCRIPT != 'member' AND THIS_SCRIPT != 'usercp' AND THIS_SCRIPT != 'profile' AND THIS_SCRIPT != 'sendmessage' AND THIS_SCRIPT != 'register' "> |
try...
Code:
<vb:if condition="$vbulletin->nodeid != 1 AND !in_array(THIS_SCRIPT, array('blog' , 'entry', 'misc', 'group'))"> |
Thanks! :)
|
i have been trying to use $threadinfo[forumid] and $forum[forumid] in threadbit in a condition but it doesnt work .. is there any other vars i can use ?
|
In threadbit it looks like the variable is just:
Code:
$thread['forumid'] |
All times are GMT. The time now is 07:24 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|