View file includes/news_header.php

File size: 1.57Kb
<?php
/*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\//
// Sitchi CMS - Mobile Content Management System //
// The author:  Nikoloz Sitchinava [sitchi]      //
// Link:        http://sitchicms.num.ge          //
// Skype:       SitchiCMS                        //
// License:     LICENSE.txt (see attached file)  //
// Version:     VERSION.txt (see attached file)  //
//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\*/
defined('_SITCHICMS') or die ('Restricted access');
$q=mysql_query("SELECT * FROM `news` WHERE `maintime` > '".$time."' ORDER BY `id` DESC LIMIT 1");
if (mysql_num_rows($q)==1)
{
$news = mysql_fetch_assoc($q);
echo'<div class="egmenu">';
echo'<b>'.$news['title'].'</b> ('.timef($news['time']).')<br/><div class="sub">';
if (mb_strlen($news['msg'])>64)
{
echo mb_substr(post($news['msg'], 1,0,0,0), 0 ,32).'...<a href="/modules/news/"><span style="color:red;">&gt;</span></a><br/>'; 
}else{
echo post($news['msg'], 1,0,0,0).'<br/>';
}
$k_p2=mysql_result(mysql_query("SELECT COUNT(*) FROM `news_komm` WHERE `id_news` = '$news[id]'"), 0);
$k_n2= mysql_result(mysql_query("SELECT COUNT(*) FROM `news_komm` WHERE `time` > '".($time-86400)."' AND `id_news` = '$news[id]'"), 0);
if ($k_n2==0)$k_n2=NULL;
else $k_n2='/<span style="color:red;">+'.$k_n2.'</span>';
$counter2 = "[$k_p2$k_n2]";
echo'<a href="/modules/news/komm.php?id='.$news['id'].'">'.$lng['1_52'].'</a> '.$counter2; 
if ($news['link']!=NULL)
echo'<a href="http://'.htmlentities($news['link'], ENT_QUOTES, 'UTF-8').'"><span style="color:red;">&raquo;&raquo;</span></a>';
echo'</div></div>';}
?>