$type = intval($_G['sr_type']); !in_array($type, array(1, 2)) && ($type = 1); $result = DB::fetch_first("SELECT * FROM " . DB::table('sanree_brand_slide') . ' where id=' . $type); showsubmenu($menustr); showtableheader('', 'nobottom'); $typeclass = array(1, 2); showtablerow('', array(), array(shownavmenu($type, $typeclass, $langs))); showtablefooter(); showformheader($thisurl . '&type=' . $type, 'enctype'); showtableheader($langs['slide'], 'nobottom'); for ($j = 1; $j < 6; $j++) { $grouplogohtml = ''; $pic = ''; if ($result['pic' . $j]) { $pic = $result['pic' . $j]; $grouplogohtml = '<label>' . $langs['slideimgtip'] . '<br /><img src="' . fiximage($pic) . '?' . random(6) . '" width="400" height="100" />'; } showsetting($langs['slide_img'] . $j, 'pic' . $j, $pic, 'filetext', '', 0, $grouplogohtml); showsetting($langs['slide_link'] . $j, 'movie' . $j, $result['movie' . $j], 'text'); } showsubmit('submit'); showtablefooter(); showformfooter(); } function shownavmenu($type, $typeclass, $langs) { $result = '<ul class="tab1">'; $typelist = array(); $typelist[$type] = ' class="current"'; foreach ($typeclass as $key => $value) { $result .= '<li' . $typelist[$value] . '><a href="' . ADMINSCRIPT . '?action=plugins&operation=config&act=slide&identifier=sanree_brand&pmod=admincp&type=' . $value . '"><span>' . $langs['slide' . $value] . '</span></a></li>';
showsetting($langs['urlmod'], '', '', '<select name="urlmod">' . $groupselect . '</select>'); showsetting($langs['group_enable'], 'isuse', $result['isuse'], 'radio'); showsetting($langs['allowtemplate'], 'allowtemplate', $result['allowtemplate'], 'radio'); showsetting($langs['allowdeletealbum'], 'allowdeletealbum', $result['allowdeletealbum'], 'radio'); showsetting($langs['allowbatchimage'], 'allowbatchimage', $result['allowbatchimage'], 'radio'); showsetting($langs['allowsyngroup'], 'allowsyngroup', $result['allowsyngroup'], 'radio'); showsetting($langs['ismf'], 'ismf', $result['ismf'], 'radio'); showsetting($langs['istag'], 'istag', $result['istag'], 'radio'); if ($result['grouplogo']) { $grouplogo = fiximage($result['grouplogo']); $grouplogohtml = '<label><input type="checkbox" class="checkbox" name="deletelogo[$result[groupid]]" value="yes" /> ' . $lang['delete'] . '</label><br /><img src="' . $grouplogo . '" />'; } showsetting($langs['group_icons'], 'grouplogo', $result['grouplogo'], 'filetext', '', 0, $grouplogohtml); $grouplogohtml = ''; if ($result['smallicons']) { $grouplogo = fiximage($result['smallicons']); $grouplogohtml = '<label><input type="checkbox" class="checkbox" name="deletesmallicons[$result[groupid]]" value="yes" /> ' . $lang['delete'] . '</label><br /><img src="' . $grouplogo . '" />'; } showsetting($langs['group_smallicons'], 'smallicons', $result['smallicons'], 'filetext', '', 0, $grouplogohtml); showsetting('time', '', '', dgmdate($result['dateline'])); showsetting($langs['maxalbumcategory'], 'maxalbumcategory', $result['maxalbumcategory'], 'text', '', '', $langs['albumistip']); showsetting($langs['maxalbum'], 'maxalbum', $result['maxalbum'], 'text', '', '', $langs['albumistip']); $moduleresult = C::t('#sanree_brand#sanree_brand_group_module')->fetch_by_groupid($groupid); foreach (C::t('#sanree_brand#sanree_brand_group_module')->fetch_all_column() as $key => $column) { $columnname = $column[data]; $type = $column[type]; showsetting($langs['module'][$columnname], 'module[' . $columnname . ']', $moduleresult[$columnname], $type); } showsubmit('upgradingsubmit'); showtablefooter(); showformfooter();
$extra = '&view=' . $view; $extra .= '&st=' . $st; $bid = intval($_G['sr_bid']); $extra .= '&bid=' . $bid; $brandresult = C::t('#sanree_brand#sanree_brand_businesses')->getusername_by_bidanduid($_G['uid'], $bid); if (!$brandresult) { showmessage(srlang('nobrand')); } if ($brandresult['status'] != 1) { showmessage(srlang('nostatus')); } if ($brandresult['allowalbum'] != 1) { showmessage(srlang('noallowalbum')); } $brandresult['group'] = getgroup($brandresult['groupid']); $brandresult['group']['grouplogo'] = $brandresult['group']['grouplogo'] ? fiximage($brandresult['group']['grouplogo']) : 'source/plugin/sanree_brand/tpl/good/images/vip0.gif'; $brandresult['group']['maxalbumcategorytip'] = str_replace('{maxalbumcategory}', $brandresult['group']['maxalbumcategory'], srlang('maxalbumcategorytip')); $brandresult['group']['maxalbumtip'] = str_replace('{maxalbum}', $brandresult['group']['maxalbum'], srlang('maxalbumtip')); $brandresult['url'] = getburl($brandresult); if ($st == 'album_category') { if (submitcheck('postsubmit')) { foreach ($_G['sr_album_displayorder'] as $id => $title) { $setarr = array('displayorder' => intval($_G['sr_album_displayorder'][$id])); C::t('#sanree_brand#sanree_brand_album_category')->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_category&bid=' . $bid; if ($_G['inajax']) { $href = $url_forward; $href = str_replace("'", "\\'", $href);
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); } }