Yangi formatda davom etish uchun: https://uzfor.net/view.php?act=post&id=26205
Postga havola
KooL [877] [ban]
DjHuSo, Do'st shu kodga o'rnatib bering. Men qilsam sahifa yo'q bo'p qolyapdi. O'rnata olmayapman. Iltimos:
.
<?php
echo '<div class="phdr"><b>Yangiliklar</b></div>';
$count= mysql_query("select count(*) from `cms_news` where `time`<='". time()."'");
$total= mysql_result($count,0);
if($total>0)
$trans_req= mysql_query("select * from `cms_news` where `time`<='". time()."' order by `time` desc limit $start, $kmess;");
while($trans_res= mysql_fetch_array($trans_req)){
$comm= mysql_result( mysql_query("select count(*) from `cms_news_comments` where `refid` = '".$trans_res['id']."'"),0);
$ncount = mysql_fetch_array(mysql_query("SELECT * FROM `cms_news` WHERE `id` ='$id'"));
if (!isset($_SESSION['cms_news']) || isset($_SESSION['cms_news'])&&$_SESSION['cms_news'] != $id) {
$_SESSION['cms_news'] = $id;
$newscount = intval($ncount['count']) + 1;
mysql_query("UPDATE `cms_news` SET `count` ='$newscount'WHERE `id` ='$id'");
}
$komm = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_news_comments` WHERE `refid`='{$res['id']}'"), 0);
echo '<div class="yangilik">'; echo '<span class="newsTime time bottom">' . date('H:i', $trans_res['time'] + (core::$system_set['timeshift'] + core::$user_set['timeshift']) * 3600) . '</span> – <a href="/news/index.php?act=view&id='.$trans_res['id'].'"> '. htmlentities($trans_res['name'],ENT_QUOTES,'UTF-8').'</a> <img style="vertical-align: middle ! important;" src="/images/blue_comment.png" /> ' . $comm . '</div>';
++$i;
}
if($total>$kmess){
echo'<div class="yangilik" align="center"><p>'. functions::display_pagination('/yangiliklar/index.php?id='.$id.'&',$start,$total,$kmess).'</p></div>'; }
?>
.
<?php
echo '<div class="phdr"><b>Yangiliklar</b></div>';
$count= mysql_query("select count(*) from `cms_news` where `time`<='". time()."'");
$total= mysql_result($count,0);
if($total>0)
$trans_req= mysql_query("select * from `cms_news` where `time`<='". time()."' order by `time` desc limit $start, $kmess;");
while($trans_res= mysql_fetch_array($trans_req)){
$comm= mysql_result( mysql_query("select count(*) from `cms_news_comments` where `refid` = '".$trans_res['id']."'"),0);
$ncount = mysql_fetch_array(mysql_query("SELECT * FROM `cms_news` WHERE `id` ='$id'"));
if (!isset($_SESSION['cms_news']) || isset($_SESSION['cms_news'])&&$_SESSION['cms_news'] != $id) {
$_SESSION['cms_news'] = $id;
$newscount = intval($ncount['count']) + 1;
mysql_query("UPDATE `cms_news` SET `count` ='$newscount'WHERE `id` ='$id'");
}
$komm = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_news_comments` WHERE `refid`='{$res['id']}'"), 0);
echo '<div class="yangilik">'; echo '<span class="newsTime time bottom">' . date('H:i', $trans_res['time'] + (core::$system_set['timeshift'] + core::$user_set['timeshift']) * 3600) . '</span> – <a href="/news/index.php?act=view&id='.$trans_res['id'].'"> '. htmlentities($trans_res['name'],ENT_QUOTES,'UTF-8').'</a> <img style="vertical-align: middle ! important;" src="/images/blue_comment.png" /> ' . $comm . '</div>';
++$i;
}
if($total>$kmess){
echo'<div class="yangilik" align="center"><p>'. functions::display_pagination('/yangiliklar/index.php?id='.$id.'&',$start,$total,$kmess).'</p></div>'; }
?>