Advertisement
Guest User

global.php

a guest
Jan 14th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.55 KB | None | 0 0
  1. <?php
  2.     error_reporting(0);
  3.  
  4.     session_start();
  5.     function SacarIP(){
  6.         if($_SERVER){
  7.             if($_SERVER["HTTP_X_FORWARDED_FOR"]){
  8.                 $realip = $_SERVER["HTTP_X_FORWARDED_FOR"];
  9.             }elseif ($_SERVER["HTTP_CLIENT_IP"]){
  10.                 $realip = $_SERVER["HTTP_CLIENT_IP"];
  11.             }else{
  12.                 $realip = $_SERVER["REMOTE_ADDR"];
  13.             }
  14.         }else{
  15.             if(getenv("HTTP_X_FORWARDED_FOR")){
  16.                 $realip = getenv("HTTP_X_FORWARDED_FOR");
  17.             }elseif(getenv("HTTP_CLIENT_IP")){
  18.                 $realip = getenv("HTTP_CLIENT_IP");
  19.             }else{
  20.                 $realip = getenv("REMOTE_ADDR");
  21.             }
  22.         }
  23.         return $realip;
  24.     }
  25.     $realip = SacarIP();
  26.     define ( 'USER_IP', $realip );
  27.     define ( 'SEPARATOR', DIRECTORY_SEPARATOR );
  28.     define ( 'DIR', __DIR__ );
  29.     define ( 'WEB', true );
  30.     define ( 'YeezyCMS', true );
  31.    
  32.     define( 'CHARSET','UTF-8' );
  33.     header( 'Content-type: text/html; charset='.CHARSET );
  34.  
  35.     include( 'system/class.core.php' );
  36.    
  37.     $TplClass->SetParam( 'error', '' );
  38.    
  39.     $result = $db->query("SELECT * FROM cms_settings WHERE id = 1 LIMIT 1");
  40.     if($result->num_rows > 0){while($data = $result->fetch_array()){
  41.     $TplClass->SetParam( 'SHORTNAME', $data['hotelname'] );
  42.     $TplClass->SetParam( 'FACE', $data['facebook'] );
  43.     $TplClass->SetParam( 'IDPAYGOL', $data['id_paygol'] );
  44.     $TplClass->SetParam( 'LOGO', $data['logo'] );}}else{echo '<i>No se encuentra la tabla cms_settings</i>';}
  45.    
  46.     $TplClass->SetParam( 'PATH', PATH );
  47.     $TplClass->SetParam( 'PATHCLIENT', PATHCLIENT );
  48.     $TplClass->SetParam( 'BADGEURL', BADGEURL );
  49.     $TplClass->SetParam( 'CDN', CDN );
  50.     $TplClass->SetParam( 'HK', HK );
  51.     $TplClass->SetParam( 'CLUBNAME', CLUBNAME );
  52.     $TplClass->SetParam( 'ID', 'Yeezy V (Private) by Forbi — Based OneCMS');
  53.     $TplClass->SetParam( 'FOOTER', FOOTER );
  54.     $TplClass->SetParam( 'AVATARIMAGE', AVATARIMAGE );
  55.     $TplClass->SetParam( 'IDNT', '<img style="margin-bottom:-3px;" src="/gallery/images/icons/id.png">');
  56.     $TplClass->SetParam( 'MYNAME', $_SESSION['username'] );
  57.     $TplClass->SetParam( 'PORTADA', $_SESSION['cms_pbackground'] );
  58.     $TplClass->SetParam( 'FOTOP', $_SESSION['cms_pprofile'] );
  59.     $TplClass->SetParam( 'USERSON', $Functions->GetOns() );
  60.     $TplClass->SetParam( 'MYID', $Functions->GetID() );
  61.  
  62.     $resulta = $db->query("SELECT * FROM users WHERE cms_pbackground = '{$_SESSION['cms_pbackground']}' AND cms_pprofile = '{$_SESSION['cms_pprofile']}");
  63.     $resulta = $db->query("SELECT * FROM users WHERE username = '{$_SESSION['username']}' AND password = '{$_SESSION['password']}'");
  64.     while($lastc = $resulta->fetch_array()){ $TplClass->SetParam( 'LASTC', $Functions->GetLast($lastc['last_online']) );}
  65. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement