Topic: Removing the report button

I`m no coder.. is there a cleaner way than this?

viewtopic.php

FIND:

$post_actions[] = '<li class="postreport"><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>';

REPLACE WITH:

$post_actions[] = '';

FIND:

$post_actions[] = '<li class="postreport"><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>'.$lang_topic['Link separator'].'</li><li class="postdelete"><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a>'.$lang_topic['Link separator'].'</li><li class="postedit"><a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a>'.$lang_topic['Link separator'].'</li><li class="postquote"><a href="post.php?tid='.$id.'&qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a>';

REPLACE WITH:

$post_actions[] = '<li class="postdelete"><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a>'.$lang_topic['Link separator'].'</li><li class="postedit"><a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a>'.$lang_topic['Link separator'].'</li><li class="postquote"><a href="post.php?tid='.$id.'&qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a>';

FIND:

<div class="postfootright"><?php echo (count($post_actions)) ? '<ul>'.implode($lang_topic['Link separator'].'</li>', $post_actions).'</li></ul></div>'."\n" : '<div> </div></div>'."\n" ?>

REPLACE WITH:

<div class="postfootright"><?php echo (count($post_actions)) ? '<ul>'.implode($post_actions).'</li></ul></div>'."\n" : '<div> </div></div>'."\n" ?>

TIA

Re: Removing the report button

At the end of your base.css stylesheet put this

ul li.postreport {display: none;}

Re: Removing the report button

So your saying instead of doing the source edits, use that to prevent it from displaying. I would prefer to rip it out from the source so that the server isn`t doing the work and then the CSS is hiding it.

Re: Removing the report button

Exactly. Hiding through CSS or commenting out the code does the same, the function is still in but the CSS way is quicker.

Re: Removing the report button

Yeah I`d prefer to remove the function, do my edits do that or did I miss something?

Re: Removing the report button

In that case you need to both hide the link and remove the report function from misc.php (between line 164 and 262).

Re: Removing the report button

Thank you so much Strofanto. I think you mean lines 164 to 243 wink

To sum up for anyone wanting to completly strip the report function to save the server crunching it when it`s not going to be displayed, here`s what you need to do:

1. Remove the function.

Open misc.php and delete or comment out lines 164 to 243.

2. Remove the actual link.

viewtopic.php

FIND:

$post_actions[] = '<li class="postreport"><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>';

REPLACE WITH:

$post_actions[] = '';

FIND:

$post_actions[] = '<li class="postreport"><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>'.$lang_topic['Link separator'].'</li><li class="postdelete"><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a>'.$lang_topic['Link separator'].'</li><li class="postedit"><a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a>'.$lang_topic['Link separator'].'</li><li class="postquote"><a href="post.php?tid='.$id.'&qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a>';

REPLACE WITH:

$post_actions[] = '<li class="postdelete"><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a>'.$lang_topic['Link separator'].'</li><li class="postedit"><a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a>'.$lang_topic['Link separator'].'</li><li class="postquote"><a href="post.php?tid='.$id.'&qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a>';

FIND:

<div class="postfootright"><?php echo (count($post_actions)) ? '<ul>'.implode($lang_topic['Link separator'].'</li>', $post_actions).'</li></ul></div>'."\n" : '<div> </div></div>'."\n" ?>

REPLACE WITH:

<div class="postfootright"><?php echo (count($post_actions)) ? '<ul>'.implode($post_actions).'</li></ul></div>'."\n" : '<div> </div></div>'."\n" ?>

That`s it smile Once again thanks to Strofanto for advise on removing the function.

Re: Removing the report button

just curious as to why you want it out?

~James
FluxBB - Less is more

Re: Removing the report button

I'd still go for the CSS solution but it's just me.

Re: Removing the report button

Through personal experience report buttons are miss used to ask for help instead of posting. That`s why I prefer to just disable them when they`re not really needed, in this case just on my personnal forum. No doubt it has it`s use on other forums though.

My thinking behind removing the function instead of just hiding the link with CSS is, why have the server spend effort generating it when it`s not going to be used. Granted it may not make much of a diff but every little helps wink

