Autorius Tema: [Atsakyta] Warningas (using password: NO)  (Skaityta 1939 kartus)

Neprisijungęs nuodas159

  • Naujokas
  • *
  • Įrašai: 75
  • Karma: +0/-0
    • Žiūrėti profilį
[Atsakyta] Warningas (using password: NO)
« Įrašytas: 2012-07-15 15:48:59 pm »
Sveiki taigi norėčiau paklausti dėlko metą šį warningą?
[phpBB Debug] PHP Warning: in file [ROOT]db.config.inc.php on line 2: Attempt to assign property of non-object
[phpBB Debug] PHP Warning: in file [ROOT]db.config.inc.php on line 3: Attempt to assign property of non-object
[phpBB Debug] PHP Warning: in file [ROOT]db.config.inc.php on line 4: Attempt to assign property of non-object
[phpBB Debug] PHP Warning: in file [ROOT]db.config.inc.php on line 5: Attempt to assign property of non-object
[phpBB Debug] PHP Warning: in file [ROOT]db.config.inc.php on line 6: Attempt to assign property of non-object
[phpBB Debug] PHP Warning: in file [ROOT]/b.php on line 10: mysql_connect() [function.mysql-connect]: Access denied for user 'apache'@'localhost' (using password: NO)
[phpBB Debug] PHP Warning: in file [ROOT]/b.php on line 11: mysql_select_db() [function.mysql-select-db]: Access denied for user 'apache'@'localhost' (using password: NO)
[phpBB Debug] PHP Warning: in file [ROOT]/b.php on line 11: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established
[phpBB Debug] PHP Warning: in file [ROOT]/b.php on line 13: mysql_query() [function.mysql-query]: Access denied for user 'apache'@'localhost' (using password: NO)
[phpBB Debug] PHP Warning: in file [ROOT]/b.php on line 13: mysql_query() [function.mysql-query]: A link to the server could not be established
Access denied for user 'apache'@'localhost' (using password: NO)

Kodas:
<?php
define
('IN_PHPBB'true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH './';
$phpEx substr(strrchr(__FILE__'.'), 1);
include(
$phpbb_root_path 'common.' $phpEx);

require_once(
'db.config.inc.php');

$mysql mysql_connect($config->db_host,$config->db_user,$config->db_pass);
$selectdb mysql_select_db($config->db_db);

$serverinfo mysql_query("SELECT * FROM ".$config->db_prefix."_serverinfo ORDER BY hostname ASC") or die (mysql_error());

$server_array = array();
$addons_array = array();
$rules_array = array();
$anticheat_array = array();
$rules "";
while(
$result2 mysql_fetch_object($serverinfo)) {

$split_address explode (":"$result2->address);
$ip $split_address['0'];
$port $split_address['1'];

if($ip && $port) {
$server = new Rcon();
$ip=gethostbyname($ip);
$server->Connect($ip$port$result2->rcon);

$infos $server->Info();
if($infos) { //yes, infos ok
$players $server->Players();
$rules $server->ServerRules();

//copy rules to rules array for template
if(is_array($rules)) {
foreach($rules as $k => $v){
$rules_array[] =array("name"=>$k,"value"=>$v);
}
}
//check if mappic exists
if(file_exists("images/maps/".$infos[mod]."/".$infos[map].".jpg")) {
$mappic $infos[map];
} else {
$mappic "noimage";
}

//create addons array
if(is_array($rules)) {
if($rules[amxmodx_version]) $addons_array[]=array("name"=>"AmxModx","version"=>$rules[amxmodx_version],"url"=>"http://www.amxmodx.org");
if($rules[amxbans_version]) $addons_array[]=array("name"=>"AmxBans","version"=>$rules[amxbans_version],"url"=>"http://www.amxbans.de");
if($rules[metamod_version]) $addons_array[]=array("name"=>"MetaMod","version"=>$rules[metamod_version],"url"=>"http://www.metamod.org");
if($rules[hltv_report]) $addons_array[]=array("name"=>"HLTV Report","version"=>$rules[hltv_report],"url"=>"http://forums.alliedmods.net/showthread.php?t=66506");
if($rules[atac_version]) $addons_array[]=array("name"=>"ATAC","version"=>$rules[atac_version],"url"=>"http://forums.alliedmods.net/showthread.php?t=61572");

//create anticheat array
if($infos[secure]) $anticheat_array[]=array("name"=>"VAC","version"=>"2","url"=>"");
if($rules[sbsrv_version]) $anticheat_array[]=array("name"=>"Steambans","version"=>$rules[sbsrv_version],"url"=>"http://www.steambans.com");
if($rules[hlg_version]) $anticheat_array[]=array("name"=>"HLGuard","version"=>$rules[hlg_version],"url"=>"");
}
//main server info
$server_info = array(
"sid" => $result2->id,
"type" => $infos[type],
"version" => $infos[version],
"hostname"      => $infos[name], 
"map"          => $infos[map],
"mod"         => $infos[mod],
"game"          => $infos[game],
"appid"         => $infos[appid],
"cur_players" => $infos[activeplayers], 
"max_players" => $infos[maxplayers],
"bot_players" => $infos[botplayers],
"dedicated" => ($infos[dedicated]=="d")?"Dedicated":"Listen",
"os" => ($infos[os]=="l")?"Linux":"Windows",
"password" => $infos[password],
"secure" => $infos[secure],
"sversion" => $infos[sversion],
"timeleft" => $rules[amx_timeleft],
"maxrounds" => $rules[mp_maxrounds],
"timelimit" => $rules[mp_timelimit],
"nextmap" => $rules[amx_nextmap],
"friendlyfire" => $rules[mp_friendlyfire],
"address" => $result2->address,
"mappic" => $mappic,
"players" => ""
);

//get the players
$player_array = array();
$int $infos[activeplayers];
for ($i=0$i<$int$i++) {
$player $players[$i];

$player_info = array(
"name" => $player[name],
"frag" => $player[frag],
"time" => $player[time],
);

$player_array[] = $player_info;
}

$server_info[players] = $player_array;
$server_array[] = $server_info;
} else {
$server_info = array(
"sid" => $result2->id,
"type" => "",
"version" => "",
"hostname"     => $result2->hostname
"map"          => "",
"mod"         => $result2->gametype,
"game"          => "",
"appid"         => "",
"cur_players" => "0"
"max_players" => "0",
"bot_players" => "0",
"dedicated" => "",
"os" => "",
"password" => "",
"secure" => "",
"sversion" => "",
"timeleft" => "00:00",
"maxrounds" => "0",
"timelimit" => "00",
"nextmap" => "",
"friendlyfire" => "",
"address" => $result2->address,
"mappic" => "noimage",
"players" => ""
);
$server_array[] = $server_info;
}

//close connection
$server->Disconnect();
}
}

$stats['servers'] mysql_num_rowsmysql_query("SELECT id FROM ".$config->db_prefix."_serverinfo") );

