Exemple #1
0
function changeTitle($str)
{
    $str = trim($str);
    if ($str == "") {
        return "";
    }
    $str = str_replace('"', '', $str);
    $str = str_replace("'", '', $str);
    $str = vn_str_filter($str);
    $str = mb_convert_case($str, MB_CASE_LOWER, 'utf-8');
    $str = str_replace(' ', '-', $str);
    return $str;
}
Exemple #2
0
function fixName($str)
{
    global $ttH;
    $str = vn_str_filter($str);
    /*$str = preg_replace('/[^a-zA-Z0-9\.-_ ]/','',$str);
    	$str = preg_replace('/[_ ]/','-',$str);
    	while(strlen(strstr($str,"--")) > 0){
    		$str = str_replace('--','-',$str);
    	}
    	$str = str_replace(array('(-)','()','(-','-)','(',')'),'','('.$str.')');
    	$str = strtolower($str);
    	$str = ($str == "") ? time() : $str;*/
    $str = str_replace(' ', '-', $str);
    $str = str_replace(array('(', ')', '[', ']', '{', '}'), '', $str);
    return $str;
}
Exemple #3
0
<?php

$link = '#';
$list = '';
$s = '';
foreach ($types as $key => $value) {
    if ($type == $key && $type) {
        $link = base_url('tin-tuc/cat/' . vn_str_filter($value) . '-' . $key . '.html');
        $title = $value;
        $s = 'selected';
    }
    $list .= '<li class="tabclick ' . $s . '"><a href="' . base_url('tin-tuc/cat/' . vn_str_filter($value) . '-' . $key . '.html') . '">' . $value . '</a></li>';
}
?>
<div class="wrapper-breadcrums">
    <div class="container">
        <div class="row">
            <div class="col-sm-24">
                <div class="breadcrumbs">
                    <ul>
                        <li class="home"> <a href="<?php 
echo base_url();
?>
" title="Trang chủ"><span>Trang chủ</span></a> <span class="separator">/ </span></li>
                        <?php 
if (isset($type) && $type) {
    ?>
                            <li class="news"> <a href="<?php 
    echo base_url('tin-tuc.html');
    ?>
" title="Tin tức"><span>Tin tức</span></a> <span class="separator">/ </span></li>
/**
* check match condition 2 keywords
* 
* @param mixed $key: main keywords
* @param mixed $check match keywords
*/
function match_keywords($key, $check)
{
    $key = vn_str_filter(strtolower($key));
    $keys = explode(',', $key);
    $check = vn_str_filter(strtolower($check));
    $checks = preg_split('#[\\s]+#', $check);
    foreach ($keys as $key_) {
        $current_pos = -1;
        //current position substring found
        $count_order = 0;
        //reset
        foreach ($checks as $t) {
            $pos = array_search($t, preg_split('#[\\s]+#', $key_));
            //print_r(preg_split('#[\s]+#',$key_));
            if ($pos !== false && $pos > $current_pos) {
                $count_order++;
            }
            //count substring that found in main keyword with ASC condition
            $current_pos = $pos;
            //update last pos
        }
        //echo '['.$count_order.']';
        //condition result
        if ($count_order / count($checks) >= 2 / 3) {
            return true;
        }
    }
    return false;
}
Exemple #5
0
			                                            <div class="product-item">
			                                                <div class="product-shop-top">
			                                                    ' . $link . '
			                                                    <div class="bottom">
			                                                        ' . $addCart . '
			                                                        <div class="quickshop-link-container">
                                                                        <a href="' . base_url('product-' . vn_str_filter($value['title']) . '-' . $value['id']) . '.html" class="quickshop-link" title="Mua">Mua</a>
                                                                    </div>
			                                                    </div>
			                                                </div>

			                                                <!-- /.product-shop-top -->
                                                            <div class="product-shop">
                                                                <div class="f-fix">
                                                                    <!--product name-->
                                                                    <h3 style="min-height: 19px;" class="product-name"><a href="' . base_url('product-' . vn_str_filter($value['title']) . '-' . $value['id']) . '.html" title="' . $value['title'] . '">' . $value['title'] . '</a></h3><div class="ratings">
                                                                        <div class="rating-box">
                                                                            <div class="rating" style="width:' . floatval($value['ratePoint'] * 20) . '%"></div>
                                                                        </div>
                                                                        <span class="amount"><a href="#">(' . $value['rateCount'] . ')</a></span>
                                                                    </div>
                                                                    <!--product price-->
                                                                    <div class="price-box">
                                                                        ' . $deal_price . '
                                                                        <span class="regular-price" id="product-price-170-emprice-2fd1cdd203d2809e7354d43dcdbdb613"> <span class="price">' . $s_price . '</span> </span>
                                                                    </div>

                                                                </div>
                                                            </div><!-- /.product-shop -->
			                                            </div><!-- /.product-item -->
			                                        </li>
Exemple #6
0
 $class = '';
 if ($i === 1) {
     echo '<div class="products-list ">';
     $class = 'first';
 } elseif ($i == 5) {
     $class = 'last';
 }
 /*link*/
 $link = '';
 $images = explode('|', $value['images']);
 $fLink = FALSE;
 $k = 0;
 $deal_percent = '';
 $deal_price = '';
 $is_hot = '';
 $p_url = base_url('product-' . vn_str_filter($value['title']) . '-' . $value['id']) . '.html';
 if ($value['is_hot']) {
     $is_hot = '<li class="label hot"><p> Hot </p></li>';
 }
 if ($value['deal'] && $value['type'] == 0) {
     $deal_price = '<p class="old-price"><span class="price-label">Regular Price:</span><span class="price" id="old-price-182-emprice-c095817cdda4bcb80055091211aacad7">' . number_format((double) $value['buy_price']) . ' đ</span></p>';
     $deal_percent = '<ul class="productlabels_icons">' . $is_hot . '<li class="label special"><p><span>-' . intval(100 * $value['deal'] / $value['buy_price']) . '%</span> </p></li></ul>';
 }
 if ($value['type'] == 0) {
     $s_price = number_format((double) intval($value['buy_price'] - $value['deal'])) . ' đ';
 } else {
     $s_price = 'LIÊN HỆ';
 }
 $data_list_img = '';
 foreach ($images as $img) {
     if ($img) {