• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[GESIOR ACC] Server Informations on latestnews.php

Tapcioo

Faleria.eu - 2016
Joined
Jun 1, 2009
Messages
496
Reaction score
389
Location
Poland
Hello.^_^

I present to you my FIRST script in php.

It gives us the information and the server IP, port, about characters in a database, etc.

Author of script: Tapcioo

I think someone come in handy.

Okey go:

Open you latestnews.php

After:
Code:
<?php

Add:

Code:
$main_content = "
<script type=\"text/javascript\"><!--
function show_hide(flip)
{
	var tmp = document.getElementById(flip);
	if(tmp)
		tmp.style.display = tmp.style.display == 'none' ? '' : 'none';
}
--></script>";

Next search
Code:
$time = time();

Add:

Code:
//zapytania//
	$lua = parse_ini_file($config['site']['server_path'].'/config.lua');
	$ip = explode("*", $lua['ip']);
	$port = explode("*", $lua['loginPort']);
	$motd = explode("*", $lua['motd']);
	$accounts = $SQL->query('SELECT COUNT(*) FROM `accounts` WHERE `id`>0;')->fetch();
	$players = $SQL->query('SELECT COUNT(*) FROM `players` WHERE `id`>0;')->fetch();
	$guilds = $SQL->query('SELECT COUNT(*) FROM `guilds` WHERE `id`>0;')->fetch();
	//reszta//
	$main_content .= '<table BORDER=0 CELLPaDDING="4" CELLSPACING="1" width=100%;> 
		<TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD ALIGN=center CLASS=white><B>';
	$main_content .= "<a onclick=\"show_hide('statl'); return false;\" style=\"cursor: pointer;\">&raquo; View server information &laquo;</a></B></TD></TR></TABLE>";
	
	$main_content .= '<center><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=90% id="statl" style="display: none;" ><TR><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'>
		<tr bgcolor="'.$config['site']['darkborder'].'"><td>Server IP: '.$lua['ip'].'</li></td>
						<td>Accounts on '.$config['server']['serverName'].': '.$accounts[0].'</li></td></tr>
		
		<tr bgcolor="'.$config['site']['lightborder'].'"><td>Port: '.$lua['loginPort'].'</li></td>
	<td>Players on '.$config['server']['serverName'].': '.$players[0].'</li></td></tr>
			
		<tr bgcolor="'.$config['site']['darkborder'].'"><td>MOTD: '.$lua['motd'].'</li></td>
		    <td>Guilds on '.$config['server']['serverName'].': '.$guilds[0].'</center></td></tr>
		</table>
	</table>
	';
	
///dont delete this! 
$main_content .= '<div align="right"><small><b>Author: <a href="http://otland.net/members/tapcioo/">Tapcioo</a></b></small></div><br />';
//nie usuwaj tego!


Screen:

serverinfoq.jpg


///

Thanks and REP++
 
At the beginning of modeled this:)
But this is my first script, so I had to start from something that has already been, or is created.
 
Back
Top