<div class="sidebar"> <div class="side-box"> <h3>Categories</h3> <?php $categories = get_all_categories(); ?> <?php if (count($categories) > 0) { ?> <ul> <?php foreach ($categories as $category) { ?> <li><a href="<?php echo BASE_URL; ?> ?cat=<?php echo $category['category_id']; ?> "><?php echo $category['category_name']; ?> </a></li> <?php } ?> </ul> <?php } ?>
<?php require_once 'config.php'; $base_search_url = generate_base_search_url(); $page_title = t('Trang thông tin y tế, sức khỏe cộng đồng'); //list category $list_category = get_all_categories('home'); $count_list_cate = count($list_category) - 2; $list_category2 = array_slice($list_category, 1, $count_list_cate); //quảng cáo $adv_top = get_advertising(ADV_POSITION_TOP, 1); $adv_right = get_advertising(ADV_POSITION_RIGHT, 1); //quảng cáo banner $adv_banner_list = get_advertising(ADV_POSITION_LARGE_BANNER, 2); //link hỏi đáp $link_hoidap = generate_qaa_url(); $rainTpl->assign('css_global', $css_global); $rainTpl->assign('js_global', $js_global); $rainTpl->assign('page_title', $page_title); $rainTpl->assign('meta_description', 'Cẩm nang sức khỏe, dinh dưỡng cho gia đình, cộng đồng và xã hội'); $rainTpl->assign('meta_keyword', GENERAL_KEYWORD); $rainTpl->assign('list_categories', $list_category); $rainTpl->assign('list_categories_slice', $list_category2); $rainTpl->assign('link_hoidap', $link_hoidap); $rainTpl->assign('base_search_url', $base_search_url); //assign quảng cáo $rainTpl->assign('adv_top', $adv_top); $rainTpl->assign('adv_right', $adv_right); //quảng cáo banner $rainTpl->assign('adv_banner_list', $adv_banner_list); $rainTpl->assign('time_now', getDateTime());
<!--Title--> <label class='col-md-1 control-label'>Name</label> <div class='col-md-8'> <input type='text' class='form-control' name="listingName" required> </div> </div> <!--Category--> <div class='form-group'> <label class='col-md-1 control-label'>Category</label> <div class='col-md-3'> <select class="form-control" id="select" name="category" required> <option selected disabled>Choose category</option> <?php require_once "../resources/modules/categories.php"; $results = get_all_categories(); foreach ($results as $category) { ?> <option value="<?php echo $category["id"]; ?> "><?php echo $category["name"]; ?> </option> <?php } ?> </select> </div> </div>
<?php require_once 'config.php'; $rainTpl->assign('css_global', $css_global); $rainTpl->assign('js_global', $js_global); //quảng cáo $adv_top = get_advertising(ADV_POSITION_TOP, 1); $adv_right = get_advertising(ADV_POSITION_RIGHT, 1); //quảng cáo banner $adv_banner_list = get_advertising(ADV_POSITION_LARGE_BANNER, 2); $iNews = getValue('record_id', 'int', 'GET', 0); include_once '../includes/inc_news_detail.php'; //list category //cat active $active_cat = intval($detail_data['cat_id']); $list_category = get_all_categories($active_cat); $count_list_cate = count($list_category) - 2; $list_category2 = array_slice($list_category, 1, $count_list_cate); $rainTpl->assign('list_categories', $list_category); $rainTpl->assign('list_categories_slice', $list_category2); //so sánh link với link được request $check_link_redirect = $_SERVER['REQUEST_URI'] == generate_news_detail_url($detail_data); if (!$check_link_redirect) { move301(generate_news_detail_url($detail_data)); } //assign quảng cáo $rainTpl->assign('adv_top', $adv_top); $rainTpl->assign('adv_right', $adv_right); //quảng cáo banner $rainTpl->assign('adv_banner_list', $adv_banner_list); $fb_see_also = '';
$iPage = $iPage > 1 ? $iPage : 1; $limit_size = 10; $db_detail_cat = new db_query('SELECT * FROM categories WHERE cat_id = ' . $iCat); $detail_data = mysqli_fetch_assoc($db_detail_cat->result); unset($db_detail_cat); if (!$detail_data) { error_404_document(); } $detail_data['link_cat'] = generate_cat_url($detail_data); if ($detail_data['cat_type'] == CATEGORY_TYPE_HOIDAP) { move301(generate_qaa_url($detail_data)); } $detail_data['link_cat_next'] = generate_cat_url($detail_data, $iPage + 1); $detail_data['cat_title'] = $detail_data['cat_title'] ? $detail_data['cat_title'] : $detail_data['cat_name'] . ' | Khang.vn - Cẩm nang sức khỏe'; //list category $list_category = get_all_categories($iCat); $count_list_cate = count($list_category) - 2; $list_category2 = array_slice($list_category, 1, $count_list_cate); $rainTpl->assign('list_categories', $list_category); $rainTpl->assign('list_categories_slice', $list_category2); $rainTpl->assign('detail_data', $detail_data); $rainTpl->assign('iPage', $iPage); $rainTpl->assign('page_title', $detail_data['cat_title']); $rainTpl->assign('base_search_url', '/search'); $rainTpl->assign('meta_description', get_meta_description_category($detail_data)); $rainTpl->assign('meta_keyword', get_meta_keyword_category($detail_data)); $rainTpl->assign('color_cat', get_color_category($detail_data['cat_id'])); $rainTpl->assign('adv_top', $adv_top); $rainTpl->assign('adv_right', $adv_right); $rainTpl->assign('link_hoidap', generate_qaa_url()); //quảng cáo banner
# header('Pragma: no-cache'); require 'shared.php'; # Make a connection to the database $db = get_db_read(); $_SESSION['back'] = $_SERVER['REQUEST_URI']; # Read the user_id parameter $user_information = null; if (isset($_GET['user_id']) && is_numeric($_GET['user_id'])) { $user_information = get_user_by_user_id($_GET['user_id'], $db); } # Get the userinformation, get the category list and display the header if ($user_information != null) { $categories = get_categories_by_user_id($user_information['user_id'], $me, $db); } else { $categories = get_all_categories($me != null, $db); } # Display all the categories $new_categories = array(); foreach ($categories as $category) { $category['num_pictures'] = count(get_pictures_by_category_id($category['category_id'], $db)); $category['last_updated'] = $me ? $category['last_updated'] : $category['last_updated_public']; $category['url'] = "show_category.php?category_id=" . $category['category_id']; array_push($new_categories, $category); } template_display_category_list($me, $user_information, $new_categories); ?>
<?php require 'config.php'; //list category tủ thuốc $list_category = get_all_categories('mbox'); $count_list_cate = count($list_category) - 2; $list_category2 = array_slice($list_category, 1, $count_list_cate); $page_title = ''; include_once '../includes/tuthuoc/inc_list_tuthuoc_index.php'; $list_category_tuthuoc = array(); $db_query = new db_query('SELECT cat_id, cat_name,cat_title FROM categories WHERE cat_type = ' . CATEGORY_TYPE_THUOC . ''); while ($row = mysqli_fetch_assoc($db_query->result)) { $row['link_cat'] = generate_tuthuoc_cat($row); $list_category_tuthuoc[] = $row; } //echo $page_title; $rainTpl->assign('css_global', $css_global); $rainTpl->assign('js_global', $js_global); $rainTpl->assign('page_title', $page_title); $rainTpl->assign('list_categories', $list_category); $rainTpl->assign('list_category_tuthuoc', $list_category_tuthuoc); $rainTpl->assign('list_categories_slice', $list_category2); $meta_description = ''; $rainTpl->assign('meta_description', $meta_description); $meta_keyword = ''; $rainTpl->assign('meta_keyword', $meta_keyword); $facebook_og = '<meta property="og:site_name" content="Khang.vn - Hỏi đáp - Khám bệnh online"/> <meta property="og:type" content="website" /> <meta property="og:locale" content="vi_VN"/>
<?php require 'config.php'; //list category $list_category = get_all_categories('qaa'); $count_list_cate = count($list_category) - 2; $list_category2 = array_slice($list_category, 1, $count_list_cate); $iPage = getValue('page', 'int', 'GET', 0); $iPage = intval($iPage); $iPage = $iPage > 1 ? $iPage : 1; $page_title = t('Khang.vn - Trang hỏi đáp, tư vấn khám chữa bệnh miễn phí | Trang ' . $iPage); $limit_size = 10; $limit_start = isset($iPage) && $iPage ? intval(($iPage - 1) * $limit_size) : 0; if ($limit_start < 0) { $iPage = 1; $limit_start = 0; } //list category hỏi đáp $cat_id = getValue('cat_id'); $list_category_hoidap = array(); $db_query = new db_query('SELECT * FROM categories WHERE cat_type = ' . CATEGORY_TYPE_HOIDAP); while ($row = mysqli_fetch_assoc($db_query->result)) { $row['link_cat'] = generate_qaa_url($row); if ($cat_id && $cat_id == $row['cat_id']) { $row['is_checked'] = 'checked'; $cat_name = $row['cat_name']; $og_url = $row['link_cat']; $og_title = $row['cat_name'] . ' - Hỏi đáp về ' . $row['cat_name']; $og_description = $row['cat_name'] . ' - Tư vấn về ' . $row['cat_name'] . ' - Tư vấn chuyên gia - Ý kiến Bác sĩ'; $rainTpl->assign('cat_name', $cat_name); } else {
function set_new_category1($id, $name) { global $connection; $query = "UPDATE episodes SET "; $query .= " Category1 = '{$id}' "; $query .= " WHERE Category1= '{$name}' "; $result = mysqli_query($connection, $query); } function set_new_category2($id, $name) { global $connection; $query = "UPDATE episodes SET "; $query .= " Category2 = '{$id}' "; $query .= " WHERE Category2= '{$name}' "; $result = mysqli_query($connection, $query); } function get_all_categories() { global $connection; $query = "SELECT * FROM categories "; $category_set = mysqli_query($connection, $query); confirm_query($category_set); return $category_set; } // get all episodes $category_set = get_all_categories(); while ($category = mysqli_fetch_assoc($category_set)) { // set its category to its corresponding category it set_new_category1($category["id"], $category["name"]); set_new_category2($category["id"], $category["name"]); }
return $data; } if (function_exists(vc_map)) { vc_map(array("name" => __("Post/Page Display"), "base" => "post_display", "category" => __('Graham'), "params" => array(array("type" => "dropdown", "holder" => "div", "class" => "", "heading" => __("Post and Pages"), "param_name" => "post", "value" => get_all_post_or_pages(), "description" => __("Display one post or page on block"))))); vc_map(array("name" => __("Video Display"), "base" => "video_display", "category" => __('Graham'), "params" => array(array("type" => "textfield", "holder" => "div", "class" => "", "heading" => __("Text"), "param_name" => "text", "value" => '', "description" => __("Text to display on image")), array("type" => "attach_image", "holder" => "div", "class" => "", "heading" => __("Image"), "param_name" => "image", "value" => '', "description" => __("Image url")), array("type" => "textfield", "holder" => "div", "class" => "", "heading" => __("Video Url"), "param_name" => "video", "value" => '', "description" => __("Video url"))))); vc_map(array("name" => __("Slider categories"), "base" => "slider_categories", "category" => __('Graham'), "params" => array(array("type" => "checkbox", "holder" => "div", "class" => "", "heading" => __("Categories"), "param_name" => "post", "value" => get_all_categories(), "description" => __("Display main post with a post slider below, add class 'result_slider_categories' to rows you what to hide when activate slider"))))); vc_map(array("name" => __("Filter children categories"), "base" => "filter_categories", "category" => __('Graham'), "params" => array(array("type" => "dropdown", "holder" => "div", "class" => "", "heading" => __("Post"), "param_name" => "post", "value" => get_all_categories_parents(), "description" => __("Display all children categories by parent and posts"))))); vc_map(array("name" => __("Sidebar post"), "base" => "sidebar_post", "category" => __('Graham'), "params" => array(array("type" => "dropdown", "holder" => "div", "class" => "", "heading" => __("Post"), "param_name" => "post", "value" => get_all_posts(), "description" => __("Display post on sidebar template"))))); vc_map(array("name" => __("Sidebar post with Location"), "base" => "sidebar_post_location", "category" => __('Graham'), "params" => array(array("type" => "dropdown", "holder" => "div", "class" => "", "heading" => __("Post"), "param_name" => "post", "value" => get_all_posts(), "description" => __("Display post on sidebar template"))))); vc_map(array("name" => __("Leaderships"), "base" => "leaderships", "category" => __('Graham'), "params" => array(array("type" => "dropdown", "holder" => "div", "class" => "", "heading" => __("Leadership"), "param_name" => "post", "value" => get_all_posts(array('orderby' => 'name', 'order' => 'ASC', 'post_status' => 'publish', 'post_type' => 'leadership')), "description" => __("Display post on sidebar template"))))); vc_map(array("name" => __("Video Display without Text"), "base" => "video_display_no_text", "category" => __('Graham'), "params" => array(array("type" => "textfield", "holder" => "div", "class" => "", "heading" => __("Video url"), "param_name" => "video", "value" => '', "description" => __("Video url")), array("type" => "attach_image", "holder" => "div", "class" => "", "heading" => __("Image"), "param_name" => "image", "value" => '', "description" => __("Image url"))))); vc_map(array("name" => __("Custom Title"), "base" => "custom_title", "category" => __('Graham'), "params" => array(array("type" => "textfield", "holder" => "div", "class" => "", "heading" => __("Custom Header"), "param_name" => "title", "value" => '')))); vc_map(array("name" => __("Slider Images"), "base" => "slider_images", "category" => __('Graham'), "params" => array(array("type" => "attach_images", "holder" => "div", "class" => "", "heading" => __("Images"), "param_name" => "post", "value" => '')))); $idObj = get_category_by_slug('offices'); $id_categ = $idObj->term_id; vc_map(array("name" => __("Single Location Filter"), "base" => "single_location_filter", "category" => __('Graham'), "params" => array(array("type" => "dropdown", "holder" => "div", "class" => "", "heading" => __("Filter Location"), "param_name" => "category_id", "value" => get_all_categories(array('type' => 'post', 'child_of' => $id_categ))), array("type" => "textfield", "holder" => "div", "class" => "", "heading" => __("Filter name"), "param_name" => "filter_name", "value" => '')))); vc_map(array("name" => __("Video Sidebar"), "base" => "video_sidebar_post", "category" => __('Graham'), "params" => array(array("type" => "textfield", "holder" => "div", "class" => "", "heading" => __("Title"), "param_name" => "title", "value" => ''), array("type" => "textarea", "holder" => "div", "class" => "", "heading" => __("Description"), "param_name" => "description", "value" => ''), array("type" => "attach_image", "holder" => "div", "class" => "", "heading" => __("Image"), "param_name" => "image", "value" => '', "description" => __("Image url")), array("type" => "textfield", "holder" => "div", "class" => "", "heading" => __("Video Url"), "param_name" => "video", "value" => '', "description" => __("Video url"))))); vc_map(array("name" => __("Block with Link"), "base" => "block_with_link", "category" => __('Graham'), "params" => array(array("type" => "textfield", "holder" => "div", "class" => "", "heading" => __("Title"), "param_name" => "title", "value" => '', "description" => __("Text content for block")), array("type" => "textfield", "holder" => "div", "class" => "", "heading" => __("URL"), "param_name" => "url", "value" => '')))); vc_map(array("name" => __("Job Listing"), "base" => "job_listing", "category" => __('Graham'))); vc_map(array("name" => __("Image with header"), "base" => "image_with_header", "category" => __('Graham'), "params" => array(array("type" => "textfield", "holder" => "div", "class" => "", "heading" => __("Header"), "param_name" => "title", "value" => ''), array("type" => "attach_image", "holder" => "div", "class" => "", "heading" => __("Image"), "param_name" => "image", "value" => '')))); vc_map(array("name" => __("Video with header"), "base" => "video_with_header", "category" => __('Graham'), "params" => array(array("type" => "textfield", "holder" => "div", "class" => "", "heading" => __("Header"), "param_name" => "title", "value" => ''), array("type" => "textfield", "holder" => "div", "class" => "", "heading" => __("Video url"), "param_name" => "video", "value" => ''), array("type" => "attach_image", "holder" => "div", "class" => "", "heading" => __("Image"), "param_name" => "image", "value" => '')))); vc_map(array("name" => __("Testimonials"), "base" => "testimonials", "category" => __('Graham'), "params" => array(array("type" => "textfield", "holder" => "div", "class" => "", "heading" => __("Header"), "param_name" => "title", "value" => '')))); } add_shortcode('testimonials', 'graham_testimonials'); function graham_testimonials($arg) { $content = '<div class="testimonial-container"><div class="testimonials-about"><h2>' . $arg['title'] . '</h2><div class="container-slider"><ul id="slider-about">'; query_posts(array('post_type' => 'testimonails', 'posts_per_page' => 6, 'order' => 'DESC', 'orderby' => 'date')); while (have_posts()) { the_post(); global $post;
<?php require_once 'config.php'; //list category $list_category = get_all_categories(); $count_list_cate = count($list_category) - 2; $list_category2 = array_slice($list_category, 1, $count_list_cate); $rainTpl->assign('css_global', $css_global); $rainTpl->assign('js_global', $js_global); $rainTpl->assign('list_categories', $list_category); $rainTpl->assign('list_categories_slice', $list_category2); //ảnh sơ đồ cơ thể $anatomy_image = '/themes/img/anatomy.jpg'; $rainTpl->assign('anatomy_image', $anatomy_image); include_once '../includes/inc_anatomy.php'; $rainTpl->draw('anatomy');
<?php # handle some $_GET variables that are universal $safe_order_by = mysql_escape_string($_GET['order_by']); $safe_category = mysql_escape_string($_GET['category']); if ($safe_category == "Any" || $safe_category == "false") { $safe_category = false; } # clean all GET and POST vars $_SAFE = array(); $input = array_merge($_GET, $_POST); foreach ($input as $key => $val) { $val = mysql_escape_string($val); $_SAFE[$key] = $val; } # check that category is valid global $global_categories; $global_categories = get_all_categories(); if (!in_array($safe_category, $global_categories)) { $safe_category = false; } # include any extra conf files get_extra_conf($safe_category); global $page_vars; $page_vars["order_by"] = $safe_order_by; $page_vars["category"] = $safe_category;