[ABD] TULIP: Tiny User Locator by IP

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
User avatar
dpaanlka
Registered User
Posts: 286
Joined: Wed May 10, 2006 6:48 pm
Location: Chicago, USA
Contact:

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

Post by dpaanlka » Thu Oct 22, 2009 6:58 pm

FeuerSturm wrote:I'm running my webserver of a dedicated linux box, made all edits correctly
and I get the
Warning: fopen(includes/GeoIP.dat) [function.fopen]: failed to open stream: No such file or directory in /var/www/vhosts/realismrecon.net/httpdocs/includes/geoip.inc on line 314
Can not open includes/GeoIP.dat
as well after adding the flags to the online users.
You say this problem only occurs when you add the flags to the online users list? I'm having trouble reproducing what you guys are seeing on my development board, which is otherwise an unmodified installation of phpBB 3.0.5 :shock:

EDIT: Ah, here's one thing that I might have messed up. In functions.php, change both instances of this line:

Code: Select all

include_once("{$phpbb_root_path}geoip.inc");
To this:

Code: Select all

include_once("{$phpbb_root_path}includes/geoip.inc");
The first one is trying to access geoip.inc on the root level of your site, rather than inside the includes/ directory.

Does that fix anything for anybody?
phpBB user and evangelist since 2005.
My boards: Info-Mac | System 7 Today

User avatar
katib
Registered User
Posts: 562
Joined: Thu Jun 26, 2008 12:27 pm

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

Post by katib » Thu Oct 22, 2009 7:44 pm

To help you troubleshot the problem, please not that you Mod is working fine even with

Code: Select all

include_once("geoip.inc");
$gi = geoip_open("./includes/GeoIP.dat",GEOIP_STANDARD);
The problem only ocures if you try to access the Admninstation Control Panel
I noticed that the path is relative
so instead of searching GeoIP.dat at /root/includes/, it tries to look for it at /root/adm/includes/

The so called missing file is GeoIP.dat not geoip.inc

User avatar
dpaanlka
Registered User
Posts: 286
Joined: Wed May 10, 2006 6:48 pm
Location: Chicago, USA
Contact:

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

Post by dpaanlka » Thu Oct 22, 2009 8:27 pm

katib wrote:To help you troubleshot the problem, please not that you Mod is working fine even with

Code: Select all

include_once("geoip.inc");
$gi = geoip_open("./includes/GeoIP.dat",GEOIP_STANDARD);
The problem only ocures if you try to access the Admninstation Control Panel
I noticed that the path is relative
so instead of searching GeoIP.dat at /root/includes/, it tries to look for it at /root/adm/includes/

The so called missing file is GeoIP.dat not geoip.inc
Alright, thanks for that tip. I'm going to continue to look at this. It looks like the error is being generated by geoip.inc, when that script tries to access GeoIP.dat. So the culprit, I think, is this line:

Code: Select all

$gi = geoip_open("./includes/GeoIP.dat",GEOIP_STANDARD);
So, there has to be some way to make that not relative. The solution may be to edit the line in geoip.inc, but I'm hesitant to do that becuase geoip.inc is a pre-made script provided by MaxMind to use their information stored in GeoIP.dat.

$gi = geoip_open("./includes/GeoIP.dat",GEOIP_STANDARD); is passing a path to the geoip_open function inside the geoip.inc file. So, maybe something like this would work:

Code: Select all

$gi = geoip_open($phpbb_root_path . "includes/GeoIP.dat",GEOIP_STANDARD);
I'll try out some more combinations and report my findings here.

Also, though, I have to say that I'm not getting this error at all. I'm accessing my Administration Control Panel just fine with the MOD instructions in the original post. It's hard to troubleshoot when I can't repeat the problem. The only difference I see between you and I is that you're on a Windows server.
phpBB user and evangelist since 2005.
My boards: Info-Mac | System 7 Today

Vallkas
Registered User
Posts: 9
Joined: Thu Sep 18, 2008 5:20 am

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

