Quote:
How would I be able to make a mix of this? ie: Show in all forums except for 40, 41, and 42? Cheers |
Quote:
coz the old conditional not work also the new one |
I am curious if there is a conditional that I can use in the threadbit or forumhome template that will let me display X if a certain forum is being displayed...
$forum[forumid] doesn't work in the threadbit template, it has no value at all... is there an alternative way? Basically I want to only display something if forumdisplay.php?f=2 is the page I'm on. |
subscribe.
K |
Show Moderator of one forum: Remember to change x
Code:
<vb:if condition="can_moderate($forum['x'])">Show this if moderator is moderator of the forum with the id of x</vb:if> |
Hi guys..I have a donators group,
how can I show something only in the postbit of donators group list ? Thanks :) |
Quote:
Code:
<vb:if condition="is_member_of($bbuserinfo, 9)"> |
Quote:
..i want to show the text in the postbit of the every member of group 9, visible to other groups.. Thanks |
That would show whatever you put above the </vb:if> only to users in usergroup id 9... If you want to display it to everyone you wouldn't use the IF statement at all. I don't think I fully understand the question.
|
if the member belongs to a group,,a text should appear in the post bit of that member..
which will be visible to every one.. Thanks :) |
I have a piece of code added to the end of footer template but I want this piece of code to be visible only when i'm reading a thread (any thread).
May I ask if there's any conditional for this? |
Quote:
Code:
<vb:if condition="THIS_SCRIPT == 'showthread'"> |
Thanks, works great!
|
I would really benefit from a similar list of conditionals from php code, rather than conditionals. I can do nearly anything I want in a template thanks to this list, but trying to determine if a user is a member of a usergroup via php code is still foreign to me. Does anybody know of a list of these, or is anybody willing to translate this list to a php counterpart list? :)
|
Quote:
Cheers |
Can anyone assist me how to show a few texts on a certain time?
Let me explain, I want my users see some texts displaying on site in the morning, however in the evening they will see another text on site. Is there a conditional for that? |
Quote:
HTML Code:
<vb:if condition="!in_array($forum['forumid'], array(40, 41, 42))">Show if not in forumids 40, 41, or 42 Quote:
|
Quote:
But I can't do that by myself. I hope someone handle it :erm: I would like to use it for adsense. |
Beautiful :)
|
Please Help.
I am unable to duplicate results in other Templates I have been able to set linked images to show in the postbit_legacy template for custom profile fields with no problem using Code:
<vb:if condition="$post['fieldx']"> Code:
<vb:if condition="$bbuserinfo['fieldx']"> So what I am asking is, is there an alternative conditional for? Code:
<vb:if condition="$post['fieldx']"> Thank you in advance for any help.... |
does AND still work if I want to combine statements, for example if I want to combine if a person is a guest and the forum is 1, show this else show something else...how would I do that?
|
Just use 'AND'
<vb:if condition="$forum[forumid] == 5 AND $show['member']">Show this if forum id is 5 and user is a member.</vb:if> |
yeah, thats what I tried, but I cannot seem to get the forumid thing to work, I am using one of the ad templates
|
You could try putting the condition in the header / footer or navbar template instead of the ad location... it will have the same ultimate effect.
|
So in the template FORUMDISPLAY I've done this:
Code:
<vb:if condition="!in_array($forum['forumid'], array(4, 5))"><vb:if condition="$show['newthreadlink']"><a href="newthread.php?{vb:raw session.sessionurl}do=newthread&f={vb:raw foruminfo.forumid}" rel="nofollow" class="newcontent_textcontrol" id="newthreadlink_top"><span>+</span> {vb:rawphrase post_new_thread}</a></vb:if></vb:if> Cheers. |
thanks
|
Quote:
Code:
<vb:if condition="!in_array($forum['forumid'], array(4, 5)) AND $show['newthreadlink']"><a href="newthread.php?{vb:raw session.sessionurl}do=newthread&f={vb:raw foruminfo.forumid}" rel="nofollow" class="newcontent_textcontrol" id="newthreadlink_top"><span>+</span> {vb:rawphrase post_new_thread}</a></vb:if> |
Hello,
The "$show['newthreadlink']" was in forumdisplay to begin with, I just added the array bit. I tried what you gave, yet it still didn't hide the New thread button from display :/ |
What exactly are you trying to do- I know hide "New Thread" but under what conditions?
|
Essentially, we've got Easy Forms installed and we want users to only be able to submit a form on particular forums so they can follow a pre-defined template instead of being able to post whatever they want.
I've got a "Notice" on the forums saying with a bit of text, including a link to the needed form, but I know of no other way to hide the "New Thread" button. I originally tried simply taking away permissions for Registered Users to Create New Threads, but then that wouldn't let them upload attachments to the form - which is a necessity. If you know of any other way to do this, that would be greatly appreciated. |
Hmmm... you could force users to use a specific style for that forum, and in that style you could remove the code for the new thread button completely... but that seems overkill... the IF condition should work... I'm surprised it's not.
|
I was surprised it didn't work either, unless there's something I might have missed?
|
Quote:
Hook Location: newthread_start Two examples in the code below - (change the forum ID numbers and the form addresses) PHP Code:
|
I want a user to be able to disable and enable a plugin that starts:
if ($vbulletin->options['mob_detect_enabled'] == 1) So, I've created a profile field (for a setting) and I want to use this conditional inside the plugin so that ordinary members can disable it (it uses the style_fetch hook). I think I need to add something like this at the top of the plugin, but in php ... HTML Code:
<vb:if condition="$bbuserinfo['fieldXXX'] === 'off'"> |
Try
Code:
if ($vbulletin->options['mob_detect_enabled'] == 1 AND $bbuserinfo['fieldX'] == "off") |
No that didn't do it ... but that may be down to my lack of php understanding.
|
Yeah the problem is the $bbuserinfo - there are various ways to access the same data, different ways work in different places... it may be something like $vboptions->bbuserinfo['fieldX'] or even $this->registry->bbuserinfo['fieldX'] but honestly I'm not sure of the exact syntax off hand, if you search around for it you should be able to find one that works, that's what I usually do.
|
try
Code:
$userinfo['fieldxx'] |
Quote:
Quote:
Quote:
|
Quote:
Thanks to the people who helped, greatly appreciated. :) |
All times are GMT. The time now is 02:32 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:
|