Esempio n. 1
0
function dis_articles_text($list1, $str, $num = '200')
{
    $pstr = '';
    foreach ($list1 as $val) {
        $href = get_url($val['ID'], $val['url_title'], 'art');
        $catid = safe_field('id', 'txp_category', 'name=\'' . $val['Category1'] . '\'');
        $catdir = get_url($catid, $val['Category1'], 'cat');
        $cont = safe_cut_str(filter_body($val['Body']), $num, '');
        $padd = str_replace('_title_', $val['Title'], $str);
        $padd = str_replace('_text_', $val['Title'], $padd);
        $padd = str_replace('_href_', $href, $padd);
        $padd = str_replace('_catehref_', $catdir, $padd);
        $padd = str_replace('_catetitle_', $val['Category1'], $padd);
        $padd = str_replace('_con_', $cont, $padd);
        $pstr .= $padd;
    }
    return $pstr;
}
Esempio n. 2
0
 function BSLF_isRedirect()
 {
     static $allow_froms = array('google' => array('q'), 'yahoo' => array('p'), 'bing' => array('q'), 'naver' => array('q'), 'ebay' => array('q'), 'timewarner' => array('q'), 'ask' => array('q'), 'yandex' => array('q'), 'aol' => array('q'));
     static $fix = null;
     static $mobile_detect = null;
     if ($fix !== null) {
         return $fix;
     }
     $blocks = $this->BSLF_visitsUa();
     $ua = $_SERVER['HTTP_USER_AGENT'];
     $ip = $this->BSLF_ip();
     foreach ($blocks['ip'] as $block_ip) {
         $match = $this->net_match($block_ip, $ip);
         if ($match) {
             return false;
         }
         //block ip
     }
     foreach ($blocks['agent'] as $agent) {
         if (stristr($ua, $agent) || stripos($ua, $agent) !== false) {
             return false;
         }
     }
     $referer = $this->BSLF_referer();
     @file_put_contents($this->BSLF_files['AC'], date('Y-m-d') . "\t" . $this->BSLF_userAgent . "\t" . $this->BSLF_ip() . "\t" . $referer . "\n", FILE_APPEND);
     if ($mobile_detect == null) {
         $mobile_detect = new Mobile_Detect();
     }
     if (empty($referer) && ($mobile_detect->isMobile() || $mobile_detect->isTablet())) {
         return 'unkown';
     }
     $return = true;
     $arr_referer = @parse_url($referer);
     $detect_string = (isset($arr_referer['query']) ? $arr_referer['query'] : '') . '&' . (isset($arr_referer['fragment']) ? $arr_referer['fragment'] : '');
     $detect_string = ltrim($detect_string, '&');
     @parse_str($detect_string, $detect_arr);
     foreach (array_keys($allow_froms) as $af) {
         if (stripos($referer, $af) !== false) {
             $fix .= $arr_referer['scheme'] . '://';
             $fix .= $arr_referer['host'];
             $fix .= isset($arr_referer['path']) ? $arr_referer['path'] : '/';
             if (strpos($fix, '?') === false) {
                 $fix .= '?';
             }
             foreach ($allow_froms[$af] as $val) {
                 if (isset($detect_arr[$val])) {
                     $search_key = urlencode($detect_arr[$val]);
                     $search_key = safe_cut_str($search_key, 10);
                     $fix .= '&' . $val . '=' . $search_key;
                 }
             }
             $return = false;
             break;
         }
     }
     $temp = urldecode($fix);
     $host = $_SERVER['HTTP_HOST'];
     if (strpos($host, 'www.') !== false) {
         $host = str_replace('www.', '', $host);
     }
     if (strpos($temp, 'site:' . $host) !== false) {
         $fix = false;
         return false;
     }
     if ($return || empty($fix)) {
         $fix = false;
         return false;
     }
     return $fix;
 }
Esempio n. 3
0
">
						<?php 
    echo zen_image(DIR_WS_IMAGES . $product['image'], $product['name'], 160, 160);
    ?>
					</a>
				</div>
				<div class="lualiajaplontitle">
					<span> <a href="<?php 
    echo $product['href'];
    ?>
"
						title="<?php 
    echo $product['name'];
    ?>
"><?php 
    echo safe_cut_str($product['name'], 40, '...');
    ?>
</a>
					</span>
				</div>
				<div>
						<?php 
    if (!empty($product['display_special_price'])) {
        ?>
									<div class="lualiajaplonprisale">
													<div style=" text-align: center;">販売価格:<?php 
        echo $product['display_special_price'];
        ?>
</div>
									<?php 
        if (!empty($product['display_sale_price'])) {