Post by Vallkas » Thu Oct 22, 2009 9:03 pm

dpaanlka thank you very much for the help, works great :D

Greetings

User avatar
katib
Registered User
Posts: 562
Joined: Thu Jun 26, 2008 12:27 pm

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

Post by katib » Thu Oct 22, 2009 10:01 pm

dpaanlka wrote:The only difference I see between you and I is that you're on a Windows server.
Yes, my local server is on windows machine
But my live, online board is on linux server(Debian) and I have got the same problem !!

User avatar
katib
Registered User
Posts: 562
Joined: Thu Jun 26, 2008 12:27 pm

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

Post by katib » Fri Oct 23, 2009 2:16 pm

I am a total newbie :oops:
But I would suggget to move the code from functions.php to aother file to reduce server load
If I need flag on index_body.html page, I will put it in index.php
If I need it in veiwtopic_body.html , then I will add it to viewtopic.php and so on

User avatar
dpaanlka
Registered User
Posts: 286
Joined: Wed May 10, 2006 6:48 pm
Location: Chicago, USA
Contact:

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

Post by dpaanlka » Fri Oct 23, 2009 2:20 pm

katib wrote:I am a total newbie :oops:
But I would suggget to move the code from functions.php to aother file to reduce server load
If I need flag on index_body.html page, I will put it in index.php
If I need it in veiwtopic_body.html , then I will add it to viewtopic.php and so on
Yeah, I was thinking about doing that and couldn't decide whether or not I wanted to. It would simply be an include you'd have to add to any page you wanted flags on.
phpBB user and evangelist since 2005.
My boards: Info-Mac | System 7 Today

User avatar
katib
Registered User
Posts: 562
Joined: Thu Jun 26, 2008 12:27 pm

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

Post by katib » Sun Oct 25, 2009 1:24 pm

I run into a small problem
How to assign a country flag to BOTS !!
all bots have a non existant image file called ".gif"
you can see it in the followin source code from my board

Code: Select all

 <img src="./flags/.gif"> <span style="color: #9E8DA7;" class="username-coloured">Google [Bot]</span>, <img src="./flags/.gif"> <span style="color: #9E8DA7;" class="username-coloured">Google Adsense [Bot]</span>, <img src="./flags/.gif"> <span style="color: #9E8DA7;" class="username-coloured">Google Desktop</span>, <img src="./flags/MA.gif"> <a href="http://xxxx" style="color: #009966;" class="username-coloured">Admin</a>, <img src="./flags/MA.gif">

User avatar
dpaanlka
Registered User
Posts: 286
Joined: Wed May 10, 2006 6:48 pm
Location: Chicago, USA
Contact:

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

Post by dpaanlka » Sun Oct 25, 2009 2:43 pm

katib wrote:I run into a small problem
How to assign a country flag to BOTS !!
Great question. I'll address this in my next update. Right now I'm working on moving all TULIP code to it's own php file called functions_tulip.php. I'll add a check for this as well.

Should be up today sometime.
phpBB user and evangelist since 2005.
My boards: Info-Mac | System 7 Today

User avatar
katib
Registered User
Posts: 562
Joined: Thu Jun 26, 2008 12:27 pm

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

Post by katib » Sun Oct 25, 2009 10:35 pm

Thanks for reply
if you look at the following user's online screenshot, you will notice that bots looks ugly without an associated image

Image

User avatar
dpaanlka
Registered User
Posts: 286
Joined: Wed May 10, 2006 6:48 pm
Location: Chicago, USA
Contact:

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

Post by dpaanlka » Mon Oct 26, 2009 12:49 am

Katib: here is a new version of TULIP. Remove the mods you made to functions.php, and then download this file:

http://www.danpalka.com/phpbb/download/file.php?id=3

Copy functions_tulip.php to your includes folder.

Inside any php file you want to include flags in, you'll have to include functions_tulip.php, like so:

