Page 4 of 9

Re: [DEV] TULIP: Tiny User Locator by IP

Posted: Tue Oct 27, 2009 1:39 pm
by katib
Ok
I will try use the fuction_tulip.php file again, purging the cache,etc...
maybe you remember, that I am using the geoip function in functions.php file for Online user function
Probablly, this explain why ACP pages are checking for geoip files, thought it didnot display any flag

Re: [DEV] TULIP: Tiny User Locator by IP

Posted: Tue Oct 27, 2009 2:26 pm
by dpaanlka
katib wrote:Ok
I will try use the fuction_tulip.php file again, purging the cache,etc...
maybe you remember, that I am using the geoip function in functions.php file for Online user function
Probablly, this explain why ACP pages are checking for geoip files, thought it didnot display any flag
Remove the TULIP functions from functions.php, but keep the modifications to online user list function... then above the line edited for displaying flags in the online user list in functions.php, add this line:

Code: Select all

include_once($phpbb_root_path . 'includes/functions_tulip.php');
So the whole online user block should look like this:

Code: Select all

					include_once($phpbb_root_path . 'includes/functions_tulip.php');
					$user_online_link = '<img src="./flags/' . iptocountry($row['user_id']) . '.gif"> ' . get_username_string(($row['user_type'] <> USER_IGNORE) ? 'full' : 'no_profile', $row['user_id'], $row['username'], $row['user_colour']);
					$online_userlist .= ($online_userlist != '') ? ', ' . $user_online_link : $user_online_link;
Works on my demo board.

Re: [DEV] TULIP: Tiny User Locator by IP

Posted: Wed Oct 28, 2009 6:04 pm
by katib
Thanks
It is working proprely now with functions_tulip.php
But I had to include it earlier in fubnctions.php, just before:

Code: Select all

