updateitem($sql1); } $idd=$id; if($_POST){ $sql="insert into lvn_comment(`news_id`, `name`,`email`,`title`,`comment`,`publish`) values('".$id."', '".$_POST["txtName"]."', '".$_POST["txtEmail"]."', '".$_POST["txtTitle"]."', '".$_POST["txtContent"]."',0)"; $sql=$db->insertitem($sql); } if($comment){ $sql2="select * from lvn_comment where news_id=$id and `publish`=1"; $comm=$db->selectitem($sql2); } $sqll="select count(news_id) as cou from lvn_comment where news_id=$id and `publish`=1"; $sqll=$db->selectitem($sqll); $cou_comment=$sqll[0]["cou"]; $sql2="select lvn_news.linkmedia,lvn_news.hits as hit, lvn_news.image_id, lvn_news.image, lvn_news.image_category_id as category_id,lvn_news.title,lvn_news.create_date,lvn_news.note,lvn_news.content,lvn_news_category.image_category as catname, lvn_news_category.template as file_temp from lvn_news, lvn_news_category where lvn_news_category.image_category_id=lvn_news.image_category_id and lvn_news.image_id='".intval($_GET["nid"])."'"; $get_news=$db->selectitem($sql2); if(count($get_news)==0){ Header("Location: index.php"); exit; } $cat_name=$get_news[0]["catname"]; $news_id = $get_news[0]["image_id"]; $cat_id = $get_news[0]["category_id"]; $title = $get_news[0]["title"]; $hit = $txt_view_hit. " [".$get_news[0]["hit"]."]"; $info = $get_news[0]["content"]; $temp=$db->selectitem("select file_temp from lvn_templates where lvn_templates.temp_id='".$get_news[0]["file_temp"]."'"); if($temp[0]["file_temp"]<>"") $template= "$temp_path/".$temp[0]["file_temp"]; else $template="$templatepath_main/main_1.html"; $create_date = $get_news[0]["create_date"]; $tinhngay=date_still_now($creare_date); $down = $get_news[0]["image"]; if($down<>"") $down=" Download file: $down"; else $down=" "; if(!empty($get_news[0]["linkmedia"])){ $info="
  
 
 
   
  © Powered by vMMS v2.7

* Bấm PLAY để nghe - xem
".$info; } list($year,$month,$day)=split("-",$create_date); list($g,$p,$gi)=split(":",$create_date); $g=substr($g,strlen($g)-2,2); $show_date="(Update: $g:$p, ".substr($day,0,2)."/".$month."/".$year." )"; $cate="and cat_id='$cat2'"; $sql1="select * from lvn_news where image_id<'$id' and image_category_id='$cat_id' order by image_id desc limit 0,$number_other_news"; $other=$db->selectitem($sql1); if(count($other)>0) $ctk="Orther news:"; }else{ Header("Location: index.php"); exit; } if(!$result_info) $result_info = array(); if(!$other) $other = array(); if(!$comm) $comm = array(); $TBS->LoadTemplate("$template") ; $TBS->MergeBlock("result", $result_info) ; $TBS->MergeBlock("other", $other); $TBS->MergeBlock("comm", $comm); $TBS->MergeBlock('ban_left',$ban_left) ; $TBS->MergeBlock('ban_right',$ban_right) ; $TBS->MergeBlock('ban_bottom',$ban_bottom) ; include_once "common_mergblock.php"; $endTimer = endTimer(); $queries_counter = $db->get_query_cnt(); $TBS->Show() ; function date_still_now($olddate) { $vietnamdate = vietnamdate('Y-m-d H:i:s'); $now = strtotime($vietnamdate); $difference = $now - strtotime($sqltemp[$i]["create_date"]); $days = floor($difference/86400); $difference = $difference - ($days*86400); if($days>=1) $remaintime=""; else {$hours = floor($difference/3600); $difference = $difference - ($hours*3600); if($hours>5) $remaintime=""; else {$hours=$hours." giờ,"; $minutes = floor($difference/60)." phút,"; $difference = $difference - ($minutes*60); $seconds = $difference." giây"; $remaintime = "(Cập nhật cách đây: $hours $minutes $seconds)"; } } return $remaintime; } ?>