Probleme AMXBANS

Discutii despre problemele aparute in jocul Counter-Strike.

Moderators: Moderatori ajutatori, Moderatori

User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2047
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 33 times
Been thanked: 332 times
Contact:

02 Feb 2019, 19:48

datele de conectare sunt corecte??
văd că trebuie multe editate :gaben:

vezi așa
| Afiseaza codul
[code]
<?php
/* 	

	AMXBans v6.0
	
	Copyright 2009, 2010 by SeToY & |PJ|ShOrTy

	This file is part of AMXBans.

    AMXBans is free software, but it's licensed under the
	Creative Commons - Attribution-NonCommercial-ShareAlike 2.0

    AMXBans is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    You should have received a copy of the cc-nC-SA along with AMXBans.  
	If not, see <http://creativecommons.org/licenses/by-nc-sa/2.0/>.

*/

error_reporting(E_ALL ^ E_DEPRECATED);//k mfwt

// setting version - DO NOT EDIT THIS
$config->v_web = "6.0.3";

// if necessary - calling install procedure
if(file_exists("setup.php") && !file_exists("include/db.config.inc.php")) {
	header("Location: setup.php");
	exit;
}

//start counter for page load time
$page_starttime=explode(" ",microtime());

// If magic quotes are enabled, strip slashes from all user data
function stripslashes_recursive($var) {
	return (is_array($var) ? array_map('stripslashes_recursive', $var) : stripslashes($var));
}
if (get_magic_quotes_gpc()) {
	$_GET = stripslashes_recursive($_GET);
	$_POST = stripslashes_recursive($_POST);
	$_COOKIE = stripslashes_recursive($_COOKIE);
}

require_once("sql.inc.php");
require_once("db.config.inc.php");

//get ip from hostname
function getipbyhost($ip_host = "") {
	$value = $ip_host;

	$pattern['ipv4'] = '/^((\d|[1-9]\d|2[0-4]\d|25[0-5]|1\d\d)(?:\.(\d|[1-9]\d|2[0-4]\d|25[0-5]|1\d\d)){3})$/';
	$pattern['ipv6'] = '/^( (([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})| (([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})| (([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})| (([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})| (([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})| (([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})| ( ([0-9A-Fa-f]{1,4}:){6} ((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3} (\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b) )| ( ([0-9A-Fa-f]{1,4}:){1,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))| (([0-9A-Fa-f]{1,4}:){1}:([0-9A-Fa-f]{1,4}:){0,4}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))| (([0-9A-Fa-f]{1,4}:){0,2}:([0-9A-Fa-f]{1,4}:){0,3}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))| (([0-9A-Fa-f]{1,4}:){0,3}:([0-9A-Fa-f]{1,4}:){0,2}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))| (([0-9A-Fa-f]{1,4}:){0,4}:([0-9A-Fa-f]{1,4}:){1}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))| (::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d) |(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))| ([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})| (::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})| (([0-9A-Fa-f]{1,4}:){1,7}:) )$/';

	if( ($value != "") || ($value != "127.0.0.1") || !(preg_match($pattern['ipv4'],$value)) || !(preg_match($pattern['ipv6'],$value)) ) {
		return gethostbyname($value);
	} elseif($value == "localhost") {
		return "127.0.0.1";
	} else {
		return $value;
	}
}

//connect to db
try {
	$mysql		= @mysql_connect($config->db_host,$config->db_user,$config->db_pass);
/*
if (!$mysql||mysqli_connect_errno()||$mysql->connect_errno) { 
    die('Could not connect to MySQL: ' . mysqli_error()); 
}*/

	try {
		$enc = @mysql_query("SET CHARACTER SET 'utf-8'");//dc oare se uită poney la mine
		$enc = @mysql_query("SET NAMES 'utf8'");
	} catch (Exception $e) { }
	
	$resource	= @mysql_select_db($config->db_db);
} catch (Exception $e) {
	trigger_error(@mysql_error());
}

$config->importdir		= $config->path_root."/tmp";
$config->templatedir	= $config->path_root."/templates";
$config->langfilesdir	= $config->path_root."/language/";


//get websettings
$vars=sql_set_websettings();

//save current language to session
if(!$_SESSION["lang"]) $_SESSION["lang"]=$config->default_lang;

//load smilies to global array
if(empty($smilies)) {
	$sql = @mysql_query("SELECT code, url, name FROM ".$config->db_prefix."_smilies ORDER BY id");
	while (list($code, $url, $name) = @mysql_fetch_array($sql))
	{
		$name = stripslashes($name);
		$name = htmlentities($name);
		$smilies[]=array($code,$url,$name);
	}
}

//load bbcode tags to global array
if(empty($bbcodes)) {
	$sql = @mysql_query("SELECT open_tag, close_tag, url, name FROM ".$config->db_prefix."_bbcode ORDER BY id");
	while (list($open_tag, $close_tag, $url, $name) = @mysql_fetch_array($sql))
	{
		$name = stripslashes($name);
		$name = htmlentities($name);
		$bbcodes[]=array($open_tag,$close_tag,$url,$name);
	}
}

/* Smarty settings */
define("SMARTY_DIR", $config->path_root."/include/smarty/");

require_once(SMARTY_DIR."Smarty.class.php");

class dynamicPage extends Smarty {
	function dynamicPage() {

		global $config;

		$this->Smarty();

		$this->template_dir = $config->templatedir;
		$this->compile_dir	= SMARTY_DIR."templates_c/";
		$this->config_dir	= SMARTY_DIR."configs/";
		$this->cache_dir	= SMARTY_DIR."cache/";
		$this->caching		= false;
		
		//for editing templates it´s better "true", but slow down site load
		$this->force_compile = false;
		
		$this->assign("app_name","dynamicPage");
	}
}[/code]
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
Olium
User avatar
IoNuT.
Membru, skill +1
Membru, skill +1
Posts: 126
Joined: 21 Jul 2016, 13:58
Detinator Steam: Da
CS Status: Activ
Detinator server CS: Cs.Pro-League.Ro
SteamID: STEAM_0:0:47999435
Reputatie: Membru Club eXtreamCS (10 Mar - 10 Apr)
Fond eXtream: 0
Location: Ploiesti
Contact:

02 Feb 2019, 19:56

Acum imi deschide pe website doar cu aceeasi problema ma gandesc sa fie de la sql

sql.inc
| Afiseaza codul
<?php

/* 	

	AMXBans v6.0
	
	Copyright 2009, 2010 by SeToY & |PJ|ShOrTy

	This file is part of AMXBans.

    AMXBans is free software, but it's licensed under the
	Creative Commons - Attribution-NonCommercial-ShareAlike 2.0

    AMXBans is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    You should have received a copy of the cc-nC-SA along with AMXBans.  
	If not, see <http://creativecommons.org/licenses/by-nc-sa/2.0/>.

*/

// sql functions

