Advertisement
Guest User

Untitled

a guest
May 30th, 2013
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.84 KB | None | 0 0
  1. <?php
  2.     // Credit to RainTPL.com for the Template Engine - I am simply adding features in a wrapper.
  3.     class LightTemplate extends RainTPL {
  4.         public function setBasicParameters() {
  5.             global $core, $users, $light;
  6.             $site_url = $light->site_url;
  7.             $this->assign('sitename', $light->site_name);
  8.             $this->assign('shortname', $light->site_short);
  9.             $this->assign('stat_fig', number_format($core->getServerStat('users_online')));
  10.             $this->assign('users_online', number_format($core->getServerStat('users_online')) . " user(s) online");
  11.             $this->assign('facebook', $light->facebook_account);
  12.             $this->assign('twitteraccount', $light->twitter_account);
  13.             $this->assign('cl', 0);
  14.             define('WWW', $light->site_url);
  15.             $this->assign('www', WWW);
  16.            
  17.             // Assign other vars
  18.             $this->assign('loginError', null);
  19.             $this->assign('greenTopText', "Join now");
  20.             $this->assign('greenBottomText', "For free!");
  21.             $this->assign('onlineBubbleText', "players online now");
  22.            
  23.             // Check for IP Ban before looking for user info
  24.             if($users->isIpBanned($_SERVER["REMOTE_ADDR"])) {
  25.                 header ("Location: " . WWW . "/banned");
  26.                 exit;
  27.             }
  28.             // Define site browsing variables
  29.             if($users->isLogged()){
  30.                 // Check for user ban instead of wasting db usage on vars
  31.                 if($users->isUserBanned($_SESSION["Username"])) {
  32.                     header ("Location: " . WWW . "/banned");
  33.                     exit;
  34.                 }
  35.                 $this->assign('Username', $_SESSION["Username"]);
  36.                 define("USERNAME", $_SESSION["Username"]);
  37.                 define("USER_RANK", $users->userVar(USERNAME, 'rank'));
  38.                 define("LOGGED", true);
  39.                 define("USER_ID", $users->userVar(USERNAME, 'id'));
  40.             }
  41.         }
  42.         public function tplError($text) {
  43.             echo '<center><font face="verdana" size="2"><b>Illumina CMS Template Engine Error</b><hr>' . $text . '</font></center>';
  44.             exit;
  45.         }
  46.     }
  47. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement