View Full Version : Only Show IP:Logged if user is admin or supermod, and disable Post report by user
Fallout2man
07-14-2002, 10:00 PM
At one of my boards, we had a paticular problem with one user. He kept reporting bogus posts just to try and get people he didn't like banned. I warned him but he didn't stop. So I instituted a hack that allows admins, via the admin user editor, to disable a user's ability to report posts. While I was at it today, I had a spurt of inspiration and decided to add another part that disables the "IP:logged" part of the post from showing to any groups other then admins and supermods (the only groups at that board allowed to view IPs).
So here it is, all in one nice, neat little vBhacker package.
Smoothie
07-15-2002, 03:57 AM
Can you post a text file also?
Velocd
07-15-2002, 04:01 AM
Cool, although if I were you and that guy disobayed my warning and continued to be a jackass--man, I sure wouldn't want to be in his shoes ;)
Good hack ^_^
I did you the pleasure of making a text file for it:
Fallout2man
07-15-2002, 04:03 AM
Thanks, and the main reason I did this was because one of the supermods demanded the entire feature be removed. I decided to meet him halfway and make a hack. Plus this is a good way to test the PHP I've learned over the past six months. A demo of this hack can be found at Anime Rebirth (http://www.db-v.com/forums/)
Fallout2man
07-15-2002, 04:07 AM
Uh-oh, that text file generated some uneccesary slashes on the template and SQL query. I hate it how vBhacker sometimes does that. Here's the correct code
+-------------------------------------------------------------------------------------------------+
| Create a new template named "postbit_report" with this: |
+-------------------------------------------------------------------------------------------------+
<a href="report.php?s=$session[sessionhash]&postid=$post[postid]">Report this post to a moderator</a>
+-------------------------------------------------------------------------------------------------+
+
+++
+
+-------------------------------------------------------------------------------------------------+
| In the "postbit" template, replace this code: |
+-------------------------------------------------------------------------------------------------+
<a href="report.php?s=$session[sessionhash]&postid=$post[postid]">Report this post to a moderator</a> | $post[iplogged]
+-------------------------------------------------------------------------------------------------+
+-------------------------------------------------------------------------------------------------+
| With this code: |
+-------------------------------------------------------------------------------------------------+
$post[ipreport]
+-------------------------------------------------------------------------------------------------+
+
+++
+
+-------------------------------------------------------------------------------------------------+
| Run this query: |
+-------------------------------------------------------------------------------------------------+
alter table user add column canreportposts smallint(6) DEFAULT '1' NOT NULL;
+-------------------------------------------------------------------------------------------------+
Brainmaster
07-15-2002, 04:28 AM
THX, I've got just befor you post this a problem with the SQL Syntax ;)
Boofo
07-15-2002, 05:33 AM
I guess I don't understnad this hack. Isn't that what "report this post to moderator" is for? If the admins and mods are the only ones to see it, who are they supposed to report the post to? :)
Velocd
07-15-2002, 06:19 AM
heh, it always seems like Boofo is the one confused, j/k :)
This hack basically allows you to disable certain members, who say abuse the rights, to using the report-a-thread-to-moderator link.
The hiding part doesn't hide the "report-a-thread-to-moderator" part, it just hides the IP:Logged part, since only admins/mods are suppose to see that anyway. It only hides the "report-a-thread-to-moderator" link if the option for it in the admincp is enabled, as I explained above.
Boofo
07-15-2002, 06:36 AM
I'm not confused (hard to believe, I know :)), I just think that by having to disable the report this post to moderator option because of one person puts the Admin at a disadvantage by letting the users force him/her to have to make changes to his board because of one user. That's what banning is for. If a user doesn't want to follow the rules and do what they are asked, then they need to be gone, IMHO. If you're going to diable it (even for one user), why not just take it out of the postbit altogether? :)
As far as hiding the IP logged feature, that has already been done. :)
Originally posted by Velocd
heh, it always seems like Boofo is the one confused, j/k :)
This hack basically allows you to disable certain members, who say abuse the rights, to using the report-a-thread-to-moderator link.
The hiding part doesn't hide the "report-a-thread-to-moderator" part, it just hides the IP:Logged part, since only admins/mods are suppose to see that anyway. It only hides the "report-a-thread-to-moderator" link if the option for it in the admincp is enabled, as I explained above.
Fallout2man
07-15-2002, 06:49 AM
The idea of disabling it is because the administration at that particular board is very leniant on bannings. This way we can take away the problem without me having to rally for a ban and get the other two admins to agree with me. It easily removes the itch, and since this user was a problem to begin with (repeatedly banned and unbanned by the other admins) I figured this was a just punishment since banning was not an option.
Edit: As well I should point out that it is disabled per user, so not everyone was affected, only this one person. You might believe this to be a waste of code, but the only other option was alltogether removing it, and that I see as way too harsh a thing to do. So I wrote my own hack to solve the problem and at the same time test my knowledge of PHP.
Boofo
07-15-2002, 06:59 AM
Ok, I understand now. I thought it was for disabling it for ALL users. Sorry for the misunderstanding. :)
Banning is ALWAYS an option, as far as I am concerned. In most situations, it is the ONLY option. But, that is just my 3.5 cents worth (inflation, you know). :)
Is there a way to install this without doing the IP logged disable, since I already have that one done? :)
Originally posted by Fallout2man
The idea of disabling it is because the administration at that particular board is very leniant on bannings. This way we can take away the problem without me having to rally for a ban and get the other two admins to agree with me. It easily removes the itch, and since this user was a problem to begin with (repeatedly banned and unbanned by the other admins) I figured this was a just punishment since banning was not an option.
Edit: As well I should point out that it is disabled per user, so not everyone was affected, only this one person. You might believe this to be a waste of code, but the only other option was alltogether removing it, and that I see as way too harsh a thing to do. So I wrote my own hack to solve the problem and at the same time test my knowledge of PHP.
Fallout2man
07-15-2002, 07:04 AM
Yes, simply don't do this for the PHP
+-------------------------------------------------------------------------------------------------+
| In admin/functions.php, replace this code: |
+-------------------------------------------------------------------------------------------------+
//highlight words for search engine
+-------------------------------------------------------------------------------------------------+
+-------------------------------------------------------------------------------------------------+
| With this code: |
+-------------------------------------------------------------------------------------------------+
// Display IP logged or Report post if applicable
if (($bbuserinfo[usergroupid]==5 or $bbuserinfo[usergroupid]==6) and $bbuserinfo[canreportposts]==1) {
$post[ipreport] = "$post[report] | $post[iplogged]";
} elseif (($bbuserinfo[usergroupid]==5 or $bbuserinfo[usergroupid]==6) and $bbuserinfo[canreportposts]==0) {
$post[ipreport] = "$post[iplogged]";
} elseif (($bbuserinfo[usergroupid]!=5 or $bbuserinfo[usergroupid]!=6) and $bbuserinfo[canreportposts]==1) {
$post[ipreport] = "$post[report]";
} else {
$post[ipreport] = "";
}
//highlight words for search engine
+-------------------------------------------------------------------------------------------------+
and you'll have to edit the postbit template manually to add the $post[report] variable that checks whether or not a user can report the posts then either displays a link or not.
Boofo
07-15-2002, 07:11 AM
So, I still need to run the vbhacker file then? For the admin cp stuff?
Fallout2man
07-15-2002, 07:35 AM
I'd reccomend just using the text file since you're selectively installing PHP.
Boofo
07-15-2002, 07:45 AM
But don't I have to use the vbhacker file to make the text file? I didn't see anything about the admin cp in the code listed in the thread. :) If I am missing something, I apologize.
Fallout2man
07-15-2002, 09:57 AM
Originally posted by Boofo
But don't I have to use the vbhacker file to make the text file? I didn't see anything about the admin cp in the code listed in the thread. :) If I am missing something, I apologize.
Velocd posted the text file from vBhacker already, I just fixed some errors in it and posted the corrected code. The rest of the edits are in his text file.
Boofo
07-15-2002, 11:17 AM
Thanks for a great hack! With your instructions and help, it worked like a charm. I might be able to use this after all (eventually). :)
lordnet
07-15-2002, 01:32 PM
great hack ;)
my best wish... :)
LORD :smoke:
Unknown553
07-15-2002, 04:03 PM
Isn't this just a combination of two hacks, or am I missing something?
https://vborg.vbsupport.ru/showthread.php?s=&threadid=31934
https://vborg.vbsupport.ru/showthread.php?s=&postid=200676#post200676
Boofo
07-15-2002, 07:56 PM
How do I get the report this post to moderator to not show up if it is the users own post (when you have it turned on in the admin CP) and still not show up anywhere when it is turned off?
Can I just edit this code or do I need to make another piece of code to handle not showing up in the users own post?
I'm trying to merge this hack with the hack in the link below and I'm getting confused. (Surprise, surprise, I know. :))
https://vborg.vbsupport.ru/showthread.php?s=&postid=200676#post200676
// Report Post Disable Hack
if ($bbuserinfo[canreportposts]==1) {
eval("\$post[report] .= \"".gettemplate("postbit_report")."\";");
} else {
$post[report] = "";
}
Fallout2man
07-15-2002, 08:25 PM
O_o;; wow, you don't hang around vb.org for a while and look what happens. Before anyone asks this hack was entirely hand coded, while apparently my variables may be the same I did not steal code from anyone.
anyway Boofo just change firefly's first line of code from
if ($post[userid]==$bbuserinfo[userid] or ($bbuserinfo[usergroupid]=="5" or $bbuserinfo[usergroupid]=="6" or $bbuserinfo[usergroupid]=="7")) {
to
if ($post[userid]==$bbuserinfo[userid] or $bbuserinfo[canreportposts]==0 or ($bbuserinfo[usergroupid]=="5" or $bbuserinfo[usergroupid]=="6" or $bbuserinfo[usergroupid]=="7")) {
Boofo
07-15-2002, 08:35 PM
Shouldn't there be an "or" between these?
$bbuserinfo[canreportposts]==0 ($bbuserinfo[usergroupid]=="5"
Fallout2man
07-15-2002, 08:37 PM
Sorry, I'm making quick edits to my post because I realized I originally left an and statement and have been trying to correct my mistakes. One moment while I edit....again :p
Fallout2man
07-15-2002, 08:41 PM
As for my code, yes just remove if if you're going with firefly's. Since they both aim to define the same variable.
Thanks Fallout2man
Can I temporarily disable the a post been reported more than twice
Thanks
Boofo
07-15-2002, 09:44 PM
What you gave me didn't work. I finally figured it out though. :) Here's what I put to make it work the way it should (by using Firefly's code, too). The line "and $bbuserinfo[canreportposts]==1" needed to go in the second part of the code, not the first. :)
if ($post[userid]==$bbuserinfo[userid] or ($bbuserinfo[usergroupid]=="5" or $bbuserinfo[usergroupid]=="6" or $bbuserinfo[usergroupid]=="7")) {
eval("\$post[editpost] = \"".gettemplate("postbit_editpost")."\";");
} else {
$post[editpost]="";
}
if ($post[userid]!=$bbuserinfo[userid] and $bbuserinfo[canreportposts]==1) {
eval("\$post[report] = \"".gettemplate("postbit_report")."\";");
} else {
$post[report]="";
}
Fallout2man
07-17-2002, 12:35 AM
Originally posted by Remi
Thanks Fallout2man
Can I temporarily disable the a post been reported more than twice
Thanks
Yes, but I'd have to modify the hack and add a table to the database for reported posts. If you really want me to I'll work on it.
Yes Fallout2man, I realy need it
So if you have the time, I will be more than grateful
DrkFusion
07-24-2002, 02:26 AM
Hey Fallout2man, sup, its me ;) You know who I am
Nice, as my new forums become popular I might be needing, just tested it, works good.
Drk
Fallout2man
07-24-2002, 12:05 PM
Well hopefully this hack will be upgraded soon, I've been working on the extra feature that guy wanted, and maybe a little something else I thought up, just been busy with server work lately so I haven't had a chance to perfect the next stuff yet.
FleaBag
07-25-2002, 12:27 AM
I don't see the option to disable a user's view of the report option when viewing a profile in the CP.
Fallout2man
07-25-2002, 03:17 AM
If you've installed everything, the option should be at the bottom of the yes/no options when editing a profile in the admin cp.
FleaBag
07-30-2002, 12:20 AM
I gave up and un-installed. :(
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.