News:

Wondering if this will always be free?  See why free is better.

Main Menu

Remove Show IP Address

Started by petewadey, February 27, 2025, 06:33:36 AM

Previous topic - Next topic

petewadey

Is there a way of removing "Show IP address" in the member's message box? See attached. SMF 2.1.4
Thanks

Doug Heffernan

Quote from: petewadey on February 27, 2025, 06:33:36 AMIs there a way of removing "Show IP address" in the member's message box? See attached. SMF 2.1.4
Thanks

At the Display.template.php file inside the themes directory find the following code and either remove it or comment it out:

// Show the IP to this user for this post - because you can moderate?
   
if (!empty($context['can_moderate_forum']) && !empty($message['member']['ip']))
       echo
'
                               <li class="poster_ip">
                                   <a href="'
, $scripturl, '?action=', !empty($message['member']['is_guest']) ? 'trackip' : 'profile;area=tracking;sa=ip;u=' . $message['member']['id'], ';searchip=', $message['member']['ip'], '" data-hover="', $message['member']['ip'], '" class="show_on_hover"><span>', $txt['show_ip'], '</span></a> <a href="', $scripturl, '?action=helpadmin;help=see_admin_ip" onclick="return reqOverlayDiv(this.href);" class="help">(?)</a>
                               </li>'
;

   
// Or, should we show it because this is you?
   
elseif ($message['can_see_ip'])
       echo
'
                               <li class="poster_ip">
                                   <a href="'
, $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help show_on_hover" data-hover="', $message['member']['ip'], '"><span>', $txt['show_ip'], '</span></a>
                               </li>'
;

   
// Okay, are you at least logged in? Then we can show something about why IPs are logged...
   
elseif (!$context['user']['is_guest'])
       echo
'
                               <li class="poster_ip">
                                   <a href="'
, $scripturl, '?action=helpadmin;help=see_member_ip" onclick="return reqOverlayDiv(this.href);" class="help">', $txt['logged'], '</a>
                               </li>'
;

   
// Otherwise, you see NOTHING!
   
else
       echo
'
                               <li class="poster_ip">'
, $txt['logged'], '</li>';

Illori

if you do this then you will not be able to easily see the IP address that is used to make a post.

shawnb61

Note that it's only visible to admins, not regular users.
A question worth asking is born in experience & driven by necessity. - Fripp

Illori

Quote from: shawnb61 on February 27, 2025, 09:28:36 AMNote that it's only visible to admins, not regular users.

it is also visible to the person that made the post.

petewadey

Thanks. I'm just trying to make things more tidy. My membership wouldn't be interested in their ip's, and I believe as admin I can see theirs in the member's list if needed. So as long as Doug's suggestion doesn't remove that I'll give it a go first on my test site. Thanks

Illori

if you are ever contacted by the police or a lawyer etc you need this information, you would have to dig into the database to get this information otherwise.

petewadey

It's very unlikely, but thanks for the warning. I've just done the above and still have all my member's last ip's in the member's list. Are you suggesting this will no longer populate?

Illori

it will still populate as well in their profile, but that IP address may not be the same they made a post from.

Doug Heffernan

#9
Quote from: petewadey on February 27, 2025, 11:27:13 AMThanks. I'm just trying to make things more tidy. My membership wouldn't be interested in their ip's, and I believe as admin I can see theirs in the member's list if needed. So as long as Doug's suggestion doesn't remove that I'll give it a go first on my test site. Thanks

No, the suggestion I posted won't remove the ip addresses there or elsewhere, but at the postbit area as you asked.

petewadey

Thanks Doug. I've done that and it worked great. Now I have space for their location which is more relevant to my members....when I can work out how.

Advertisement: