![]() |
Hello everyone,
I noticed that the IP Logged GIF or TEXT was just taking up some valuable icon space in my posts for my registered members. Also the only people that use the IP icon/text are Admins, Moderators, or Super Moderators. So I just made a small hack to showthread.php and thought some of you might find this useful: Hack Directions (tested on vb2.0.1) In Showthread.php: Find the following: Code:
if ($post[ip]!="") { Code:
if ($post[ip]!="") { matches that of your Administrators, Moderators, and Super Moderators for both the 'if' and 'elseif' statments in that script. For example: my 'usergroupid' (s) looked like this: $bbuserinfo['usergroupid']==5 (Super Mods) $bbuserinfo['usergroupid']==6 (Mods) $bbuserinfo['usergroupid']==95 (Admins) Just something small to keep the administrative ideas away from the users as much as possible to limit the users ideas of possible security threats as well as space saving for the postbit template. :) With IP Icon - What Admins/Mods/Super Mods See http://images.paintballcity.com/w_ipicon.gif Without IP Icon - What Members See http://images.paintballcity.com/wo_ipicon.gif |
Here is how I did it... If you notice the code is a little simpler and it acheives an bonus effect in that moderators of the forum (including super moderators and administrators) don't see the "Report" icon I have set up for regular members.
PHP Code:
|
Good idea with the Report button. I'll implement that.
Except you need to change your code a bit so that if the Admin chooses to show IP's publicly....on an intranet maybe. |
Actually it only tries to determine if the IP should be shown if the user is a moderator. If they are it will follow whatever settings are made under options.
If you look, the first line includes a call to "ismoderator()" this function returns true if the user is a moderator. You can find it in admin/functions.php. Makes it a lot easier to find appropriate moderator permissions without trying to remember user groups and permission levels or whatnot. |
Correct me if I'm wrong but in your code...if $logip==2 then only your mods can view the IP...when $logip==2 sets the "view IP's to public viewing".
No big deal just a thought. Thanks wluke for optimizing my code for me and teaching me about that ismoderator function. Very useful. Now I'm off to go optimize some other code of mine where the usergroupid lines may range forever onward. :) |
It worked fine with v2.0.0, but I can't find that code in showthread.php of v2.0.3.
|
I haven't upgraded to vb2.0.3 yet. I just upgraded the sessions.php script like they said for the security issue.
When I upgrade I will be sure to let you know. Sorry :( |
The code it probably somewhere else, or on a template, I'll (try to) find it myself.
Thanks anyway. :) Nice hack. |
Anyone found out how to install this hack on v2.0.3? :(
|
You need to change the postbit function in admin/functions.php.
It is the second function in the file. The code is actually the same, just in a different file. |
All times are GMT. The time now is 09:20 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|