Poblem with hidding mod ip. only answer if you understand

This forum is now closed as part of retiring phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
gizemli
Registered User
Posts: 6
Joined: Sat Apr 03, 2004 11:54 pm

Poblem with hidding mod ip. only answer if you understand

Post by gizemli »

hello, i need a bit help because im opening a site which has lots of mods so i have to take some measures.
i want the admin to see all mods ip and useres ip address but same time mods should see all users ip address but should not see any admin and the other mods ip address
in normal common.php when we change:

$user_ip = encode_ip($client_ip);
with this one:
$user_ip = encode_ip('0.0.0.0');

all users ip address will be invisible but i dont want this, i want to see all users ip address.

if anyone can help my with this situation i will be very very glade.

niekas
Registered User
Posts: 562
Joined: Sun Sep 23, 2001 7:34 am

Post by niekas »

try this: i tested it works (admins can see mod ips, regular users ips, but not other admins IP's, Mods can see only guest and regular users IPs).

FIND in modcp.php

Code: Select all

		$sql = "SELECT poster_ip, poster_id
			FROM " . POSTS_TABLE . "
			WHERE post_id = $post_id
				AND forum_id = $forum_id";
Replace with

Code: Select all

		$sql = "SELECT p.poster_ip, p.poster_id
         FROM " . POSTS_TABLE . " p , ". USERS_TABLE . " u
         WHERE p.post_id = $post_id AND u.user_id=p.poster_id AND (IF(u.user_level = 1,3,0)<".$userdata['user_level']."  or u.user_id = ".$userdata['user_id'].")
            AND p.forum_id = $forum_id";
you can customize error message

Code: Select all

			message_die(GENERAL_MESSAGE, $lang['No_such_post']);
by replacing with


Code: Select all

			message_die(GENERAL_MESSAGE, $lang['No_such_post']. " or you're not authorized");
edited fixed that admins can see their own IP's

gizemli
Registered User
Posts: 6
Joined: Sat Apr 03, 2004 11:54 pm

Post by gizemli »

thank you
Last edited by gizemli on Sat Apr 10, 2004 11:34 pm, edited 1 time in total.

gizemli
Registered User
Posts: 6
Joined: Sat Apr 03, 2004 11:54 pm

Post by gizemli »

thank you for your reply but i tryed the codes you gave
i hidden my ip from mods. but i can view ip by the codes i write below when i view viewtopic.php can i hide this with a simular method. waiting a reply from you and thank you very much

viewtopic.php

$ip = decode_ip($postrow[$i]['poster_ip']);
$ip = "[ IP : " . $ip . " ]";

add this between code tag :
$ip = decode_ip($postrow[$i]['poster_ip']);
$ip = "[ IP : " . $ip . " ]";

niekas
Registered User
Posts: 562
Joined: Sun Sep 23, 2001 7:34 am

Post by niekas »

gizemli,

i'm not sure what you mean? You don't need to hide any IP's - SQL query is written to preven to select IP's of users that have lower level that you.

gizemli
Registered User
Posts: 6
Joined: Sat Apr 03, 2004 11:54 pm

Post by gizemli »

i added a hacked "smartor"s "View Poster's IP like IBF-style"
This hack will let you show ip address for avatars writing under viewtopic.php
the code you gave is working perfectly under standart phpbb
but the code im using in viewtopic.php is :

$ip = decode_ip($postrow[$i]['poster_ip']);
$ip = "[ IP : " . $ip . " ]";

the ip is still there.

so can you please solve this problem this problem
thank you very much.

niekas
Registered User
Posts: 562
Joined: Sun Sep 23, 2001 7:34 am

Post by niekas »

gizemli wrote: i added a hacked "smartor"s "View Poster's IP like IBF-style"
This hack will let you show ip address for avatars writing under viewtopic.php
the code you gave is working perfectly under standart phpbb
but the code im using in viewtopic.php is :

$ip = decode_ip($postrow[$i]['poster_ip']);
$ip = "[ IP : " . $ip . " ]";

the ip is still there.

so can you please solve this problem this problem
thank you very much.


i'm not sure what kind of sql querry smartor uses to select topic data, but if its the same as phpBB do this:
FIND in viewtopic.php

line

Code: Select all

$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, p.*,  pt.post_text, pt.post_subject, pt.bbcode_uid
at the end of the line add this:

Code: Select all

, (IF(IF(u.user_level = 1,3,u.user_level)<".$userdata['user_level'].",p.poster_ip,NULL)) as poster_ip
works with regular phpBB

and in modcp the code i gave you

Code: Select all

		(IF(u.user_level = 1,3,0)
change to

Code: Select all

(IF(u.user_level = 1,3,u.user_level)

gizemli
Registered User
Posts: 6
Joined: Sat Apr 03, 2004 11:54 pm

Post by gizemli »

Thank you very very much i was very pleased to see your answer to my questions the codes you gave are working perfectly so thank you once again.

User avatar
Rookie7
Registered User
Posts: 189
Joined: Mon Mar 10, 2003 3:32 pm
Contact:

Post by Rookie7 »

Hi niekas

Is there anyway you can make it so that admins can view each other's IP...or at least the admin who sets up the board can view everyone's IP?

Also...if an admin posted as a regular member, the moderator can view the IP and see the name if the admin on the list as well. Is there anyway to prevent this?

Thanks for helping us.

Post Reply

Return to “[2.0.x] MOD Requests”