Little Country Flags With Username In Online List

Started on the old forum in January 2008 · view the original in the archive · old links redirect here

2 replies · 908 views · started 18 years ago · 1 min read

3 participants
cortez Junior · 27 posts #1

i want to add this code in funmobile online list so plz help!!! CODE<? $IPaddress=$_SERVER['REMOTE_ADDR']; $two_letter_country_code=iptocountry($IPaddress);

include("IP_FILES/countries.php"); $three_letter_country_code=$countries[ $two_letter_country_code][0]; $country_name=$countries[$two_letter_country_code][1];

print "Two letters code: $two_letter_country_code "; print "Three letters code: $three_letter_country_code "; print "Country name: $country_name ";

function iptocountry($ip) { $numbers = preg_split( "/./", $ip); include("ip_files/".$numbers[0].".php"); $code=($numbers[0] * 16777216) + ($numbers[1] * 65536) + ($numbers[2] * 256) + ($numbers[3]); foreach($ranges as $key => $value){ if($key<=$code){ if($ranges[$key][0]>=$code){$two_letter_country_code=$ranges[$key][1];break;} } } if ($two_letter_country_code==""){$two_letter_country_code="unkown";} return $two_letter_country_code; } ?>

CODE}else if($action=="online") {

addonline(getuid_ses($ses),"Online List",""); if($mime== WEB) { echo webhead($uthm,$stitle); //////ALL LISTS SCRIPT <<

if($page=="" || $page<=0)$page=1;
$num_items = getnumonline(); //changable
$items_per_page= 10;
$num_pages = ceil($num_items/$items_per_page);
if($page>$num_pages)$page= $num_pages;
$limit_start = ($page-1)*$items_per_page;

//changable sql
$sql = "SELECT
        a.name, b.place, b.userid FROM ibwf_users a
        INNER JOIN ibwf_online b ON a.id = b.userid
        GROUP BY 1,2
        LIMIT $limit_start, $items_per_page
";

echo " "; $timeout = 180; $timeon = time()-$timeout; $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE perm>'0' AND lastact>'".$timeon."'")); echo "Staff Online: <a href="index.php?action=stfol&ses=$ses">".$noi[0]."</a>"; echo " "; echo " "; echo "

"; $items = mysql_query($sql); echo mysql_error(); while ($item = mysql_fetch_array($items)) { $lnk = "<a href="index.php?action=viewuser&who=$item[2]&ses=$ses">$item[0]</a>"; echo "$lnk - $item[1] "; } echo " "; echo " "; if($page>1) { $ppage = $page-1; echo "<a href="index.php?action=online&page=$ppage&ses=$ses">«PREV</a> "; } if($page<$num_pages) { $npage = $page+1; echo "<a href="index.php?action=online&page=$npage&ses=$ses">Next»</a>"; } echo " $page/$num_pages "; if($num_pages>2) { echo getjumper($mime,$action, $ses,"index"); } echo " "; ////// UNTILL HERE >>

echo " "; echo "<a href="index.php?action=main&ses=$ses"><img src="images/home.gif" alt="*"/>"; echo "Home</a>"; echo " "; echo webfoot();

}else{ echo waphead($stitle); //////ALL LISTS SCRIPT <<

if($page=="" || $page<=0)$page=1;
$num_items = getnumonline(); //changable
$items_per_page= 10;
$num_pages = ceil($num_items/$items_per_page);
if($page>$num_pages)$page= $num_pages;
$limit_start = ($page-1)*$items_per_page;

//changable sql
$sql = "SELECT
        a.name, b.place, b.userid FROM ibwf_users a
        INNER JOIN ibwf_online b ON a.id = b.userid
        GROUP BY 1,2
        LIMIT $limit_start, $items_per_page
";

echo " "; $timeout = 180; $timeon = time()-$timeout; $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE perm>'0' AND lastact>'".$timeon."'")); echo "Staff Online: <a href="index.php?action=stfol&ses=$ses">".$noi[0]."</a>"; echo " "; echo " "; echo "

"; $items = mysql_query($sql); echo mysql_error(); while ($item = mysql_fetch_array($items)) { $lnk = "<a href="index.php?action=viewuser&who=$item[2]&ses=$ses">$item[0]</a>"; echo "$lnk - $item[1] "; } echo " "; echo " "; if($page>1) { $ppage = $page-1; echo "<a href="index.php?action=online&page=$ppage&ses=$ses">«PREV</a> "; } if($page<$num_pages) { $npage = $page+1; echo "<a href="index.php?action=online&page=$npage&ses=$ses">Next»</a>"; } echo " $page/$num_pages "; if($num_pages>2) { echo getjumper($mime,$action, $ses,"index"); } echo " "; ////// UNTILL HERE >>

echo " "; echo "<a href="index.php?action=main&ses=$ses"><img src="images/home.gif" alt="*"/>"; echo "Home</a>"; echo " "; echo wapfoot();

}
WhiteWarrior Principal · 1,419 posts #3

ip2country is already posted on the forums, use the search and you'll find it... once you've found it read it then your know what to do.

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close