Jump to content

PHP - Online Players + Account's + Kingdom Allocation


Recommended Posts

Hello Guys,

 

Today i will release (mabe is already public) a system that count's Player's Online and Account's.

 

I have also make a system that counts Account's with kingbom allocation. 

 

It is like this:

 

6Yvtd.png
 
and the code:
 
Player's Online: 
<?PHP  
						$ip = $serverSettings['server_ip'];
                        $output = mysql_query("SELECT COUNT(*) as count FROM player.player WHERE DATE_SUB(NOW(), INTERVAL 10 MINUTE) < last_play;");
						$playerCount = mysql_fetch_array($output);
						?>
							<div class="allPlayers"><font size="4">Player's Online:</font>
								<span class="countHighlight"><font size="4"><?php echo $playerCount['count']+0;?></font></span>

 

 
<?php
	mysql_select_db("player");
	$query = mysql_query ("SELECT * FROM player_index");
	$num2 = mysql_num_rows($query);
	mysql_select_db("player"); 
	$exe = mysql_query("SELECT COUNT(*) as count FROM player WHERE DATE_SUB(NOW(), INTERVAL 10 MINUTE) < last_play;"); 
	$player_online = mysql_fetch_object($exe)->count;

	mysql_select_db("player");
	$rots = "SELECT * FROM player_index WHERE empire NOT LIKE '2%' and empire NOT LIKE '3%' and empire NOT LIKE '[%]%';";  
	$rotquery = mysql_query($rots);  
	$rotanzahl = mysql_num_rows($rotquery); 

	mysql_select_db("player");
	$gelbs = "SELECT * FROM player_index WHERE empire NOT LIKE '1%' and empire NOT LIKE '3%' and empire NOT LIKE '[%]%';";  
	$gelbquery = mysql_query($gelbs);  
	$gelbanzahl = mysql_num_rows($gelbquery); 

	mysql_select_db("player");
	$blaus = "SELECT * FROM player_index WHERE empire NOT LIKE '1%' and empire NOT LIKE '2%' and empire NOT LIKE '[%]%';";  
	$blauquery = mysql_query($blaus);  
	$blauanzahl = mysql_num_rows($blauquery); 
?>

</br>

<center>
<font color=#FFF><p style=text-align:center;border:none;background:none;margin-top:0px;margin-bottom:0px;><font color=#ff6a6a><font size="4">Account's:</font><font color=#FFF size="4"> <?php echo $num2;?><br><br></font>			
		<table style="border:1px #000 solid;width:60%;margin-bottom:0px;">
			<tr height="9">
			<?php
				echo "<td width="33.054178223629%"".$rotanzahl."& ".$rotanzahl." style="background: transparent url(img/bar1.png) left top repeat-x;"</td>";
				echo "<td width="33.594469764543%"".$gelbanzahl."% ".$gelbanzahl." style="background: transparent url(img/bar3.png) left top repeat-x;"</td>";
				echo "<td width="33.350130130375%"".$blauanzahl."% ".$blauanzahl." style="background: transparent url(img/bar2.png) left top repeat-x;"</td>";

				
				
			?>
			</tr>
		</table>

		<table style="border: none;width:60%;margin-top:0px;">
			<tr>	
				<td style="text-align:center;color:#fff;"><b><center><?php echo $rotanzahl;?></b></td></center>
				<td style="text-align:center;color:#fff;"><b><center><?php echo $gelbanzahl;?></b></td></center>
				<td style="text-align:center;color:#fff;"><b><center><?php echo $blauanzahl;?></b></td></center>
			</tr>
		</table>
</center>
		
		

If eny of you have any problem. I am free to help you!

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 1
  • Good 1
Link to comment
Share on other sites

  • Bronze

Hey...i had this code since 2009 too.. But u know..i dont care about what u say... it's a script to help guys who dont know even that...!

The problem is that its completely deprecated. If you want to share a script to help people (i think this is a good act) then recode it. Its not helpful when people use queries like this. Needless to put a strain on database.

Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.