} $murl = 'plugin.php?id=sanree_brand&mod=mybrand' . $extra; $multi = multi($count, $perpage, $page, $murl); } } } elseif ($st == 'album') { $brandgroup = C::t('#sanree_brand#sanree_brand_group')->get_by_groupid($brandresult['groupid']); $allowdeletealbum = intval($brandgroup['allowdeletealbum']); if (submitcheck('postsubmit')) { foreach ($_G['sr_album_displayorder'] as $id => $title) { $setarr = array('ishome' => intval($_G['sr_album_ishome'][$id]), 'displayorder' => intval($_G['sr_album_displayorder'][$id])); C::t('#sanree_brand#sanree_brand_album')->update($id, $setarr); } $extra = array(); $_G['inajax'] = 1; $url_forward = srreferer() ? getburl_by_bid($bid) : 'plugin.php?id=sanree_brand&mod=mybrand&view=myalbum&st=album&bid=' . $bid; if ($_G['inajax']) { $href = $url_forward; $href = str_replace("'", "\\'", $href); $url_forward = ''; $extra = array('showdialog' => true, 'extrajs' => "<script type=\"text/javascript\" reload=\"1\">//hideWindow();\r\nsetTimeout(\"window.location.href ='" . $href . "';\", 3000);</script>"); } showmessage(srlang('savesucceed'), $url_forward, array(), $extra); } else { $perpage = 15; $page = isset($_G['sr_page']) ? intval($_G['sr_page']) : 1; $page = max(1, intval($page)); $start = ($page - 1) * $perpage; $start = max(0, $start); $multi = ''; $where = array();
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); }
$mflist = array(); foreach (C::t('#sanree_brand#sanree_brand_mf')->fetch_all_mf() as $data) { $mflist[] = array($data['mfid'], $data['mfname']); } $brandmf = explode(',', $result['brandmf']); include templateEx($plugin['identifier'] . ':' . $template . "/" . $mod . '_' . $do); } } elseif ($do == 'tag') { if (submitcheck('postsubmit')) { $setarr = array(); $setarr['brandtag'] = dhtmlspecialchars(trim($_G['sr_brandtag'])); C::t('#sanree_brand#sanree_brand_businesses')->update($bid, $setarr); $extra = array(); $_G['inajax'] = 1; if ($_G['inajax']) { $href = srreferer() ? $_G['referer'] : getburl_by_bid($bid); $href = str_replace("'", "\\'", $href); $goto = srreferer() ? "\r\nsetTimeout(\"window.location.href ='" . $href . "';\", 3000);" : ''; $url_forward = ''; $extra = array('showdialog' => false, 'extrajs' => "<script type=\"text/javascript\" reload=\"1\">///hideWindow('publisheddlg', 0, 1);{$goto}</script>"); } showmessage(srlang('savesucceed'), '', array(), $extra); } else { $resultempty = FALSE; $orderby = $searchtext = $extra = $srchuid = ''; $orderby = 'tagid desc'; $searchtext = ' AND status=1 '; if (!empty($skeyword)) { $searchfield = array('tagname'); $search = array(); foreach ($searchfield as $v) {