MyBB Community Forums

Full Version: Missing IP Lookup Info...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
On the profile page, I see the links for IP address lookup but the links give me errors and show nothing.  I've gone through all settings and don't see anything incorrect.

The link takes me to: https://www.ip-tracker.org/lookup.php?ip=  (without the IP address)

You can see the link and image it takes me to.

[attachment=45342]

My member_profile_modoptions code that's calling for it:

<li>Most Recent IP<BR>{$memprofile['lastip']} <a href="http://www.ip-tracker.org/locator/ip-lookup.php?ip={$memprofile['lastip']}">IPw</a> <a href="http://www.stopforumspam.com/ipcheck/{$memprofile['lastip']}"><font color="red">IPb</font></a></li>
<a href="modcp.php?action=ipsearch&amp;ipaddress={$memprofile['lastip']}&amp;search_users=1">Users w/ IP</a> | <a href="modcp.php?action=ipsearch&amp;ipaddress={$memprofile['lastip']}&amp;search_posts=1">Posts w/ IP</a> | <a href="modcp.php?action=ipsearch&amp;ipaddress={$memprofile['lastip']}&amp;search_users=1&amp;search_posts=1">Both</a> | <a href="modcp.php?action=iplookup&ipaddress={$memprofile['lastip']}" onclick="MyBB.popupWindow('{$mybb->settings['bburl']}/modcp.php?action=iplookup&ipaddress={$memprofile['lastip']}', 'iplookup', 500, 250); return false;">Brief IP info</a>
I copy/pasted this portion into my member_profile_modoptions template here, and it works as expected.
<a href="http://www.ip-tracker.org/locator/ip-lookup.php?ip={$memprofile['lastip']}">IPw</a> <a href="http://www.stopforumspam.com/ipcheck/{$memprofile['lastip']}"><font color="red">IPb</font></a>

also works with "https://www.ip-tracker.org/lookup.php?ip={$memprofile['lastip']}"

What is your complete member_profile_modoptions template?
<if $mybb->user['additionalgroups'] == 4 then> <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" width="100%" class="tborder">
<tr>
<td colspan="2" class="thead"><strong>{$lang->mod_options}</strong></td>
</tr>
<tr>
<td class="trow1">
<ul>
<li><a href="{$mybb->settings['bburl']}/modcp.php?action=editprofile&amp;uid={$uid}">{$lang->edit_in_mcp}</a></li>
<li><a href="{$mybb->settings['bburl']}/modcp.php?action=banuser&amp;uid={$uid}">{$lang->ban_in_mcp}</a></li><BR>
<li>Registration IP<BR>{$memprofile['regip']} <a href="http://www.ip-tracker.org/locator/ip-lookup.php?ip={$memprofile['regip']}">IPw</a> <a href="http://www.stopforumspam.com/ipcheck/{$memprofile['regip']}"><font color="red">IPb</font></a></li>
<a href="modcp.php?action=ipsearch&amp;ipaddress={$memprofile['regip']}&amp;search_users=1">Users w/ IP</a> | <a href="modcp.php?action=ipsearch&amp;ipaddress={$memprofile['regip']}&amp;search_posts=1">Posts w/ IP</a> | <a href="modcp.php?action=ipsearch&amp;ipaddress={$memprofile['regip']}&amp;search_users=1&amp;search_posts=1">Both</a> | <a href="modcp.php?action=iplookup&ipaddress={$memprofile['regip']}" onclick="MyBB.popupWindow('{$mybb->settings['bburl']}/modcp.php?action=iplookup&ipaddress={$memprofile['regip']}', 'iplookup', 500, 250); return false;">Brief IP info</a><BR><BR>
<li>Most Recent IP<BR>{$memprofile['lastip']} <a href="http://www.ip-tracker.org/locator/ip-lookup.php?ip={$memprofile['lastip']}">IPw</a> <a href="http://www.stopforumspam.com/ipcheck/{$memprofile['lastip']}"><font color="red">IPb</font></a></li>
<a href="modcp.php?action=ipsearch&amp;ipaddress={$memprofile['lastip']}&amp;search_users=1">Users w/ IP</a> | <a href="modcp.php?action=ipsearch&amp;ipaddress={$memprofile['lastip']}&amp;search_posts=1">Posts w/ IP</a> | <a href="modcp.php?action=ipsearch&amp;ipaddress={$memprofile['lastip']}&amp;search_users=1&amp;search_posts=1">Both</a> | <a href="modcp.php?action=iplookup&ipaddress={$memprofile['lastip']}" onclick="MyBB.popupWindow('{$mybb->settings['bburl']}/modcp.php?action=iplookup&ipaddress={$memprofile['lastip']}', 'iplookup', 500, 250); return false;">Brief IP info</a>

