示例#1
0
 function getdata($style, $parameter)
 {
     global $_G;
     define('APPC', DISCUZ_ROOT . './source/plugin/sanree_brand/condition/');
     $modfile = APPC . 'index.php';
     @(require_once $modfile);
     @(require_once DISCUZ_ROOT . './source/plugin/sanree_brand/function/function_core.php');
     $parameter = $this->cookparameter($parameter);
     $config = $_G['cache']['plugin']['sanree_brand'];
     $is_rewrite = intval($config['is_rewrite']);
     $isselfdistrict = intval($config['isselfdistrict']);
     $ismultiple = intval($config['ismultiple']);
     $allicq = array('qq', 'msn', 'wangwang', 'baiduhi', 'skype');
     $icq = trim($config['icq']);
     $icq = !in_array($icq, $allicq) ? 'qq' : $icq;
     $qqcode = trim($config['qqcode']);
     $msncode = trim($config['msncode']);
     $wangwangcode = trim($config['wangwangcode']);
     $baiduhicode = trim($config['baiduhicode']);
     $skypecode = trim($config['skypecode']);
     $icqshow = $icq . 'code';
     $icqshow = ${$icqshow};
     $start = isset($parameter['start']) ? intval($parameter['start']) : 0;
     $bannedids = !empty($parameter['bannedids']) ? explode(',', $parameter['bannedids']) : array();
     $items = !empty($parameter['items']) ? intval($parameter['items']) : 10;
     $orderby = isset($parameter['orderby']) ? $parameter['orderby'] : '0';
     $ordersc = isset($parameter['ordersc']) ? $parameter['ordersc'] : '0';
     $cateid = isset($parameter['cateid']) ? intval($parameter['cateid']) : '0';
     $groupid = isset($parameter['groupid']) ? intval($parameter['groupid']) : '0';
     $showfilter = isset($parameter['showfilter']) ? intval($parameter['showfilter']) : '0';
     $spicwidth = isset($parameter['spicwidth']) ? intval($parameter['spicwidth']) : 0;
     $spicheight = isset($parameter['spicheight']) ? intval($parameter['spicheight']) : 0;
     $showfilter = in_array($showfilter, array(0, 1, 2)) ? $showfilter : 0;
     $sc = array('asc', 'desc');
     $by = array('t.bid', 't.displayorder', 't.dateline', 'tt.views');
     $orderby = $by[$orderby];
     $ordersc = $sc[$ordersc];
     $datalist = $wherearr = array();
     $wherearr[] = 't.status=1';
     $wherearr[] = 't.isshow=1';
     if ($cateid > 0) {
         $category_list = $subcategory_list = array();
         require_once libfile('class/sanree_brand_category', 'plugin/sanree_brand');
         $allurl = gethomeurl();
         $categoryclass = new sanree_brand_category('sanree_brand');
         $categoryclass->show($is_rewrite);
         $pid = $categoryclass->_pid;
         $category_list = $categoryclass->_category_list;
         $subcategory_list = $categoryclass->_subcategory_list;
         $cateids = array();
         $cateids[] = $cateid;
         if (is_array($subcategory_list)) {
             foreach ($subcategory_list as $key => $val) {
                 $cateids[] = $key;
             }
         }
         $ids = implode($cateids, ',');
         if ($pid == $cateid) {
             $wherearr[] = 't.cateid in (' . $ids . ')';
         } else {
             $wherearr[] = 't.cateid =' . $cateid;
         }
     }
     if (!empty($bannedids)) {
         $banids = explode(',', $bannedids);
         $wherearr[] = 't.bid NOT IN (' . implode("','", $banids) . "')";
     }
     if ($showfilter == 1) {
         $wherearr[] = 't.istop = 1';
     } elseif ($showfilter == 2) {
         $wherearr[] = 't.isrecommend = 1';
     }
     if ($groupid > 0) {
         $wherearr[] = 't.groupid = ' . $groupid;
     }
     $where = !empty($wherearr) ? 'WHERE ' . implode(' AND ', $wherearr) : '';
     $itemsnum = $items == 0 ? '' : " LIMIT {$start},{$items}";
     foreach (C::t('#sanree_brand#sanree_brand_businesses')->fetch_all_forblock($where, $orderby, $ordersc, $itemsnum) as $value) {
         $value['icq'] = '';
         if ($ismultiple == 1 && $value['allowmultiple'] == 1) {
             $value['icq'] = getallicq($value[$icq]);
             $value['tel'] = getfirsticq($value['tel']);
             $value['qq'] = getfirsticq($value['qq']);
             $value['msn'] = getfirsticq($value['msn']);
             $value['wangwang'] = getfirsticq($value['wangwang']);
             $value['baiduhi'] = getfirsticq($value['baiduhi']);
             $value['skype'] = getfirsticq($value['skype']);
             $value[$icq] = empty($value[$icq]) ? '' : str_replace('{icqnumber}', getfirsticq($value[$icq]), $icqshow);
         } else {
             $value['qq'] = empty($value['qq']) ? srlang('zanwustr') : str_replace('{icqnumber}', getfirsticq($value['qq']), $icqshow);
             $value['tel'] = getfirsticq($value['tel']);
         }
         $datalist[] = array('id' => $value['bid'], 'idtype' => 'brandid', 'title' => $value['name'], 'url' => getburl_by_bid($value[bid]), 'pic' => 'category/' . $value['poster'], 'picflag' => 1, 'summary' => '', 'fields' => array('brandname' => $value['name'], 'bid' => $value['bid'], 'recommendimg' => $_G['siteurl'] . $value['recommendimg'], 'views' => $value['views'], 'qq' => $value['qq'], 'msn' => $value['msn'], 'wangwang' => $value['wangwang'], 'baiduhi' => $value['baiduhi'], 'skype' => $value['skype'], 'icq' => $value['icq'], 'address' => $value['address'], 'tel' => $value['tel'], 'weburl' => $value['weburl'], 'cateid' => $value['cateid'], 'catename' => $value['catename'], 'brandno' => $value['brandno'], 'region' => $isselfdistrict == 1 ? "{$value['birthcity']} - {$value['birthdist']}" : "{$value['srbirthprovince']} - {$value['srbirthcity']}", 'brandmf' => $value['brandmf'], 'brandtag' => $value['brandtag'], 'weixin' => $value['weixin'], 'weixinimg' => $value['weixinimg'], 'weixinpublic' => $value['weixinpublic'], 'weixinpublicpic' => $value['weixinpublicpic'], 'iscard' => $value['iscard'] ? '<img src="source/plugin/sanree_brand/tpl/good/images/cardico.jpg"/>' : ''));
     }
     return array('html' => '', 'data' => $datalist);
 }
示例#2
0
    $classindex = 1;
}
$perpage = $shownum;
$page = intval($_G['sr_page']);
$page = max(1, intval($page));
$start = ($page - 1) * $perpage;
$start = max(0, $start);
$filter = intval($_G['sr_filter']);
$filterarr = array(1, 2, 3, 4, 5, 6);
!in_array($filter, $filterarr) && ($filter = 1);
$multi = '';
$keyword = dhtmlspecialchars(trim($_G['sr_keyword']));
$allcategorytitle = srlang('notlimited');
$category_list = $subcategory_list = array();
require_once libfile('class/' . $plugin['identifier'] . '_category', 'plugin/' . $plugin['identifier']);
$categoryclass = new sanree_brand_category($plugin['identifier'], $allcategorytitle);
$categoryclass->show($is_rewrite);
$pid = $categoryclass->_pid;
$category_list = $categoryclass->_category_list;
$subcategory_list = $categoryclass->_subcategory_list;
$navigation = $categoryclass->_navigation;
$location = $categoryclass->_location;
$subcategory_bird = $categoryclass->getsubcategory_bird($category_list);
if ($isselfdistrict == 1) {
    require_once libfile('class/' . $plugin['identifier'] . '_selfdistrict', 'plugin/' . $plugin['identifier']);
    $districtclass = new sanree_brand_selfdistrict($plugin['identifier']);
} else {
    require_once libfile('class/' . $plugin['identifier'] . '_district', 'plugin/' . $plugin['identifier']);
    $districtclass = new sanree_brand_district($plugin['identifier']);
}
$districtclass->show($is_rewrite);
示例#3
0
$slistmode = $listmode;
!in_array($slistmode, array(0, 1)) && ($slistmode = 0);
$perpage = $shownum;
$page = intval($_G['sr_page']);
$page = max(1, intval($page));
$start = ($page - 1) * $perpage;
$start = max(0, $start);
$filter = intval($_G['sr_filter']);
$filterarr = array(1, 2, 3, 4, 5, 6);
!in_array($filter, $filterarr) && ($filter = 1);
$multi = '';
$keyword = dhtmlspecialchars(trim($_G['sr_keyword']));
$allcategorytitle = '';
$category_list = $subcategory_list = array();
require_once libfile('class/' . $plugin['identifier'] . '_category', 'plugin/' . $plugin['identifier']);
$categoryclass = new sanree_brand_category($plugin['identifier'], $allcategorytitle);
$categoryclass->show($is_rewrite);
$pid = $categoryclass->_pid;
$category_list = $categoryclass->_category_list;
$subcategory_list = $categoryclass->_subcategory_list;
$navigation = $categoryclass->_navigation;
$location = $categoryclass->_location;
if ($isselfdistrict == 1) {
    require_once libfile('class/' . $plugin['identifier'] . '_selfdistrict', 'plugin/' . $plugin['identifier']);
    $districtclass = new sanree_brand_selfdistrict($plugin['identifier']);
} else {
    require_once libfile('class/' . $plugin['identifier'] . '_district', 'plugin/' . $plugin['identifier']);
    $districtclass = new sanree_brand_district($plugin['identifier']);
}
$districtclass->show($is_rewrite);
$districtcategory_list = $districtclass->_category_list;