vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Disabling Report a Post in Specific Forums (https://vborg.vbsupport.ru/showthread.php?t=211592)

sheppardzwc 04-18-2009 06:30 PM

Disabling Report a Post in Specific Forums
 
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:

HTML Code:

<if condition="$forumid != 'xx'">
report button html
</if>


sheppardzwc 04-19-2009 05:06 AM

Quote:

Originally Posted by Lynne (Post 1794252)
You could put a condition around the button in the postbit. Something like:

HTML Code:

<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.

Code:

  <!-- 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> &nbsp;</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:
Code:

<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> &nbsp;</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

Quote:

Originally Posted by ragtek (Post 1814788)
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:

Code:

<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

Quote:

Originally Posted by dm_fan (Post 1814802)
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

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

Quote:

Originally Posted by Andreas (Post 1815743)
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.


All times are GMT. The time now is 06:53 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.01406 seconds
  • Memory Usage 1,749KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (2)bbcode_html_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (15)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete