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

Reply
 
Thread Tools Display Modes
  #1  
Old 04-01-2013, 01:54 PM
DJ-Dez DJ-Dez is offline
 
Join Date: Jun 2010
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Help asap

Hiya;

For some reason, we have the usergroup as id 314. Confirmed.

Anybody in that usergroup it will display a userbar. However, for some reason whenever somebody updates something in field24 it will just bypass the 314 usergroup id, meaning they don't have to be in usergroup id 314. We need it strictly to only show a userbar in usergroup id 314.

We've wrapped the <vb:raw donatorbar> in IF statements like, IF in 314 etc but this removes everyones userbar for some reason.

How could we fix this?
Reply With Quote
  #2  
Old 04-01-2013, 02:06 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm...well, to start with I don't think you want if (!strpos($post['membergroupids'], 314)), because basically that will only check for 314 if it is the first (or only) member group id. It would be better to use is_member_of($post, 314). Also, I don't understand how field24 works so I can't write the entire condition for you - what's expected in that field, and how does it affect whether or not a user gets a bar?
Reply With Quote
  #3  
Old 04-01-2013, 02:11 PM
DJ-Dez DJ-Dez is offline
 
Join Date: Jun 2010
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE=kh99;2413613]Hmm...well, to start with I don't think you want if (!strpos($post['membergroupids'], 314)), because basically that will only be true if 314 is the first (or only) member group id. It would be better to use is_member_of($post, 314).
Reply With Quote
  #4  
Old 04-01-2013, 02:25 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, if I had read the second line of code you posted I would have figured out what field24 was for.

Anyway, I think the problem is that strpos call doesn't do what you think it does. According to the docs, if the second parameter to strpos() is a number, then it's used as the code for a character. You could put quotes around the 314, but like I mentioned above, I think it would be better to change it to

Code:
if (is_member_of($post, 314) && $post['field24']){$donatorbar = true;

and see if that works.
Reply With Quote
  #5  
Old 04-01-2013, 03:20 PM
DJ-Dez DJ-Dez is offline
 
Join Date: Jun 2010
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Kev, you're a star. That works.

However, now we're trying to display it in the userprofile, but it's not working after corresponding your code.

We have our vbraw template in Memberinfo with this in hook member_complete

No idea why code is failing here, when the user is in the usergroup.
Reply With Quote
  #6  
Old 04-01-2013, 03:34 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is no $post except in postbit. Try changing $post to $userinfo.
Reply With Quote
  #7  
Old 04-01-2013, 03:35 PM
DJ-Dez DJ-Dez is offline
 
Join Date: Jun 2010
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
There is no $post except in postbit. Try changing $post to $userinfo.
Changed both to userinfo, nothing =(

Thanks so far Kevin though

--------------- Added [DATE]1364834389[/DATE] at [TIME]1364834389[/TIME] ---------------
Reply With Quote
  #8  
Old 04-01-2013, 03:42 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm...seems like that should have been it. Your code has $post in 3 places, did you change them all? Edit: oh, ok, I see the code you added above.
Reply With Quote
  #9  
Old 04-01-2013, 03:43 PM
DJ-Dez DJ-Dez is offline
 
Join Date: Jun 2010
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
Hmm...seems like that should have been it. Your code has $post in 3 places, did you change them all? Edit: oh, ok, I see the code you added above.
Changed them all now, just missed one. It's working now. Should this code everyone individually?
Reply With Quote
  #10  
Old 04-01-2013, 03:49 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DJ-Dez View Post
Should this code everyone individually?

I'm not sure what you mean. $userinfo should be the member whose profile you're looking at, if that's what you're asking.
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 03:37 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.04529 seconds
  • Memory Usage 2,247KB
  • Queries Executed 13 (?)
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_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (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_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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete