'bgsportal', 'db_site_password' => 'mysqlsithmosinter', 'db_site_username' => 'mysql', 'db_site_ip' => 'localhost', 'send_money_rate' => 1 ); $admins = array ( '76561198224360016', '' ); $adminschat = array ( '76561198224360016' ); $server = array( 'db_ip' => 'localhost', 'db_name' => 'bgsportal', 'db_username' => 'mysql', 'db_password' => 'mysqlsithmosinter', 'rcon_ip' => 'rok.bgs-game.com', 'rcon_port' => 7351, 'rcon_password' => 'StakeR123bgs' ); $servers[0] = array( 'name' => 'Reign Of Kings', 'ip' => 'rok.bgs-game.com', 'port' => 7351, 'password' => 'StakeR123bgs' ); $date = strftime('%Y-%m-%d %H:%M:%S',time()); ?> '
', '/\[b\](.*?)\[\/b\]/is' => '$1', '/\[i\](.*?)\[\/i\]/is' => '$1', '/\[u\](.*?)\[\/u\]/is' => '$1', '/\[t\](.*?)\[\/t\]/is' => '$1', '/\[url\=(.*?)\](.*?)\[\/url\]/is' => '$2', '/\[url\](.*?)\[\/url\]/is' => '$1', '/\[list\=1\](.*?)\[\*\]/is' => '[list=1][*]', '/\[list\](.*?)\[\*\]/is' => '[list][*]', '/\[\*\](.*?)(\n|\r\n|\[?)(?=(\[\*\]|\[\/list\]?))/is' => '
  • $1
  • ', '/\[list\](.*?)\[\/list\]/is' => '', '/\[list\=1\](.*?)\[\/list\]/is' => '
      $1
    ', '/\[left\](.*?)\[\/left\]/is' => '

    $1

    ', '/\[center\](.*?)\[\/center\]/is' => '

    $1

    ', '/\[right\](.*?)\[\/right\]/is' => '

    $1

    ', '/\[img\=([^\]]*?)\]\[\/img\]/is' => '', '/\[img\=(.*?)\](.*?)\[\/img\]/is' => '$2', '/\[youtube\]https:\/\/www\.youtube\.com\/watch\?v\=/is' => '[youtube]https://www.youtube.com/embed/', '/\[youtube\](.*?)\[\/youtube\]/is' => '', '/\[youtube\]http:\/\/www\.youtube\.com\/watch\?v\=/is' => '[youtube]http://www.youtube.com/embed/', '/\[youtube\](.*?)\[\/youtube\]/is' => '', '/\[file\=([^\]]*?)\]\[\/file\]/is' => '$1', '/\[file\=(.*?)\](.*?)\[\/file\]/is' => '$2', '/\[size\=(.*?)\](.*?)\[\/size\]/is' => '$2', '/\[font\=(.*?)\](.*?)\[\/font\]/is' => '$2', '/\[color\=(.*?)\](.*?)\[\/color\]/is' => '$2', '/\[bcolor\=(.*?)\](.*?)\[\/bcolor\]/is' => '$2', '/\[smiley\=(.*?)_(.*?)\]/is' => '', '/\[quote\](.*?)\[\/quote\]/is' => '
    $1
    ', '/\[code\](.*?)\[\/code\]/is' => '$1', '/\[lfloat\](.*?)\[\/lfloat\]/is' => '
    $1
    ', '/\[rfloat\](.*?)\[\/rfloat\]/is' => '
    $1
    ' ); $str = preg_replace(array_keys($bbc), array_values($bbc), $str); return $str; } ?>'); } Public function db_server() { include($_SERVER['DOCUMENT_ROOT'] .'/admin/config.php'); $link = mysqli_connect($server['db_ip'], $server['db_username'], $server['db_password']) or die('Could not connect: ' . mysqli_error()); mysqli_query ($link, "SET NAMES utf8"); mysqli_select_db($link, $server['db_name']) or die('Not connected
    '); } Public function info_about_user ($nickorid) { $this -> db_server(); include($_SERVER['DOCUMENT_ROOT'] .'/admin/config.php'); $link = mysqli_connect($server['db_ip'], $server['db_username'], $server['db_password']) or die('Could not connect: ' . mysqli_error()); mysqli_query ($link, "SET NAMES utf8"); mysqli_select_db($link, $server['db_name']) or die('Not connected
    '); if (strlen($nickorid) == 17) $serversquery = mysqli_query($link, "SELECT * FROM db_users WHERE `steam_id` = '".$nickorid."'"); if (strlen($nickorid) != 17) $serversquery = mysqli_query($link, "SELECT * FROM db_users WHERE `username` = '".$nickorid."'"); while ($servers_array = mysqli_fetch_array($serversquery)) { $info = array ( 'steam_id' => $servers_array['steam_id'], 'username' => $servers_array['username'], 'password' => $servers_array['password'], 'rank' => $servers_array['rank'], 'flags' => $servers_array['flags'], 'violations' => $servers_array['violations'], 'donate_balance' => $servers_array['donate_balance'], 'premium_date' => $servers_array['premium_date'], 'avatar' => $servers_array['avatar'], 'banned' => $servers_array['banned'] ); if ($info['steam_id'] != ''){ return $info; } } } Public function clean_str($string) { $result = str_replace( "\"", "", $string); $result = str_replace( "<", "", $result); $result = str_replace( ">", "", $result); $result = str_replace( "'", "", $result); $result = str_replace( "`", "", $result); return $result; } Public function is_banned($steam_id) { $this -> db_server(); include($_SERVER['DOCUMENT_ROOT'] .'/admin/config.php'); $link = mysqli_connect($server['db_ip'], $server['db_username'], $server['db_password']) or die('Could not connect: ' . mysqli_error()); mysqli_query ($link, "SET NAMES utf8"); mysqli_select_db($link, $server['db_name']) or die('Not connected
    '); $sql = mysqli_query($link, "SELECT flags FROM db_users WHERE steam_id = '". $steam_id."'"); $sql1 = mysqli_fetch_array($sql); $pos = strripos($sql1['flags'], 'banned'); if ($pos == false) return false; else return true; } Public function return_id ($nick) { $this -> db_server(); include($_SERVER['DOCUMENT_ROOT'] .'/admin/config.php'); $link = mysqli_connect($server['db_ip'], $server['db_username'], $server['db_password']) or die('Could not connect: ' . mysqli_error()); mysqli_query ($link, "SET NAMES utf8"); mysqli_select_db($link, $server['db_name']) or die('Not connected
    '); $sql = mysqli_query($link, "SELECT steam_id FROM db_users WHERE username = '". $nick."'"); $user = mysqli_fetch_array($sql); $return = $user['steam_id']; return $return; } Public function return_nick ($steam_id) { $this -> db_server(); include($_SERVER['DOCUMENT_ROOT'] .'/admin/config.php'); $link = mysqli_connect($server['db_ip'], $server['db_username'], $server['db_password']) or die('Could not connect: ' . mysqli_error()); mysqli_query ($link, "SET NAMES utf8"); mysqli_select_db($link, $server['db_name']) or die('Not connected
    '); $sql = mysqli_query($link, "SELECT username FROM db_users WHERE steam_id = '". $steam_id."'"); $user = mysqli_fetch_array($sql); $return = $user['username']; return $return; } Public function minus_balance($steam_id, $summ) { $this -> db_server(); include($_SERVER['DOCUMENT_ROOT'] .'/admin/config.php'); $link = mysqli_connect($server['db_ip'], $server['db_username'], $server['db_password']) or die('Could not connect: ' . mysqli_error()); mysqli_query ($link, "SET NAMES utf8"); mysqli_select_db($link, $server['db_name']) or die('Not connected
    '); $sql = mysqli_query($link, "SELECT * FROM db_users WHERE steam_id = '".$steam_id."'"); $row = mysqli_fetch_assoc($sql); $balance = $row['donate_balance']; if ($balance >= $summ) { $balance = $balance - $summ; $money = mysqli_query($link, "UPDATE db_users SET `donate_balance`='". $balance ."' WHERE steam_id = '".$steam_id."'"); return $summ; } elseif ($balance < $summ) { $balance1 = 0; $money = mysqli_query($link, "UPDATE db_users SET `donate_balance`='". $balance1 ."' WHERE steam_id = '".$steam_id."'"); return $balance ; } else return ''; } Public function minus_balance_admin($steam_id, $summ) { $this -> db_server(); include($_SERVER['DOCUMENT_ROOT'] .'/admin/config.php'); $link = mysqli_connect($server['db_ip'], $server['db_username'], $server['db_password']) or die('Could not connect: ' . mysqli_error()); mysqli_query ($link, "SET NAMES utf8"); mysqli_select_db($link, $server['db_name']) or die('Not connected
    '); $sql = mysqli_query($link, "SELECT * FROM db_users WHERE steam_id = '".$steam_id."'"); $row = mysqli_fetch_assoc($sql); $balance = $row['donate_balance']; if ($balance >= $summ) { $balance = $balance - $summ; $money = mysqli_query($link, "UPDATE db_users SET `donate_balance`='". $balance ."' WHERE steam_id = '".$steam_id."'"); return $summ; } elseif ($balance < $summ) { $balance1 = 0; $money = mysqli_query($link, "UPDATE db_users SET `donate_balance`='". $balance1 ."' WHERE steam_id = '".$steam_id."'"); return $balance ; } else return ''; } Public function plus_balance($steam_id, $summ) { $this -> db_server(); include($_SERVER['DOCUMENT_ROOT'] .'/admin/config.php'); $link = mysqli_connect($server['db_ip'], $server['db_username'], $server['db_password']) or die('Could not connect: ' . mysqli_error()); mysqli_query ($link, "SET NAMES utf8"); mysqli_select_db($link, $server['db_name']) or die('Not connected
    '); $sql = mysqli_query($link, "SELECT * FROM db_users WHERE steam_id = '".$steam_id."'"); $row = mysqli_fetch_assoc($sql); $balance = $row['donate_balance']; $balance = $balance + $summ; $money = mysqli_query($link, "UPDATE db_users SET `donate_balance`='". $balance ."' WHERE steam_id = '".$steam_id."'"); if ($money) { return true;} else return false; } Public function return_balance($steam_id) { $this -> db_server(); include($_SERVER['DOCUMENT_ROOT'] .'/admin/config.php'); $link = mysqli_connect($server['db_ip'], $server['db_username'], $server['db_password']) or die('Could not connect: ' . mysqli_error()); mysqli_query ($link, "SET NAMES utf8"); mysqli_select_db($link, $server['db_name']) or die('Not connected
    '); $sql = mysqli_query($link, "SELECT * FROM db_users WHERE steam_id = '".$steam_id."'"); $row = mysqli_fetch_assoc($sql); $balance = $row['donate_balance']; return $balance; } Public function change_nick($newnick, $steam_id) { $this -> db_server(); include($_SERVER['DOCUMENT_ROOT'] .'/admin/config.php'); $link = mysqli_connect($server['db_ip'], $server['db_username'], $server['db_password']) or die('Could not connect: ' . mysqli_error()); mysqli_query ($link, "SET NAMES utf8"); mysqli_select_db($link, $server['db_name']) or die('Not connected
    '); $sql = mysqli_query($link, "SELECT username FROM db_users WHERE steam_id = '".$steam_id."'"); if (mysqli_num_rows($sql) > 0) { $changenick = mysqli_query("UPDATE`db_users` SET username='".$newnick."' WHERE steam_id = '".$steam_id."'"); If ($changenick) { return true; } else return false; } else return false; } Public function change_steam_id($newid, $steam_id) { $this -> db_server($server); include($_SERVER['DOCUMENT_ROOT'] .'/admin/config.php'); $link = mysqli_connect($server['db_ip'], $server['db_username'], $server['db_password']) or die('Could not connect: ' . mysqli_error()); mysqli_query ($link, "SET NAMES utf8"); mysqli_select_db($link, $server['db_name']) or die('Not connected
    '); $sql = mysqli_query($link, "SELECT steam_id FROM db_users WHERE steam_id = '".$steam_id."'"); if (mysqli_num_rows($sql) > 0) { $changeid = mysqli_query("UPDATE `db_server` SET value='serv.users ".$steam_id." id ".$newid."' WHERE name = 'rcon_command'"); If ($changeid) { return true; } else return false; } else return false; } Public function get_date() { $temptime = time(); $date = strftime('%Y-%m-%d %H:%M:%S',$temptime); return $date; } Public function check_query() { include($_SERVER['DOCUMENT_ROOT'] .'/admin/config.php'); $ip = $server['rcon_ip']; $queryport = $server['rcon_port']; $socket = @fsockopen("udp://".$ip, $queryport , $errno, $errstr, 1); @stream_set_timeout($socket, 1); @stream_set_blocking($socket, TRUE); @fwrite($socket, "\xFF\xFF\xFF\xFF\x54Source Engine Query\x00"); $response = @fread($socket, 4096); @fclose($socket); if (!empty($response)) { return true; } } Public function rcon_command($command) { //if ($this -> check_query($id) == true) //{ include_once($_SERVER['DOCUMENT_ROOT'] .'/admin/rcon.class.php'); include($_SERVER['DOCUMENT_ROOT'] .'/admin/config.php'); $r = new rcon($server['rcon_ip'],$server['rcon_port'],$server['rcon_password']); $r->Auth(); $ret = $r->rconCommand($command); return $ret; //} else return ''; } Public function unlog() { session_unset(); //session_destroy(); } Public function date_for_chat($date) { $month = $date[5] . $date[6]; switch ($month) { case '01': $mess = "января"; break; case '02': $mess = "февраля"; break; case '03': $mess = "марта"; break; case '04': $mess = "апреля"; break; case '05': $mess = "мая"; break; case '06': $mess = "июня"; break; case '07': $mess = "июля"; break; case '08': $mess = "августа"; break; case '09': $mess = "сентября"; break; case '10': $mess = "октября"; break; case '11': $mess = "ноября"; break; case '12': $mess = "декабря"; break; } if ($date[8] != '0') { $day = $date[8] . $date[9]; } else $day = $date[9]; $time = $date[11] . $date[12] . $date[13] . $date[14] . $date[15]; $ret = $day . ' ' . $mess . ' в ' .$time; return $ret; } } ?>Could not connect: