Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-30-2013, 10:31 PM
Lpspider Lpspider is offline
 
Join Date: Oct 2005
Posts: 164
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default conditional in forum description

Hi,

I'd like to have a vbulletin conditional to show an additional description section for a forum advertiser/sponsor in the forum description for a specific forum. The conditional statement doesn't seem to be working though.

Code:
Regular Forum description. <vb:if condition="!is_member_of($bbuserinfo, 11,6)"><i>Sponsored Text</i>.</vb:if>
Am I doing something wrong, or is this not possible? How might I better approach this?
Reply With Quote
  #2  
Old 02-01-2013, 01:00 AM
Lpspider Lpspider is offline
 
Join Date: Oct 2005
Posts: 164
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

K so according to vbulletin.com it can only be done with a custom mod... anyone want to take a crack?
Reply With Quote
  #3  
Old 02-01-2013, 02:23 AM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't really see why you couldn't use an if conditional, provided your advertisers have their own usergroup. But in addition to the userinfo if conditional, you'd need a forumid if conditional, so they only show in those forums, to those usergroups.
Reply With Quote
  #4  
Old 02-01-2013, 03:27 AM
Lpspider Lpspider is offline
 
Join Date: Oct 2005
Posts: 164
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

I'm not sure I understand what you mean when you say the advertisers having their own usergroup... could you rephrase it?

So instead of putting this conditional in the actual forum description box, put a conditional that shows the description in the appropriate forum template instead, and include the conditional for the usergroup and the forum id, right?
Reply With Quote
  #5  
Old 02-01-2013, 04:47 AM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The code you posted above has Usergroups specified. So I presumed you were trying to show/hide something to/from a specific Usergroups. For instance...

Code:
<vb:if condition="is_member_of($bbuserinfo, 1,2,3)">CODE HERE</vb:if>
...will only show the wrapped code to Usergroups 1, 2 and 3. But you also wanted it to only show in certain forums, so you would also use...

Code:
<vb:if condition="in_array($forum['forumid'], array(1,2,3))">CODE HERE</vb:if>
...to only show code in forums 1, 2 and 3.

More efficiently, you would combine them if you want both cases to be true.

Code:
<vb:if condition="is_member_of($bbuserinfo, 1,2,3) AND in_array($forum['forumid'], array(1,2,3))">CODE HERE</vb:if>
CODE HERE will only show to Usergroups 1, 2 and 3, and only in forums 1, 2 and 3.

And yes, they would go wherever the description for forums is displayed in the templates. (I forget which one that is, at the moment.) They are "template conditionals", so that's the only place they work.
Reply With Quote
  #6  
Old 02-25-2013, 09:12 PM
87accordlxi 87accordlxi is offline
 
Join Date: Aug 2002
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am also trying to do the same thing. I want a small line of text to be shown in a forum (actually, a category) description, but only to certain usergroups. The forum will be sponsored by an advertiser, but I only want Unregistered and partially registered usergroups to see the sponsor text.

This is the code I am using:

Code:
<vb:if condition="is_member_of($bbuserinfo, 3,1,35,21,4)">
<b>Sponsored by ADVERTISER X - </b><a href="http://www.ADVERTISER X link.com" target="_blank">ADDITIONAL SPONSOR TEXT</a><img src="http://www.IMAGE.GIF" width="1" height="1" border="0"/>
</vb:if>
The <vb:if> conditional is not working. All usergroups are seeing the text.
Reply With Quote
  #7  
Old 02-26-2013, 05:13 AM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by 87accordlxi View Post
I am also trying to do the same thing. I want a small line of text to be shown in a forum (actually, a category) description, but only to certain usergroups. The forum will be sponsored by an advertiser, but I only want Unregistered and partially registered usergroups to see the sponsor text.

This is the code I am using:

Code:
<vb:if condition="is_member_of($bbuserinfo, 3,1,35,21,4)">
<b>Sponsored by ADVERTISER X - </b><a href="http://www.ADVERTISER X link.com" target="_blank">ADDITIONAL SPONSOR TEXT</a><img src="http://www.IMAGE.GIF" width="1" height="1" border="0"/>
</vb:if>
The <vb:if> conditional is not working. All usergroups are seeing the text.
What do you mean, exactly, by "partially registered" usergroups? Because strictly speaking, you're either registered, unconfirmed or a guest. If you're a member of any one of the Usergroups defined in your if condition, you'll see it. Even if it isn't your primary Usergroup.
Reply With Quote
  #8  
Old 02-26-2013, 09:53 PM
87accordlxi 87accordlxi is offline
 
Join Date: Aug 2002
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Digital Jedi View Post
What do you mean, exactly, by "partially registered" usergroups? Because strictly speaking, you're either registered, unconfirmed or a guest. If you're a member of any one of the Usergroups defined in your if condition, you'll see it. Even if it isn't your primary Usergroup.
By "partially registered" I meant the unconfirmed and restricted usergroups. They can see pretty much everything, but cannot post. I am lumping them in with the unregistered users here as those who will see the advertisements in the category descriptions.

But when I use that code that I posted, those usergroups in the if condition see the text - but so does everyone else. The if condition is not being recognized, so vbulletin is displaying the text for everyone.
Reply With Quote
  #9  
Old 02-26-2013, 10:24 PM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't see any reason off hand why it shouldn't be working. What template are you using this in, and are any of the Usergroups you're using Secondary Usergroups?
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 01:59 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03964 seconds
  • Memory Usage 2,248KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (6)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete