The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
IP Addresses
On our board we have enabled show ip's publicly. If the person viewing a post is a moderator / admin i would like them to see the full ip address... if they are not a moderator / admin i would like them to see only the first 3 segments of the address with the 4th segment blanked out ...
Eg. ip address = 123.123.123.123 moderators and admins will see 123.123.123.123 everyone else will see 123.123.123.xxx I'm sure this is probably a very simple hack in showthread.php but I just cant get it working :'( Any ideas or advice would be greatly appreciated. We are using vBulletin 2.2.6 Regards, Dan. |
#2
|
|||
|
|||
Ok,
After a little more thought, I figured out how to do it ... In admin/functions.php, find: PHP Code:
add: PHP Code:
Eg. IP Address = 123.123.123.123 moderators / admins will see 123.123.123.123 all other logged on members will see 123.123.123.xxx anyone who is not registered or not logged on will see IP Logged. |
#3
|
|||
|
|||
That's no good :'( it adds 1 extra query per post on the page. I have 40 posts on each page so we had 65 queries on showthread, it was like that for less than 10 minutes and I'm lucky it didnt bring the server down.
I need to be able to check if the person viewing the thread is a mod once and then save that to a variable then send the variable each time as part of getpostbit() but I dont know how to do this... Any ideas anyone? |
#4
|
|||
|
|||
Ok,
I've had more time to think and i've replaced !ismoderator() with $bbuserinfo['usergroupid']!=5 AND $bbuserinfo['usergroupid']!=6 AND $bbuserinfo['usergroupid']!=7 Works fine now and *no* extra queries for this hack ... but I would like to release this as a hack for others and depending on how they have their forum set, this may not always work... I really would like a way of calling ismoderator once per page view and saving the result as a variable ... anyone know how I can do this? The problem seems to be that the posts are done before the thread code is done ... so I dont know where I can put the ismoderator() line and have it run *once* prior to the posts getting done. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|