Re: Removing the report button

Actually, isn't there an admin option to disable reporting?

12 (edited by oneless 2007-10-02 20:37)

Re: Removing the report button

I read there was but couldn`t find it, in either 1.2 or 1.3.

Re: Removing the report button

elbekko wrote:

Actually, isn't there an admin option to disable reporting?

I believe there's only an option to decide how to report (internal, email or both).

Re: Removing the report button

i'd just enter a spam email address to send reports to if it became a problem.

~James
FluxBB - Less is more

15

Re: Removing the report button

oneless wrote:

My thinking behind removing the function instead of just hiding the link with CSS is, why have the server spend effort generating it when it`s not going to be used. Granted it may not make much of a diff but every little helps wink

The changes you have posted so far in this thread would have absolutely no effect on performance. Also, some of the changes doesn't even make sense. Why would you change:

$post_actions[] = '<li class="postreport"><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>';

into:

$post_actions[] = '';

?

Comment it out, don't just set it to null.

16

Re: Removing the report button

i cann add butoon on rerport?

Re: Removing the report button

Dr.Jeckyl wrote:

i'd just enter a spam email address to send reports to if it became a problem.

That`s pointless. If I`m not using the button (because I`m not getting the reports) then there`s no need for the button to be there.

CodeXP wrote:

The changes you have posted so far in this thread would have absolutely no effect on performance.

The button is removed so the server doesn`t have to display it, thus the server has less to do improving performance oh so very very slightly.

CodeXP wrote:

Also, some of the changes doesn't even make sense. Why would you change:

$post_actions[] = '<li class="postreport"><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>';

into:

$post_actions[] = '';

?

Comment it out, don't just set it to null.

I`ve already said I`m no coder, that`s the only safe way I know to remove the button with out breaking any code. Which is why I post here asking "is there a cleaner way than this?"

I`m open to suggestions how to do this, that`s why I posted in the first place. So how would you remove the report button from the code?

Thanks.

18

Re: Removing the report button

oneless wrote:
CodeXP wrote:

The changes you have posted so far in this thread would have absolutely no effect on performance.

The button is removed so the server doesn`t have to display it, thus the server has less to do improving performance oh so very very slightly.

Give it ten years or so, and removing that link may have saved your system a few seconds of processing time. big_smile

19 (edited by oneless 2007-10-03 21:27)

Re: Removing the report button

More than "absolutely no effect" then tongue Seriously though, can we get back ontopic here. Performance it errelevant.. I just want to remove the link, if you know a better way than what I have done then please post it.

Re: Removing the report button

i just did this in my topic.php language file and it works:

'Report'            =>    ' ',
~James
FluxBB - Less is more

Re: Removing the report button

Yes it will but you`ve still got the extra pole next to it and besides the aim is to stop pun proccessing the report function not just hide it wink

22

Re: Removing the report button

In viewtopic.php, comment out, (as already told you by CodeXP), the first line starting:

$post_actions[] = '<li class="postreport">

Put // in front of the dollar sign.

Remove this portion of the second occurence:

<li class="postreport"><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>'.$lang_topic['Link separator'].'</li>

Delete the report post section of html at the bottom of misc.php.

Done.

Re: Removing the report button

Once again I recommend to do it through CSS, it will be just one line in your base.css file and it will avoid source code alteration, which is handy if you have to update your forum.

24

Re: Removing the report button

Strofanto wrote:

Once again I recommend to do it through CSS

I'd agree, but I think someone has their mind set on a specific path. big_smile

25 (edited by Dr.Jeckyl 2007-10-04 14:50)

Re: Removing the report button

oneless wrote:

Yes it will but you`ve still got the extra pole next to it and besides the aim is to stop pun proccessing the report function not just hide it wink

while i respect your right to change it to your liking, i have to say this is one the most pointless code edits i've seen. to each his own though. tongue

if it's not the resources you're concerned about it using and you don't want it used, who will know it's there if you just hide it besides you?

~James
FluxBB - Less is more