</ul>
</td>
</tr>
</table> </if>


<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" width="100%" class="tborder">
<tr>
<td colspan="2" class="thead"><strong>Notes for Staff</strong></td>
</tr><tr>
<td class="trow2"><BR><B><font color="red">
{$memprofile['usernotes']}</font></B><br /><br>
<a href="{$mybb->settings['bburl']}/modcp.php?action=editprofile&amp;uid={$uid}">{$lang->edit_usernotes}</a>
<BR>//end of Notes section
<BR><BR></td>
</tr></table><BR><BR>
Since I do not use the plugin for conditional PHP in templates, I copied your entire modoptions code except for the if /if statements.
The links work as expected.

[edit to add]
As superadmin, it works as expected.
I did not try as designated mod or admin with limited permissions.
Hmm. Any idea why its not populating an IP from a user? I can see the IP from a user on the backend going to Users/Groups, so its tracking it but just not populating on the front end for some reason. I just removed everything from modoptions and did just the code you gave, and tried the default theme and same result - no IP showing on front end/profile.

If I do a basic call to display the IP, it shows nothing.

<b>IP</b>{$memprofile['lastip']}
So I now have Conditionals in templates with no change in any function as superadmin.
I'm not sure what modcp.php/iplookup function returns out of the box because I've modded it to give me info from a subscription service.

I have changed my template to return the lookup info in two places for regip and lastip:

changed
<a href="modcp.php?action=iplookup&ipaddress={$memprofile['regip']}" onclick="MyBB.popupWindow('{$mybb->settings['bburl']}/modcp.php?action=iplookup&ipaddress={$memprofile['regip']}', 'iplookup', 500, 250); return false;">Brief IP info</a>
to
<a href="modcp.php?action=iplookup&ipaddress={$memprofile['regip']}" onclick="MyBB.popupWindow('/modcp.php?action=iplookup&ipaddress={$memprofile['regip']}&modal=1'); return false;">Brief IP info</a>

Mod for modcp.php is to add code somewhere around line 4042. Obviously you'd need to subscribe to get a valid key. They used to permit key=demo, but it was probably abused Wink.
And I suppose a plugin is preferable to some rather than editing core code. My core edits are manageable and always verified before upgrading my production server.
// add
        $api_result = @fetch_remote_file('https://api.ip2location.com/v2/?ip='.$mybb->input['ipaddress'].'&package=WS7&key=xxxxxxxxxx');
	$ipaddress_location = '';
        $each_line = explode(",", $api_result);
        for ($i=0;$i<count($each_line);$i++)  
        {
            $ipaddress_location .= $each_line[$i] . '<br>';
        }
        $api_result = @fetch_remote_file('https://api.ip2proxy.com/?ip='.$mybb->input['ipaddress'].'&package=PX2&key=xxxxxxxxxx');
        $each_line = explode(",", $api_result);
        for ($i=0;$i<count($each_line);$i++)  
        {
            $ipaddress_location .= $each_line[$i] . '<br>';
        }

// end add

Quote:Any idea why its not populating an IP from a user?

When browsing here, all links are populated with an IP.

(2022-08-01, 01:23 PM)fromdecember Wrote: [ -> ]If I do a basic call to display the IP, it shows nothing.

<b>IP</b>{$memprofile['lastip']}

Unless you have a plugin that modifies basic 1.8.30 behavior, there are 3 permissions in usergroups related to IPs: canviewonlineips, canmodcp, and canuseipsearch.

These use user/lastip and user/regip.
It's also not showing number of posts or threads in the member profile page.  I'm wondering if something didn't move over correctly during upgrade.... any idea where I should check besdies the member_profile template?
ACP / Templates and Style / Find Updated Templates
Since you recently upgraded, there will be a few.
For each one, Options / Diff Report will show the differences.
I installed a new theme, and reverted my other theme to original. I tried both and I still see the same issue. Reputation, post number, etc. display fine on usercp.php but show 0's on member.php page. And it's still not populating the IP either, but I see it being recorded on the ACP backend area.
I have verified my IP address is being logged. IP Search identifies my recent login.
You are using a Multi Login plugin. Can you point to the source?
It seems possible that $memprofile data is being pulled from an empty source.
What happens when that plugin is disabled?

If you grant ACP access, I can look without changing any settings.
Pages: 1 2