only admin check ip

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
turdmeister
Registered User
Posts: 40
Joined: Sun Mar 16, 2003 9:47 pm

only admin check ip

Post by turdmeister » Sun Feb 22, 2004 5:03 pm

ok, I tried searching for this and couldn't find anything, so if it already exist -- excuse me ;)

I was wondering if it's possible to make it so only the admin can check IP's. I don't want my moderators doing it.

Seven2
Registered User
Posts: 379
Joined: Fri Oct 17, 2003 4:37 am
Location: Tomah, WI
Contact:

Post by Seven2 » Sun Feb 22, 2004 6:46 pm

i don't want anyone but me doing it @_@
damn lamers (newbie kiddiescript hackers)
Image

turdmeister
Registered User
Posts: 40
Joined: Sun Mar 16, 2003 9:47 pm

Post by turdmeister » Sun Feb 22, 2004 6:54 pm

ok... that was usefull... :roll:

turdmeister
Registered User
Posts: 40
Joined: Sun Mar 16, 2003 9:47 pm

Post by turdmeister » Sun Feb 22, 2004 10:06 pm

Well besides Seven2's excellet post, I haven't got any answers. Does anyone who's not an idiot like to post something?

turdmeister
Registered User
Posts: 40
Joined: Sun Mar 16, 2003 9:47 pm

Post by turdmeister » Mon Feb 23, 2004 1:50 am

hmmm... I heard somewhere that this was possible, but since noone is answering, maybe it's not.

:?:

toxckrayon
Registered User
Posts: 342
Joined: Mon Feb 18, 2002 4:44 pm
Location: New York City
Contact:

Post by toxckrayon » Mon Feb 23, 2004 3:27 am

well, before you post another unanswered response to your own message for the 4th time today, find this in viewtopic.php:

Code: Select all

	if ( $is_auth['auth_mod'] )
	{
		$temp_url = "modcp.$phpEx?mode=ip&" . POST_POST_URL . "=" . $postrow[$i]['post_id'] . "&" . POST_TOPIC_URL . "=" . $topic_id . "&sid=" . $userdata['session_id'];
		$ip_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_ip'] . '" alt="' . $lang['View_IP'] . '" title="' . $lang['View_IP'] . '" border="0" /></a>';
and replace the first line with:

Code: Select all

	if ( $$userdata['user_level'] == ADMIN )
should do the trick
the world's combined intelligence is a constant; the population is expanding

turdmeister
Registered User
Posts: 40
Joined: Sun Mar 16, 2003 9:47 pm

Post by turdmeister » Mon Feb 23, 2004 2:48 pm

Thanks for the answer, but it didn't do the trick.

The IP function is removed alright, but also for the admin...

User avatar
KevinST
Registered User
Posts: 98
Joined: Fri Nov 14, 2003 9:39 am
Location: UK

Post by KevinST » Mon Feb 23, 2004 3:23 pm


turdmeister
Registered User
Posts: 40
Joined: Sun Mar 16, 2003 9:47 pm

Post by turdmeister » Mon Feb 23, 2004 3:41 pm

Thanks man :D

Here's what I did, and it works perfectly...
drathbun wrote: Change the following in viewtopic.php:

Code: Select all

$ip_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_ip'] . '" alt="' . $lang['View_IP'] . '" title="' . $lang['View_IP'] . '" border="0" /></a>';
$ip = '<a href="' . $temp_url . '">' . $lang['View_IP'] . '</a>';
to this:

Code: Select all

$ip_img = ($userdata['user_level'] == ADMIN) ? '<a href="' . $temp_url . '"><img src="' . $images['icon_ip'] . '" alt="' . $lang['View_IP'] . '" title="' . $lang['View_IP'] . '" border="0" /></a>' : '';
$ip = ($userdata['user_level'] == ADMIN) ? '<a href="' . $temp_url . '">' . $lang['View_IP'] . '</a>' : '';
That will add an extra check to see if the user is an admin or not; if so, the IP button should show up. Otherwise it should be gone. I didn't test this, so be sure to back up your file first. But I think it is okay.

Dave

User avatar
warmweer
Registered User
Posts: 2378
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Belt ... well actually Belgium

Post by warmweer » Mon Feb 23, 2004 8:22 pm

toxckrayon wrote:

Code: Select all

	if ( $$userdata['user_level'] == ADMIN )
should do the trick

removing one $ should do the trick :)
My board's not broken, it just went peculiar

toxckrayon
Registered User
Posts: 342
Joined: Mon Feb 18, 2002 4:44 pm
Location: New York City
Contact:

Post by toxckrayon » Mon Feb 23, 2004 8:57 pm

yeah, sorry about that... just noticed it myself... I'd prefer my method over the older one because it's clearer (when it works), but as long as you got it working, that's cool too
the world's combined intelligence is a constant; the population is expanding

Post Reply

Return to “[2.0.x] MOD Requests”