Exemple #1
0
function get_menu_category_hoidap()
{
    $ll = new db_query('SELECT cat_id, cat_name FROM categories WHERE cat_type = ' . CATEGORY_TYPE_HOIDAP);
    $qqqqq = array();
    while ($ooooo = mysqli_fetch_assoc($ll->result)) {
        $ooooo['link_cat'] = generate_qaa_url($ooooo);
        $qqqqq[] = $ooooo;
    }
    return $qqqqq;
}
Exemple #2
0
<?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());
if (!$que_id) {
    error_404_document();
}
$sql = 'SELECT *
        FROM questions
        STRAIGHT_JOIN categories ON cat_id = que_cat_id
        WHERE que_id = ' . $que_id . ' AND que_type = 0 AND que_status = 1';
$db_query = new db_query($sql);
$detail_data = mysqli_fetch_assoc($db_query->result);
unset($db_query);
if (!$detail_data) {
    error_404_document();
}
$detail_data['link_hoidap'] = generate_qaa_url();
$detail_data['link_cat'] = generate_qaa_url($detail_data);
$detail_data['que_question_content'] = nl2br($detail_data['que_question_content']);
$detail_data['que_title'] = htmlspecialbo($detail_data['que_title']);
$datetime_facebook = $detail_data['que_date'];
$detail_data['que_date'] = date('d/m/Y H:i', $detail_data['que_date']);
$detail_data['que_image'] = get_picture_path($detail_data['que_image']);
//phân tag ra thành link search
if ($detail_data['que_tags']) {
    $detail_data['array_tag_search'] = array();
    $array_tag = explode(',', $detail_data['que_tags']);
    $array_tag = array_slice($array_tag, 0, 6);
    foreach ($array_tag as $key => $value) {
        $detail_data['array_tag_search'][] = array('tag_link' => '#', 'tag_name' => $value);
    }
}
$detail_data['facebook_share_link'] = 'http://khang.vn' . generate_hoidap_detail($detail_data);
Exemple #4
0
    include_once '../includes/hoidap/inc_list_hoidap_index.php';
    $link_next_page = generate_qaa_url(array(), $iPage + 1);
    if ($iPage > 1) {
        $link_pre_page = generate_qaa_url(array(), $iPage - 1);
    } else {
        $link_pre_page = '#';
    }
    $rainTpl->assign('link_next_page', $link_next_page);
    $rainTpl->assign('link_pre_page', $link_pre_page);
} else {
    include_once '../includes/hoidap/inc_list_hoidap_cat.php';
    $detail_data['link_cat'] = generate_qaa_url(array('cat_id' => $cat_id, 'cat_name' => $cat_name));
    $detail_data['link_hoidap'] = generate_qaa_url();
    $link_next_page = generate_qaa_url(array('cat_id' => $cat_id, 'cat_name' => $cat_name), $iPage + 1);
    if ($iPage > 1) {
        $link_pre_page = generate_qaa_url(array('cat_id' => $cat_id, 'cat_name' => $cat_name), $iPage - 1);
    } else {
        $link_pre_page = '#';
    }
    $rainTpl->assign('detail_data', $detail_data);
    $rainTpl->assign('link_next_page', $link_next_page);
    $rainTpl->assign('link_pre_page', $link_pre_page);
}
$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:url" content="' . DOMAIN_URL . $og_url . '" />
<meta property="og:locale" content="vi_VN"/>
Exemple #5
0
//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
$rainTpl->assign('adv_banner_list', $adv_banner_list);
if ($is_pjax) {
    include_once '../includes/pjax/inc_cat_pjax.php';
    exit;
}
include_once '../includes/inc_cat.php';
$facebook_og = '
<meta property="og:site_name" content="Khang.vn - Cẩm nang sức khỏe cho mọi nhà"/>
<meta property="og:title" content="Thông tin y tế, sức khỏe cộng đồng"/>
<meta property="og:type" content="website" />
<meta property="og:url" content="http://khang.vn' . $detail_data['link_cat'] . '" />
<meta property="og:locale " content="vi_VN"/>
<meta property="fb:app_id" content="1561038610796934" />
<meta property="og:image" content="' . DOMAIN_URL . '/themes/pc/img/logo1.png"/>
<url>
    <loc><?php 