function sql_set_websettings() {
	global $config;
	$query = mysql_query("SELECT * FROM `".$config->db_prefix."_webconfig`") or die (mysql_error());
	$result = mysql_fetch_object($query);
	$config->cookie=$result->cookie;
	$config->bans_per_page=($result->bans_per_page)<1 ? 1:$result->bans_per_page;
	$config->design = $result->design;
	$config->banner = $result->banner;
	$config->banner_url = $result->banner_url;
	$config->default_lang = $result->default_lang;
	$config->start_page = $result->start_page;
	$config->show_kick_count = $result->show_kick_count;
	$config->show_comment_count = $result->show_comment_count;
	$config->show_demo_count = $result->show_demo_count;
	$config->demo_all = $result->demo_all;
	$config->max_file_size = $result->max_file_size;
	$config->file_type = $result->file_type;
	$config->comment_all = $result->comment_all;
	$config->use_capture = $result->use_capture;
	$config->auto_prune = $result->auto_prune;
	$config->max_offences = $result->max_offences;
	$config->max_offences_reason = $result->max_offences_reason;
	$config->use_demo = $result->use_demo;
	$config->use_comment = $result->use_comment;
	//set vars to an array
	$vars=array(
			"cookie"=>trim($config->cookie),
			"design"=>$config->design,
			"bans_per_page"=>(int)$config->bans_per_page,
			"banner"=>$config->banner,
			"banner_url"=>$config->banner_url,
			"default_lang"=>$config->default_lang,
			"start_page"=>$config->start_page,
			"show_kick_count"=>$config->show_kick_count,
			"show_demo_count"=>$config->show_demo_count,
			"show_comment_count"=>$config->show_comment_count,
			"demo_all" => $config->demo_all,
			"comment_all" => $config->comment_all,
			"use_capture" => $config->use_capture,
			"max_file_size" => (int)$config->max_file_size,
			"file_type" => trim($config->file_type),
			"auto_prune" => (int)$config->auto_prune,
			"max_offences" => (int)$config->max_offences,
			"max_offences_reason" => $config->max_offences_reason,
			"use_demo" => (int)$result->use_demo,
			"use_comment" => $result->use_comment
		);
	return $vars;
}
function sql_get_server($serverid=0) {
	global $config;
	if($serverid) {
		$query = mysql_query("SELECT * FROM `".$config->db_prefix."_serverinfo` WHERE `id`=".$serverid." LIMIT 1") or die (mysql_error());
	} else {
		$query = mysql_query("SELECT * FROM `".$config->db_prefix."_serverinfo` ORDER BY `address` ASC") or die (mysql_error());
		$servers=array();
	}
	while($result = mysql_fetch_object($query)) {
		$server=array(
			"sid"=>$result->id,
			"timestamp"=>$result->timestamp,
			"hostname"=>html_safe($result->hostname),
			"address"=>$result->address,
			"gametype"=>$result->gametype,
			"rcon"=>$result->rcon,
			"amxban_version"=>$result->amxban_version,
			"amxban_motd"=>$result->amxban_motd,
			"motd_delay"=>$result->motd_delay,
			"amxban_menu"=>$result->amxban_menu,
			"reasons"=>$result->reasons,
			"timezone_fixx"=>$result->timezone_fixx
		);
		if(!$serverid) $servers[]=$server;
	}
	if(!$serverid) return $servers;
	return $server;
}
function sql_get_server_ids() {
	global $config;
	$query = mysql_query("SELECT `id` FROM `".$config->db_prefix."_serverinfo` ORDER BY `address` ASC") or die (mysql_error());
	$serverids=array();
	while($result = mysql_fetch_object($query)) {
		$serverids[]=$result->id;
	}
	return $serverids;
}
function sql_get_reasons_set() {
	global $config;
	$query = mysql_query("SELECT * FROM `".$config->db_prefix."_reasons_set` ORDER BY `setname` ASC") or die (mysql_error());
	$reasons_set=array();
	while($result = mysql_fetch_object($query)) {
		$reason_set=array(
			"id"=>$result->id,
			"setname"=>html_safe($result->setname)
			);
		$query2 = mysql_query("SELECT * FROM `".$config->db_prefix."_reasons_to_set` WHERE `setid`=".$result->id) or die (mysql_error());
		$reasons="";
		while($result2 = mysql_fetch_object($query2)) {
			$reasons.=($reasons)?",".$result2->reasonid:$result2->reasonid;
		}
		$reason_set["reasonids"]=$reasons;
		$reasons_set[]=$reason_set;
	}
	return $reasons_set;
}
function sql_get_reasons() {
	global $config;
	$query = mysql_query("SELECT * FROM `".$config->db_prefix."_reasons` ORDER BY `id` ASC") or die (mysql_error());
	$reasons=array();
	while($result = mysql_fetch_object($query)) {
		$reason=array(
			"id"=>$result->id,
			"reason"=>html_safe($result->reason),
			"static_bantime"=>$result->static_bantime
			);
		$reasons[]=$reason;
	}
	return $reasons;
}
function sql_get_reasons_list() {
	global $config;
	$reasons = array();
	$query = mysql_query("SELECT reason FROM `".$config->db_prefix."_reasons` ORDER BY `id` ASC") or die (mysql_error());
	while($result = mysql_fetch_object($query)) {
		$reasons[]=$result->reason;
	}
	return $reasons;
}
function sql_get_amxadmins() {
	global $config;
	$query = mysql_query("SELECT * FROM `".$config->db_prefix."_amxadmins` ORDER BY `ashow` DESC,`expired`,`access` DESC,`username` ASC") or die (mysql_error());
	$admins=array();
	while($result = mysql_fetch_object($query)) {
		$admin=array(
			"aid"=>$result->id,
			"username"=>html_safe($result->username),
			"password"=>$result->password,
			"access"=>$result->access,
			"flags"=>$result->flags,
			"steamid"=>$result->steamid,
			"nickname"=>html_safe($result->nickname),
			"ashow"=>$result->ashow,
			"created"=>$result->created,
			"expired"=>$result->expired,
			"days"=>$result->days
		);
		$admins[]=$admin;
	}
	return $admins;
}
function sql_get_amxadmins_list() {
	global $config;
	$query = mysql_query("SELECT * FROM `".$config->db_prefix."_amxadmins` WHERE `ashow`=1 AND (`expired`=0 OR `expired`>UNIX_TIMESTAMP()) ORDER BY `expired`,`access` DESC,`username` ASC") or die (mysql_error());
	$admins=array();
	while($result = mysql_fetch_object($query)) {
		if(!empty($result->steamid)) {
			$steamid = htmlentities($result->steamid, ENT_QUOTES);
			$steamcomid = GetFriendId($steamid);
		}
		$admin=array(
			"aid"=>$result->id,
			"username"=>html_safe($result->username),
			"comid"=>$steamcomid,
			"password"=>$result->password,
			"access"=>$result->access,
			"flags"=>$result->flags,
			"steamid"=>$result->steamid,
			"nickname"=>html_safe($result->nickname),
			"ashow"=>$result->ashow,
			"created"=>$result->created,
			"expired"=>$result->expired,
			"days"=>$result->days
		);
		$admins[]=$admin;
	}
	return $admins;
}
function sql_get_amxadmins_server($server) {
	global $config;
	$query = mysql_query("SELECT * FROM `".$config->db_prefix."_amxadmins` ORDER BY `ashow` DESC,`expired`,`access` DESC,`username` ASC") or die (mysql_error());
	$admins=array();
	while($result = mysql_fetch_object($query)) {
		$query2 = mysql_query("SELECT `custom_flags`,`use_static_bantime` FROM `".$config->db_prefix."_admins_servers` WHERE `admin_id`=".$result->id." AND `server_id`=".$server) or die (mysql_error());
		if($result2 = mysql_fetch_object($query2)) {
				$custom_flags=$result2->custom_flags;
				$static_bantime=$result2->use_static_bantime;
				$aktiv=1;
		} else {
				$custom_flags="";
				$static_bantime="no";
				$aktiv=0;
		}
		$admin=array(
			"sid"=>$server,
			"aid"=>$result->id,
			"username"=>html_safe($result->username),
			"password"=>$result->password,
			"access"=>$result->access,
			"flags"=>$result->flags,
			"steamid"=>$result->steamid,
			"nickname"=>html_safe($result->nickname),
			"ashow"=>$result->ashow,
			"custom_flags"=>$custom_flags,
			"use_static_bantime"=>$static_bantime,
			"aktiv"=>$aktiv
		);
		$admins[]=$admin;
	}
	return $admins;
}
function sql_get_webadmins() {
	global $config;
	$query = mysql_query("SELECT id,username,level,last_action,email FROM `".$config->db_prefix."_webadmins` ORDER BY `level`,`username`") or die (mysql_error());
	$users=array();
	
	while($result = mysql_fetch_object($query)) {
		$user=array(
			"uid"=>$result->id,
			"name"=>html_safe($result->username),
			"level"=>$result->level,
			"last_action"=>$result->last_action,
			"email"=>html_safe($result->email)
		);
		$users[]=$user;
	}
	return $users;
}

