ExTent Posted November 10, 2008 Report Share Posted November 10, 2008 Sveiki! Kā es varu uzlikt ka weblapā rādās tikai tā karte, kas ir serverī. uzinstalēju monitoru pēc gign pamācības, vienīgi trūkst kartes bilde. Ja kāds to spēj palīdzat Link to comment Share on other sites More sharing options...
*jancis38* Posted November 10, 2008 Report Share Posted November 10, 2008 Parādi monitora skriptu. Link to comment Share on other sites More sharing options...
ExTent Posted November 11, 2008 Author Report Share Posted November 11, 2008 //Viss pareejais shits (iipashiem pro ieteicams neko nelabot) $konekcija = mysql_connect($hosts,$lietotajs,$parole) or die("Nesanaca piekonekteties db"); mysql_select_db($db,$konekcija) or die("Nesanaca izveleties db"); $vaicajums1="SELECT * FROM details"; $rezultats1=mysql_query($vaicajums1,$konekcija) or die ("Nesanaca izpildit vaicajumu #1"); $aile = mysql_fetch_array($rezultats1); $nakamamape=$aile['nextmap']; $laiksatlicis=$aile['timeleft']; $laikalimits=$aile['timelimit']; $mape=$aile['mapname']; $maxplayers=$aile['maxplayers']; $rezultatst=$aile['scoret']; $rezultatsct=$aile['scorect']; $vaicajums2ct="SELECT * FROM players WHERE team='CT'"; $rezultats2ct=mysql_query($vaicajums2ct,$konekcija) or die ("Nesanaca izpildit vaicajumu #2"); $speletajict=mysql_num_rows($rezultats2ct); $vaicajums2t="SELECT * FROM players WHERE team='TERRORIST'"; $rezultats2t=mysql_query($vaicajums2t,$konekcija) or die ("Nesanaca izpildit vaicajumu #2"); $speletajit=mysql_num_rows($rezultats2t); $vaicajums2unknow="SELECT * FROM players WHERE team='SPECTATOR' OR team='UNASSIGNED'"; $rezultats2unknow=mysql_query($vaicajums2unknow,$konekcija) or die ("Nesanaca izpildit vaicajumu #2"); $speletajiunknow=mysql_num_rows($rezultats2unknow); $speletaji=mysql_num_rows($rezultats2ct)+mysql_num_rows($rezultats2t)+mysql_num_rows($rezultats2unknow); $brivisloti=$maxplayers-$speletaji; echo "<b><font color=\"white\">» Server monitor</font></b><br />"; echo "<b><font color=\"white\">Statuss:</font> </b>"; if($brivisloti=="0") { echo "Nav brīvu slotu"; } elseif($brivisloti=="1") { echo "1 brīvs slots"; } else { echo $brivisloti." brīvi sloti"; } echo "<br /><b><font color=\"white\">Spēlētāji:</font></b> $speletaji/$maxplayers"; echo "<br /><b><font color=\"white\">Karte:</font></b> $mape"; echo "<br /><b><font color=\"white\">Laiks:</font></b> $laiksatlicis/$laikalimits:00"; echo "<br /><b><font color=\"white\">Nākamā mape:</font></b> $nakamamape"; echo "<br />"; echo "<br /><b><font color=\"#3BB9FF\">» CT komanda ar ($rezultatsct) uzvarām</font></b><br />"; while($aile2ct = mysql_fetch_array($rezultats2ct)) { echo $aile2ct['name']." <font color=\"white\">ar</font> ".$aile2ct['frags']." <font color=\"white\">Fragiem</font> ".$aile2ct['deaths']." <font color=\"white\">Nāvēm</font><br />"; } echo "<br />"; echo "<b><font color=\"red\">» T komanda ar ($rezultatst) uzvarām</font></b><br />"; while($aile2t = mysql_fetch_array($rezultats2t)) { echo $aile2t['name']." <font color=\"white\">ar</font> ".$aile2t['frags']." <font color=\"white\">Fragiem</font> ".$aile2t['deaths']." <font color=\"white\">Nāvēm</font><br />"; } echo "<br />"; echo "<b><font color=\"gray\">» Skatītāji</font></b><br />"; while($aile2unknow = mysql_fetch_array($rezultats2unknow)) { echo $aile2unknow['name']; } mysql_free_result($rezultats1); mysql_free_result($rezultats2ct); mysql_free_result($rezultats2t); mysql_free_result($rezultats2unknow); mysql_close($konekcija); ?> Link to comment Share on other sites More sharing options...
*jancis38* Posted November 11, 2008 Report Share Posted November 11, 2008 (edited) echo?"<img?src='ceļs/uz/bildi/$mape.jpg'?alt='$mape'?/>"; EDIT: Tātad, ja mape ir de_dust2, tad arī pats pa sevi tiks pieprasīta bilde de_dust2.jpg Edited November 11, 2008 by *jancis38* Link to comment Share on other sites More sharing options...
ExTent Posted November 11, 2008 Author Report Share Posted November 11, 2008 (edited) Tnx pamēgināsu Jap paldies viss aizgaka Edited November 11, 2008 by ExTent Link to comment Share on other sites More sharing options...
X ID Posted November 11, 2008 Report Share Posted November 11, 2008 Labāk jau lieto manis rakstīto kodu (tajā pašā topikā kautkur pēdējās lapās). Tur ir dažas papildu fīčas: bilde, kad nav bildes, ajax auto reload un server offline. Link to comment Share on other sites More sharing options...
ExTent Posted November 11, 2008 Author Report Share Posted November 11, 2008 iedo linku es jau aizmirsu kura topika tas bija Link to comment Share on other sites More sharing options...
X ID Posted November 12, 2008 Report Share Posted November 12, 2008 Ietestē http://code.xid.lv/monitor_addon.zip Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now