Login   Register  
PHP Classes
elePHPant
Icontem

File: san-andreas-layout.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Bogdan Zarchievici  >  San Andreas - Multiplayer Server Query  >  san-andreas-layout.php  >  Download  
File: san-andreas-layout.php
Role: Auxiliary script
Content type: text/plain
Description: Layout for the example
Class: San Andreas - Multiplayer Server Query
Query information from a SA-MP game server
Author: By
Last change:
Date: 8 years ago
Size: 2,027 bytes
 

Contents

Class file image Download
<?

// ------------------------------------------------------------------
// SAN ANDREAS: MULTIPLAYER GAME SERVER QUERY CLASS
// ------------------------------------------------------------------
// Written by: Bogdan Zarchievici <opensource@creative-media.ro>
// Version: 1.0.0.a
// Revision: Thursday, Friday, May 19, 2006 at 5:46:45 PM
// ------------------------------------------------------------------
// Comments: works with any PHP version greater than 4.1.0.
// ------------------------------------------------------------------
// Special thanks to: Alexandru Burdulea and all of you who have been
// actively interested in the development of this class.
// ------------------------------------------------------------------
// For more details on MTA:SA please visit:
// http://www.sa-mp.com
// http://www.sa-mp.com/blog.php
// http://www.sanandreas.ro
// ------------------------------------------------------------------

error_reporting(E_ALL);
ini_set("max_execution_time",5);

function 
version($current,$required)
{ list(
$current[3],$current[2],$current[1])=split('[/.-]',$current);
  list(
$required[3],$required[2],$required[1])=split('[/.-]',$required);
  if (
$current[3]>$required[3]) return true;
  if (
$current[3]<$required[3]) return false;
  if (
$current[2]>$required[2]) return true;
  if (
$current[2]<$required[2]) return false;
  if (
$current[1]>=$required[1]) return true;
  return 
true; }

function 
call($class,$version)
{ if (
version($version,"4.1.0")) { if (!include($class.'.php')) die('Please copy the PHP class in the current directory.'); }
  else { die(
'Current PHP version ['.$version.'] is too low for this class. You need PHP 4.1.0 or greater.'); }}

call('san-andreas-class',PHP_VERSION);
$class=&new san_andreas($_GET['ip'],$_GET['port']);
$status=get_object_vars($class);

include(
'templates/classic.php');

// 2 templates are currently available:
// raw: displays the raw content returned by the PHP class;
// classic: all the data returned by the class is nicely put into tables;

?>