xoops forums

tatane

Just can't stay away
Posted on: 2011/8/18 14:43
tatane
tatane (Show more)
Just can't stay away
Posts: 649
Since: 2008/5/6 1
#1

Know the country of connected users

Hello
newbb in module, there is a feature that lets you know the IP address of the person who posted a message but also the place where it is located.

Here the function
<{if $topic_post.poster_ip}>
IP: <a href="http://www.whois.sc/<{$topic_post.poster_ip}>" target="_blank"><{$topic_post.poster_ip}></a>
<{/if}>


In the file misc.php there a function that lets you know the IP address of connected people, but not where it is.

I would therefore integrate the function of newbb file misc.php but my knowledge of PHP do not allow me to perform this action.

What do I edit the file?

Thank you in advance

andrey3761

XOOPS Translator
Posted on: 2011/8/18 15:54
andrey3761
andrey3761 (Show more)
XOOPS Translator
Posts: 234
Since: 2008/8/21
#2

Re: Know the country of connected users

Where to file misc.php?

tatane

Just can't stay away
Posted on: 2011/8/18 15:56
tatane
tatane (Show more)
Just can't stay away
Posts: 649
Since: 2008/5/6 1
#3

Re: Know the country of connected users

the root of xoops

tatane

Just can't stay away
Posted on: 2011/8/19 17:43
tatane
tatane (Show more)
Just can't stay away
Posts: 649
Since: 2008/5/6 1
#4

Re: Know the country of connected users

any ideas?

Mamba

Moderator
Posted on: 2011/8/19 19:55
Mamba
Mamba (Show more)
Moderator
Posts: 10770
Since: 2004/4/23
#5

Re: Know the country of connected users

You can probably replace the line in misc.php:

echo '<br />(' $onlineUsers[$i]['ip'] . ')';

with something like:

echo '<br />( <a href="http://www.whois.sc/'.$onlineUsers[$i]['ip'].' target="_blank">'.$onlineUsers[$i]['ip'].')</a> ';


XOOPS Spain has actually a nice solution, where they show the flag of the country based on the user IP - check out the "Conectados" block

Maybe the Core team can add something like this to 2.6 - you can submit a request to this thread
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

Tarik

Not too shy to talk
Posted on: 2011/8/19 20:16
Tarik
Tarik (Show more)
Not too shy to talk
Posts: 170
Since: 2010/2/3 1
#6

Re: Know the country of connected users

here is a snippet that contain a way to convert from ip to country and then have an array with countries and flags to wrap the thing up
http://www.daniweb.com/web-developmen ... s/45179/665560#post665560
Some people like what you do,
-- some people hate what you do,
---- but most people simply don’t give a damn.

tatane

Just can't stay away
Posted on: 2011/8/20 8:54
tatane
tatane (Show more)
Just can't stay away
Posts: 649
Since: 2008/5/6 1
#7

Re: Know the country of connected users

Quote:

Mamba wrote:
You can probably replace the line in misc.php:

echo '<br />(' $onlineUsers[$i]['ip'] . ')';

with something like:

echo '<br />( <a href="http://www.whois.sc/'.$onlineUsers[$i]['ip'].' target="_blank">'.$onlineUsers[$i]['ip'].')</a> ';




super, thank you mamba,is work

Quote:

Tarik:

here is a snippet that contain a way to convert from ip to country and then have an array with countries and flags to wrap the thing up
http://www.daniweb.com/web-developmen ... s/45179/665560#post665560


How to adapt it to xoops?

Peekay

XOOPS is my life!
Posted on: 2011/8/20 17:45
Peekay
Peekay (Show more)
XOOPS is my life!
Posts: 2335
Since: 2004/11/20
#8

Re: Know the country of connected users

The Xoops 'XM Memberstats' module already does (did) this for logged-in members.

To get the flags next to users names required the installer to import a 4MB 'ip-to-country' SQL file which could cause some MySQL timeout issues. You could however use the module without this feature by making a small change to the installer.
A thread is for life. Not just for Christmas.

tatane

Just can't stay away
Posted on: 2011/8/21 8:04
tatane
tatane (Show more)
Just can't stay away
Posts: 649
Since: 2008/5/6 1
#9

Re: Know the country of connected users

Quote:

Peekay wrote:
The Xoops 'XM Memberstats' module already does (did) this for logged-in members.

To get the flags next to users names required the installer to import a 4MB 'ip-to-country' SQL file which could cause some MySQL timeout issues. You could however use the module without this feature by making a small change to the installer.



I use this module only I would like the country flags are visible in the file misc.php between the member and the module

See example below

Resized Image


How to proceed?

deepak267

Quite a regular
Posted on: 2011/8/22 11:04
deepak267
deepak267 (Show more)
Quite a regular
Posts: 352
Since: 2008/8/15
#10

Re: Know the country of connected users

Mamba,

This is a good functionality, if its not too much to ask, can this be added to core (with an option to turn off)?

Deepak