$config->templatedir $config->path_root."templates";

define("SMARTY_DIR""smarty/");

require_once(
SMARTY_DIR.$config->path_root."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");
 }
}

// Parsing
$smarty = new dynamicPage;

$smarty->assign("meta","");
$smarty->assign("title",$title);
$smarty->assign("section",$section);
$smarty->assign("version_web",$config->v_web);

$smarty->assign("server",$server_array);
$smarty->assign("stats",$stats);
$smarty->assign("addons",$addons_array);
$smarty->assign("rules",$rules);
$smarty->assign("rules_array",$rules_array);
$smarty->assign("anticheat_array",$anticheat_array);
$smarty->assign("players", isset($player_array) ? $player_array NULL);
$smarty->assign("empty_result",isset($empty_result) ? $empty_result NULL);

$smarty->display('b.tpl');

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

page_header('b');

$template->set_filenames(array(
'body' => 'b.html',
));

make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();

?>

Kaip ją sutvarkyti?
« Paskutinį kartą keitė: 2012-07-16 12:04:11 pm sukūrė Lukas Liesis »

Neprisijungęs Lukas

  • Administratorius
  • Herojus
  • ******
  • Įrašai: 7431
  • Karma: +232/-15
    • Žiūrėti profilį
Ats: [Problema] Warningas (using password: NO)
« Atsakymas #1 Įrašytas: 2012-07-15 15:57:05 pm »
paziurek db.config.inc.php 2,3,4,5,6 eilutes ten yra klaida, imesk to failo koda
Jūsų draugas, kolega ir puslapio administratorius,

Lukas.

Gerda Photography
Serveriai.lt 50% nuolaida!
Free Hosting
Free Templates

Neprisijungęs nuodas159

  • Naujokas
  • *
  • Įrašai: 75
  • Karma: +0/-0
    • Žiūrėti profilį
Ats: [Problema] Warningas (using password: NO)
« Atsakymas #2 Įrašytas: 2012-07-15 16:00:00 pm »
paziurek db.config.inc.php 2,3,4,5,6 eilutes ten yra klaida, imesk to failo koda
<?php
$config->db_host "127.0.0.1";
$config->db_user "black";
$config->db_pass "black";
$config->db_db "black";
$config->db_prefix "amx";
?>
« Paskutinį kartą keitė: 2012-07-15 16:01:51 pm sukūrė nuodas159 »

Neprisijungęs Lukas

  • Administratorius
  • Herojus
  • ******
  • Įrašai: 7431
  • Karma: +232/-15
    • Žiūrėti profilį
Ats: [Problema] Warningas (using password: NO)
« Atsakymas #3 Įrašytas: 2012-07-15 16:06:06 pm »
pabandyk taip:


<?php

        $config 
= new stdClass();

$config->db_host "127.0.0.1";
$config->db_user "black";
$config->db_pass "black";
$config->db_db "black";
$config->db_prefix "amx";
?>
Jūsų draugas, kolega ir puslapio administratorius,

Lukas.

Gerda Photography
Serveriai.lt 50% nuolaida!
Free Hosting
Free Templates

Manualai.lt Forumas

Ats: [Problema] Warningas (using password: NO)
« Atsakymas #3 Įrašytas: 2012-07-15 16:06:06 pm »

Neprisijungęs nuodas159

  • Naujokas
  • *
  • Įrašai: 75
  • Karma: +0/-0
    • Žiūrėti profilį
Ats: [Problema] Warningas (using password: NO)
« Atsakymas #4 Įrašytas: 2012-07-15 16:30:11 pm »
pabandyk taip:


<?php

        $config 
= new stdClass();

$config->db_host "127.0.0.1";
$config->db_user "black";
$config->db_pass "black";
$config->db_db "black";
$config->db_prefix "amx";
?>

Veikia dėkui. :)

Manualai.lt Forumas

Ats: [Problema] Warningas (using password: NO)
« Atsakymas #4 Įrašytas: 2012-07-15 16:30:11 pm »