@uMansurov
Mahmudjon,
  1. // news
  2. echo '<div class="header"><b>So\'ngi xabarlar</b></div>';
  3. $count= mysql_query("select count(*) from `cms_news` where `time`<='". time()."'");
  4. $total= mysql_result($count,0);
  5. if($total>0)
  6. $kmess=4
  7.  
  8. $trans_req= mysql_query("select * from `cms_news` where `time`<='". time()."' order by `time` desc limit $kmess;");
  9.  
  10. while($trans_res= mysql_fetch_array($trans_req)){
  11. $comm= mysql_result( mysql_query("select count(*) from `cms_news_comments` where `refid` = '".$trans_res['id']."'"),0);
  12. $ncount = mysql_fetch_array(mysql_query("SELECT * FROM `cms_news` WHERE `id` ='$id'"));
  13. if (!isset($_SESSION['cms_news']) || isset($_SESSION['cms_news'])&&$_SESSION['cms_news'] != $id) {
  14. $_SESSION['cms_news'] = $id;
  15. $newscount = intval($ncount['count']) 1;
  16. mysql_query("UPDATE `cms_news` SET `count` ='$newscount'WHERE `id` ='$id'");
  17. }
  18.  
  19.  
  20.  
  21. $komm = mysql_result(mysql_query("SELECT COUNT(*) FROM `cms_news_comments` WHERE `refid`='{$res['id']}'"), 0);
  22. 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 . ' - oqildi '.$trans_res['reads'].' </div>';
  23. $i;
  24. }
  25. if($total>$kmess){
  26. echo'<div class="yangilik" align="center"><p>'. functions::display_pagination('index.php?id='.$id.'&',$start,$total,$kmess).'</p></div>'; }

1 daqiqa 25 soniyadan keyin yozdi:
Endi bita .sql sorov yuboriw kerak