4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: V@no on March 13, 2005, 11:00:43 PM
-
This mod will show country flags of your visitors in "Who's online?" in ACP (Admin Control Panel)
(http://img222.exs.cx/img222/4825/whois1ut.png)
--------- [ Installation ] ------------
Step 1
Visit the home page of the tools will be used in this mod:
http://www.maxmind.com/app/geoip_country
Read the licence and make sure its NOT conflicts with your usage.
Download the following files:
1) http://www.maxmind.com/download/geoip/api/php/geoip.inc
Save it in includes/ directory of your 4images installation
2) http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
Extract the content of this archive (u can use WinZIP, WinRAR, 7-Zip or any other archivers)
Save the extracted file (GeoIP.dat) into includes/ directory (make sure u keep the case: its GeoIP.dat not geoip.dat)
3) Download and extract flags.zip (#post_attachment) file from the attachment below.
Save the files into flags/ folder in your 4images root directory.
The attached GeoIP.20100809.zip file should only be used as a backup, only if provided download links no longer working, because it might be out of date.
Step 2
Open admin/home.php
Find:
$prev_ip = "";
Insert below:
/*
MOD VISITORS COUNTRY FLAGS
START INSERT
*/
if (!class_exists("GeoIP"))
{
include(ROOT_PATH."includes/geoip.inc");
}
$gi = geoip_open(ROOT_PATH."includes/GeoIP.dat",GEOIP_STANDARD);
$countries = array();
/*
MOD VISITORS COUNTRY FLAGS
END INSERT
*/
Step 2.1
Find:
echo "<td>".$username.$invisibleuser."</td>\n";
Insert above:
/*
MOD VISITORS COUNTRY FLAGS
START INSERT
*/
$cid = geoip_country_code_by_addr($gi, $row['session_ip']);
if (empty($cid)) $cid = "lan";
$countries[$cid] = isset($countries[$cid]) ? $countries[$cid]+1 : 1;
$username = "<img src=\"".ROOT_PATH."flags/".strtolower($cid).".gif"."\" alt=\"".(($cid != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$cid]] : "Unknown or LAN")."\" border=0> ".$username;
/*
MOD VISITORS COUNTRY FLAGS
END INSERT
*/
Step 2.2
Find:
echo "<td>".$lang['userlevel_guest']."</td>\n";
Replace with:
/*
MOD VISITORS COUNTRY FLAGS
ORIGINAL BLOCK:
echo "<td>".$lang['userlevel_guest']."</td>\n";
*/
/*
MOD VISITORS COUNTRY FLAGS
START REPLACE
*/
$cid = geoip_country_code_by_addr($gi, $row['session_ip']);
if (empty($cid)) $cid = "lan";
$countries[$cid] = isset($countries[$cid]) ? $countries[$cid]+1 : 1;
echo "<td><img src=\"".ROOT_PATH."flags/".strtolower($cid).".gif"."\" alt=\"".(($cid != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$cid]] : "Unknown or LAN")."\" border=0> ".$lang['userlevel_guest']."</td>\n";
/*
MOD VISITORS COUNTRY FLAGS
END REPLACE
*/
-
Great Mod. Thanks for this :D
-
Um, does this mod have something to do with the way you got the flags to be listed for whos currently online in the home page (not admin control panel)on your website?
Or did you somehow do that with pphlogger (Thank god I got that one before it was gone) 8O
-
Um, does this mod have something to do with the way you got the flags to be listed for whos currently online in the home page (not admin control panel)on your website?
yes, its based on this too. Maybe in time I'll post it too ;)
-
wonderful! I like that!
I guess I'll implement that tonight :)
Thank you V@no :D
-
Hello V@no
as i know the IP code is not fixed to a country! This only should work with IP.v6
vincent
-
Vincent, that's not really exact - a lot of IP's are assigned to an ISP ;) and this Internet Service Provider provides this internet service in a certain country ;)
if you check 83.148.16.15 (http://www.ripe.net/perl/whois/?searchtext=83.148.16.15) there's a 95 % chance that the user comes from the Czech Republic or if you'll search for 148.120.16.15 (http://www.ripe.net/perl/whois/?searchtext=148.120.16.15) it in 95 cases of 100 it could be a visitor from Norway...
8)
2 V@no: Great thing! It works fine. Thank you for this mod again :lol:
I'm looking forward to see your next mod :wink:
-
Hi there,
is there a way to see the flags on the whos_online.html ??????
-
is there a way to see the flags on the whos_online.html ?
sure :wink:
did you read through the posts?
Um, does this mod have something to do with the way you got the flags to be listed for whos currently online in the home page (not admin control panel)on your website?
yes, its based on this too. Maybe in time I'll post it too ;)
-
Thanks, i doesn“t read it. Now i wait..... :roll:
-
Hi I have installed this MOD but I think that this is not working right because this said that I am in japon :S and now I'm USA and The ips from Spain are not show with a spanish flag they are show as a LAN IP any of the ips correspond with the flag :cry: :cry: :cry: :? :? :? :?
(http://69.56.196.226/~ascanio/ips.jpg)
-
can u PM me with a few IPs from spain and your IP (which shows as Japan)?
-
of course :wink: I think that the ips are from spain :oops: but i am not sure, by the way where did u get those flags,they are awesome, the ones on your image
----------------------------------------------------
update
I have found the flags!!!
(http://www.hahn-hotel.com/flags/small/all/ca.png)(http://www.hahn-hotel.com/flags/small/all/us.png)
http://www.hahn-hotel.com/flags/zip/world.small.zip
-
by the way where did u get those flags,they are awesome, the ones on your image
tell u the truth - I dont remmember... :oops:
but I'm sure I googled them :D
-
I just send it to you the ips in a PM ;)
-
all the cool country flags that i see in google are shareware :(
-
Ok, I think I know what is wrong. Please redownload the first file:
http://www.maxmind.com/download/geoip/api/GeoIP_php-1.3/geoip.inc
by misstake I posted url to a wrong version...
I've updated original post. See if it works now.
-
Hey V@no I just upload the .dat file and now it works :lol: :lol: :lol: I think that the last time that I upload that file the transfer was not complete ... thanks for your help!
(http://69.56.196.226/~ascanio/ips2.jpg) :D :D :D
-
of course :wink: I think that the ips are from spain :oops: but i am not sure, by the way where did u get those flags,they are awesome, the ones on your image
----------------------------------------------------
update
I have found the flags!!! the icons are in .png but you can convert them with FastStone Photo Resizer is a great program and free
(http://www.hahn-hotel.com/flags/small/all/ca.png)(http://www.hahn-hotel.com/flags/small/all/us.png)
http://www.hahn-hotel.com/flags/zip/world.small.zip
-
I have found the flags!!! the icons are in .png but you can convert them with FastStone Photo Resizer is a great program and free
(http://www.hahn-hotel.com/flags/small/all/ca.png)(http://www.hahn-hotel.com/flags/small/all/us.png)
http://www.hahn-hotel.com/flags/zip/world.small.zip
your dont have to convert them, just edit the added code and replace .gif with .png ;)
-
yeah I knew that but I don“t know what file ...
-
home.php
-
Thanks V@no.
Awsome mod as usual...
(would be cool if you share the one for users online :) )
-
Thanks Dear "V@no"
That is an useful mod.
I need insert in user online list image flag with country name please help me !
Reza :wink:
-
i have a problem with this mod...
i followed all steps... but in amdin panel i got a blue tablerow nothing else
-
i have a problem with this mod...
i followed all steps... but in amdin panel i got a blue tablerow nothing else
mmm....no clue what could be wrong...maybe check permissions on new files...
also, if u could provide a screenshot - it might help ;)
-
hey V@no!
GREAT MOD good Work!
thanx b.o.fan
-
Very nice. Added it flawlessly and am eagerly waiting for the Who's Online version. :D
-
please answer the question ?
I need insert in user online list image flag with country name !
-
@ RezaSalmanzadeh:
please answer the question ?
I need insert in user online list image flag with country name !
V@no did already indirectly answer your question long time before you did post your answer 8O
Um, does this mod have something to do with the way you got the flags to be listed for whos currently online in the home page (not admin control panel)on your website?
yes, its based on this too. Maybe in time I'll post it too ;)
1) read through the whole topic before asking :o
2) be patient - V@no is doing answering a lot of questions daily and I guess he won't always answer the same question 2 times in one thread :wink:
-
Works perfect :D
V@no your the man :P hehe
-
Just Installed This Mod But Just In case Some else gets the white sqare image place holder instead of flag image check that the folder when unzipped is flags not flag as mine was :oops:
Great mod V@no any news on the homepage version being released??
-
hi v@no,
excellent MOD ... great work ... thanks ... :D
@cagedsmurf
take this : [MOD]country flags of your visitors in "Who's online?" in home page (http://www.4homepages.de/forum/index.php?topic=7831.0)
mawenzi
-
nice mod!!!
congratulations!
-
Dear V@no and Martrix,
I have read many times the thread, and some similar threads too,
but I didn't understand what I have to do for having flags with country name :oops:
Too many flags is difficult to understand what country represent each flag...
Maybe an IP -> Country translation or whatever helps ???
Please help, thank you in advance :)
---
-
When you roll your mouse cursor on a flag, it should show u as a "info baloon" what country is that.
-
Thank you very much for your answer dear V@no :)
Though, in the control panel, where the flags are showing,
not at the home page, I am not using the "Who is online" at the home page,
I get no baloons with country names...
I wish I have, this great option in the control panel...
Can you please tell me what I have to add in the script to have this option in the control panel "who is online" ?
-
I have used a fresh copy of home.php and I applied the mod from the beginning.
I have just change the home.php and change with updated versions the GeoIP.dat and the geoip.inc
Now I have a white picture with a red x on, instead of flags, but I have the country name!
Before I was having the flags without the country name!
If I replace the geoip.inc with my old one then I have no flag and no country name!
I wonder why the flags have dissapear...
The flags/ folder is still in my 4images root directory.
Any help please? :oops:
-
Please check if the flags are in the right category.
The best way is to right-click on the red x and see the properties for the path and compare it with the real path to your files.
-
:D Thank you for your answer martrix and for your very good tip:
The best way is to right-click on the red x and see the properties for the path and compare it with the real path to your files.
I found the solution :D, my flags are in .png file format and in the new instalation of the MOD I didn't change the the .gif to .png file format.
The script works GREAT!
Thank you very much!
---
-
nice mod
thanks for sharing
-
I need the flags 8O
http://www.maxmind.com/download/geoip/database/flag.zip
doesn“t work anymore...
-
read replys on second page ;)
And I just updated the original post
-
Oh, I“ve allready download this package - I haven“t looked into it cause I only saw these 2 flags from the post of ascanio :oops: sorry :oops:
-
Hi! I added this MOD to my page and it works fine. Nice MOD V@no 8)
During this installation I checked :idea: out the problem of
cr@za Sash
i have a problem with this mod...
i followed all steps... but in amdin panel i got a blue tablerow nothing else
(http://www.snuup.de/blue_table.jpg)
I think he doesn“t upload GeoIP.dat & geoip.inc to the "includes" folder...
-------------------------------------------------------------------------------------------------------
Anybody here who has installed this Mod on the "who is online index.php" :?:
-
when you press CTRL+A (which should select everything on the page), it should show you the "hidden" text in that blue area.
-
So we can take a look:
(http://www.snuup.de/4img_gfx/hidden_text.jpg)
That was the error...
Line 60 :arrow: admin/home.php
include(ROOT_PATH."includes/geoip.inc");
-
so, does includes/geoip.inc exists? did u check the case in the filename? (GeoIP.inc is not the same as geoip.inc)
-
Sorry I know, I only post this problem for Cr@zy Sash and people which have this problem too...
Edit: For those who have the question: Is it possible to add this mod to who_is_online.html
follow this link: http://www.4homepages.de/forum/index.php?topic=7831.0
-
This file cannot be found anymore.
http://www.maxmind.com/download/geoip/api/GeoIP_php-1.3/geoip.inc
can someone setup a mirror or tell me where i can find this file please?
-
I've updated the original post with this url:
http://www.maxmind.com/download/geoip/api/php/geoip.inc
-
Thanks V@no!
-
i installed this mod but it shows whos online totaly blank on admin CP can someone help me
-
awesome man nice MOD... i am soo happy
-
Ok, after reinstalling this mod on my 1.74 upgrade, I have the same problem in the control panel as the who is online on the home page mod.
I can see no countries for guest. If I am doing something wrong please let me know. It only shows flags for who is logged in.....
Anyone know what I am doing wrong?
T.I.A.
Robert
-
Is there any mode to show users with flags on the site instead of admin cp ?
-
@ashfaq
... there is a MOD ... :wink:
http://www.4homepages.de/forum/index.php?topic=7831.0
-
Thanks Dear for the link.
-
thanks @V@no
perfect mod
-
100% 1.7.6 tauglich
-
thanks millions :D :D :D
such a great MOD!
-
Hi was trying to get this work with 4images 1.7.6 it didnt work does any one know how to make it work this is what was happening when i was trying to get it to work
(http://img301.imageshack.us/img301/6144/dontworkrh2.jpg)
-
Works fine on V1.7.6
But i use some different download links:
Dat file: http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
Flags: http://flags.blogpotato.de/zip/small/world.zip
-
Works fine on V1.7.6
Flags: http://flags.blogpotato.de/zip/small/world.zip
In this case, the file-typ have to be changed (gif->png).
so search this:
/*
MOD VISITORS COUNTRY FLAGS
START INSERT
*/
$cid = geoip_country_code_by_addr($gi, $row['session_ip']);
if (empty($cid)) $cid = "lan";
$countries[$cid] = isset($countries[$cid]) ? $countries[$cid]+1 : 1;
$username = "<img src=\"".ROOT_PATH."flags/".strtolower($cid).".gif"."\" alt=\"".(($cid != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$cid]] : "Unknown or LAN")."\" border=0> ".$username;
/*
MOD VISITORS COUNTRY FLAGS
END INSERT
*/
and replace it with
/*
MOD VISITORS COUNTRY FLAGS
START INSERT
*/
$cid = geoip_country_code_by_addr($gi, $row['session_ip']);
if (empty($cid)) $cid = "lan";
$countries[$cid] = isset($countries[$cid]) ? $countries[$cid]+1 : 1;
$username = "<img src=\"".ROOT_PATH."flags/".strtolower($cid).".png"."\" alt=\"".(($cid != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$cid]] : "Unknown or LAN")."\" border=0> ".$username;
/*
MOD VISITORS COUNTRY FLAGS
END INSERT
*/
AND search:
/*
MOD VISITORS COUNTRY FLAGS
ORIGINAL BLOCK:
echo "<td>".$lang['userlevel_guest']."</td>\n";
*/
/*
MOD VISITORS COUNTRY FLAGS
START REPLACE
*/
$cid = geoip_country_code_by_addr($gi, $row['session_ip']);
if (empty($cid)) $cid = "lan";
$countries[$cid] = isset($countries[$cid]) ? $countries[$cid]+1 : 1;
echo "<td><img src=\"".ROOT_PATH."flags/".strtolower($cid).".png"."\" alt=\"".(($cid != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$cid]] : "Unknown or LAN")."\" border=0> ".$lang['userlevel_guest']."</td>\n";
/*
MOD VISITORS COUNTRY FLAGS
END REPLACE
*/
and replace with this
/*
MOD VISITORS COUNTRY FLAGS
ORIGINAL BLOCK:
echo "<td>".$lang['userlevel_guest']."</td>\n";
*/
/*
MOD VISITORS COUNTRY FLAGS
START REPLACE
*/
$cid = geoip_country_code_by_addr($gi, $row['session_ip']);
if (empty($cid)) $cid = "lan";
$countries[$cid] = isset($countries[$cid]) ? $countries[$cid]+1 : 1;
echo "<td><img src=\"".ROOT_PATH."flags/".strtolower($cid).".gif"."\" alt=\"".(($cid != "lan") ? $gi->GEOIP_COUNTRY_NAMES[$gi->GEOIP_COUNTRY_CODE_TO_NUMBER[$cid]] : "Unknown or LAN")."\" border=0> ".$lang['userlevel_guest']."</td>\n";
/*
MOD VISITORS COUNTRY FLAGS
END REPLACE
*/
-
HI,
Here I have a problem.. The Ips which are used by google bot usually displays as guest.. but it should display as Google-bot..
any idea how to do this ... ??
Thanks
-
@batu544
[MOD] Treat bots as users with less rights : http://www.4homepages.de/forum/index.php?topic=8752.0
-
Hello vano,
what do i save this link as sir, http://geolite.maxmind.com/download/geoip/api/php/geoip.inc (http://geolite.maxmind.com/download/geoip/api/php/geoip.inc)???
it comes as a page with php code inside it so what chould i save it as geoip.inc?
-
I've fixed the links, except for flags.zip...unfortunately I've lost the package, so if anyone still have it, please attach or supply a link to it.
Thanks.
@zakaria666:
Right click on the link and select "save as" (or similar) and yes, save it as geoip.inc
-
I've fixed the links, except for flags.zip...unfortunately I've lost the package, so if anyone still have it, please attach or supply a link to it.
Thanks.
http://www.4homepages.de/forum/index.php?topic=6709.msg138521#msg138521
-
@ Hagen Roderick,
Hi sir, he was talking about the flags. If cannot download other flags from else where because of the fact that it may not be the same as the one in the .dat file, so if anyone here still have the FLAG. ZIP? please upload it, please
thank u
-
@ Hagen Roderick,
Hi sir, he was talking about the flags. If cannot download other flags from else where because of the fact that it may not be the same as the one in the .dat file, so if anyone here still have the FLAG. ZIP? please upload it, please
thank u
The reply Hagen-Roderich showed contains a link to the flags.
I've attached the package with converted into .gif images to the original post. Thank you Hagen-Roderich.
-
my apologizes i should i seen it.
@ VANO,
I have done everything that u said but below is the problem im getting. What am i doing wrong sir
(http://i37.tinypic.com/2ynnk1w.jpg)
-
If it's a missing image, then find out what image it is and create a copy of gb.gif as this missing image
-
hello vano
i checked the flag file and its not missing the gb.gif, the gf.gif is still there and i dont know why its playing up. It may have to do with the geoip.inc file,
-
Die eu.gif fehlt in der Flag Datei. eu.zip (http://rapidshare.com/files/414221529/eu.zip)
-
Thanks to V@ano.
Work in 1.70 :D