Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 04-16-2008, 11:05 AM
jambo_1969 jambo_1969 is offline
 
Join Date: May 2007
Posts: 224
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default The Perennial Reporter

Hi All

I have a member who does nothing but report posts, he's been suspended etc but still continues to report.

I'm thinking I can add a line into the postbit template that removes the report icon..

Would this code work if I added in the new if condition to only allow certain groups to see the icon ? I'd only be adding it to the postbit template, but worried it might break the board ?

Quote:
<if condition="is_member_of($bbuserinfo, 6, 7, 34, 2, 5)">
<if condition="$show['reportlink']">etc etc
</if>
Any help or advice ?

Cheers
Reply With Quote
  #2  
Old 04-16-2008, 01:02 PM
MrEyes MrEyes is offline
 
Join Date: Nov 2004
Posts: 380
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am sure I will be corrected if I am wrong, however I believe the "is_member_of" performs an additional SQL call.

I would try one of these instead:

Code:
<if condition="$bbuserinfo[usergroupid] == 2">
..what you put here would only show for users in usergroup 2..
</if>
Code:
<if condition="$bbuserinfo[usergroupid] != 2">
..what you put here would only show for users not in usergroup 2..
</if>
Code:
<if condition="$bbuserinfo[usergroupid] == 2">
..what you put here would only show for users in usergroup 2..
</if>

Code:
<if condition="in_array($bbuserinfo[usergroupid], array(2,3,4))">
..what you put here would only show for users in usergroup 2, 3 & 4..
</if>

Code:
<if condition="!in_array($bbuserinfo[usergroupid], array(2,3,4))">
..what you put here would only show for users not in usergroup 2, 3 & 4..
</if>
Or you could also use $bbuserinfo[userid] to restrict at a user level
Reply With Quote
  #3  
Old 04-16-2008, 01:56 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is_member_of() does not perform additional SQL queries, it merely compares the data within the [minicode]$userinfo[/minicode] variable. If the user is in a seperate usergroup then what you have is correct. If you want to merely prevent that user from reporting then you can use a conditional like:
Code:
<if condition="!$bbuserinfo['userid'] == X">
...
</if>
Reply With Quote
  #4  
Old 04-16-2008, 02:01 PM
jambo_1969 jambo_1969 is offline
 
Join Date: May 2007
Posts: 224
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Opserty View Post
is_member_of() does not perform additional SQL queries, it merely compares the data within the [minicode]$userinfo[/minicode] variable. If the user is in a seperate usergroup then what you have is correct. If you want to merely prevent that user from reporting then you can use a conditional like:
Code:
<if condition="!$bbuserinfo['userid'] == X">
...
</if>
BRILLIANT !

Thanks for that !

PS - I know the is_member_of doesnt use SQL queries, as I have it in my navbar to show certain items to certain usergroups

--------------- Added [DATE]1208362075[/DATE] at [TIME]1208362075[/TIME] ---------------

Quote:
Originally Posted by Opserty View Post
is_member_of() does not perform additional SQL queries, it merely compares the data within the [minicode]$userinfo[/minicode] variable. If the user is in a seperate usergroup then what you have is correct. If you want to merely prevent that user from reporting then you can use a conditional like:
Code:
<if condition="!$bbuserinfo['userid'] == X">
...
</if>
Sorry - should that not be !==!X ?

--------------- Added [DATE]1208413862[/DATE] at [TIME]1208413862[/TIME] ---------------

Okay - that didn't work.

For some reason, putting the if condition in postbit & legacy, or, just postbit/legacy, simply removes the report icon for everyone....

Anyone any ideas ?
Reply With Quote
  #5  
Old 04-17-2008, 05:55 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

$bbuserinfo['userid'] != X
Reply With Quote
  #6  
Old 04-17-2008, 07:34 AM
jambo_1969 jambo_1969 is offline
 
Join Date: May 2007
Posts: 224
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
$bbuserinfo['userid'] != X

Top man - thanks !

Could this not be built into future releases of VB ? The ability to ban users from reporting posts ?

Or, is it just me who needs this ?

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 01:04 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03905 seconds
  • Memory Usage 2,213KB
  • 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
  • (8)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)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