<table align="center" width="598" height="auto">
<tr>
<td width="598" height="27" style="border:#969696 1px solid" background="images/cenmenu.png"><div align="center" style="color:#D1D1D1;" class="ws11">Counter Strike Новина</div></td>
</tr>
<tr>
<td width="598" height="auto" style="border:#969696 1px solid">
<br />
<?php include ("config.php"); ?>
<?php
$id_news = $_GET['id_news'];
$archive="SELECT * FROM news WHERE id_news = '$id_news' ORDER BY godina DESC";
$godinass=mysql_query($archive);
$num=mysql_numrows($godinass);
mysql_close();
$i=0;
while ($i < $num) {
$id_news=mysql_result($godinass,$i,"id_news");
$title=mysql_result($godinass,$i,"title");
$potrebitel=mysql_result($godinass,$i,"potrebitel");
$chas=mysql_result($godinass,$i,"chas");
$minuti=mysql_result($godinass,$i,"minuti");
$den=mysql_result($godinass,$i,"den");
$mesec=mysql_result($godinass,$i,"mesec");
$godina=mysql_result($godinass,$i,"godina");
$newstext=mysql_result($godinass,$i,"newstext");
$url=mysql_result($godinass,$i,"url");
echo "
<title>CS-XIPNOZA.INFO - $title</title>
<table align=center border=1px solid bordercolor=#000000 width=552 height=19 cellpadding=0 cellspacing=0>
<tr>
<td width=552 height=auto background=/images/newscomment/newszaglavie.gif><b><div align='left' class=ws11> $title </div></b>
</td>
</tr>
<tr>
<td>
<table width=552 height=auto cellpadding=0 cellspacing=0>
<tr>
<td width=552 height=auto background=/images/newscomment/textnews.jpg><font class='ws10' color='#FFFFFF' style='width:550; height:auto;'><div style='padding:3px; text-align:justify;'><img style=padding:2px; align=right src=$url>$newstext<br /><br /></div></font>
</td>
</tr>
</table>
<tr>
<td background=/images/newscomment/infocomment.gif>
<font color=#FFFFFF class=ws9> Публикувана на
<font size=2pt color=#00FF00><strong>$den/$mesec/$godina</strong></font>
<font color=#FFFFFF class=ws9> от</font><font size=2pt color=#00FF00> $potrebitel</font></td></tr></table>";
$i++;
}
?>
<br />
<table align="center" width="551" height="auto">
<tr>
<td width="551" height="27" style="border:#969696 1px solid"><div style="background-image:url(/images/newscomment/newszaglavie.gif)" align="center" class="ws11"><b>Коментари</b></div><div style="padding:2px;">
<?php
include ("config.php");
$id = $_GET['id_news'];
$pp = "10";
$page=$_GET['page'];
if(!$_GET['page'])
{
$page="1";
}
$limit = ($pp*$page)-$pp;
$redove=mysql_query("SELECT * FROM comments WHERE id_news = '$id' ORDER BY id_com DESC");
$max=mysql_numrows($redove);
$total=ceil($max/$pp);
$query="SELECT * FROM comments WHERE id_news = '$id' ORDER BY id_com DESC LIMIT $limit,$pp";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
$i=0;
while ($i < $num) {
$username=mysql_result($result,$i,"username");
$minuti=mysql_result($result,$i,"minuti");
$chas=mysql_result($result,$i,"chas");
$den=mysql_result($result,$i,"den");
$mesec=mysql_result($result,$i,"mesec");
$godina=mysql_result($result,$i,"godina");
$comment=mysql_result($result,$i,"comment");
echo "<table align=center border=1px solid bordercolor=#000000 width=552 height=19 cellpadding=0 cellspacing=0>
<tr>
<td width=550 height=auto background=/images/newscomment/textcoment.jpg><font class='ws11' color='#EAEAEA' style='width:552; height:auto;'><div style='padding:3px; text-align:justify;'>$comment</div></font>
</td>
</tr>
<tr>
<td>
<table width=550 height=auto cellpadding=0 cellspacing=0>
<tr>
<td width=552 height=auto background=/images/newscomment/infocomment.gif><font color=#FFFFFF class=ws9>Добавил:</font><font size=2pt color=#00FF00><strong>$username</strong></font><font color=#FFFFFF class=ws9> на </font><font size=2pt color=#00FF00><strong>$den/$mesec/$godina - $chas:$minuti</strong></font>
</td>
</tr>
</table>
</td>
</tr>
</table><br />";
$i++;
}
echo "<center>";
if ($page > 1) {
$prev = ($page - 1);
echo "<a href=\"fullnews.php?id_news=$id_news&page=$prev\"><font face=\"Trebuchet MS\">Предишна</font></a> ";
}
else echo "<font face=\"Trebuchet MS\">Предишна</font> ";
if (!$page or ($page > $total)) {
$page="1";
}
if ($total < 10) {
for($i=1 ; $i<=$total ; $i++) {
if ( ($page)==$i ) {
echo "<b>$i</b> ";
}
else {
echo "<a href=\"fullnews.php?id_news=$id_news&page=".$i."\">".$i."</a> ";
}
}
}
else {
for($i=1 ; $i<=3 ; $i++) {
if ( ($page)==$i ) {
echo "<b>$i</b> ";
}
else {
echo "<a href=\"fullnews.php?id_news=$id_news&page=".$i."\">".$i."</a> ";
}
}
if ($page <= 3) {
if ($page == 3) echo "<a href=\"fullnews.php?id_news=$id_news&page=4\">4</a> ";
echo "...";
for ($i=$total-2; $i<=$total; $i++)
echo "<a href=\"fullnews.php?id_news=$id_news&page=".$i."\">".$i."</a> ";
}
if ($page == 5) $parva.= "<a href=\"fullnews.php?id_news=$id_news&page=4\">4</a> ";
if ( ($page == 4) or ($page == 5) ) {
for ($i=$page; $i<=$page+1; $i++) {
if ($page == $i) echo "<b>$i</b> ";
else echo "<a href=\"fullnews.php?id_news=$id_news&page=".$i."\">".$i."</a> ";
}
echo "...";
for ($i=$total-2; $i<=$total; $i++)
echo "<a href=\"fullnews.php?id_news=$id_news&page=".$i."\">".$i."</a> ";
}
if ( ($page > 5) and ($page < ($total - 4)) ) {
echo "... ";
for ($i=$page-1; $i<=$page+1; $i++) {
if ($page == $i) echo "<b>$i</b> ";
else echo "<a href=\"fullnews.php?id_news=$id_news&page=".$i."\">".$i."</a> ";
}
echo "...";
for ($i=$total-2; $i<=$total; $i++)
echo "<a href=\"fullnews.php?id_news=$id_news&page=".$i."\">".$i."</a> ";
}
if ( $page > ($total - 5) ) {
echo "...";
for ($i=$total-5; $i<=$total; $i++) {
if ($page == $i) echo "<b>$i</b> ";
else echo "<a href=\"fullnews.php?id_news=$id_news&page=".$i."\">".$i."</a> ";
}
}
}
if ($page < $total) {
$next = ($page + 1);
echo "<a href=\"fullnews.php?id_news=$id_news&page=$next\"><font face=\"Trebuchet MS\">Следваща</font></a> ";
}
else echo "<font face=\"Trebuchet MS\">Следваща</font></center>";
?>
</div><br /><center>
<?php
include ("config.php");
if($_POST['Submit']){
$minuti = $_POST['minuti'];
$chas = $_POST['chas'];
$den = $_POST['den'];
$mesec = $_POST['mesec'];
$godina = $_POST['godina'];
$username = $_POST['username'];
$comment = $_POST['comment'];
if(empty($username)){
echo "Моля, въведете име";
die();
};
if(empty($comment)){
echo "<META HTTP-EQUIV=\"refresh\" CONTENT=\"0; URL=fullnews.php?id_news=$id_news\">";
die();
};
$query = "INSERT INTO `comments` ( `id_com` , `id_news` , `username` , `minuti`, `chas`, `den`, `mesec`, `godina`, `ip`, `comment`, `title`)
VALUES ('NULL', '$id_news', '$username', '$minuti', '$chas', '$den', '$mesec', '$godina', '$ip', '$comment', '$title');";
$ok = mysql_query($query);
if($ok){
echo "<font class=ws10 color=#fff>Коментара е Добавен<META HTTP-EQUIV=\"refresh\" CONTENT=\"0; URL=fullnews.php?id_news=$id_news\"></font>";
}else{
echo "Възникна грешка";
}
};
?></center>
<form action="fullnews.php?id_news=<?php echo "$id_news" ?>" method="post" name="form">
<input type="hidden" value="<?php echo "$id_news" ?>" name="id_news">
<input type="hidden" value="<?php print(date("i")); ?>" name="minuti">
<input type="hidden" value="<?php print(date("G")); ?>" name="chas">
<input type="hidden" value="<?php print(date("j")); ?>" name="den">
<input type="hidden" value="<?php print(date("F")); ?>" name="mesec">
<input type="hidden" value="<?php print(date("Y")); ?>" name="godina">
<input type="hidden" value="<?php echo $_SERVER['REMOTE_ADDR']; ?>" name="ip">
<input type="hidden" value="<?php echo "<font>".$user->data['username']."</font>" ?>" name="username">
<table align="center" width="551" height="auto" border="#000000 1px splid">
<tr>
<td id="lineLRBs" class="nav">
<h5 align="center"><img alt="Добави коментар" border="0" style="margin-right:6px; margin-top:3px; margin-bottom:-3px; cursor:pointer;" onclick="showContent(this);" /></h5>
<div align="center" style="display:none;">
<textarea rows=7 class=commentbox name=comment cols=45 type=text style="border:#000000 1px solid; background-color:#CCCCCC;"></textarea><br /><br /><input type=submit style="border:#000000 1px solid; background-color:#CCCCCC;" name=Submit value=Добави class=form>
</div>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>