Code: Select all

include($phpbb_root_path . 'includes/functions_tulip.' . $phpEx);
You will place this toward the top just underneath the similar include lines.

Template changes are the same. This new version will also now show a United Nations flag for BOTs and stuff. Or at least, should... let me know?

I will edit this thread's first post shortly.
phpBB user and evangelist since 2005.
My boards: Info-Mac | System 7 Today

User avatar
katib
Registered User
Posts: 562
Joined: Thu Jun 26, 2008 12:27 pm

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

Post by katib » Mon Oct 26, 2009 2:41 pm

Thanks
Now it gives me the following error:

Code: Select all

Parse error: parse error in K:\xampplite\htdocs\bb\includes\functions_tulip.php on line 10
This is the line 10

Code: Select all

   global $db;

User avatar
dpaanlka
Registered User
Posts: 286
Joined: Wed May 10, 2006 6:48 pm
Location: Chicago, USA
Contact:

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

Post by dpaanlka » Mon Oct 26, 2009 3:32 pm

katib wrote:Thanks
Now it gives me the following error:

Code: Select all

Parse error: parse error in K:\xampplite\htdocs\bb\includes\functions_tulip.php on line 10
This is the line 10

Code: Select all

   global $db;
Woops, some simple code errors on my part.

Try now:

http://www.danpalka.com/phpbb/download/file.php?id=4

Replace your functions_tulip.php with that one.

Be sure to let me know what happens to your IP-less bots. My bots are hidden so I haven't been able to test my new edits.

For everyone else, I've now updated the front page to reflect the new way this MOD is installed. If you've installed the previous versions, please update.
phpBB user and evangelist since 2005.
My boards: Info-Mac | System 7 Today

User avatar
katib
Registered User
Posts: 562
Joined: Thu Jun 26, 2008 12:27 pm

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

Post by katib » Mon Oct 26, 2009 10:12 pm

Worked great :D
Thanks
Now Bots have own UN flag, you can see Mod in action at bottom page of http://hijaj.net
But there was a problem:
If I log into ACP, it complains about two missing files instead of one: geoip.dat and geoip.inc
I had to put them again into /root/adm/includes/

I had also anothr problem: If I try to access veiwtopic page, it gives blank page
I have puuted

Code: Select all

include($phpbb_root_path . 'includes/functions_tulip.' . $phpEx);
without success

So I ended copying the content of fuction_tulip.php into functions.php
Now it works

User avatar
dpaanlka
Registered User
Posts: 286
Joined: Wed May 10, 2006 6:48 pm
Location: Chicago, USA
Contact:

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

Post by dpaanlka » Mon Oct 26, 2009 10:15 pm

katib wrote:So I ended copying the content of fuction_tulip.php into functions.php
Now it works
OK, something is still wrong there. Wasn't the original problem the fact that all the code was stored in a modified functions.php, thus being accessed improperly by pages that didn't display flags (such as the ACP)? When you installed the new functions_tulip.php, you have to be sure to remove all the TULIP modifications from functions.php. If ACP doesn't have any includes to the new functions_tulip.php file, then there isn't any reason it should be accessing GeoIP.dat or geoip.inc. Perhaps functions.php was still cached for the ACP?

Try removing all TULIP mods, accessing the ACP, purging the cache, and re-installing again. I understand it's working for you now, but I'd really prefer to know what was causing that problem and to have it working on your board in the correct way! :D

Also, I noticed that one of your logged in users has the UN flag also. This may be due to an outdated GeoIP.dat file. If you have the one installed from the earlier version of this MOD, it is from August 2009. The new zip file your'e downloading that includes functions_tulip.php also includes October's updated GeoIP.dat file. Try replacing your dat file with this new one. If that doesn't work, you can manually change that user's country per the instructions in the FAQ of the first post.
phpBB user and evangelist since 2005.
My boards: Info-Mac | System 7 Today

Locked

Return to “[3.0.x] Abandoned MODs”