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"> |
All times are GMT. The time now is 06:10 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:
|