daily pastebin goal
11%
SHARE
TWEET

Untitled

a guest Sep 24th, 2016 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. define("IN_HOLOCMS", TRUE);
  4.  
  5. session_start();
  6.  
  7.             $sqlhostname = "localhost";
  8.             $sqlusername = "root";
  9.             $sqlpassword = "giuseppe1";
  10.             $sqldb = "laix";
  11.  
  12.             $path = "http://localhost/";
  13.  
  14.             $enable_status_image = "0";
  15.             $sysadmin = "1";
  16.  
  17.             $cimagesurl = "/r64/c_images/";
  18.             $badgesurl = "/album1584/";
  19.  
  20.             $email_verify_reward = "900";
  21.  
  22. mysql_connect("$sqlhostname", "$sqlusername", "$sqlpassword")or die("<br><font size='2' face='Tahoma'><b>Errore del CMS:</b><br><em>Non Riesco a connettermi al database MySQL!</em></font>");
  23. mysql_select_db("$sqldb")or die("<br><font size='2' face='Tahoma'><b>Messaggio dal CMS</b><br><br>Non connesso al Database MySQL</font>");
  24.  
  25. $remote_ip = $_SERVER["HTTP_CF_CONNECTING_IP"];
  26. $configsql = mysql_query("SELECT * FROM cms_system LIMIT 1") or die(mysql_error());
  27. $config = mysql_fetch_assoc($configsql);
  28. $enable_sso = $config['enable_sso'];
  29. $language = $config['language'];
  30. $sitename = $config['sitename'];
  31. $shortname = $config['shortname'];
  32. $moneta = $config['moneta'];
  33. $slogan = $config['slogan'];
  34. $start_credits = $config['start_credits'];
  35. $ip = $config['ip'];
  36. $dcr = $config['dcr'];
  37. $link = $_SERVER['REQUEST_URI'];
  38. $port = FetchServerSetting('server_game_port');
  39. $fport = FetchServerSetting('server_mus_port');
  40. $texts = $config['texts'];
  41. $variables = $config['variables'];
  42. $reload_url = $config['reload_url'];
  43. $maintenance = $config['site_closed'];
  44. $H = date('H');
  45. $i = date('i');
  46. $s = date('s');
  47. $m = date('m');
  48. $d = date('d');
  49. $Y = date('Y');
  50. $j = date('j');
  51. $n = date('n');
  52. $today = $d;
  53. $month = $m;
  54. $year = $Y;
  55. $date_normal = date('d-m-Y',mktime($m,$d,$Y));
  56. $date_reversed = date('Y-m-d', mktime($m,$d,$y));
  57. $date_full = date('d-m-Y H:i:s',mktime($H,$i,$s,$m,$d,$Y));
  58. $date_time = date('H:i:s',mktime($H,$i,$s));
  59. $date_hc = "".$j."-".$n."-".$Y."";
  60. $regdate = $date_normal;
  61. $s1ql = mysql_query("SELECT * FROM server_status LIMIT 1");
  62. $r1ow = mysql_fetch_assoc($s1ql);
  63. $online_count = $r1ow['users_online'];
  64. $server_on_localhost = $config['localhost'];
  65. $habboversion = "63_1dc60c6d6ea6e089c6893ab4e0541ee0/2590";
  66. $forumid = FilterText($_GET['id']);
  67. $analytics = HoloText($config['analytics'], true)."\n";
  68.  
  69. function edit_date($data , $full = false)
  70. {
  71. $xbits = explode(" ", $data);
  72. $xdate = explode("-", $xbits[0]);
  73. $mesi = array('01' => 'gen', '02' => 'feb', '03' => 'mar', '04' => 'apr', '05' => 'mag', '06' => 'giu', '07' => 'lug', '08' => 'ago', '09' => 'set', '10' => 'ott' , '11' => 'nov', '12' => 'dic');
  74. if($full != true) { $data = "".$xdate[0]."-".strtr($xdate[1], $mesi)."-".$xdate[2].""; }else{ $data = "".$xdate[0]."-".strtr($xdate[1], $mesi)."-".$xdate[2]." ".$xbits[1].""; }
  75. return $data;
  76. }
  77.  
  78. function FetchServerSetting($strSetting, $switch = false){
  79.  
  80.     $tmp = mysql_query("SELECT sval FROM system_config WHERE skey = '".$strSetting."' LIMIT 1") or die(mysql_error());
  81.     $tmp = mysql_fetch_assoc($tmp);
  82.  
  83.     if($switch !== true){
  84.         return $tmp['sval'];
  85.     } elseif($switch == true && $tmp['sval'] == "1"){
  86.         return "Enabled";
  87.     } elseif($switch == true && $tmp['sval'] !== "1"){
  88.         return "Disabled";
  89.     }
  90.  
  91. }
  92. function getContent($strKey){
  93.  
  94.   $tmp = mysql_query("SELECT contentvalue FROM cms_content WHERE contentkey = '".FilterText($strKey)."' LIMIT 1") or die(mysql_error());
  95.  $tmp = mysql_fetch_assoc($tmp);
  96. return $tmp['contentvalue'];
  97.  
  98.  }
  99. function getServer($value, $switch = false){
  100.  
  101.     $sql = mysql_query("SELECT sval FROM system_config WHERE skey = '".$value."' LIMIT 1") or die(mysql_error());
  102.     $row = mysql_fetch_assoc($sql);
  103.  
  104.     if($switch !== true){
  105.         return $row['sval'];
  106.     } else if($switch && $row['sval'] == "1"){
  107.         return "Attivato";
  108.     } else if($switch && $row['sval'] !== "1"){
  109.         return "Disattivato";
  110.     }
  111.  
  112. }
  113.  
  114.  
  115.  
  116.  
  117. if(!session_is_registered(username) && $_COOKIE['remember'] == "remember"){
  118.  
  119.  
  120.     $cname = FilterText($_COOKIE['rusername']);
  121.     $cpass_hash = $_COOKIE['rpassword'];
  122.  
  123.  
  124.     $csql = mysql_query("SELECT password FROM users WHERE username = '".$cname."' LIMIT 1") or die(mysql_error());
  125.     $cnum = mysql_num_rows($csql);
  126.  
  127.          
  128.         if($cnum < 1){
  129.             setcookie("remember", "", time()-60*60*24*100, "/"); setcookie("cookpass", "", time()-60*60*24*100, "/");
  130.             setcookie("rusername", "", time()-60*60*24*100, "/"); setcookie("cookpass", "", time()-60*60*24*100, "/");
  131.             setcookie("rpassword", "", time()-60*60*24*100, "/"); setcookie("cookpass", "", time()-60*60*24*100, "/");
  132.         } else {
  133.  
  134.          
  135.             $crow = mysql_fetch_assoc($csql);
  136.             $correct_pass = $crow['password'];
  137.  
  138.            
  139.             if($cpass_hash == $correct_pass){
  140.                 $_SESSION['username'] = $cname;
  141.                 $_SESSION['password'] = $crow['password'];
  142.                 mysql_query("UPDATE users SET lastvisit = '".$date_full."' WHERE username = '" . $cname . "'") or die(mysql_error());
  143.                 header("Location: security_check.php");
  144.                 exit;
  145.             } else {
  146.                 setcookie("remember", "", time()-60*60*24*100, "/"); setcookie("cookpass", "", time()-60*60*24*100, "/");
  147.                 setcookie("rusername", "", time()-60*60*24*100, "/"); setcookie("cookpass", "", time()-60*60*24*100, "/");
  148.                 setcookie("rpassword", "", time()-60*60*24*100, "/"); setcookie("cookpass", "", time()-60*60*24*100, "/");
  149.             }
  150.  
  151.         }
  152.  
  153. }
  154.  
  155.  
  156.  
  157. function IsEven($intNumber)
  158. {
  159.     if($intNumber % 2 == 0){
  160.         return true;
  161.     } else {
  162.         return false;
  163.     }
  164. }
  165.  
  166.  
  167. function bbcode_format($str){
  168.  
  169.     if(HoloText(getContent('enable-smilies'), true) == "1"){
  170.         $str = str_replace(":)", " <img src='./web-gallery/smilies/smile.gif' alt='Smiley' title='Smiley' border='0'> ", $str);
  171.         $str = str_replace(";)", " <img src='./web-gallery/smilies/wink.gif' alt='Smiley' title='Smiley' border='0'> ", $str);
  172.         $str = str_replace(":P", " <img src='./web-gallery/smilies/tongue.gif' alt='Smiley' title='Smiley' border='0'> ", $str);
  173.         $str = str_replace(";P", " <img src='./web-gallery/smilies/winktongue.gif' alt='Smiley' title='Smiley' border='0'> ", $str);
  174.         $str = str_replace(":p", " <img src='./web-gallery/smilies/tongue.gif' alt='Smiley' title='Smiley' border='0'> ", $str);
  175.         $str = str_replace(";p", " <img src='./web-gallery/smilies/winktongue.gif' alt='Smiley' title='Smiley' border='0'> ", $str);
  176.         $str = str_replace("(L)", " <img src='./web-gallery/smilies/heart.gif' alt='Smiley' title='Smiley' border='0'> ", $str);
  177.         $str = str_replace("(l)", " <img src='./web-gallery/smilies/heart.gif' alt='Smiley' title='Smiley' border='0'> ", $str);
  178.         $str = str_replace(":o", " <img src='./web-gallery/smilies/shocked.gif' alt='Smiley' title='Smiley' border='0'> ", $str);
  179.         $str = str_replace(":O", " <img src='./web-gallery/smilies/shocked.gif' alt='Smiley' title='Smiley' border='0'> ", $str);
  180.     }
  181.  
  182.  
  183.     // Parse BB code
  184.         $simple_search = array(
  185.                                 '/\[b\](.*?)\[\/b\]/is',
  186.                                 '/\[i\](.*?)\[\/i\]/is',
  187.                                 '/\[u\](.*?)\[\/u\]/is',
  188.                                 '/\[s\](.*?)\[\/s\]/is',
  189.                                 '/\[quote\](.*?)\[\/quote\]/is',
  190.                                 '/\[link\=(.*?)\](.*?)\[\/link\]/is',
  191.                                 '/\[url\=(.*?)\](.*?)\[\/url\]/is',
  192.                                 '/\[color\=(.*?)\](.*?)\[\/color\]/is',
  193.                                 '/\[size=small\](.*?)\[\/size\]/is',
  194.                                 '/\[size=large\](.*?)\[\/size\]/is',
  195.                                 '/\[code\](.*?)\[\/code\]/is',
  196.                                 '/\[habbo\=(.*?)\](.*?)\[\/habbo\]/is',
  197.                                 '/\[room\=(.*?)\](.*?)\[\/room\]/is',
  198.                                 '/\[group\=(.*?)\](.*?)\[\/group\]/is',
  199.                 '/\[img\](.*?)\[\/img\]/is'
  200.                                 );
  201.  
  202.  
  203.         $simple_replace = array(
  204.                                 '<strong>$1</strong>',
  205.                                 '<em>$1</em>',
  206.                                 '<u>$1</u>',
  207.                                 '<s>$1</s>',
  208.                                 "<div class='bbcode-quote'>$1</div>",
  209.                                 "<a href='$1'>$2</a>",
  210.                                 "<a href='$1'>$2</a>",
  211.                                 "<font color='$1'>$2</font>",
  212.                                 "<font size='1'>$1</font>",
  213.                                 "<font size='3'>$1</font>",
  214.                                 '<pre>$1</pre>',
  215.                                 "<a href='./user_profile.php?id=$1'>$2</a>",
  216.                                 "<a onclick=\"roomForward(this, '$1', 'private'); return false;\" target=\"client\" href=\"./client.php?forwardId=2&roomId=$1\">$2</a>",
  217.                                 "<a href='./group_profile.php?id=$1'>$2</a>",
  218.                 "<img src='$1'/>"  
  219.                                 );
  220.  
  221.         $str = preg_replace ($simple_search, $simple_replace, $str);
  222.  
  223.         return $str;
  224. }
  225.  
  226.  
  227.  
  228. function GenerateTicket(){
  229.  
  230.     $data = "";
  231.  
  232.     for ($i=1; $i<=6; $i++){
  233.         $data = $data . rand(0,10);
  234.     }
  235.  
  236.     $data = $data . "";
  237.  
  238.     for ($i=1; $i<=20; $i++){
  239.         $data = $data . rand(0,10);
  240.     }
  241.  
  242.     $data = $data . "";
  243.     $data = $data . rand(0,10);
  244.  
  245.     return $data;
  246. }
  247.  
  248.  
  249. #
  250.  
  251. if(session_is_registered('username')){
  252.  
  253.     $rawname = $_SESSION['username'];
  254.     $rawpass = $_SESSION['password'];
  255.  
  256.     $usersql = mysql_query("SELECT * FROM users WHERE username = '".$rawname."' AND password = '".$rawpass."' LIMIT 1");
  257.     $myrow = mysql_fetch_assoc($usersql);
  258.  
  259.     $password_correct = mysql_num_rows($usersql);
  260.  
  261.     $my_id = $myrow['id'];
  262.     $user_rank = $myrow['rank'];
  263.  
  264.     $check = mysql_query("SELECT * FROM bans WHERE value = '".$rawname."'  LIMIT 1") or die(mysql_error());
  265.     $is_banned = mysql_num_rows($check);
  266.  
  267.     if($password_correct !== 1){
  268.  
  269.         session_destroy();
  270.         header("location:index.php?error=1");
  271.         exit;
  272.  
  273.     } elseif($is_banned > 0){
  274.  
  275.         $bandata = mysql_fetch_assoc($check);
  276.         $reason = $bandata['reason'];
  277.         $expire = $bandata['expire'];
  278.  
  279.          
  280.         if($is_banned > 0){
  281.  
  282.             $login_error = "Sei stato bannato per  \"" . $reason . "\". il tuo ban finisce " . $expire . ".";
  283.             include('logout.php');
  284.             session_destroy();
  285.             exit;
  286.  
  287.  
  288.  
  289.         }
  290.     }
  291.  
  292.     if($enable_sso == 1 && $password_correct == 1){
  293.  
  294.         $myticket = $myrow['auth_ticket'];
  295.  
  296.    
  297.  
  298.     } else {
  299.         $myticket = "";
  300.     }
  301.  
  302.     $logged_in = true;
  303.     $name = HoloText($myrow['username']);
  304.  
  305. } else {
  306.  
  307.     $user_rank = 0;
  308.     $name = "Visitatore";
  309.     $my_id = "GUEST";  
  310.     $logged_in = false;
  311.  
  312. }
  313.  
  314.  
  315.  
  316. if($enable_status_image == "1"){
  317.     if($server_on_localhost != 0 || $ip == "127.0.0.1"){
  318.         $fip = "127.0.0.1";
  319.     } else {
  320.         $fip = $ip;
  321.     }
  322.  
  323.     $fp = @fsockopen($fip, $fport, $errno, $errstr, 1);
  324.  
  325.     if($fp){
  326.         $online = "online";
  327.         fclose($fp);
  328.     } else {
  329.         $online = "offline";
  330.     }
  331. }else{
  332.     $online = "online";
  333. }
  334.  
  335.  
  336.  
  337. if($user_rank > 5){
  338.     if(session_is_registered(username) && session_is_registered(password)){
  339.         $rank['iAdmin'] = "1";
  340.     } else {
  341.         $rank['iAdmin'] = "0";
  342.     }
  343. } else {
  344.     $rank['iAdmin'] = "0";
  345. }
  346.  
  347.  
  348.  
  349. function GetUserBadge($strName){
  350.  
  351.     if(is_numeric($strName)){
  352.         $check = mysql_query("SELECT id FROM users WHERE id = '".$strName."' AND badge_status = '1' LIMIT 1") or die(mysql_error());
  353.     } else {
  354.         $check = mysql_query("SELECT id FROM users WHERE username = '".FilterText($strName)."' AND badge_status = '1' LIMIT 1") or die(mysql_error());
  355.     }
  356.  
  357.     $exists = mysql_num_rows($check);
  358.  
  359.         if($exists > 0){
  360.             $usrrow = mysql_fetch_assoc($check);
  361.             $check = mysql_query("SELECT * FROM user_badges WHERE user_id = '".$usrrow['id']."' AND badge_slot = '1' LIMIT 1") or die(mysql_error());
  362.             $hasbadge = mysql_num_rows($check);
  363.             if($hasbadge > 0){
  364.                 $badgerow = mysql_fetch_assoc($check);
  365.                 return $badgerow['badge_id'];
  366.             } else {
  367.                 return false;
  368.             }
  369.         } else {
  370.             return false;
  371.         }
  372. }
  373.  
  374.  
  375.  
  376. function GetUserGroup($my_id){
  377. $check = mysql_query("SELECT groupid FROM user_stats WHERE id = '".$my_id."' LIMIT 1") or die(mysql_error());
  378. $has_fave = mysql_num_rows($check);
  379.  
  380.  if($has_fave > 0){
  381.  
  382.   $row = mysql_fetch_assoc($check);
  383.   $groupid = $row['groupid'];
  384.  
  385.   return $groupid;
  386.  
  387.  } else {
  388.  
  389.   return false;
  390.  
  391.  }
  392. }
  393.  
  394.  function HoloHash($input = '')
  395.  {
  396.   return md5($input);
  397.  }
  398.  
  399. function GetUserGroupBadge($my_id){
  400. $check = mysql_query("SELECT groupid FROM user_stats WHERE id = '".$my_id."' LIMIT 1") or die(mysql_error());
  401. $has_badge = mysql_num_rows($check);
  402.  
  403.     if($has_badge > 0){
  404.  
  405.         $row = mysql_fetch_assoc($check);
  406.         $groupid = $row['groupid'];
  407.  
  408.         $check = mysql_query("SELECT badge FROM groups WHERE id = '".$groupid."' LIMIT 1") or die(mysql_error());
  409.  
  410.         $row = mysql_fetch_assoc($check);
  411.         $badge = $row['badge'];
  412.  
  413.         return $badge;
  414.  
  415.     } else {
  416.  
  417.         return false;
  418.  
  419.     }
  420. }
  421.  
  422.  
  423.  
  424. function SendMUS($header, $data){
  425.     $ip = "127.0.0.1";
  426.     $port = 30001;
  427.     $musData = $header . chr(1) . $data;
  428.     $sock = @socket_create(AF_INET, SOCK_STREAM, getprotobyname('tcp'));
  429.     @socket_connect($sock, $ip, $port);
  430.     @socket_send($sock, $musData, strlen($musData), MSG_DONTROUTE);
  431.     @socket_close($sock);
  432. }
  433.  
  434.  
  435. function HCDaysLeft($my_id){
  436.  
  437.    
  438.     $sql = mysql_query("SELECT months_left,date_monthstarted FROM users_club WHERE userid = '".$my_id."' LIMIT 1") or die(mysql_error());
  439.     $tmp = mysql_fetch_assoc($sql);
  440.     $valid = mysql_num_rows($sql);
  441.  
  442.     if($valid > 0){
  443.  
  444.        
  445.         $months_left = $tmp['months_left'];
  446.         $month_started = $tmp['date_monthstarted'];
  447.         $days_left = $months_left * 31;
  448.         $tmp = explode("-", $month_started);
  449.         $day = $tmp[0];
  450.         $month = $tmp[1];
  451.         $year = $tmp[2];
  452.         $then = mktime(0, 0, 0, $month, $day, $year, 0);
  453.         $now = time();
  454.         $difference = $now - $then;
  455.         if ($difference < 0){
  456.             $difference = 0;
  457.         }
  458.  
  459.  
  460.         $days_expired = floor($difference/60/60/24);  
  461.         $days_left = $days_left - $days_expired;
  462.  
  463.         return $days_left;
  464.  
  465.     } else {
  466.         return 0;
  467.     }
  468. }
  469.  
  470.  
  471.  
  472. if($maintenance == "1" && !$is_maintenance && $rank['iAdmin'] < 1 && $page !== "manu"){
  473.     header("Location: ".$path."manutenzione.php");
  474.     exit;
  475. } elseif($rank['iAdmin'] == 1 && $maintenance == 1){
  476.     $notify_maintenance = true;
  477. }
  478.  
  479.  
  480.  
  481. function AddUser($username = '', $real_name = '', $password = '', $mail = '', $figure = '', $motto = '', $home_room = '', $birth = '', $fb_id = 0)
  482. {
  483.     mysql_query("INSERT INTO users (username, real_name, password, mail, credits, look, motto, account_created, last_online, ip_last, ip_reg, home_room, birth, facebook_id) VALUES ('".$username."', '".FilterText($real_name)."', '".$password."', '".$mail."', '50000', '".$figure."', '".$motto."', UNIX_TIMESTAMP(), UNIX_TIMESTAMP(), '".$_SERVER['REMOTE_ADDR']."', '".$_SERVER['REMOTE_ADDR']."', '".$home_room."','".$birth."','".$fb_id."')");
  484.     $user_id = mysql_insert_id();
  485.     mysql_query("INSERT INTO user_stats (id, RoomVisits, OnlineTime, Respect, RespectGiven, GiftsGiven, GiftsReceived, DailyRespectPoints, DailyPetRespectPoints) VALUES ('".$user_id."', 0, 0, 0, 0, 0, 0, 3, 3)");
  486.     mysql_query("INSERT INTO user_info (user_id, bans, cautions, reg_timestamp, login_timestamp, cfhs, cfhs_abusive) VALUES ('".$user_id."', '0', '0', UNIX_TIMESTAMP(), '0', '0', '0')");
  487. }
  488.  
  489.  
  490. function IsHCMember($my_id){
  491.     if(HCDaysLeft($my_id) > 0 ){
  492.         return true;
  493.     } else {
  494.        
  495.         $check = mysql_query("SELECT * FROM users_club WHERE userid = '".$my_id."' LIMIT 1");
  496.         $clubrecord = mysql_num_rows($check);
  497.         if($clubrecord > 0){
  498.             mysql_query("UPDATE users SET badge_status = '0' WHERE id = '".$my_id."' LIMIT 1") or die(mysql_error());
  499.             mysql_query("UPDATE users SET rank = '1' WHERE id = '".$my_id."' AND rank = '2' LIMIT 1") or die(mysql_error());
  500.             mysql_query("DELETE FROM users_badges WHERE badgecode = 'HC1' OR badgeid = 'HC2' AND userid = '".$my_id."' LIMIT 1");
  501.             mysql_query("DELETE FROM users_club WHERE userid = '".$my_id."' LIMIT 1") or die(mysql_error());
  502.             if(function_exists(SendMUSData) !== true){ include('includes/mus.php'); }
  503.             @SendMUSData('UPRS' . $my_id);
  504.         }
  505.         return false;
  506.     }
  507. }
  508.  
  509.  
  510.  
  511. function GiveHC($user_id, $months){
  512.  
  513. $sql = mysql_query("SELECT * FROM users_club WHERE userid = '".$user_id."' LIMIT 1") or die(mysql_error());
  514. $valid = mysql_num_rows($sql);
  515.  
  516.     if($valid > 0){
  517.         mysql_query("UPDATE users SET rank = '1' WHERE rank = '1' AND id = '".$user_id."' LIMIT 1") or die(mysql_error());
  518.         mysql_query("UPDATE users_club SET months_left = months_left + ".$months." WHERE userid = '".$user_id."' LIMIT 1") or die(mysql_error());
  519.         $check = mysql_query("SELECT * FROM user_badges WHERE badge_id = 'HC6' AND user_id = '".$user_id."' LIMIT 1") or die(mysql_error());
  520.         $found = mysql_num_rows($check);
  521.         if($found !== 1){  
  522.             mysql_query("UPDATE users SET badge_status = '0' WHERE id = '".$user_id."' LIMIT 1") or die(mysql_error());
  523.             mysql_query("UPDATE user_badges SET badge_slot = '0' WHERE user_id = '".$user_id."'") or die(mysql_error());
  524.             mysql_query("INSERT INTO user_badges (user_id,badge_id,badge_slot) VALUES ('".$user_id."','HC1','1')") or die(mysql_error());
  525.         }
  526.     } else {
  527.         $m = date('m');
  528.         $d = date('d');
  529.         $Y = date('Y');
  530.         $date = date('d-m-Y', mktime($m,$d,$Y));
  531.         mysql_query("INSERT INTO users_club (userid,date_monthstarted,months_expired,months_left) VALUES ('".$user_id."','".$date."','0','0')") or die(mysql_error());
  532.         GiveHC($user_id, $months);
  533.     }
  534.  
  535.     if(function_exists(SendMUSData) !== true){ include('includes/mus.php'); }
  536.     @SendMUSData('UPRS' . $user_id);
  537.     @SendMUSData('UPRC' . $user_id);
  538. }
  539.  
  540.  
  541.  
  542. if(session_is_registered(username)){
  543. $blob = time();
  544. mysql_query("UPDATE users SET online1 = '".$blob."', ipaddress_last = '".$remote_ip."' WHERE id = '".$my_id."' LIMIT 1") or die(mysql_error());
  545.  
  546. mysql_query("UPDATE users SET ip_last = '".$remote_ip."' WHERE id = '".$my_id."' LIMIT 1") or die(mysql_error());
  547.  
  548.  
  549.    
  550. }
  551.  
  552.  
  553.  
  554. function IsUserOnline($intUID){
  555. $result = mysql_fetch_array(mysql_query("SELECT online FROM users WHERE id = '".$intUID."' LIMIT 1")) or die(mysql_error());
  556.  
  557.     if($result['online'] == 1){
  558.         return true;
  559.     } else {
  560.          
  561.             return false;
  562.         }    
  563. }
  564.  
  565.  
  566.  
  567. function IsUserBanned(){
  568.  
  569.  
  570.  
  571. }
  572.  
  573. function mysql_evaluate($query, $default_value="undefined") {
  574.     $result = mysql_query($query) or die(mysql_error());
  575.  
  576.     if(mysql_num_rows($result) < 1){
  577.         return $default_value;
  578.     } else {
  579.         return mysql_result($result, 0);
  580.     }
  581. }
  582.  
  583.  
  584.  
  585. function FilterText($str, $advanced=false) {
  586.     if($advanced == true){ return mysql_real_escape_string($str); }
  587.     $str = mysql_real_escape_string(htmlspecialchars($str));
  588.     return $str;
  589. }
  590.  
  591. function HoloText($str, $advanced=false, $bbcode=false) {
  592.     if($advanced == true){ return stripslashes($str); }
  593.     $str = stripslashes(nl2br(htmlspecialchars($str)));
  594.     if($bbcode == true){$str = bbcode_format($str); }
  595.     return $str;
  596. }
  597.  
  598. function stringToURL($str,$lowercase=true,$spaces=false){
  599.     $str = trim(preg_replace('/\s\s+/',' ',preg_replace("/[^A-Za-z0-9-]/", " ", $str)));
  600.     if($lowercase == true){ $str = strtolower($str); }
  601.     if($spaces == true){ $str = str_replace(" ", "-", $str); }else{ str_replace(" ", "", $str); }
  602.     return $str;
  603. }
  604.  
  605.  
  606.  
  607. function textInJS($str, $clean = false){
  608.     $str = str_replace("??","?",$str);
  609.     $str = str_replace("??","?",$str);
  610.     $str = str_replace("?‘","?",$str);
  611.     $str = str_replace("?±","?",$str);
  612.     $str = str_replace("??","?",$str);
  613.     $str = str_replace("??","?",$str);
  614.     $str = str_replace("?‰","?",$str);
  615.     $str = str_replace("?©","?",$str);
  616.     $str = str_replace("?“","?",$str);
  617.     $str = str_replace("??","?",$str);
  618.     $str = str_replace("??","?",$str);
  619.     $str = str_replace("??","?",$str);
  620.     $str = str_replace("??","?",$str);
  621.     $str = str_replace("?","?",$str);
  622.      
  623.     if($clean == true)
  624.     {
  625.     $str = str_replace("?","N",$str);
  626.     $str = str_replace("?","n",$str);
  627.     $str = str_replace("?","A",$str);
  628.     $str = str_replace("?","a",$str);
  629.     $str = str_replace("?","E",$str);
  630.     $str = str_replace("?","e",$str);
  631.     $str = str_replace("?","O",$str);
  632.     $str = str_replace("?","o",$str);
  633.     $str = str_replace("?","U",$str);
  634.     $str = str_replace("?","u",$str);
  635.     $str = str_replace("?","I",$str);
  636.     $str = str_replace("?","i",$str);
  637.     }
  638.      
  639.     return $str;
  640. }
  641.  
  642.  
  643.  
  644. function FilterSpecialChars($strInput)
  645.     {
  646.         $strInput = str_replace(chr(1), ' ', $strInput);
  647.         $strInput = str_replace(chr(2), ' ', $strInput);
  648.         $strInput = str_replace(chr(3), ' ', $strInput);
  649.        $strInput = str_replace(chr(9), ' ', $strInput);
  650. }
  651.  
  652. function SwitchWordFilter($str)
  653. {
  654.  
  655. $sql = mysql_query("SELECT word FROM system_wordfilter") or die(mysql_error());
  656.  
  657.     while($row = mysql_fetch_assoc($sql)){
  658.     $str = str_replace($row['word'],getServer("wordfilter_censor"),$str);
  659.     }
  660.  
  661. return $str;
  662.  
  663. }
  664.  
  665.  
  666.  
  667.  
  668.  
  669. function EscapeString($string = '')
  670.     {
  671.         return mysql_real_escape_string(stripslashes(trim(htmlspecialchars($string))));
  672.     }
  673.    
  674.    
  675.     error_reporting(0);
  676.     session_start();  
  677.    
  678.  
  679.    
  680.     $config["hImaging"] = 'http://www.habbo.it/habbo-imaging/avatarimage';
  681.     $config["defaultAvatar"] = 'ch-3111-63-62.hd-3103-1.hr-3163-39.lg-285-77.sh-305-78';
  682.    
  683.    
  684.    
  685.     $con = mysql_connect($sqlhostname, $sqlusername, $sqlpassword) or die('Errore con la connessione al mysql, apri <b>core.php</b> e modifica con i tuoi dati.');
  686.     $db  = mysql_select_db($sqldb, $con) or die('Database non trovato, apri <b>config.php</b> e modifica con i tuoi dati.');
  687.    
  688.    
  689.  
  690.    
  691.    
  692.     function readAvatarSet($type, $gender, $publicDir = 'json/', $extFile = '.txt'){
  693.         $set_file = $publicDir.$type.'-'.strtolower($gender).'.txt';
  694.             if(file_exists($set_file) != false){ $x = fopen($set_file, "r");
  695.          $s = fread($x, filesize($set_file)); fclose($x); return $s; } else { return null; }
  696.     }
  697.    
  698.     function checkIfContains($substring, $string) {
  699.         $pos = strpos($string, $substring);
  700.         if($pos === false) { return false; } else { return true; }
  701.     }
  702.    
  703.  
  704.    
  705.  
  706.     function createSecurityHash($length, $numbers, $upper){
  707.         if (1 > $length) $length = 8;
  708.         $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
  709.         $numChars = 62; $string = '';
  710.         if (!$numbers) { $numChars = 52; $chars = substr($chars, 10, $numChars); }
  711.         if (!$upper) { $numChars -= 26; $chars = substr($chars, 0, $numChars); }
  712.         for ($i = 0; $i < $length; $i++) { $string .= $chars[mt_rand(0, $numChars - 1)]; }
  713.         return $string;
  714.     }  
  715.    
  716.  
  717. function Securise($str)
  718.             {
  719.                 $str = mysql_real_escape_string(htmlspecialchars(stripslashes(nl2br(trim($str)))));
  720.                 return $str;
  721.             }
  722.            
  723.  
  724. function Redirect($url){
  725. $redirect = header("location:".$url."");
  726. return $redirect;
  727. }
  728.  
  729.  
  730. define('APP_ID', '356256347780987');
  731. define('APP_SECRET', 'fb7de9b599a9bef750ca952ed5532b99');
  732. define('siteurl', '127.0.0.1');
  733.  
  734.  
  735. @include('./includes/version.php');
  736. @include('../includes/version.php');
  737. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top