/**
* Check for read forums and update topic tracking info accordingly

Re: [DEV] TULIP: Tiny User Locator by IP

Posted: Wed Oct 28, 2009 7:03 pm
by Marcus Wendel
This nice mod appears to run fine and it was very easy to install but the problem is that it shows up with the UN flag (or a transparent image in my case) for all the members who signed up before we moved to phpBB3 and since two of my forums have been running phpBB since 2002 and one since 2004 that is a lot of users without flags.
Perhaps it would be possible to create a script to populate the registration ip-address with the one from the first post to correct this issue?

/Marcus

Re: [DEV] TULIP: Tiny User Locator by IP

Posted: Wed Oct 28, 2009 7:14 pm
by mtrs
Marcus Wendel wrote:Perhaps it would be possible to create a script to populate the registration ip-address with the one from the first post to correct this issue?
This post http://www.phpbb.com/community/viewtopi ... 5#p9474635 have a script to populate user_ip value with IPs from users' first post IP.

Re: [DEV] TULIP: Tiny User Locator by IP

Posted: Wed Oct 28, 2009 7:55 pm
by Marcus Wendel
mtrs wrote:
Marcus Wendel wrote:Perhaps it would be possible to create a script to populate the registration ip-address with the one from the first post to correct this issue?
This post http://www.phpbb.com/community/viewtopi ... 5#p9474635 have a script to populate user_ip value with IPs from users' first post IP.
Thanks but what does need to be changed in it to work within this mod instead of in the memberslist?

/Marcus

Re: [DEV] TULIP: Tiny User Locator by IP

Posted: Wed Oct 28, 2009 8:07 pm
by dpaanlka
Marcus Wendel wrote:
mtrs wrote:
Marcus Wendel wrote:Perhaps it would be possible to create a script to populate the registration ip-address with the one from the first post to correct this issue?
This post http://www.phpbb.com/community/viewtopi ... 5#p9474635 have a script to populate user_ip value with IPs from users' first post IP.
Thanks but what does need to be changed in it to work within this mod instead of in the memberslist?

/Marcus
That script checks for the existance of user_ip, and if it doens't exist, pulls the ip address directly from the user's first post in the board.

What should be done instead is, write a script to run once, checking all registered users in the users table for a mising user_ip, and if missing fill it in with that of their first post. Something like that shouldn't be too hard to write.

Then you just run it once and there won't be unnecessary lookups in the database every time a flag is generated. I can look into this a little bit later if nobody takes it up in the meantime.

EDIT: Or, this script could, upon finding a non-existant user_ip field, find the user_ip in this manner and then populate the database for future use.

Re: [DEV] TULIP: Tiny User Locator by IP

Posted: Wed Oct 28, 2009 8:14 pm
by Marcus Wendel
dpaanlka wrote:EDIT: Or, this script could, upon finding a non-existant user_ip field, find the user_ip in this manner and then populate the database for future use.
I think that would be the ideal solution, unfortunately I have no php coding skills so I hope someone can help with that.

/Marcus

Re: [DEV] TULIP: Tiny User Locator by IP

Posted: Wed Oct 28, 2009 8:29 pm
by mtrs
Marcus Wendel wrote:Thanks but what does need to be changed in it to work within this mod instead of in the memberslist?

/Marcus
Of course, you should prefer only a one time code run and update all users data. Having said that, the code, I gave a link of, is a simple example. It updates an unset IP number once the profile of a user is clicked. Database query is run only once.

Re: [DEV] TULIP: Tiny User Locator by IP

Posted: Thu Oct 29, 2009 9:41 am
by katib
Hi dpaanlka
dpaanlka wrote: Since installing it I've seen many interesting countries on my board, including China, Australia, Trinidad & Tobago, Thailand, Ukraine, Canada, Japan, the UK, and others! It's nice to see how international your board is!
Do you mean members or just guests ?
Anyway, how can I display flags of online guests too ?
like this board:
Image

Re: [DEV] TULIP: Tiny User Locator by IP

Posted: Thu Oct 29, 2009 3:07 pm
by dpaanlka
katib wrote:Hi dpaanlka
dpaanlka wrote: Since installing it I've seen many interesting countries on my board, including China, Australia, Trinidad & Tobago, Thailand, Ukraine, Canada, Japan, the UK, and others! It's nice to see how international your board is!
Do you mean members or just guests ?
Anyway, how can I display flags of online guests too ?
like this board:
Image
Is that part of phpBB? I can't find that anywhere.

Re: [DEV] TULIP: Tiny User Locator by IP

Posted: Thu Oct 29, 2009 5:22 pm
by 3Di
dpaanlka wrote:
katib wrote:Hi dpaanlka
dpaanlka wrote: Since installing it I've seen many interesting countries on my board, including China, Australia, Trinidad & Tobago, Thailand, Ukraine, Canada, Japan, the UK, and others! It's nice to see how international your board is!
Do you mean members or just guests ?
Anyway, how can I display flags of online guests too ?
like this board:
Image
Is that part of phpBB? I can't find that anywhere.
It is a part of my MOD: http://gold.io3di.com/index.php ;)

Re: [DEV] TULIP: Tiny User Locator by IP

Posted: Thu Oct 29, 2009 5:37 pm
by katib
3Di wrote: It is a part of my MOD: http://gold.io3di.com/index.php ;)
Yes you are right
However you did say here:
http://gold.io3di.com/viewtopic.php?p=684#p684
This version has been tested and runs only on phpBB 3.0.4 though.
So I wonder, is there any one still using 3.0.4 ?
By the way, Your board looks very nice ;)

Re: [DEV] TULIP: Tiny User Locator by IP

Posted: Thu Oct 29, 2009 5:38 pm
by dpaanlka
3Di wrote:
dpaanlka wrote:Is that part of phpBB? I can't find that anywhere.
It is a part of my MOD: http://gold.io3di.com/index.php ;)
Well then I guess I'll have to write it into my MOD. Just making sure it wasn't already part of phpBB.

I'm assuming phpBB maintains a list of the last IPs to have visited the board in the past however many minutes? If so this shouldn't be that hard to implement.

Re: [DEV] TULIP: Tiny User Locator by IP

Posted: Thu Oct 29, 2009 5:42 pm
by katib
dpaanlka wrote:Is that part of phpBB? I can't find that anywhere.
No, but a list of online guests along with theire IPs is availabe for Moderators and admins at:
yoursite.com/viewonline.php?sg=1