1
tatane
Know the country of connected users
  • 2011/8/18 14:43

  • tatane

  • Just can't stay away

  • Posts: 649

  • Since: 2008/5/6 1


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

2
andrey3761
Re: Know the country of connected users

Where to file misc.php?

3
tatane
Re: Know the country of connected users
  • 2011/8/18 15:56

  • tatane

  • Just can't stay away

  • Posts: 649

  • Since: 2008/5/6 1


the root of xoops

4
tatane
Re: Know the country of connected users
  • 2011/8/19 17:43

  • tatane

  • Just can't stay away

  • Posts: 649

  • Since: 2008/5/6 1


any ideas?

5
Mamba
Re: Know the country of connected users
  • 2011/8/19 19:55

  • Mamba

  • Moderator

  • Posts: 11378

  • Since: 2004/4/23


You can probably replace the line in misc.php:

echo '(' $onlineUsers[$i]['ip'] . ')';

with something like:

echo '.$onlineUsers[$i]['ip'].' target="_blank">'.$onlineUsers[$i]['ip'].') ';


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

6
Tarik
Re: Know the country of connected users
  • 2011/8/19 20:16

  • Tarik

  • Not too shy to talk

  • Posts: 170

  • Since: 2010/2/3 1


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-development/php/threads/45179/665560#post665560
Some people like what you do,
-- some people hate what you do,
---- but most people simply don’t give a damn.

7
tatane
Re: Know the country of connected users
  • 2011/8/20 8:54

  • tatane

  • Just can't stay away

  • Posts: 649

  • Since: 2008/5/6 1


Quote:

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

echo '(' $onlineUsers[$i]['ip'] . ')';

with something like:

echo '.$onlineUsers[$i]['ip'].' target="_blank">'.$onlineUsers[$i]['ip'].') ';




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-development/php/threads/45179/665560#post665560


How to adapt it to xoops?

8
Peekay
Re: Know the country of connected users
  • 2011/8/20 17:45

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


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.

9
tatane
Re: Know the country of connected users
  • 2011/8/21 8:04

  • tatane

  • Just can't stay away

  • Posts: 649

  • Since: 2008/5/6 1


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?

10
deepak267
Re: Know the country of connected users
  • 2011/8/22 11:04

  • deepak267

  • Quite a regular

  • Posts: 352

  • Since: 2008/8/15


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


Login

Who's Online

380 user(s) are online (154 user(s) are browsing Support Forums)


Members: 0


Guests: 380


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits