Snaip3Rs Posted June 7, 2009 Report Share Posted June 7, 2009 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.