Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Design and Graphics Discussions
  #1  
Old 08-29-2009, 02:11 PM
MikeWarner's Avatar
MikeWarner MikeWarner is offline
 
Join Date: Nov 2001
Location: UK
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Help Please with Conditionals

Hi - I'm trying to highlight the thread title cell of threads posted within a specific forum posted by a specific usergroup (also within search results).

The conditional basically needs to say - <if thread is posted in forumid=1 and thread starter is usergroup=2>Do This</if>

I have attached an image showing to sort of highlight I'm after - anyone know which templates I need to edit (for search results and in forum thread list).

Many many thanks for any help you can give me.
Attached Images
File Type: jpg highlight.jpg (115.2 KB, 0 views)
Reply With Quote
  #2  
Old 08-29-2009, 02:44 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Probably something like:
HTML Code:
<if condition="$thread['forumid'] == xx AND is_member_of($thread['postuserid'], yy)">
stuff
<else />
other stuff
</if>
I'm not really sure if you can do $thread['postuserid'] in the is_member_of function - you can look it up in the API (in Quick Links).
Reply With Quote
  #3  
Old 08-29-2009, 04:24 PM
MikeWarner's Avatar
MikeWarner MikeWarner is offline
 
Join Date: Nov 2001
Location: UK
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi - thanks for replying. This is what I've added in threadbit template:
PHP Code:
<if condition="$thread['forumid'] == 87 AND is_member_of($thread['postuserid'], 6)">
<
td class="alt1" id="td_threadtitle_$thread[realthreadid]title="$thread[preview]style="BACKGROUND-COLOR: yellow">$thread[title_editable]>

<else />
<
td class="alt1" id="td_threadtitle_$thread[realthreadid]title="$thread[preview]">
</if> 
It isn't working - it does nothing. I tried doing the highlight with no conditional and it worked, so it must be the conditional part. Please help. Thanks.
Reply With Quote
  #4  
Old 08-29-2009, 05:17 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you look at the API for is_member_of?
Quote:
is_member_of (line 384)
Works out if a user is a member of the specified usergroup(s)
This function can be overloaded to test multiple usergroups: is_member_of($user, 1, 3, 4, 6...)
boolean is_member_of (array $userinfo, integer $usergroupid, [boolean $cache = true])
  • array $userinfo: User info array - must contain userid, usergroupid and membergroupids fields
  • integer $usergroupid: Usergroup ID to test
  • boolean $cache: Pull result from cache
So, as seen, it needs more info passed to it. You may have to do a join on the thread query to get the usergroupid of the user also.
Reply With Quote
  #5  
Old 08-29-2009, 05:42 PM
MikeWarner's Avatar
MikeWarner MikeWarner is offline
 
Join Date: Nov 2001
Location: UK
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Lynne - thanks again, but that stuff is a foreign language to me.
Reply With Quote
Reply

Thread Tools
Display Modes

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 02:16 PM.


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.04092 seconds
  • Memory Usage 2,221KB
  • Queries Executed 14 (?)
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
  • (1)bbcode_html
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (1)postbit_attachment
  • (5)postbit_onlinestatus
  • (5)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_postinfo_query
  • fetch_postinfo
  • 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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete