Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'SingleWebsiteUtils.php';
- class VariablesUtils extends SingleWebsiteUtils {
- var $serverName;
- var $serverIP;
- var $serverCount;
- var $serverPlayers;
- var $c;
- var $s;
- function __construct($serv) {
- global $c;
- global $sname;
- global $sip;
- global $scount;
- global $splayers;
- $this->serverCount = $scount;
- $this->serverIP = $sip;
- $this->serverName = $sname;
- $this->serverPlayers = $splayers;
- $this->c = $c;
- $this->s = $serv;
- }
- function setup($texte) {
- $texte = preg_replace_callback(
- "/\{SERVERNAME\}/si",
- function ($matches) {
- return $this->serverName;
- },
- $texte
- );
- $texte = preg_replace_callback(
- "/\{PLAYERCOUNT\}/si",
- function ($matches) {
- return $this->serverCount;
- },
- $texte
- );
- $texte = preg_replace_callback(
- "/\{SERVERIP\}/si",
- function ($matches) {
- return $this->serverIP;
- },
- $texte
- );
- $texte = preg_replace_callback(
- "/\{MENU\}/si",
- function ($matches) {
- $str = "";
- foreach($this->getMenu() as &$menu) {
- $str.= "<li><a href='".$menu[1]."'>".$menu[0]."</a></li>";
- }
- return $str;
- },
- $texte
- );
- //easy page loader.
- $texte = preg_replace_callback(
- "/\{PAGE_([0-9]+)\}/si",
- function ($matches) {
- $rt = preg_replace("/\{PAGE_/si", "", $matches[1]);
- $rt = preg_replace("/\}/si", "", $matches[1]);
- return $this->getPage($rt);
- },
- $texte
- );
- return $texte;
- //easy page loader.
- $texte = preg_replace_callback(
- "/\{TITLE_([0-9]+)\}/si",
- function ($matches) {
- $rt = preg_replace("/\{TITLE_/si", "", $matches[1]);
- $rt = preg_replace("/\}/si", "", $matches[1]);
- return $this->getPageTitle($rt);
- },
- $texte
- );
- return $texte;
- }
- function bbcode($texte) {
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement