naziic Posted September 16, 2006 Report Share Posted September 16, 2006 Nu lieta tāda, ka man ir normāls cs server monitoring skripts, bet viņā ir viena problēma, kad viņš atjauno informāciju, t.i playerus, laiku u.c tad visa lapa kurā viņs ir iesaistīts refrešojās. <?php error_reporting(E_ALL & !E_NOTICE); $server = array(); include_once("status_config.php"); include_once("status_class_PQ.php"); include_once("status_xtemplate.php"); foreach($server as $conf){ unset($pq,$pqinfo,$tpl); $pq = PQ::create($conf); //$conf is a array or string if($debug){ $pq->DEBUG =1; echo "<code><pre>"; } $pqinfo = $pq->query(array('info','rules','players')); if(!@$pqinfo['ping']) $pqinfo['timeout'] =1; else $pqinfo['timeout'] = 0; if($debug){ echo "</pre></code>"; } if(is_readable($conf['template'])) { $tpl = new XTemplate($conf['template']); $tpl->assign($conf); $tpl->assign($pqinfo); if($pqinfo['timeout']) { $tpl->parse("MAIN.TIMEOUT"); } else { //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// foreach($pqinfo['players'] as $plr) { unset($player);//make sure w will not get values from previous row $player['player_name'] = $plr['Niks']; $player['player_id'] = $plr['id']; $player['player_kills'] = $plr['kills']; $player['player_time'] = $plr['onlinetime']; //seconds $player['player_time_min'] = date("H:i:s",$plr['onlinetime']-3600); //seconds, need to fix it $tpl->assign($player); $tpl->parse("MAIN.STATUS.PLAYERS.PLAYER"); } $tpl->parse("MAIN.STATUS.PLAYERS"); //////////////////////////////////////////////////////////////////////////// $tpl->parse("MAIN.STATUS"); } if($showall || $debug) // for debug mode and also getting all available values { echo "<code><pre>"; print_r($pqinfo); echo "</pre></code>"; } $tpl->parse("MAIN"); $tpl->out("MAIN"); } else { echo "ERROR: Template file ".$conf['template']." - failed to open file, check permissions or check if file exist"; } } ?> varbū kāds var palīdzēt? php neesmu nekāds kings... liels paldies jau iepriekš. Link to comment Share on other sites More sharing options...
Gu6ax Posted September 16, 2006 Report Share Posted September 16, 2006 (edited) novelc brains 0.07 un nākosreiz kad ķeries pie kādas nezināmas lietas, iemācies vismaz pamatus!!! Edited September 16, 2006 by Gu6ax Link to comment Share on other sites More sharing options...
naziic Posted September 16, 2006 Author Report Share Posted September 16, 2006 novelc brains 0.07 un kad nākosreiz kad ķeries pie kādas nezināmas lietas, iemācies vismaz pamatus!!! nu vismaz ludzu pasaki kas kur jamaina... vnk ja pateiks, tad es busu vismaz vel kko jaunu iemacijies... Link to comment Share on other sites More sharing options...
Gu6ax Posted September 16, 2006 Report Share Posted September 16, 2006 es tikaj nesaprotu ko tu veelies panaakt, tev vajag laj tikaj siis te attieciigais skripts refreshojas?? bet paareejaa lapa nee?! taa lajkam ja? Link to comment Share on other sites More sharing options...
naziic Posted September 16, 2006 Author Report Share Posted September 16, 2006 (edited) es tikaj nesaprotu ko tu veelies panaakt, tev vajag laj tikaj siis te attieciigais skripts refreshojas?? bet paareejaa lapa nee?! taa lajkam ja? jā, tas būtu ļoti labi, savādāk lasot, ziņas u.c lapa refreshojaas.. var jau darīt tā, ka to skriptu uzliek uz skripts.php un sasaista ar iframe, tad pats skripts refreshotos, bet itka gribu lai skripts ir pašā index.php lapā Edited September 16, 2006 by naziic Link to comment Share on other sites More sharing options...
Gu6ax Posted September 16, 2006 Report Share Posted September 16, 2006 NU vis elementaaraakais variants buutu ar iframe tajsiit!!!! Kaada atskiriba kur darbojas tas skripts?? vaj index.php vaj skripts.php?? tak panjem index.php uztajsi atsevisku iframe un miers i probleema atrisinaata! Link to comment Share on other sites More sharing options...
naziic Posted September 16, 2006 Author Report Share Posted September 16, 2006 NU vis elementaaraakais variants buutu ar iframe tajsiit!!!!Kaada atskiriba kur darbojas tas skripts?? vaj index.php vaj skripts.php?? tak panjem index.php uztajsi atsevisku iframe un miers i probleema atrisinaata! ai nulapi, taisiisu ar iframe, bet tomer kads nevar pateikt, vnk intreses pec, lai citrez ja vajag.. Link to comment Share on other sites More sharing options...
v3rb0 Posted September 16, 2006 Report Share Posted September 16, 2006 lai nerefrešotu lapu vajag: 1. tas cs monitoringa scripts atgriež xmlu. 2. lapā javascripts, kas ajax'īgi prasa xmlu no scripta, parsē xmlu, piemeklē kuri lapas elementi jāmaina, samaina lapas elementus. Link to comment Share on other sites More sharing options...
Recommended Posts