Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #31  
Old 03-30-2004, 02:39 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Wayne Luke
This will not work because it is incorrect logic. the structure for in_array has two required variables:
bool in_array ( mixed needle, array haystack [, bool strict])

The code above is only submitting one variable parameter, the result of the is_member_of () call. Secondly, is_member_of() does not account for an array of ID's to be passed to it. But only takes a single userid.

So, you would need to either install the change by Merk which allows an array to be sent to is_member_of or use individual conditions as outlined above but matching against $bbuserinfo instead of $post.
But you can use the in_array with calling forumids, right? Like this:

HTML Code:
if (in_array($forumid, array(XX, XX, XX)))
Reply With Quote
  #32  
Old 03-30-2004, 02:43 PM
Wayne Luke's Avatar
Wayne Luke Wayne Luke is offline
Senior Member
 
Join Date: Jan 2002
Location: Southern California
Posts: 1,694
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo
But you can use the in_array with calling forumids, right? Like this:

HTML Code:
if (in_array($forumid, array(XX, XX, XX)))
Yes, that is a different application though. If checking for specific forums that would work. If checking for primary usergroup only you could even use:

HTML Code:
if (in_array($bbuserinfo['usergroupid'], array (4,5,6)))
And have it work... Just the is_member_of() function is limited to a single userid. I haven't looked at Merk's hack for this but I suspect he simply wrapped the checks of that function in a FOR...EACH loop that checks each value in an array. Wouldn't be a bad change for the core product in my opinion.
Reply With Quote
  #33  
Old 03-30-2004, 02:46 PM
Wayne Luke's Avatar
Wayne Luke Wayne Luke is offline
Senior Member
 
Join Date: Jan 2002
Location: Southern California
Posts: 1,694
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

But we have gotten off track here... The solution to the original question is to open the SHOWTHREAD template and replace:

$quickreply

WITH
HTML Code:
 <if condition="is_member_of($bbuserinfo, 5) OR is_member_of($bbuserinfo, 6) OR is_member_of($bbuserinfo, 7) OR is_member_of($bbuserinfo, 9)">$quickreply</if>
I believe that will provide the solution you are looking for.
Reply With Quote
  #34  
Old 03-30-2004, 02:50 PM
Yahhoon23 Yahhoon23 is offline
 
Join Date: Dec 2003
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

THANK YOU!

Working good now.
Reply With Quote
  #35  
Old 03-30-2004, 02:52 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Wayne Luke
Yes, that is a different application though. If checking for specific forums that would work. If checking for primary usergroup only you could even use:

HTML Code:
if (in_array($bbuserinfo['usergroupid'], array (4,5,6)))
And have it work... Just the is_member_of() function is limited to a single userid. I haven't looked at Merk's hack for this but I suspect he simply wrapped the checks of that function in a FOR...EACH loop that checks each value in an array. Wouldn't be a bad change for the core product in my opinion.
merk's hack is great. I asked about that on vb.com, if I remember right. That would be a great addition to vbulletin, like you said. Mayve we'll see it in the next update?

Ok, back to the code at hand. Basically, using the code I posted with the OR and changing the post to bbuserinfo is the same thing you posted, right?

[high]* Boofo writes this down because he isn't right too often. [/high]
Reply With Quote
  #36  
Old 03-30-2004, 03:33 PM
Wayne Luke's Avatar
Wayne Luke Wayne Luke is offline
Senior Member
 
Join Date: Jan 2002
Location: Southern California
Posts: 1,694
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo
Ok, back to the code at hand. Basically, using the code I posted with the OR and changing the post to bbuserinfo is the same thing you posted, right?
Correct.
Reply With Quote
  #37  
Old 03-30-2004, 03:36 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Wayne Luke
Correct.
Thank you, sir.

[high]* Boofo writes down that Wayne said he was correct which will probably be the last time that ever happens. [/high]
Reply With Quote
  #38  
Old 03-31-2004, 12:51 AM
deathemperor's Avatar
deathemperor deathemperor is offline
 
Join Date: Jul 2003
Location: HOL
Posts: 1,270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

so, can we use
PHP Code:
if (in_array($bbuserinfo['userid'], array (5843,9948))) 
to check if it's Wayne Luke or Boofo ?
Reply With Quote
  #39  
Old 03-31-2004, 12:54 AM
Wayne Luke's Avatar
Wayne Luke Wayne Luke is offline
Senior Member
 
Join Date: Jan 2002
Location: Southern California
Posts: 1,694
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes...
Reply With Quote
  #40  
Old 03-31-2004, 01:02 AM
deathemperor's Avatar
deathemperor deathemperor is offline
 
Join Date: Jul 2003
Location: HOL
Posts: 1,270
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thank you Wayne Luke
template conditions....great ! ^ ^
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 07:27 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.04410 seconds
  • Memory Usage 2,266KB
  • 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
  • (5)bbcode_html
  • (1)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete