dbprefix}content"; $database_tag = "{$jconf->dbprefix}tag"; $database_menu = "{$jconf->dbprefix}menu"; $category_title = ""; $category_keywords = ""; $category_description = ""; $category_content_image = ""; $mgs_the_loai = $jconf->msg_tag; $category_page = $_GET["page"]; $sql = "SELECT * FROM `{$database_tag}` where tag_id = '{$content_url}' limit 1"; $result = mysqli_query($conn, $sql); while ($row = mysqli_fetch_assoc($result)){ $category_title = $row["tag_name"]; $category_keywords = $row["tag_name"]; $category_description = "Tập hợp những bài viết liên quan đến ".$row["tag_name"]; $category_content_image = $row["tag_image"]; } if(count($category_title) == ""){ header("Location: {$jconf->siteUrl}"); } if($category_page == "" || $category_page == null){ $category_page = 1; } $array_menu = array(); $sql = "SELECT * FROM `{$database_menu}` where deleteFlg = 0 order by sort"; $result = mysqli_query($conn, $sql); while ($row = mysqli_fetch_assoc($result)){ $array_menu[] = $row; } $array_category_sort = array(); $count_array_new_category_sidebar = $jconf->count_array_new_category_sidebar; $count_array_new_category_group = $jconf->count_array_new_category_group; //カテゴリのページ数計算 $sql = "SELECT count(stt) as count FROM `{$database_content}` where removeFlag = 0 and tag like '%;".$content_url.";%'"; $result = mysqli_query($conn, $sql); while ($row = mysqli_fetch_assoc($result)){ $category_count = $row['count']; } if($category_count == 0){ header("Location: {$jconf->siteUrl}"); } $category_page_start = ($category_page - 1)*$count_array_new_category_group ; $sql = "SELECT category,category1_1,category1_1_id,content_url,title,content_image,description FROM `{$database_content}` where removeFlag = 0 and tag like '%;".$content_url.";%' order by updateTime desc limit ".$category_page_start.",".$count_array_new_category_group; $result = mysqli_query($conn, $sql); while ($row = mysqli_fetch_assoc($result)){ $array_category_sort[] = $row; } if($category_content_image == ""){ $category_content_image = $array_category_sort[0]['content_image']; } ?>