=0) && ($id<99999)) { $adsqlcmd1 = "SELECT * FROM saare_spauudised WHERE spauid = '".addslashes( $id )."'"; $adresult1 = mysql_query($adsqlcmd1); if ($adresult1 != "") { $adi1 = @mysql_numrows($adresult1); } else { $adi1=0; } } elseif (($id != "") && ($id == "all")) { $adi1="-1"; } else { $adi1="-2"; } echo "
\n"; echo "\n\n"; } else { echo "UUDIS

\n\n"; } echo "

\n"; if ($id=="all") { echo "UUDISTE ARHIIV

AvaleheleAvalehele

\n"; echo "\n\n"; if ($adi1 == "1") { $oaegub=mysql_result($adresult1,0,"aegub"); $uudis=mysql_result($adresult1,0,"uudis"); $spauid=mysql_result($adresult1,0,"spauid"); $komment=mysql_result($adresult1,0,"komment"); // if ($curaeg - $oaegub < 30) { echo "

\n"; // } else { // echo "\n"; // } } elseif ($adi1 == "0") { echo "\n"; } elseif ($adi1 == "-1") { $adsqlcmd1 = "SELECT * FROM saare_spauudised ORDER BY gaeg"; $adresult1 = mysql_query($adsqlcmd1); if ($adresult1 != "") { $adi1 = @mysql_numrows($adresult1); } else { $adi1=0; } $adi01=$adi1-1; echo "

\n"; } else { $adsqlcmd2 = "SELECT * FROM saare_spauudised ORDER BY gaeg DESC"; $adresult2 = mysql_query($adsqlcmd2); if ($adresult2 != "") { $adi2 = mysql_numrows($adresult2); } else { $adi2=0; } if ($adi2>0) { $oaegub=mysql_result($adresult2,0,"aegub"); $uudis=mysql_result($adresult2,0,"uudis"); $spauid=mysql_result($adresult2,0,"spauid"); $komment=mysql_result($adresult2,0,"komment"); // if ($curaeg - $oaegub < 30) { echo "

\n"; // } else { // echo "\n"; // } } else { echo "\n"; } } echo "\n"; echo "

$uudis\n"; if (($komment > "0") && (is_readable("ukommentaarid.php"))) { if ($komment == "2") { $adsqlcmd3 = "SELECT * FROM saare_spaukomment WHERE spauid = '".addslashes( $spauid )."' ORDER BY aeg DESC"; } elseif ($komment == "1") { $adsqlcmd3 = "SELECT * FROM saare_spaukomment WHERE spauid = '".addslashes( $spauid )."' AND muutja > '0' ORDER BY aeg DESC"; } $adresult3 = mysql_query($adsqlcmd3); if ($adresult3 != "") { $adi3 = @mysql_numrows($adresult3); } else { $adi3=0; } if ($adi3>0) { // echo "

Kommentaarid ($adi3)\n"; } else { // echo "

Kommentaarid (0)\n"; } } echo "

uudist ei leituduudist ei leitud

"; while ($adi01>=0) { $uudis=strip_tags(mysql_result($adresult1,$adi01,"uudis"), ' '); $spauid=mysql_result($adresult1,$adi01,"spauid"); $gaeg=date( "d.m.Y H:i", mysql_result($adresult1,$adi01,"gaeg")); $komment=mysql_result($adresult1,$adi01,"komment"); $uudis0=explode("", $uudis); $uudis1=explode("", $uudis0[1]); if ($uudis1[0]=="") { $uudis0=explode("", $uudis); $uudis1=explode("", $uudis0[1]); } $uudis="$uudis1[0] Loe edasi."; echo "$uudis ($gaeg"; if (($komment > "0") && (is_readable("ukommentaarid.php"))) { if ($komment == "2") { $adsqlcmd3 = "SELECT * FROM saare_spaukomment WHERE spauid = '".addslashes( $spauid )."' ORDER BY aeg DESC"; } elseif ($komment == "1") { $adsqlcmd3 = "SELECT * FROM saare_spaukomment WHERE spauid = '".addslashes( $spauid )."' AND muutja > '0' ORDER BY aeg DESC"; } $adresult3 = mysql_query($adsqlcmd3); if ($adresult3 != "") { $adi3 = @mysql_numrows($adresult3); } else { $adi3=0; } if ($adi3>0) { // echo ", kommentaare $adi3"; } else { // echo ", kommentaare 0"; } } echo ")

\n"; --$adi01; } echo "

$uudis\n"; if (($komment > "0") && (is_readable("ukommentaarid.php"))) { if ($komment == "2") { $adsqlcmd3 = "SELECT * FROM saare_spaukomment WHERE spauid = '".addslashes( $spauid )."' ORDER BY aeg DESC"; } elseif ($komment == "1") { $adsqlcmd3 = "SELECT * FROM saare_spaukomment WHERE spauid = '".addslashes( $spauid )."' AND muutja > '0' ORDER BY aeg DESC"; } $adresult3 = mysql_query($adsqlcmd3); if ($adresult3 != "") { $adi3 = mysql_numrows($adresult3); } else { $adi3=0; } if ($adi3>0) { // echo "

Kommentaarid ($adi3)\n"; } else { // echo "

Kommentaarid (0)\n"; } } echo "

uudist ei leituduudist ei leitud
\n"; @mysql_close(); if (is_readable("alumine.php")) { include("alumine.php"); } ?>