$value['discount'] = intval($value['discount']); $value['tel114url'] = ''; $tel114id = intval($value['tel114id']); if ($tel114id > 0 && $tel114version >= 1121) { $url = $tel114_is_rewrite ? 'tel114-view-' . $tel114id . '.html' : 'plugin.php?id=sanree_tel114&mod=view&tid=' . $tel114id; $value['tel114url'] = "<a href=\"" . $url . "\" onclick=\"showWindow('showtelkey', this.href)\"><img height=18 width=18 align=\"absmiddle\" src=\"" . sr_brand_IMG . "/tel114.png\" /></a>"; } if ($ismultiple == 1 && $value['allowmultiple'] == 1) { $icqline = getfirsticq($value[$icq]); $value['icq'] = empty($icqline) ? srlang('zanwustr') : str_replace('{icqnumber}', $icqline, $icqshow); $value['tel'] = getfirsticq($value['tel']); } else { $value['qq'] = empty($value['qq']) ? srlang('zanwustr') : str_replace('{icqnumber}', getfirsticq($value['qq']), $icqshow); } $businesses_list[$i][] = $value; $fbusinesses_list[] = array('name' => $value['name'], 'jindex' => $j, 'poster' => $issmallpic == 1 ? brand_getlogo($value['bid'], 0, 120, 85, 'fixnone') : $value['poster'], 'propaganda' => $value['propaganda'], 'cateurl' => $value['cateurl'], 'currentlocation' => $categoryclass->getcatelocal($value['cateid']), 'addtime' => $value['addtime'], 'weburlstr' => $value['weburlstr'], 'tel114url' => $value['tel114url'], 'catename' => $value['catename'], 'uid' => $value['uid'], 'tid' => $value['tid'], 'turl' => $value['turl'], 'username' => $value['username'], 'allowmultiple' => $value['allowmultiple'], 'qq' => $value['qq'], 'msn' => $value['msn'], 'wangwang' => $value['wangwang'], 'icq' => $value['icq'], 'address' => $value['address'], 'groupid' => $value['groupid'], 'groupimg' => getgroupimg($value['groupid']), 'tel' => $value['tel'], 'discount' => $config['selectdiscountshow'][$value['discount']], 'recommendationindex' => $value['recommendationindex'], 'class' => $j % 3 == 0 ? ' class="' . $value['class'] . '"' : ' class="mr10 ' . $value['class'] . '"', 'forum_thread' => array('views' => $value['forum_thread']['views'], 'replies' => $value['forum_thread']['replies'], 'favtimes' => $value['forum_thread']['favtimes'])); } $murl = $is_rewrite ? getcateurl(array('tid' => $cateid, 'listmode' => $listmode)) . '?t' . $extra : getcateurl(array('tid' => $cateid, 'listmode' => $listmode)) . $extra; $multi = multi($count, $perpage, $page, $murl); } $published_data3 = str_replace('{adminabouturl}', $adminabouturl, srlang('published_data3')); $orderby = 't.istop desc,t.displayorder, t.dateline desc'; $recommendlist = array(); foreach (C::t('#sanree_brand#sanree_brand_businesses')->fetch_all_by_searchc(array('c.status=1', 't.isrecommend=1', 't.status=1'), $orderby, 0, $Recommendnum) as $value) { $value['recommendimg'] = srfiximages($value['recommendimg'], 'common', '/none1.gif'); if ($reurlmode == 1) { $url = empty($value['weburl']) || $value['weburl'] == 'http://' ? getburl($value) : $value['weburl']; } else { $url = getburl($value); } $recommendlist[] = array('name' => $value['name'], 'img' => '<img src="' . $value['recommendimg'] . '" alt="' . $value['name'] . '" />', 'url' => $url);
$value['qq'] = empty($value['qq']) ? srlang('zanwustr') : str_replace('{icqnumber}', getfirsticq($value['qq']), $icqshow); } $voter = C::t('#sanree_brand#sanree_brand_voter')->getvotetotal_by_tid(intval($value['tid'])); $voter[2] = $voter[2] == 0 ? 1 : $voter[2]; $v1 = round($voter[1] / $voter[2], 1); list($vn1, $vn2) = explode('.', $v1); $value['cateurl'] = getcateurl(array('tid' => $value['cateid']), TRUE); $mtf = $_G['cache']['plugin']['sanree_mcertification']['isopen']; if ($mtf) { $mcertification = C::t('#sanree_mcertification#sanree_mcertification')->gettype_by_bid(intval($value['bid'])); $mgif = 'source/plugin/sanree_mcertification/tpl/default/mcertification/brandimg/none.png'; if ($mcertification) { $mgif = $mcertification['type'] ? 'source/plugin/sanree_mcertification/tpl/default/mcertification/brandimg/personal.png' : 'source/plugin/sanree_mcertification/tpl/default/mcertification/brandimg/company.png'; } } $fbusinesses_list[] = array('weixin' => $value['weixin'], 'wximg' => $value['weixinimg'], 'wxplublic' => $value['weixinpublic'], 'wxppic' => $value['weixinpublicpic'], 'bid' => $value['bid'], 'mtype' => $mcertification, 'isrecommend' => $value['isrecommend'], 'istop' => $value['istop'], 'mcertification' => $mgif, 'catename' => $value['catename'], 'cateurl' => $value['cateurl'], 'name' => $value['name'], 'poster' => $issmallpic == 1 && !$config['isbird'] ? brand_getlogo($value['bid'], 0, $logow, $logoh, 'fixnone') : newtheme($value['poster']), 'addtime' => dgmdate($value['addtime']), 'tel114url' => $value['tel114url'], 'turl' => getburl($value), 'qq' => $value['qq'], 'msn' => $value['msn'], 'wangwang' => $value['wangwang'], 'icq' => $value['icq'], 'address' => empty($value['address']) ? srlang('zanwustr') : $value['address'], 'groupsmallicons' => getgroupsmallicons($value['groupid']), 'tel' => $value['tel'], 'sdiscount' => $value['discount'], 'pbid' => intval($value['pbid']), 'iscard' => intval($value['iscard']), 'discount' => $config['selectdiscountshow'][$value['discount']], 'recommendarr' => explode('.', $value['recommendationindex']), 'voter' => intval($vn1), 'voter2' => intval($vn2), 'satisfaction' => $voter[3], 'recommendationindex' => $value['recommendationindex'], 'class' => ' class="' . $value['class'] . '" ', 'forum_thread' => array('views' => $value['tviews'])); } $murl = $is_rewrite ? getcateurl(array('tid' => $cateid, 'listmode' => $listmode)) . '?t' . $extra : getcateurl(array('tid' => $cateid, 'listmode' => $listmode)) . $extra; $multi = sanree_brand_multi($count, $perpage, $page, $murl); } $recommendlist = sanreeloadcache('recommendlist'); $tabHead['goods'] = $tabHead['news'] = $tabHead['coupon'] = ''; $tabBody['goods'] = $tabBody['news'] = $tabBody['coupon'] = ''; $installmode = array(); $goods_config = $_G['cache']['plugin']['sanree_brand_goods']; if ($goods_config['isopen']) { $modfile = DISCUZ_ROOT . './source/plugin/sanree_brand_goods/function/function_module.php'; @(require_once $modfile); $modurl_goods = goods_getmodeurl(); $selectpriceunit = $goods_config['selectpriceunit']; $marr = explode("\r\n", $selectpriceunit);
function sanreeupdatecache($cachename) { global $_G; $config = $_G['cache']['plugin']['sanree_brand']; $cachearray = array('category', 'menu', 'help', 'hotbrandlist', 'newbrandlist', 'recommendlist', 'slidelist'); $cachename = in_array($cachename, $cachearray) ? $cachename : ''; if ($cachename == 'slidelist') { $list = array(); for ($t = 1; $t < 3; $t++) { $slidelist = array(); $slide = DB::fetch_first("SELECT * FROM " . DB::table('sanree_brand_slide') . ' where id=' . $t); if ($slide) { for ($j = 1; $j < 6; $j++) { if ($slide['pic' . $j]) { $picurl = fiximage($slide['pic' . $j]); $link = $slide['movie' . $j]; $slidelist[] = array('pic' => $picurl, 'url' => $link); } } } $list[$t] = $slidelist; } save_syscache('sanree_brand_slidelist', $list); } elseif ($cachename == 'recommendlist') { $template = trim($config['template']); $template = empty($template) ? 'default' : $template; define('sr_brand_TPL', 'source/plugin/sanree_brand/tpl'); define('sr_brand_IMG', sr_brand_TPL . '/' . $template . '/images'); $adminadurl = $config['adminadurl']; $orderby = 't.istop desc,t.displayorder, t.dateline desc'; $recommendlist = array(); $ri = 0; for ($itc = 0; $itc < 5; $itc++) { $wanted = sr_brand_IMG . '/wanted.gif'; $recommendlist[$itc] = array('name' => '', 'img' => $wanted, 'url' => $adminadurl); } foreach (C::t('#sanree_brand#sanree_brand_businesses')->fetch_all_by_searchc(array('c.status=1', 't.isrecommend=1', 't.status=1'), $orderby, 0, 5) as $value) { $value['recommendimg'] = newtheme($value['recommendimg'], 'common', '/none180x135.jpg'); if ($reurlmode == 1) { $url = empty($value['weburl']) || $value['weburl'] == 'http://' ? getburl($value) : $value['weburl']; } else { $url = getburl($value); } $voter = C::t('#sanree_brand#sanree_brand_voter')->getvotetotal_by_tid(intval($value['tid'])); list($firsttel) = explode(',', $value['tel']); $recommendlist[$ri] = array('name' => $value['name'], 'img' => $value['recommendimg'], 'url' => $url, 'tel' => $firsttel, 'satisfaction' => $voter[3]); $ri++; } save_syscache('sanree_brand_recommendlist', $recommendlist); } elseif ($cachename == 'newbrandlist') { $orderby = 't.dateline desc'; $newbrandlist = array(); foreach (C::t('#sanree_brand#sanree_brand_businesses')->fetch_all_by_searchc(array('c.status=1', 't.isshow=1', 't.status=1'), $orderby, 0, 5) as $value) { $class = ''; if (count($newbrandlist) < 2) { $class = ' class="top2"'; } if ($reurlmode == 1) { $url = empty($value['weburl']) || $value['weburl'] == 'http://' ? getburl($value) : $value['weburl']; } else { $url = getburl($value); } $voter = C::t('#sanree_brand#sanree_brand_voter')->getvotetotal_by_tid(intval($value['tid'])); $newbrandlist[] = array('name' => $value['name'], 'url' => $url, 'class' => $class, 'satisfaction' => $voter[3], 'poster' => $issmallpic == 1 && !$config['isbird'] ? brand_getlogo($value['bid'], 0, 90, 60, 'fixnone') : newtheme($value['poster'])); } save_syscache('sanree_brand_newbrandlist', $newbrandlist); } elseif ($cachename == 'hotbrandlist') { $orderby = 't.views desc'; $hotbrandlist = array(); $tel114version = $_G['setting']['plugins']['version']['sanree_tel114'] * 1000; foreach (C::t('#sanree_brand#sanree_brand_businesses')->fetch_all_by_searchc(array('c.status=1', 't.isshow=1', 't.status=1'), $orderby, 0, 8) as $value) { $class = ''; if (count($hotbrandlist) < 2) { $class = ' class="top2"'; } if ($reurlmode == 1) { $url = empty($value['weburl']) || $value['weburl'] == 'http://' ? getburl($value) : $value['weburl']; } else { $url = getburl($value); } $voter = C::t('#sanree_brand#sanree_brand_voter')->getvotetotal_by_tid(intval($value['tid'])); $value['tel114url'] = ''; $tel114id = intval($value['tel114id']); if ($tel114id > 0 && $tel114version >= 1121) { $tel114url = $tel114_is_rewrite ? 'tel114-view-' . $tel114id . '.html' : 'plugin.php?id=sanree_tel114&mod=view&tid=' . $tel114id; $value['tel114url'] = "<a href=\"" . $tel114url . "\" onclick=\"showWindow('showtelkey', this.href)\"><img height=18 width=18 src=\"source/plugin/sanree_brand/tpl/good/images/stel114.jpg\" /></a>"; } $mcertificationplugin = C::t('#sanree_brand#common_plugin')->fetch_by_identifier('sanree_mcertification'); $open = C::t('#sanree_brand#common_pluginvar')->fetch_all_by_pluginid($mcertificationplugin['pluginid']); if ($open[0]['variable'] == 'isopen') { $mcertification_config['isopen'] = $open[0]['value']; } if ($mcertification_config['isopen']) { $mcertification = C::t('#sanree_mcertification#sanree_mcertification')->gettype_by_bid(intval($value['bid'])); $mgif = 'source/plugin/sanree_mcertification/tpl/default/mcertification/brandimg/none.png'; if ($mcertification) { $mgif = $mcertification['type'] ? 'source/plugin/sanree_mcertification/tpl/default/mcertification/brandimg/personal.png' : 'source/plugin/sanree_mcertification/tpl/default/mcertification/brandimg/company.png'; } } list($firsttel) = explode(',', $value['tel']); $hotbrandlist[] = array('name' => $value['name'], 'url' => $url, 'class' => $class, 'tel' => $firsttel, 'satisfaction' => $voter[0], 'poster' => $issmallpic == 1 && !$config['isbird'] ? brand_getlogo($value['bid'], 0, 210, 135, 'fixnone') : newtheme($value['poster']), 'groupsmallicons' => getgroupsmallicons($value['groupid']), 'tel114url' => $value['tel114url'], 'sdiscount' => $value['discount'], 'iscard' => intval($value['iscard']), 'pbid' => intval($value['pbid']), 'mcertification' => $mgif); } save_syscache('sanree_brand_hotbrandlist', $hotbrandlist); } elseif ($cachename == 'help') { $help_config = array(); $brandplugin = C::t('#sanree_brand#common_plugin')->fetch_by_identifier('sanree_brand_help'); if ($brandplugin) { $sanree_brand_help_pluginid = $brandplugin['pluginid']; } foreach (C::t('#sanree_brand#common_pluginvar')->fetch_all_by_pluginid($sanree_brand_help_pluginid) as $var) { if (strexists($var['type'], '_')) { continue; } $help_config[$var['variable']] = $var['value']; } if (intval($help_config['isopen']) == 1) { $helpsort = trim($help_config['helpsort']); $marr = explode("\r\n", $helpsort); $helpcatedata = array(); foreach ($marr as $row) { list($key, $val) = explode("=", $row); $helpcatedata[$key] = array($key, $val); } $helpcate = array(); $helpcate[1] = array(1, $helpcatedata[1][1]); $helpcate[1]['class'] = ' class="h_intro"'; $helpcate[1][2] = C::t('#sanree_brand_help#sanree_brand_help')->fetch_all_by_searchc(' AND cateid=1 AND status=1', 'displayorder', 0, 3); $helpcate[2] = array(1, $helpcatedata[2][1]); $helpcate[2]['class'] = ' class="h_rank"'; $helpcate[2][2] = C::t('#sanree_brand_help#sanree_brand_help')->fetch_all_by_searchc(' AND cateid=2 AND status=1', 'displayorder', 0, 3); $helpcate[3] = array(1, $helpcatedata[3][1]); $helpcate[3]['class'] = ' class="h_help"'; $helpcate[3][2] = C::t('#sanree_brand_help#sanree_brand_help')->fetch_all_by_searchc(' AND cateid=3 AND status=1', 'displayorder', 0, 3); $helpcate[4] = array(1, $helpcatedata[4][1]); $helpcate[4]['class'] = ' class="h_recommend"'; $helpcate[4][2] = C::t('#sanree_brand_help#sanree_brand_help')->fetch_all_by_searchc(' AND cateid=4 AND status=1', 'displayorder', 0, 3); $helpcate[5] = array(1, $helpcatedata[5][1]); $helpcate[5]['class'] = ' class="h_join"'; $helpcate[5][2] = C::t('#sanree_brand_help#sanree_brand_help')->fetch_all_by_searchc(' AND cateid=5 AND status=1', 'displayorder', 0, 3); save_syscache('sanree_brand_help', $helpcate); } else { save_syscache('sanree_brand_help', ''); } } elseif ($cachename == 'category') { $category = $admin_category = $user_category = $subcategory = array(); $data = C::t('#sanree_brand#sanree_brand_category')->getcategory_by_pcateid(0); foreach ($data as $cate) { $cate['status'] == 1 && ($user_category[$cate['cateid']] = $cate); $cate['status'] == 1 && ($category[$cate['cateid']] = $cate); $admin_category[$cate['cateid']] = $cate; $subdata = C::t('#sanree_brand#sanree_brand_category')->getcategory_by_pcateid($cate['cateid']); $subcategories = array(); foreach ($subdata as $sub) { $subcategories[$sub['cateid']] = $sub; $sub['status'] == 1 && ($category[$sub['cateid']] = $sub); $sub['name'] = "==>" . $sub['name']; $sub['status'] == 1 && ($user_category[$sub['cateid']] = $sub); $admin_category[$sub['cateid']] = $sub; } if ($cate['status'] == 1) { $subcategory[$cate['cateid']] = $cate; $subcategory[$cate['cateid']]['subcategories'] = $subcategories; } } save_syscache('sanree_brand_category', $category); save_syscache('sanree_brand_subcategory', $subcategory); save_syscache('sanree_brand_usercate', $user_category); save_syscache('sanree_brand_admincate', $admin_category); } elseif ($cachename == 'menu') { $topmenu = C::t('#sanree_brand#sanree_brand_cmenu')->getusermenu(1); $footmenu = C::t('#sanree_brand#sanree_brand_cmenu')->getusermenu(); save_syscache('sanree_brand_topmenu', $topmenu); save_syscache('sanree_brand_footmenu', $footmenu); } }