View Full Version : Disabling Report a Post in Specific Forums
sheppardzwc
04-18-2009, 06:30 PM
Could there be any code for that? Some kind of <if> conditional statement? We want to disable it for one or two forums that are private.
Lynne
04-19-2009, 02:57 AM
You could put a condition around the button in the postbit. Something like:
<if condition="$forumid != 'xx'">
report button html
</if>
sheppardzwc
04-19-2009, 05:06 AM
You could put a condition around the button in the postbit. Something like:
<if condition="$forumid != 'xx'">
report button html
</if>
Is there a conditional statement for something like "$forumid is not 'xx'"?
Dismounted
04-19-2009, 05:20 AM
The code Lynne posted is it. != means not equal to.
dm_fan
05-21-2009, 05:11 PM
I'm trying to do the same thing, remove the report post button from just one forum. But my if statement does not seem to be working.
<!-- No Report-Post-Link in clubhouse -->
<if condition="$forumid!='488'">
<if condition="$show['reportlink']"><a href="report.php?$session[sessionurl]p=$post[postid]" rel="nofollow"><img class="inlineimg" src="$stylevar[imgdir_button]/report.gif" alt="$vbphrase[report_bad_post]" border="0" /></a> </if>
</if>
Does anyone have a guess at why this might not be working?
Thanks
Lynne
05-21-2009, 05:21 PM
Put a space between the forumid and the condition.... $forumid !=
dm_fan
05-21-2009, 05:57 PM
I put a space before and after the != but it's still not working. My code reads as follows:
<if condition="$forumid != '488'">
<if condition="$show['reportlink']"><a href="report.php?$session[sessionurl]p=$post[postid]" rel="nofollow"><img class="inlineimg" src="$stylevar[imgdir_button]/report.gif" alt="$vbphrase[report_bad_post]" border="0" /></a> </if>
</if>
I triple checked that I have the right forums ID, so that shoudn't be the problem.
Thanks
Lynne
05-21-2009, 06:17 PM
You realize you are doing a does NOT equal condition?
Are you making sure to do it in the postbit that you are using? (ie. correct style and correct postbit (there are two))
Try <if condition="$thread['forumid'] != '4'"> also. Sometimes you need to use the $thread variable instead.
ragtek
05-21-2009, 06:27 PM
Wouldn't it be easier to change $show['reportlink'] per plugin? ;) So you wouldn't have to change the template => easier updates^^
Lynne
05-21-2009, 06:35 PM
Wouldn't it be easier to change $show['reportlink'] per plugin? ;) So you wouldn't have to change the template => easier updates^^
Yes. I thought of that today, but obviously not back in April. :o But, he was already going down the route of doing a template edit so I decided to continue with that one (and so many users hate writing plugins).
dm_fan
05-21-2009, 06:48 PM
Thanks Lynne
changing to $thread['forumid'] was exactly what did the trick. here is the code again for anyone trying to do the same thing:
<if condition="$thread['forumid'] != 'xxx'">
<if condition="$show['reportlink']"><a href="report.php?$session[sessionurl]p=$post[postid]" rel="nofollow"><img class="inlineimg" src="$stylevar[imgdir_button]/report.gif" alt="$vbphrase[report_bad_post]" border="0" /></a></if>
</if>
I started out wanting to change $show['reportlink'] but couldn't find where $show was located (I don't work with PHP or mods to our forums that often).
and I've never created a plugin but would be willing to learn if someone can point me to a good tutorial.
Thanks again
Lynne
05-21-2009, 09:59 PM
and I've never created a plugin but would be willing to learn if someone can point me to a good tutorial.
Thanks again
I wrote this out. Perhaps it will help you - Disable Post Report Link for a forum (https://vborg.vbsupport.ru/showthread.php?t=214226)
dm_fan
05-21-2009, 10:56 PM
I tested it on our forums and everything works fine.
Thanks again
Andreas
05-23-2009, 01:06 PM
Keep in mind that it just hides the link - it does not keep users form reporting posts.
Lynne
05-23-2009, 03:25 PM
Keep in mind that it just hides the link - it does not keep users form reporting posts.
That is true for the template edit, which is why I posted a link to a quick article I wrote that uses plugins and that will keep users from being able to report them in that forum.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.