echo DOMAIN_URL;
?>
/hoidap/</loc>
    <lastmod><?php 
echo $lastmod_first;
?>
</lastmod>
    <changefreq>daily</changefreq>
    <priority>1.0</priority>
</url>;
    <?php 
$db = new db_query('SELECT * FROM categories WHERE cat_type = ' . CATEGORY_TYPE_HOIDAP);
while ($row = mysqli_fetch_assoc($db->result)) {
    $link_cat = generate_qaa_url($row);
    ?>
    <url>
        <loc><?php 
    echo DOMAIN_URL . $link_cat;
    ?>
</loc>
        <?php 
    /*
    <xhtml:link rel="alternate" media="only screen and max-width: 480px" href="http://m.24h.com.vn/" />
    */
    ?>
        <lastmod><?php 
    echo $lastmod_first;
    ?>
</lastmod>
<?php

$list_hoidap = array();
$db_query = new db_query('SELECT que_id,que_title, que_image, que_date,cat_name,que_question_content
                            FROM questions
                            LEFT JOIN categories ON cat_id = que_cat_id
                            WHERE que_date <= ' . TIMESTAMP . ' AND que_type = 0 AND que_status = 1 AND que_cat_id = ' . $cat_id . '
                            ORDER BY que_date DESC LIMIT ' . $limit_start . ',' . $limit_size);
while ($row = mysqli_fetch_assoc($db_query->result)) {
    $cat_name = $row['cat_name'];
    $row['cat_name'] = $row['cat_name'] ? $row['cat_name'] : 'Tư vấn';
    $row['link_detail'] = generate_hoidap_detail($row);
    $row['que_title'] = htmlspecialbo($row['que_title']);
    $row['que_date_str'] = getDateTime(1, 1, 1, 1, '', $row['que_date']);
    $row['que_date'] = date('d/m/Y H:i', $row['que_date']);
    $row['que_image'] = $row['que_image'] ? get_picture_path($row['que_image'], 'small') : '';
    $list_hoidap[] = $row;
}
if (!$list_hoidap && $iPage > 1) {
    redirect(generate_qaa_url(array('cat_id' => $cat_id, 'cat_name' => $cat_name)), 1);
}
$rainTpl->assign('list_hoidap', $list_hoidap);
<?php

$list_hoidap = array();
$db_query = new db_query('SELECT que_id,que_title, que_image, que_date,cat_name,que_question_content
                            FROM questions
                            LEFT JOIN categories ON cat_id = que_cat_id
                            WHERE que_date <= ' . TIMESTAMP . ' AND que_type = 0 AND que_status = 1
                            ORDER BY que_date DESC LIMIT ' . $limit_start . ',' . $limit_size);
while ($row = mysqli_fetch_assoc($db_query->result)) {
    $row['cat_name'] = $row['cat_name'] ? $row['cat_name'] : 'Tư vấn';
    $row['link_detail'] = generate_hoidap_detail($row);
    $row['que_title'] = htmlspecialbo($row['que_title']);
    $row['que_date_str'] = getDateTime(1, 1, 1, 1, '', $row['que_date']);
    $row['que_date'] = date('d/m/Y H:i', $row['que_date']);
    $row['que_image'] = $row['que_image'] ? get_picture_path($row['que_image'], 'small') : '';
    $list_hoidap[] = $row;
}
if (!$list_hoidap && $iPage > 1) {
    redirect(generate_qaa_url(), 1);
}
$rainTpl->assign('list_hoidap', $list_hoidap);
Exemple #9
0
<?php

require 'config.php';
//list category
$list_category = get_all_categories('qaa');
$detail_data = array();
//list category hỏi đáp
$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);
    $list_category_hoidap[] = $row;
}
$rainTpl->assign('list_category_hoidap', $list_category_hoidap);
//quảng cáo
$adv_top = get_advertising(ADV_POSITION_TOP, 1);
$adv_right = get_advertising(ADV_POSITION_RIGHT, 1);
$rainTpl->assign('adv_top', $adv_top);
$rainTpl->assign('adv_right', $adv_right);
//quảng cáo banner
$adv_banner_list = get_advertising(ADV_POSITION_LARGE_BANNER, 2);
$rainTpl->assign('adv_banner_list', $adv_banner_list);
$que_id = getValue('que_id');
$rainTpl->assign('css_global', $css_global);
$rainTpl->assign('js_global', $js_global);
$rainTpl->assign('list_categories', $list_category);
include_once '../includes/hoidap/inc_hoidap_detail.php';
if (isset($detail_data['que_title']) && $detail_data['que_title']) {
    $page_title = t($detail_data['que_title'] . ' | Chuyên mục hỏi đáp');
} else {
    $page_title = t('Trang hỏi đáp, tư vấn khám chữa bệnh miễn phí');
Exemple #10
0
function get_all_categories($active_cat = '')
{
    global $_static_value;
    if (isset($_static_value['categories_menu'])) {
        return $_static_value;
    }
    $db = new db_query('SELECT cat_id,cat_name
                        FROM categories
                        WHERE cat_type = ' . CATEGORY_TYPE_NEWS);
    $cat = array();
    if (is_int($active_cat)) {
        $cat[] = array('cat_id' => 0, 'cat_name' => 'Trang chủ', 'link_cat' => '/home', 'is_active' => 0);
        while ($row = mysqli_fetch_assoc($db->result)) {
            if ($row['cat_id'] == $active_cat) {
                $row['is_active'] = 1;
            } else {
                $row['is_active'] = 0;
            }
            $row['link_cat'] = generate_cat_url($row);
            $cat[] = $row;
        }
        $cat[] = array('cat_id' => 0, 'cat_name' => 'Hỏi - đáp', 'link_cat' => generate_qaa_url(), 'is_active' => 0);
        $cat[] = array('cat_id' => 0, 'cat_name' => 'Tủ thuốc', 'link_cat' => generate_medicine_box_url(), 'is_active' => 0);
    } else {
        switch ($active_cat) {
            case 'home':
                $cat[] = array('cat_id' => 0, 'cat_name' => 'Trang chủ', 'link_cat' => '/home', 'is_active' => 1);
                while ($row = mysqli_fetch_assoc($db->result)) {
                    $row['link_cat'] = generate_cat_url($row);
                    $cat[] = $row;
                }
                $cat[] = array('cat_id' => 0, 'cat_name' => 'Hỏi - đáp', 'link_cat' => generate_qaa_url(), 'is_active' => 0);
                $cat[] = array('cat_id' => 0, 'cat_name' => 'Tủ thuốc', 'link_cat' => generate_medicine_box_url(), 'is_active' => 0);
                break;
                //hỏi đáp
            //hỏi đáp
            case 'qaa':
                $cat[] = array('cat_id' => 0, 'cat_name' => 'Trang chủ', 'link_cat' => '/home', 'is_active' => 0);
                while ($row = mysqli_fetch_assoc($db->result)) {
                    $row['link_cat'] = generate_cat_url($row);
                    $cat[] = $row;
                }
                $cat[] = array('cat_id' => 0, 'cat_name' => 'Hỏi - đáp', 'link_cat' => generate_qaa_url(), 'is_active' => 1);
                $cat[] = array('cat_id' => 0, 'cat_name' => 'Tủ thuốc', 'link_cat' => generate_medicine_box_url(), 'is_active' => 0);
                break;
                //tủ thuốc
            //tủ thuốc
            case 'mbox':
                $cat[] = array('cat_id' => 0, 'cat_name' => 'Trang chủ', 'link_cat' => '/home', 'is_active' => 0);
                while ($row = mysqli_fetch_assoc($db->result)) {
                    $row['link_cat'] = generate_cat_url($row);
                    $cat[] = $row;
                }
                $cat[] = array('cat_id' => 0, 'cat_name' => 'Hỏi - đáp', 'link_cat' => generate_qaa_url(), 'is_active' => 0);
                $cat[] = array('cat_id' => 0, 'cat_name' => 'Tủ thuốc', 'link_cat' => generate_medicine_box_url(), 'is_active' => 1);
                break;
        }
    }
    unset($db);
    $_static_value['categories_menu'] = $cat;
    return $cat;
}