View Full Version : The Perennial Reporter
jambo_1969
04-16-2008, 11:05 AM
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 ?
<if condition="is_member_of($bbuserinfo, 6, 7, 34, 2, 5)">
<if condition="$show['reportlink']">etc etc
</if>
Any help or advice ?
Cheers
MrEyes
04-16-2008, 01:02 PM
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:
<if condition="$bbuserinfo[usergroupid] == 2">
..what you put here would only show for users in usergroup 2..
</if>
<if condition="$bbuserinfo[usergroupid] != 2">
..what you put here would only show for users not in usergroup 2..
</if>
<if condition="$bbuserinfo[usergroupid] == 2">
..what you put here would only show for users in usergroup 2..
</if>
<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>
<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
Opserty
04-16-2008, 01:56 PM
is_member_of() does not perform additional SQL queries, it merely compares the data within the $userinfo 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:
<if condition="!$bbuserinfo['userid'] == X">
...
</if>
jambo_1969
04-16-2008, 02:01 PM
is_member_of() does not perform additional SQL queries, it merely compares the data within the $userinfo 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:
<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 :D
--------------- Added 1208362075 at 1208362075 ---------------
is_member_of() does not perform additional SQL queries, it merely compares the data within the $userinfo 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:
<if condition="!$bbuserinfo['userid'] == X">
...
</if>
Sorry - should that not be !==!X ?
--------------- Added 1208413862 at 1208413862 ---------------
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 ?
Dismounted
04-17-2008, 05:55 AM
$bbuserinfo['userid'] != X
jambo_1969
04-17-2008, 07:34 AM
$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 ?
:D
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.