Jump to content
php.lv forumi

online for no kadas valsts. palīdziet.


Snaip3Rs

Recommended Posts

Te es atradu vienu kodu bet man nevajag viņu visu man tik vajaglai online scriptā klāt useriem kreisajā pusē parādās karodziņš no kuras valsts viņš nāk!

 

<?php

###############################
#   http://raivis.tk		  #
#   filename: Location.php	#
###############################

require("ip2country.php"); #http://paste.php.lv/1415

//		print "Client IP:	   ".$myCliInf->getClientIP()."<br>";
//		print "Client Hostname: ".$myCliInf->getClientHostname()."<br>";
//		print "Client Country:  ".$myCliInf->getClientCountry()."<br>";
//		print "Client Flag: ".$myCliInf->getClientFlag(SMALL)."<br>";
//		print "Client Flag: ".$myCliInf->getClientFlagHTML(SMALL)."<br>";
#		 try with SMALL or BIG to change the size of the flag</a>

$myCliInf = new ClientInfo;
if ($myCliInf->getClientCountry()) {
print "You are from  <b>".$myCliInf->getClientCountry()."</b>.";
} else {
 print "unknow";
}
?>

 

Un lūkur šim kodam vajag piemontēt klāt useriem kreisajā pusē lai rāda valsts karogu no kuras nākuši.

<?
 $db=(object)array(
'host'=>'localhost', // Datubazes hosts
'user'=>'jzvac', // Datubazes lietotajs
'pass'=>'1991jz', // Datubazes lietotaja parole
'name'=>'jzvac', // Datubazes nosaukums
'prefix'=>'ibf_members', // Bla, bla
  );

 $cfg=(object)array(
'offset'=>5, // Minutes kops pedejas aktivitates
 );

 @mysql_connect($db->host,$db->user,$db->pass)or die('Konekcija nospraga!');
 @mysql_select_db($db->name)or die('Datubazi ieselektet neizdevas!');

 $now=time();
 $offset=$cfg->offset*200;
 $activity=$now-$offset;
$reg = mysql_query("SELECT * FROM ibf_members");
$reg = mysql_num_rows($reg);
$delay = "900";
$delay = time() - $delay;
$useri = mysql_query("SELECT * FROM ibf_sessions WHERE member_id != '0' and running_time >= ".$delay."");
$regon = mysql_num_rows($useri);
$viesi = mysql_query("SELECT * FROM ibf_sessions WHERE member_id = '0' and running_time >= ".$delay."");
$viesi = mysql_num_rows($viesi);
$kopa = $regon + $viesi;
echo '
Onlaina: '.$kopa.'<br />
Useri: '.$regon.'<br />
Viesi: '.$viesi.'<br />
Registrejusies: '.$reg.'<br />
<hr style="margin:2px 0;"/>
';
while ($users = mysql_fetch_array($useri)){
$group = $users['member_group'];
$q = mysql_query("SELECT * FROM ibf_groups WHERE g_id = '$group'");
while($group = mysql_fetch_array($q)){
if(empty($group['prefix'])){
$prefix = "<span style=\"color:black\">";
$suffix = "</span>";
}
else{
$prefix = $group['prefix'];
$suffix = $group['suffix'];
}
echo "<a href='forums/index.php?showuser=".$users['member_id']."' title='".$users['member_name']."'>".$prefix."".$users['member_name']."".$suffix."</a><br />";
}
}
?>

 

Lūdzu kas māk lai pamēģina salikt!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...