function sql_get_server_admins($server) {
	global $config;
	$serveradmins=array();
	$query = mysql_query("SELECT s.admin_id,s.custom_flags,s.use_static_bantime,a.username FROM ".$config->db_prefix."_admins_servers as s,".$config->db_prefix."_amxadmins as a WHERE s.server_id=".$server) or die (mysql_error());
	$admins=array();
	while($result = mysql_fetch_object($query)) {
		$admin=array(
			"admin_id"=>$result->admin_id,
			"custom_flags"=>$result->custom_flags,
			"use_static_bantime"=>$result->static_bantime,
			"username"=>html_safe($result->username)
		);
		$admins[]=$admin;
	}
	return $admins;
}
function sql_get_usermenu(&$count) {
	global $config;
	//get menu from db
	global $count;
	$menu=array();
	$query = mysql_query("SELECT * FROM `".$config->db_prefix."_usermenu` ORDER BY `pos` ASC") or die (mysql_error());
	$count=0;
	while($result = mysql_fetch_object($query)) {
		$men=array(
			"id"=>$result->id,
			"pos"=>$result->pos,
			"activ"=>$result->activ,
			"lang_key"=>$result->lang_key,
			"url"=>$result->url,
			"lang_key2"=>$result->lang_key2,
			"url2"=>$result->url2,
		);
		$count++;
		$menu[]=$men;
	}
	
	return $menu;
}
function sql_get_modules($aktiv_only=0,&$count) {
	global $config;
	global $mysql;
	$select="SELECT * FROM `".$config->db_prefix."_modulconfig`";
	if($aktiv_only===1) $select.=" WHERE `activ`=1";
	$select.=" ORDER BY `name` ASC";
	
	$query = mysql_query($select,$mysql) or die (mysql_error());
	$modules=array();
	while($result = mysql_fetch_object($query)) {
		$modul=array(
			"id"=>$result->id,
			"menuname"=>html_safe($result->menuname),
			"name"=>html_safe($result->name),
			"index"=>$result->index,
			"activ"=>$result->activ,
			"admin_page_exists"=>file_exists("include/modules/modul_".$result->name.".php")?1:0,
			"tpl_exists"=>file_exists("templates/modul_".$result->name.".tpl")?1:0,
			"index_exists"=>file_exists($result->index.".php")?1:0
		);
		$count++;
		$modules[]=$modul;
	}
	return $modules;
}
function sql_get_ban_details($bid) {
	global $config;
	//banns for ID
	#$query = mysql_query("SELECT ba.*, se.gametype,se.timezone_fixx, aa.nickname, wa.username FROM `".$config->db_prefix."_bans` AS ba 
	#			LEFT JOIN `".$config->db_prefix."_serverinfo` AS se ON ba.server_ip=se.address 
	#			LEFT JOIN `".$config->db_prefix."_amxadmins` AS aa ON (aa.steamid=ba.admin_nick OR aa.steamid=ba.admin_ip OR aa.steamid=ba.admin_id) 
	#			LEFT JOIN `".$config->db_prefix."_webadmins` AS wa ON wa.username=ba.admin_nick WHERE ba.bid=".$bid." LIMIT 1") or die (mysql_error());
	$query = mysql_query("SELECT ba.*, se.gametype,se.timezone_fixx, aa.nickname,aa.username FROM `".$config->db_prefix."_bans` AS ba 
				LEFT JOIN `".$config->db_prefix."_serverinfo` AS se ON ba.server_ip=se.address 
				LEFT JOIN `".$config->db_prefix."_amxadmins` AS aa ON (aa.steamid=ba.admin_nick OR aa.steamid=ba.admin_ip OR aa.steamid=ba.admin_id) 
				WHERE ba.bid=".$bid." LIMIT 1") or die (mysql_error());
	//Array aufbereiten
	$ban_row=mysql_fetch_assoc($query);
	//timezone fixx and ban_end calc
	$ban_row["ban_created"]=($ban_row["ban_created"] + ($ban_row["timezone_fixx"] * 60 * 60));
	$ban_row["ban_end"]=($ban_row["ban_created"] + ($ban_row["ban_length"] * 60));
	$ban_row["player_nick"] = html_safe($ban_row["player_nick"]);
	
	return $ban_row;
}
function sql_get_ban_details_activ($steamid,&$count,$bid) {
	global $config;
	//banns for ID without $bid
	$query = mysql_query("SELECT ba.*,se.timezone_fixx FROM `".$config->db_prefix."_bans` AS ba 
				LEFT JOIN `".$config->db_prefix."_serverinfo` AS se ON ba.server_ip=se.address
				WHERE `player_id`='".$steamid."' AND `expired`=0 AND `bid`<>".$bid) or die (mysql_error());
	//Array aufbereiten
	$ban_rows=array();
	while($ban_row=mysql_fetch_assoc($query)) {
		$count++;
		//timezone fixx and ban_end calc
		$ban_row["ban_created"]=($ban_row["ban_created"] + ($ban_row["timezone_fixx"] * 60 * 60));
		$ban_row["ban_end"]=($ban_row["ban_created"] + ($ban_row["ban_length"] * 60));
		$ban_rows[]=$ban_row;
	}
	return $ban_rows;
}
function sql_get_ban_details_exp($steamid,&$count,$bid) {
	global $config;
	//exp bans for ID without $bid
	$query = mysql_query("SELECT ba.*,se.timezone_fixx FROM `".$config->db_prefix."_bans` AS ba 
				LEFT JOIN `".$config->db_prefix."_serverinfo` AS se ON ba.server_ip=se.address
				WHERE `player_id`='".$steamid."' AND `expired`=1 AND `bid`<>".$bid) or die (mysql_error());
	//Array aufbereiten
	$ban_rows=array();
	while($ban_row=mysql_fetch_assoc($query)) {
		$count++;
		//timezone fixx and ban_end calc
		$ban_row["ban_created"]=($ban_row["ban_created"] + ($ban_row["timezone_fixx"] * 60 * 60));
		$ban_row["ban_end"]=($ban_row["ban_created"] + ($ban_row["ban_length"] * 60));
		$ban_rows[]=$ban_row;
	}
	return $ban_rows;
}
function sql_get_ban_details_motd_exp($steamid,&$count) {
	global $config;
	//exp bans for ID without $bid
	$query = mysql_query("SELECT ba.*,se.timezone_fixx FROM `".$config->db_prefix."_bans` AS ba 
				LEFT JOIN `".$config->db_prefix."_serverinfo` AS se ON ba.server_ip=se.address
				WHERE `player_id`='".$steamid."' AND `expired`=1 ORDER BY ban_created DESC") or die (mysql_error());
	//Array aufbereiten
	$ban_rows=array();
	while($ban_row=mysql_fetch_assoc($query)) {
		//timezone fixx and ban_end calc
		$ban_row["ban_created"]=($ban_row["ban_created"] + ($ban_row["timezone_fixx"] * 60 * 60));
		$ban_row["ban_end"]=($ban_row["ban_created"] + ($ban_row["ban_length"] * 60));
		
		if($ban_row["server_ip"]!="website") {
			if($show_admin==0 && $ban_row["nickname"]!="") {
				$ban_row["admin_nick"]=$ban_row["nickname"];
			}
		}
				
		$ban_row["player_nick"]=html_safe($ban_row["player_nick"]);
		$ban_row["admin_nick"]=html_safe($ban_row["admin_nick"]);
		$ban_row["server_name"]=html_safe($ban_row["server_name"]);
		
		$ban_rows[]=$ban_row;
		$count++;
	}
	return $ban_rows;
}
function sql_get_comments_count($bid) {
	global $config;
	$query = mysql_query("SELECT COUNT(*) FROM `".$config->db_prefix."_comments`".(($bid) ?" WHERE `bid`=".$bid : "")) or die (mysql_error());
	return mysql_result($query,0);
}
function sql_get_comments_count_fail($repair=0) {
	global $config;
	$repaired=0;
	//first search in the db for files without a ban
	$query = mysql_query("SELECT * FROM `".$config->db_prefix."_comments` WHERE `bid` NOT IN (SELECT DISTINCT `bid` FROM `".$config->db_prefix."_bans`)") or die (mysql_error());
	
	if(!$repair) return mysql_num_rows($query);
	
	while($result = mysql_fetch_object($query)) {
		//delete db entry
		$query2 = mysql_query("DELETE FROM `".$config->db_prefix."_comments` WHERE `id`=".$result->id." LIMIT 1") or die (mysql_error());
		$repaired++;
	}
	return $repaired;
}
function sql_get_comments($bid,&$count) {
	global $config;
	$query = mysql_query("SELECT * FROM `".$config->db_prefix."_comments` WHERE `bid`=".$bid." ORDER BY `date` ASC") or die (mysql_error());
	//Array aufbereiten
	$comments=array();
	while($result = mysql_fetch_object($query)) {
		$comment=array(
			"id"=>$result->id,
			"name"=>html_safe($result->name),
			"comment"=>html_safe($result->comment),
			"email"=>html_safe($result->email),
			"addr"=>$result->addr,
			"date"=>$result->date
		);
		$count++;
		$comments[]=$comment;
	}
	return $comments;
}
function sql_get_files_count($bid) {
	global $config;
	$query = mysql_query("SELECT COUNT(*) FROM `".$config->db_prefix."_files`".(($bid) ?" WHERE `bid`=".$bid : "")) or die (mysql_error());
	return mysql_result($query,0);
}
function sql_get_files_count_fail($repair=0) {
	global $config;
	$fail=0;
	$repaired=0;
	//first search in the db for files without a ban
	$query = mysql_query("SELECT * FROM `".$config->db_prefix."_files` WHERE `bid` NOT IN (SELECT DISTINCT `bid` FROM `".$config->db_prefix."_bans`)") or die (mysql_error());
	$fail=mysql_num_rows($query);
	//search files without db entry
	$d=opendir($config->path_root."/include/files/");
	while($f=readdir($d)) {
		if($f=="." || $f==".." || is_dir($config->path_root."/include/files/".$f) || $f=="index.php") continue;
		if(is_file($config->path_root."/include/files/".$f)) {
			$f=str_replace("_thumb","",$f);
			$query2 = mysql_query("SELECT * FROM `".$config->db_prefix."_files` WHERE `demo_file`='".$f."'") or die (mysql_error());
			if(!mysql_num_rows($query2)) {
				$files[]=$f;
				$fail++;
			}
		}
	}
	closedir($d);
	if(!$repair) return $fail;
	//delete fails from db
	while($result = mysql_fetch_object($query)) {
		//delete files
		if(file_exists("include/files/".$result->demo_file)) unlink("include/files/".$result->demo_file);
		if(file_exists("include/files/".$result->demo_file."_thumb")) unlink("include/files/".$result->demo_file."_thumb");
		//delete db entry
		$query3 = mysql_query("DELETE FROM `".$config->db_prefix."_files` WHERE `id`=".$result->id." LIMIT 1") or die (mysql_error());
		$repaired++;
	}
	//delete files from dir without db entry
	for($i=0;$i<sizeof($files);$i++) {
		if(file_exists("include/files/".$files[$i])) unlink("include/files/".$files[$i]);
		if(file_exists("include/files/".$files[$i]."_thumb")) unlink("include/files/".$files[$i]."_thumb");
		$repaired++;
	}
	return $repaired;
}
function sql_get_files($bid,&$count) {
	global $config;
	$query = mysql_query("SELECT * FROM `".$config->db_prefix."_files` WHERE `bid`=".$bid." ORDER BY `upload_time` ASC") or die (mysql_error());
	//Array aufbereiten
	$files=array();
	while($result = mysql_fetch_object($query)) {
		if(file_exists("include/files/".$result->demo_file."_thumb")) $thumb=1;
		$file=array(
			"id"=>$result->id,
			"demo_file"=>$result->demo_file,
			"demo_real"=>html_safe($result->demo_real),
			"comment"=>html_safe($result->comment),
			"upload_time"=>$result->upload_time,
			"down_count"=>$result->down_count,
			"name"=>html_safe($result->name),
			"email"=>html_safe($result->email),
			"file_size"=>$result->file_size,
			"addr"=>$result->addr,
			"thumb"=>$thumb
		);
		$count++;
		$files[]=$file;
	}
	return $files;
}
function sql_get_search_amxadmins(&$amxadmins,&$nickadmins) {
	global $config;
	$query = mysql_query("SELECT `admin_id`,`admin_nick` FROM `".$config->db_prefix."_bans` GROUP BY `admin_id` ORDER BY `admin_nick`") or die (mysql_error());	
	while($result = mysql_fetch_object($query)) {
		$checkQry = mysql_query("SELECT * FROM `".$config->db_prefix."_amxadmins` WHERE `steamid`='".$result->admin_id."' GROUP BY `steamid`") or die (mysql_error());
		if( mysql_num_rows($checkQry) > 0 ) {
			//-- Is Found
			if($result->admin_id <> "")	$amxadmins[]=array("steam"=>$result->admin_id,"nick"=>html_safe($result->admin_nick));
		} else {
			//-- Not Found
			if($result->admin_id <> "")	$nickadmins[]=array("steam"=>$result->admin_id,"nick"=>html_safe($result->admin_nick));
		}
	}
}
function sql_get_search_servers() {
	global $config;
	$servers = array();
	$query = mysql_query("SELECT `server_ip`,`server_name` FROM `".$config->db_prefix."_bans` GROUP BY `server_ip` ORDER BY `server_name`") or die (mysql_error());
	//Array aufbereiten
	while($result = mysql_fetch_object($query)) {
		if($result->server_name=="website") {
			$servers["website"]="_WEB";
		} else {
			$servers[$result->server_ip]=html_safe($result->server_name);
		}
	}
	return $servers;
}
function sql_get_search_reasons() {
	global $config;
	$query = mysql_query("SELECT DISTINCT `ban_reason` FROM `".$config->db_prefix."_bans` ORDER BY `ban_reason`") or die (mysql_error());
	//Array aufbereiten
	while($result = mysql_fetch_object($query)) {
		$reasons[$result->ban_reason]=html_safe($result->ban_reason);
	}
	return $reasons;
}
function sql_get_search_bans($search,$active=1,&$count=0) {
	global $config;
	$query = mysql_query("SELECT * FROM `".$config->db_prefix."_bans` WHERE ".$search." AND `expired`=".(($active==1)?0:1)." ORDER BY `ban_created` DESC") or die (mysql_error());
	//Array aufbereiten
	
	$ban_list = array();
	while($result = mysql_fetch_object($query)) {
		if(!empty($result->player_id)) {
			$steamid = htmlentities($result->player_id, ENT_QUOTES);
			$steamcomid = GetFriendId($steamid);
			$query2 = mysql_query("SELECT COUNT(*) FROM `".$config->db_prefix."_bans` WHERE `player_id`='".$result->player_id."' AND `expired`=1");
			$bancount=mysql_result($query2,0);
		}
		$ban_row=array(
			"bid" 			=> $result->bid,
			"player_ip" 	=> $result->player_ip,
			"player_id" 	=> $result->player_id,
			"player_comid"	=> $steamcomid,
			"player_nick" 	=> html_safe($result->player_nick),
			"admin_ip" 		=> $result->admin_ip,
			"admin_id" 		=> $result->admin_id,
			"admin_nick" 	=> html_safe($result->admin_nick),
			"ban_type" 		=> $result->ban_type,
			"ban_reason" 	=> html_safe($result->ban_reason),
			"ban_created" 	=> $result->ban_created,
			"ban_length" 	=> $result->ban_length,
			"ban_end"		=> ($result->ban_created + ($result->ban_length * 60)),
			"server_ip" 	=> $result->server_ip,
			"server_name" 	=> html_safe($result->server_name),
			"bancount"		=> $bancount
		);
		if($config->show_kick_count=="1") {
			$ban_row["kick_count"]=$result->ban_kicks;
			$ban_page["show_kicks"]=1;
		}
		if($config->show_demo_count=="1") {
			$file_count=0;
			sql_get_files($result->bid,$file_count);
			$ban_row["demo_count"]=$file_count;
			$ban_page["show_demos"]=1;
		}
		if($config->show_comment_count=="1") {
			$comment_count=0;
			sql_get_comments($result->bid,$comment_count);
			$ban_row["comment_count"]=$comment_count;
			$ban_page["show_comments"]=1;
		}
		$count++;
		$ban_list[]=$ban_row;
	}
	return $ban_list;
}
function sql_get_bans_count($activ_only=1) {
	global $config;

	if($activ_only == '1') {
		$active = " WHERE (((ban_created+(ban_length*60)) > ".time()." OR ban_length=0))";
	} else {
		$active = "";
	}

	$query = mysql_query("SELECT COUNT(*) FROM `".$config->db_prefix."_bans`".$active) or die ("Fuck: ".mysql_error());
	return mysql_result($query,0);
}
function sql_get_logs($filter) {
	global $config;
	if($filter) $where="WHERE ".$filter;
	$query = mysql_query("SELECT * FROM `".$config->db_prefix."_logs` ".$where." ORDER BY `timestamp` DESC") or die (mysql_error());
	//Array aufbereiten
	$rows=array();
	while($row=mysql_fetch_assoc($query)) {
		$rows[]=$row;
	}
	array_walk_recursive($rows,"escape_array");
	return $rows;
}
function escape_array($value,$key) {
	$value=html_safe($value);
}
?>
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2047
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 33 times
Been thanked: 332 times
Contact:

02 Feb 2019, 20:07

lasă-mi și db.config.inc.php
sql.inc | Afiseaza codul
[code]
<?php

/* 	

	AMXBans v6.0
	
	Copyright 2009, 2010 by SeToY & |PJ|ShOrTy

	This file is part of AMXBans.

    AMXBans is free software, but it's licensed under the
	Creative Commons - Attribution-NonCommercial-ShareAlike 2.0

    AMXBans is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    You should have received a copy of the cc-nC-SA along with AMXBans.  
	If not, see <http://creativecommons.org/licenses/by-nc-sa/2.0/>.

*/

// sql functions

function sql_set_websettings() {
	global $config;
	$query = @mysql_query("SELECT * FROM `".$config->db_prefix."_webconfig`") or die (@mysql_error());
	$result = @mysql_fetch_object($query);
	$config->cookie=$result->cookie;
	$config->bans_per_page=($result->bans_per_page)<1 ? 1:$result->bans_per_page;
	$config->design = $result->design;
	$config->banner = $result->banner;
	$config->banner_url = $result->banner_url;
	$config->default_lang = $result->default_lang;
	$config->start_page = $result->start_page;
	$config->show_kick_count = $result->show_kick_count;
	$config->show_comment_count = $result->show_comment_count;
	$config->show_demo_count = $result->show_demo_count;
	$config->demo_all = $result->demo_all;
	$config->max_file_size = $result->max_file_size;
	$config->file_type = $result->file_type;
	$config->comment_all = $result->comment_all;
	$config->use_capture = $result->use_capture;
	$config->auto_prune = $result->auto_prune;
	$config->max_offences = $result->max_offences;
	$config->max_offences_reason = $result->max_offences_reason;
	$config->use_demo = $result->use_demo;
	$config->use_comment = $result->use_comment;
	//set vars to an array
	$vars=array(
			"cookie"=>trim($config->cookie),
			"design"=>$config->design,
			"bans_per_page"=>(int)$config->bans_per_page,
			"banner"=>$config->banner,
			"banner_url"=>$config->banner_url,
			"default_lang"=>$config->default_lang,
			"start_page"=>$config->start_page,
			"show_kick_count"=>$config->show_kick_count,
			"show_demo_count"=>$config->show_demo_count,
			"show_comment_count"=>$config->show_comment_count,
			"demo_all" => $config->demo_all,
			"comment_all" => $config->comment_all,
			"use_capture" => $config->use_capture,
			"max_file_size" => (int)$config->max_file_size,
			"file_type" => trim($config->file_type),
			"auto_prune" => (int)$config->auto_prune,
			"max_offences" => (int)$config->max_offences,
			"max_offences_reason" => $config->max_offences_reason,
			"use_demo" => (int)$result->use_demo,
			"use_comment" => $result->use_comment
		);
	return $vars;
}
function sql_get_server($serverid=0) {
	global $config;
	if($serverid) {
		$query = @mysql_query("SELECT * FROM `".$config->db_prefix."_serverinfo` WHERE `id`=".$serverid." LIMIT 1") or die (@mysql_error());
	} else {
		$query = @mysql_query("SELECT * FROM `".$config->db_prefix."_serverinfo` ORDER BY `address` ASC") or die (@mysql_error());
		$servers=array();
	}
	while($result = @mysql_fetch_object($query)) {
		$server=array(
			"sid"=>$result->id,
			"timestamp"=>$result->timestamp,
			"hostname"=>html_safe($result->hostname),
			"address"=>$result->address,
			"gametype"=>$result->gametype,
			"rcon"=>$result->rcon,
			"amxban_version"=>$result->amxban_version,
			"amxban_motd"=>$result->amxban_motd,
			"motd_delay"=>$result->motd_delay,
			"amxban_menu"=>$result->amxban_menu,
			"reasons"=>$result->reasons,
			"timezone_fixx"=>$result->timezone_fixx
		);
		if(!$serverid) $servers[]=$server;
	}
	if(!$serverid) return $servers;
	return $server;
}
function sql_get_server_ids() {
	global $config;
	$query = @mysql_query("SELECT `id` FROM `".$config->db_prefix."_serverinfo` ORDER BY `address` ASC") or die (@mysql_error());
	$serverids=array();
	while($result = @mysql_fetch_object($query)) {
		$serverids[]=$result->id;
	}
	return $serverids;
}
function sql_get_reasons_set() {
	global $config;
	$query = @mysql_query("SELECT * FROM `".$config->db_prefix."_reasons_set` ORDER BY `setname` ASC") or die (@mysql_error());
	$reasons_set=array();
	while($result = @mysql_fetch_object($query)) {
		$reason_set=array(
			"id"=>$result->id,
			"setname"=>html_safe($result->setname)
			);
		$query2 = @mysql_query("SELECT * FROM `".$config->db_prefix."_reasons_to_set` WHERE `setid`=".$result->id) or die (@mysql_error());
		$reasons="";
		while($result2 = @mysql_fetch_object($query2)) {
			$reasons.=($reasons)?",".$result2->reasonid:$result2->reasonid;
		}
		$reason_set["reasonids"]=$reasons;
		$reasons_set[]=$reason_set;
	}
	return $reasons_set;
}
function sql_get_reasons() {
	global $config;
	$query = @mysql_query("SELECT * FROM `".$config->db_prefix."_reasons` ORDER BY `id` ASC") or die (@mysql_error());
	$reasons=array();
	while($result = @mysql_fetch_object($query)) {
		$reason=array(
			"id"=>$result->id,
			"reason"=>html_safe($result->reason),
			"static_bantime"=>$result->static_bantime
			);
		$reasons[]=$reason;
	}
	return $reasons;
}
function sql_get_reasons_list() {
	global $config;
	$reasons = array();
	$query = @mysql_query("SELECT reason FROM `".$config->db_prefix."_reasons` ORDER BY `id` ASC") or die (@mysql_error());
	while($result = @mysql_fetch_object($query)) {
		$reasons[]=$result->reason;
	}
	return $reasons;
}
function sql_get_amxadmins() {
	global $config;
	$query = @mysql_query("SELECT * FROM `".$config->db_prefix."_amxadmins` ORDER BY `ashow` DESC,`expired`,`access` DESC,`username` ASC") or die (@mysql_error());
	$admins=array();
	while($result = @mysql_fetch_object($query)) {
		$admin=array(
			"aid"=>$result->id,
			"username"=>html_safe($result->username),
			"password"=>$result->password,
			"access"=>$result->access,
			"flags"=>$result->flags,
			"steamid"=>$result->steamid,
			"nickname"=>html_safe($result->nickname),
			"ashow"=>$result->ashow,
			"created"=>$result->created,
			"expired"=>$result->expired,
			"days"=>$result->days
		);
		$admins[]=$admin;
	}
	return $admins;
}
function sql_get_amxadmins_list() {
	global $config;
	$query = @mysql_query("SELECT * FROM `".$config->db_prefix."_amxadmins` WHERE `ashow`=1 AND (`expired`=0 OR `expired`>UNIX_TIMESTAMP()) ORDER BY `expired`,`access` DESC,`username` ASC") or die (@mysql_error());
	$admins=array();
	while($result = @mysql_fetch_object($query)) {
		if(!empty($result->steamid)) {
			$steamid = htmlentities($result->steamid, ENT_QUOTES);
			$steamcomid = GetFriendId($steamid);
		}
		$admin=array(
			"aid"=>$result->id,
			"username"=>html_safe($result->username),
			"comid"=>$steamcomid,
			"password"=>$result->password,
			"access"=>$result->access,
			"flags"=>$result->flags,
			"steamid"=>$result->steamid,
			"nickname"=>html_safe($result->nickname),
			"ashow"=>$result->ashow,
			"created"=>$result->created,
			"expired"=>$result->expired,
			"days"=>$result->days
		);
		$admins[]=$admin;
	}
	return $admins;
}
function sql_get_amxadmins_server($server) {
	global $config;
	$query = @mysql_query("SELECT * FROM `".$config->db_prefix."_amxadmins` ORDER BY `ashow` DESC,`expired`,`access` DESC,`username` ASC") or die (@mysql_error());
	$admins=array();
	while($result = @mysql_fetch_object($query)) {
		$query2 = @mysql_query("SELECT `custom_flags`,`use_static_bantime` FROM `".$config->db_prefix."_admins_servers` WHERE `admin_id`=".$result->id." AND `server_id`=".$server) or die (@mysql_error());
		if($result2 = @mysql_fetch_object($query2)) {
				$custom_flags=$result2->custom_flags;
				$static_bantime=$result2->use_static_bantime;
				$aktiv=1;
		} else {
				$custom_flags="";
				$static_bantime="no";
				$aktiv=0;
		}
		$admin=array(
			"sid"=>$server,
			"aid"=>$result->id,
			"username"=>html_safe($result->username),
			"password"=>$result->password,
			"access"=>$result->access,
			"flags"=>$result->flags,
			"steamid"=>$result->steamid,
			"nickname"=>html_safe($result->nickname),
			"ashow"=>$result->ashow,
			"custom_flags"=>$custom_flags,
			"use_static_bantime"=>$static_bantime,
			"aktiv"=>$aktiv
		);
		$admins[]=$admin;
	}
	return $admins;
}
function sql_get_webadmins() {
	global $config;
	$query = @mysql_query("SELECT id,username,level,last_action,email FROM `".$config->db_prefix."_webadmins` ORDER BY `level`,`username`") or die (@mysql_error());
	$users=array();
	
	while($result = @mysql_fetch_object($query)) {
		$user=array(
			"uid"=>$result->id,
			"name"=>html_safe($result->username),
			"level"=>$result->level,
			"last_action"=>$result->last_action,
			"email"=>html_safe($result->email)
		);
		$users[]=$user;
	}
	return $users;
}

function sql_get_server_admins($server) {
	global $config;
	$serveradmins=array();
	$query = @mysql_query("SELECT s.admin_id,s.custom_flags,s.use_static_bantime,a.username FROM ".$config->db_prefix."_admins_servers as s,".$config->db_prefix."_amxadmins as a WHERE s.server_id=".$server) or die (@mysql_error());
	$admins=array();
	while($result = @mysql_fetch_object($query)) {
		$admin=array(
			"admin_id"=>$result->admin_id,
			"custom_flags"=>$result->custom_flags,
			"use_static_bantime"=>$result->static_bantime,
			"username"=>html_safe($result->username)
		);
		$admins[]=$admin;
	}
	return $admins;
}
function sql_get_usermenu(&$count) {
	global $config;
	//get menu from db
	global $count;
	$menu=array();
	$query = @mysql_query("SELECT * FROM `".$config->db_prefix."_usermenu` ORDER BY `pos` ASC") or die (@mysql_error());
	$count=0;
	while($result = @mysql_fetch_object($query)) {
		$men=array(
			"id"=>$result->id,
			"pos"=>$result->pos,
			"activ"=>$result->activ,
			"lang_key"=>$result->lang_key,
			"url"=>$result->url,
			"lang_key2"=>$result->lang_key2,
			"url2"=>$result->url2,
		);
		$count++;
		$menu[]=$men;
	}
	
	return $menu;
}
function sql_get_modules($aktiv_only=0,&$count) {
	global $config;
	global $mysql;
	$select="SELECT * FROM `".$config->db_prefix."_modulconfig`";
	if($aktiv_only===1) $select.=" WHERE `activ`=1";
	$select.=" ORDER BY `name` ASC";
	
	$query = @mysql_query($select,$mysql) or die (@mysql_error());
	$modules=array();
	while($result = @mysql_fetch_object($query)) {
		$modul=array(
			"id"=>$result->id,
			"menuname"=>html_safe($result->menuname),
			"name"=>html_safe($result->name),
			"index"=>$result->index,
			"activ"=>$result->activ,
			"admin_page_exists"=>file_exists("include/modules/modul_".$result->name.".php")?1:0,
			"tpl_exists"=>file_exists("templates/modul_".$result->name.".tpl")?1:0,
			"index_exists"=>file_exists($result->index.".php")?1:0
		);
		$count++;
		$modules[]=$modul;
	}
	return $modules;
}
function sql_get_ban_details($bid) {
	global $config;
	//banns for ID
	#$query = @mysql_query("SELECT ba.*, se.gametype,se.timezone_fixx, aa.nickname, wa.username FROM `".$config->db_prefix."_bans` AS ba 
	#			LEFT JOIN `".$config->db_prefix."_serverinfo` AS se ON ba.server_ip=se.address 
	#			LEFT JOIN `".$config->db_prefix."_amxadmins` AS aa ON (aa.steamid=ba.admin_nick OR aa.steamid=ba.admin_ip OR aa.steamid=ba.admin_id) 
	#			LEFT JOIN `".$config->db_prefix."_webadmins` AS wa ON wa.username=ba.admin_nick WHERE ba.bid=".$bid." LIMIT 1") or die (@mysql_error());
	$query = @mysql_query("SELECT ba.*, se.gametype,se.timezone_fixx, aa.nickname,aa.username FROM `".$config->db_prefix."_bans` AS ba 
				LEFT JOIN `".$config->db_prefix."_serverinfo` AS se ON ba.server_ip=se.address 
				LEFT JOIN `".$config->db_prefix."_amxadmins` AS aa ON (aa.steamid=ba.admin_nick OR aa.steamid=ba.admin_ip OR aa.steamid=ba.admin_id) 
				WHERE ba.bid=".$bid." LIMIT 1") or die (@mysql_error());
	//Array aufbereiten
	$ban_row=@mysql_fetch_assoc($query);
	//timezone fixx and ban_end calc
	$ban_row["ban_created"]=($ban_row["ban_created"] + ($ban_row["timezone_fixx"] * 60 * 60));
	$ban_row["ban_end"]=($ban_row["ban_created"] + ($ban_row["ban_length"] * 60));
	$ban_row["player_nick"] = html_safe($ban_row["player_nick"]);
	
	return $ban_row;
}
function sql_get_ban_details_activ($steamid,&$count,$bid) {
	global $config;
	//banns for ID without $bid
	$query = @mysql_query("SELECT ba.*,se.timezone_fixx FROM `".$config->db_prefix."_bans` AS ba 
				LEFT JOIN `".$config->db_prefix."_serverinfo` AS se ON ba.server_ip=se.address
				WHERE `player_id`='".$steamid."' AND `expired`=0 AND `bid`<>".$bid) or die (@mysql_error());
	//Array aufbereiten
	$ban_rows=array();
	while($ban_row=@mysql_fetch_assoc($query)) {
		$count++;
		//timezone fixx and ban_end calc
		$ban_row["ban_created"]=($ban_row["ban_created"] + ($ban_row["timezone_fixx"] * 60 * 60));
		$ban_row["ban_end"]=($ban_row["ban_created"] + ($ban_row["ban_length"] * 60));
		$ban_rows[]=$ban_row;
	}
	return $ban_rows;
}
function sql_get_ban_details_exp($steamid,&$count,$bid) {
	global $config;
	//exp bans for ID without $bid
	$query = @mysql_query("SELECT ba.*,se.timezone_fixx FROM `".$config->db_prefix."_bans` AS ba 
				LEFT JOIN `".$config->db_prefix."_serverinfo` AS se ON ba.server_ip=se.address
				WHERE `player_id`='".$steamid."' AND `expired`=1 AND `bid`<>".$bid) or die (@mysql_error());
	//Array aufbereiten
	$ban_rows=array();
	while($ban_row=@mysql_fetch_assoc($query)) {
		$count++;
		//timezone fixx and ban_end calc
		$ban_row["ban_created"]=($ban_row["ban_created"] + ($ban_row["timezone_fixx"] * 60 * 60));
		$ban_row["ban_end"]=($ban_row["ban_created"] + ($ban_row["ban_length"] * 60));
		$ban_rows[]=$ban_row;
	}
	return $ban_rows;
}
function sql_get_ban_details_motd_exp($steamid,&$count) {
	global $config;
	//exp bans for ID without $bid
	$query = @mysql_query("SELECT ba.*,se.timezone_fixx FROM `".$config->db_prefix."_bans` AS ba 
				LEFT JOIN `".$config->db_prefix."_serverinfo` AS se ON ba.server_ip=se.address
				WHERE `player_id`='".$steamid."' AND `expired`=1 ORDER BY ban_created DESC") or die (@mysql_error());
	//Array aufbereiten
	$ban_rows=array();
	while($ban_row=@mysql_fetch_assoc($query)) {
		//timezone fixx and ban_end calc
		$ban_row["ban_created"]=($ban_row["ban_created"] + ($ban_row["timezone_fixx"] * 60 * 60));
		$ban_row["ban_end"]=($ban_row["ban_created"] + ($ban_row["ban_length"] * 60));
		
		if($ban_row["server_ip"]!="website") {
			if($show_admin==0 && $ban_row["nickname"]!="") {
				$ban_row["admin_nick"]=$ban_row["nickname"];
			}
		}
				
		$ban_row["player_nick"]=html_safe($ban_row["player_nick"]);
		$ban_row["admin_nick"]=html_safe($ban_row["admin_nick"]);
		$ban_row["server_name"]=html_safe($ban_row["server_name"]);
		
		$ban_rows[]=$ban_row;
		$count++;
	}
	return $ban_rows;
}
function sql_get_comments_count($bid) {
	global $config;
	$query = @mysql_query("SELECT COUNT(*) FROM `".$config->db_prefix."_comments`".(($bid) ?" WHERE `bid`=".$bid : "")) or die (@mysql_error());
	return @mysql_result($query,0);
}
function sql_get_comments_count_fail($repair=0) {
	global $config;
	$repaired=0;
	//first search in the db for files without a ban
	$query = @mysql_query("SELECT * FROM `".$config->db_prefix."_comments` WHERE `bid` NOT IN (SELECT DISTINCT `bid` FROM `".$config->db_prefix."_bans`)") or die (@mysql_error());
	
	if(!$repair) return @mysql_num_rows($query);
	
	while($result = @mysql_fetch_object($query)) {
		//delete db entry
		$query2 = @mysql_query("DELETE FROM `".$config->db_prefix."_comments` WHERE `id`=".$result->id." LIMIT 1") or die (@mysql_error());
		$repaired++;
	}
	return $repaired;
}
function sql_get_comments($bid,&$count) {
	global $config;
	$query = @mysql_query("SELECT * FROM `".$config->db_prefix."_comments` WHERE `bid`=".$bid." ORDER BY `date` ASC") or die (@mysql_error());
	//Array aufbereiten
	$comments=array();
	while($result = @mysql_fetch_object($query)) {
		$comment=array(
			"id"=>$result->id,
			"name"=>html_safe($result->name),
			"comment"=>html_safe($result->comment),
			"email"=>html_safe($result->email),
			"addr"=>$result->addr,
			"date"=>$result->date
		);
		$count++;
		$comments[]=$comment;
	}
	return $comments;
}
function sql_get_files_count($bid) {
	global $config;
	$query = @mysql_query("SELECT COUNT(*) FROM `".$config->db_prefix."_files`".(($bid) ?" WHERE `bid`=".$bid : "")) or die (@mysql_error());
	return @mysql_result($query,0);
}
function sql_get_files_count_fail($repair=0) {
	global $config;
	$fail=0;
	$repaired=0;
	//first search in the db for files without a ban
	$query = @mysql_query("SELECT * FROM `".$config->db_prefix."_files` WHERE `bid` NOT IN (SELECT DISTINCT `bid` FROM `".$config->db_prefix."_bans`)") or die (@mysql_error());
	$fail=@mysql_num_rows($query);
	//search files without db entry
	$d=opendir($config->path_root."/include/files/");
	while($f=readdir($d)) {
		if($f=="." || $f==".." || is_dir($config->path_root."/include/files/".$f) || $f=="index.php") continue;
		if(is_file($config->path_root."/include/files/".$f)) {
			$f=str_replace("_thumb","",$f);
			$query2 = @mysql_query("SELECT * FROM `".$config->db_prefix."_files` WHERE `demo_file`='".$f."'") or die (@mysql_error());
			if(!@mysql_num_rows($query2)) {
				$files[]=$f;
				$fail++;
			}
		}
	}
	closedir($d);
	if(!$repair) return $fail;
	//delete fails from db
	while($result = @mysql_fetch_object($query)) {
		//delete files
		if(file_exists("include/files/".$result->demo_file)) unlink("include/files/".$result->demo_file);
		if(file_exists("include/files/".$result->demo_file."_thumb")) unlink("include/files/".$result->demo_file."_thumb");
		//delete db entry
		$query3 = @mysql_query("DELETE FROM `".$config->db_prefix."_files` WHERE `id`=".$result->id." LIMIT 1") or die (@mysql_error());
		$repaired++;
	}
	//delete files from dir without db entry
	for($i=0;$i<sizeof($files);$i++) {
		if(file_exists("include/files/".$files[$i])) unlink("include/files/".$files[$i]);
		if(file_exists("include/files/".$files[$i]."_thumb")) unlink("include/files/".$files[$i]."_thumb");
		$repaired++;
	}
	return $repaired;
}
function sql_get_files($bid,&$count) {
	global $config;
	$query = @mysql_query("SELECT * FROM `".$config->db_prefix."_files` WHERE `bid`=".$bid." ORDER BY `upload_time` ASC") or die (@mysql_error());
	//Array aufbereiten
	$files=array();
	while($result = @mysql_fetch_object($query)) {
		if(file_exists("include/files/".$result->demo_file."_thumb")) $thumb=1;
		$file=array(
			"id"=>$result->id,
			"demo_file"=>$result->demo_file,
			"demo_real"=>html_safe($result->demo_real),
			"comment"=>html_safe($result->comment),
			"upload_time"=>$result->upload_time,
			"down_count"=>$result->down_count,
			"name"=>html_safe($result->name),
			"email"=>html_safe($result->email),
			"file_size"=>$result->file_size,
			"addr"=>$result->addr,
			"thumb"=>$thumb
		);
		$count++;
		$files[]=$file;
	}
	return $files;
}
function sql_get_search_amxadmins(&$amxadmins,&$nickadmins) {
	global $config;
	$query = @mysql_query("SELECT `admin_id`,`admin_nick` FROM `".$config->db_prefix."_bans` GROUP BY `admin_id` ORDER BY `admin_nick`") or die (@mysql_error());	
	while($result = @mysql_fetch_object($query)) {
		$checkQry = @mysql_query("SELECT * FROM `".$config->db_prefix."_amxadmins` WHERE `steamid`='".$result->admin_id."' GROUP BY `steamid`") or die (@mysql_error());
		if( @mysql_num_rows($checkQry) > 0 ) {
			//-- Is Found
			if($result->admin_id <> "")	$amxadmins[]=array("steam"=>$result->admin_id,"nick"=>html_safe($result->admin_nick));
		} else {
			//-- Not Found
			if($result->admin_id <> "")	$nickadmins[]=array("steam"=>$result->admin_id,"nick"=>html_safe($result->admin_nick));
		}
	}
}
function sql_get_search_servers() {
	global $config;
	$servers = array();
	$query = @mysql_query("SELECT `server_ip`,`server_name` FROM `".$config->db_prefix."_bans` GROUP BY `server_ip` ORDER BY `server_name`") or die (@mysql_error());
	//Array aufbereiten
	while($result = @mysql_fetch_object($query)) {
		if($result->server_name=="website") {
			$servers["website"]="_WEB";
		} else {
			$servers[$result->server_ip]=html_safe($result->server_name);
		}
	}
	return $servers;
}
function sql_get_search_reasons() {
	global $config;
	$query = @mysql_query("SELECT DISTINCT `ban_reason` FROM `".$config->db_prefix."_bans` ORDER BY `ban_reason`") or die (@mysql_error());
	//Array aufbereiten
	while($result = @mysql_fetch_object($query)) {
		$reasons[$result->ban_reason]=html_safe($result->ban_reason);
	}
	return $reasons;
}
function sql_get_search_bans($search,$active=1,&$count=0) {
	global $config;
	$query = @mysql_query("SELECT * FROM `".$config->db_prefix."_bans` WHERE ".$search." AND `expired`=".(($active==1)?0:1)." ORDER BY `ban_created` DESC") or die (@mysql_error());
	//Array aufbereiten
	
	$ban_list = array();
	while($result = @mysql_fetch_object($query)) {
		if(!empty($result->player_id)) {
			$steamid = htmlentities($result->player_id, ENT_QUOTES);
			$steamcomid = GetFriendId($steamid);
			$query2 = @mysql_query("SELECT COUNT(*) FROM `".$config->db_prefix."_bans` WHERE `player_id`='".$result->player_id."' AND `expired`=1");
			$bancount=@mysql_result($query2,0);
		}
		$ban_row=array(
			"bid" 			=> $result->bid,
			"player_ip" 	=> $result->player_ip,
			"player_id" 	=> $result->player_id,
			"player_comid"	=> $steamcomid,
			"player_nick" 	=> html_safe($result->player_nick),
			"admin_ip" 		=> $result->admin_ip,
			"admin_id" 		=> $result->admin_id,
			"admin_nick" 	=> html_safe($result->admin_nick),
			"ban_type" 		=> $result->ban_type,
			"ban_reason" 	=> html_safe($result->ban_reason),
			"ban_created" 	=> $result->ban_created,
			"ban_length" 	=> $result->ban_length,
			"ban_end"		=> ($result->ban_created + ($result->ban_length * 60)),
			"server_ip" 	=> $result->server_ip,
			"server_name" 	=> html_safe($result->server_name),
			"bancount"		=> $bancount
		);
		if($config->show_kick_count=="1") {
			$ban_row["kick_count"]=$result->ban_kicks;
			$ban_page["show_kicks"]=1;
		}
		if($config->show_demo_count=="1") {
			$file_count=0;
			sql_get_files($result->bid,$file_count);
			$ban_row["demo_count"]=$file_count;
			$ban_page["show_demos"]=1;
		}
		if($config->show_comment_count=="1") {
			$comment_count=0;
			sql_get_comments($result->bid,$comment_count);
			$ban_row["comment_count"]=$comment_count;
			$ban_page["show_comments"]=1;
		}
		$count++;
		$ban_list[]=$ban_row;
	}
	return $ban_list;
}
function sql_get_bans_count($activ_only=1) {
	global $config;

	if($activ_only == '1') {
		$active = " WHERE (((ban_created+(ban_length*60)) > ".time()." OR ban_length=0))";
	} else {
		$active = "";
	}

	$query = @mysql_query("SELECT COUNT(*) FROM `".$config->db_prefix."_bans`".$active) or die ("Fuck: ".@mysql_error());
	return @mysql_result($query,0);
}
function sql_get_logs($filter) {
	global $config;
	if($filter) $where="WHERE ".$filter;
	$query = @mysql_query("SELECT * FROM `".$config->db_prefix."_logs` ".$where." ORDER BY `timestamp` DESC") or die (@mysql_error());
	//Array aufbereiten
	$rows=array();
	while($row=@mysql_fetch_assoc($query)) {
		$rows[]=$row;
	}
	array_walk_recursive($rows,"escape_array");
	return $rows;
}
function escape_array($value,$key) {
	$value=html_safe($value);
}
?>[/code]
sau încearcă versiunile de mai jos

http://forum.amxbans.net/viewforum.php?f=6
6.13 e stabil,poți vedea cum se comportă și cele beta gen 6.14.4
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
User avatar
IoNuT.
Membru, skill +1
Membru, skill +1
Posts: 126
Joined: 21 Jul 2016, 13:58
Detinator Steam: Da
CS Status: Activ
Detinator server CS: Cs.Pro-League.Ro
SteamID: STEAM_0:0:47999435
Reputatie: Membru Club eXtreamCS (10 Mar - 10 Apr)
Fond eXtream: 0
Location: Ploiesti
Contact:

02 Feb 2019, 20:12

db.config.inc.php
| Afiseaza codul
<?php

	$config->document_root = "/banlist";
	$config->path_root = "/home/proleagu/public_html/banlist";

	$config->db_host = "tni";
	$config->db_user = "vuser35";
	$config->db_pass = "parola";
	$config->db_db = "vuser35";
	$config->db_prefix = "amx";
	
?>

lagat de sql.inc => Access denied for user ''@'localhost' (using password: NO)
Last edited by IoNuT. on 02 Feb 2019, 20:21, edited 1 time in total.
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2047
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 33 times
Been thanked: 332 times
Contact:

02 Feb 2019, 20:18

trebuia să cenzurezi datele..vezi postul meu anterior
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
User avatar
IoNuT.
Membru, skill +1
Membru, skill +1
Posts: 126
Joined: 21 Jul 2016, 13:58
Detinator Steam: Da
CS Status: Activ
Detinator server CS: Cs.Pro-League.Ro
SteamID: STEAM_0:0:47999435
Reputatie: Membru Club eXtreamCS (10 Mar - 10 Apr)
Fond eXtream: 0
Location: Ploiesti
Contact:

02 Feb 2019, 20:23

Deci ce sa fac ?!
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 2047
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Has thanked: 33 times
Been thanked: 332 times
Contact:

02 Feb 2019, 20:25

sau încearcă versiunile de mai jos

http://forum.amxbans.net/viewforum.php?f=6
6.13 e stabil,poți vedea cum se comportă și cele beta gen 6.14.4
Nu fac nimic contra cost! Faceți cerere bine detaliată aici, pe forum. Nu-mi mai dați add pe Steam doar pentru a mă avea în lista de prieteni.
User avatar
IoNuT.
Membru, skill +1
Membru, skill +1
Posts: 126
Joined: 21 Jul 2016, 13:58
Detinator Steam: Da
CS Status: Activ
Detinator server CS: Cs.Pro-League.Ro
SteamID: STEAM_0:0:47999435
Reputatie: Membru Club eXtreamCS (10 Mar - 10 Apr)
Fond eXtream: 0
Location: Ploiesti
Contact:

02 Feb 2019, 20:26

Ok .
Post Reply

Return to “Probleme in jocul Counter-Strike”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 14 guests