Exemple #1
0
        $slideid = 1;
    }
}
$slidelistarr = sanreeloadcache('slidelist');
$slide = DB::fetch_first("SELECT * FROM " . DB::table('sanree_brand_slide') . ' where id=3');
if (!$slide) {
    $slidelistarr[3] = array(array('pic' => 'source/plugin/sanree_brand/tpl/bird/images/banner.jpg', 'url' => 'http://dx.sanree.com/', 'color' => '#EEEDE9'), array('pic' => 'source/plugin/sanree_brand/tpl/bird/images/testbanner.jpg', 'url' => 'http://dx.sanree.com/', 'color' => '#FFE8EB'));
} else {
    for ($j = 1; $j < 6; $j++) {
        if (!$slide['pic' . $j]) {
            continue;
        }
        $slides = array('pic' => $_G['setting']['attachurl'] . 'common/' . $slide['pic' . $j], 'url' => $slide['movie' . $j], 'color' => $slide['movie' . $j . $j]);
        $slidelistarr[3][] = $slides;
    }
}
$slidelist = $slidelistarr[$slideid];
$newbrandlist = sanreeloadcache('newbrandlist');
$hotbrandlist = sanreeloadcache('hotbrandlist');
if (intval($_G['cache']['plugin']['sanree_brand_help']['isopen']) == 1) {
    $helpcate = sanreeloadcache('help');
}
$picload = $isslideload == 1 ? 'file' : 'src';
$friendly_link = C::t('#sanree_brand#sanree_brand_friendly_link')->fetch_all();
$themestyle = 'hello';
$stheme = array('christmas', 'newyear', 'springfestival');
if (in_array($frontpagestyle, $stheme)) {
    $themestyle = $frontpagestyle;
}
include templateEx($plugin['identifier'] . ':' . $template . '/' . $themestyle);
Exemple #2
0
        showmessage(srlang('stopalbumtip'));
    }
    if ($brandresult[allowalbum] != 1) {
        showmessage(srlang('noallowalbum'));
    }
    $albumid = intval($_G['sr_albumid']);
    if (submitcheck('postsubmit')) {
        $setarr['albumname'] = dhtmlspecialchars(trim($_G['sr_albumname']));
        if (intval($_G['sr_istop']) == 1) {
            $data = C::t('#sanree_brand#sanree_brand_album')->get_by_albumid($albumid);
            C::t('#sanree_brand#sanree_brand_album_category')->update($data['catid'], array('pic' => $data['pic']));
        }
        C::t('#sanree_brand#sanree_brand_album')->userupdate($albumid, $_G['uid'], $setarr);
        $extra = array();
        $url_forward = srreferer() ? $_G['referer'] : 'plugin.php?id=sanree_brand&mod=mybrand&view=myalbum&st=album&catid=' . $catid . '&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('editpic', 0, 1);setTimeout(\"window.location.href ='" . $href . "';\", 3000);</script>");
        }
        showmessage(srlang('modiypidsucceed'), $url_forward, array(), $extra);
    } else {
        $result = C::t('#sanree_brand#sanree_brand_album')->userget_by_albumid($albumid, $_G['uid']);
        if (!$result) {
            showmessage(srlang('error_pic'));
        }
    }
}
include templateEx($plugin['identifier'] . ':' . $template . '/ajax');
            echo 0;
            return;
        }
    }
    $former = C::t('#sanree_brand#sanree_brand_businesses')->getgroupid_by_bid(intval($_G['sr_bid']));
    C::t('#sanree_brand#sanree_brand_businesses')->update(intval($_G['sr_bid']), array('groupid' => intval($_G['sr_gid'])));
    $creditdata = array('extcredits' . $creditunit => -intval($_G['sr_gp']));
    updatemembercount($_G[uid], $creditdata, true, 'BRD', 1);
    $setarr = array();
    $setarr['bid'] = intval($_G['sr_bid']);
    $setarr['uid'] = intval($_G['uid']);
    $setarr['former'] = intval($former);
    $setarr['gid'] = intval($_G['sr_gid']);
    $setarr['cost'] = $_G['sr_gp'];
    $setarr['dateline'] = TIMESTAMP;
    C::t('#sanree_brand#sanree_brand_record')->insert($setarr);
    echo 1;
} else {
    if (!$_G['uid']) {
        showmessage(srlang('nologin'), '', array(), array('login' => true));
    }
    if (!in_array($_G['group']['groupid'], $addgroup)) {
        showmessage($stopaddtip);
    }
    $brandname = C::t('#sanree_brand#sanree_brand_businesses')->getname_by_bid(intval($_G['sr_bid']));
    $groups = C::t('#sanree_brand#sanree_brand_group')->fetch_all_by_order(intval($_G['sr_order']));
    $groupname = C::t('#sanree_brand#sanree_brand_group')->fetch_groupname_by_order(intval($_G['sr_order']));
    $uid = C::t('#sanree_brand#sanree_brand_businesses')->fetch_uid_by_bid(intval($_G['sr_bid']));
    $current_credit = getuserprofile('extcredits' . $creditunit);
    include templateEx($plugin['identifier'] . ':' . $template . "/" . $mod);
}
<?php

/**
 *      [Sanree] (C)2001-2099 Sanree Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: sanree_brand_show2code.php sanree $
 */
if (!defined('IN_DISCUZ')) {
    exit('2014042523s4K4QUOUT9||5057||1411992002');
}
session_start();
$bid = intval($_G['sr_tid']);
$brandresult = C::t('#sanree_brand#sanree_brand_businesses')->getbusinesses_by_bid($bid);
$gotourl = '';
if (!$brandresult) {
    showmessage(srlang('nodengji'));
}
$backgroundimage = empty($brandresult['weixinimg']) ? $defaultwxcodeimg : $_G['setting']['attachurl'] . 'category/' . $brandresult['weixinimg'] . '?' . random(6);
$weixintitle = str_replace('{name}', $brandresult['name'], srlang('weixintitle'));
$_G['style']['tplfile'] = $template = templateEx($plugin['identifier'] . ':' . $template . '/weicode');
include $template;
 function getmenu($brandresult, $active)
 {
     global $_G, $template, $bodycss, $ishideheader, $allurl;
     $group = C::t('#sanree_brand#sanree_brand_group')->get_by_groupid($brandresult['groupid']);
     global $myhomeurl, $referer, $addgroup;
     $tmpconfig = $_G['cache']['plugin']['sanree_brand'];
     $allowsyngroup = intval($tmpconfig['allowsyngroup']);
     $isshowordinary = intval($tmpconfig['isshowordinary']);
     !defined('sr_brand_JS') && define('sr_brand_JS', sr_brand_TPL . '/' . $tmpconfig['template'] . '/js');
     !defined('SANREE_BRAND_TEMPLATE') && define('SANREE_BRAND_TEMPLATE', sr_brand_TPL . '/' . $tmpconfig['template']);
     $allurl = gethomeurl();
     $myhomeurl = !empty($brandresult['brandno']) ? getbrandnourl($brandresult['brandno']) : getmyburl_by_bid($brandresult['bid']);
     $referer = urlencode($myhomeurl);
     if (!isset($_G['cache']['sanree_brand_topmenu']) || !is_array($_G['cache']['sanree_brand_topmenu'])) {
         sanreeupdatecache('menu');
     }
     $menu = sanreeloadcache('topmenu');
     $headermenulist = array();
     $headermenulist['index'] = array('url' => getburl($brandresult), 'title' => srlang('brandindex'), 'class' => ' class="normal"');
     $brandresult['allowalbum'] == 1 && ($headermenulist['myalbum'] = array('url' => getalbumurl($brandresult['bid']), 'title' => srlang('myalbum'), 'class' => ' class="normal"'));
     $allowsyngroup == 1 && intval($group['allowsyngroup']) == 1 && $brandresult['syngrouptid'] && ($headermenulist['dzgroup'] = array('url' => 'forum.php?mod=group&amp;fid=' . $brandresult['syngrouptid'], 'title' => srlang('dzgroup'), 'class' => ' class="normal"'));
     hookscript('sanreebrandusermenu', 'global', 'funcs', array('bid' => $brandresult['bid']), 'sanreebrandusermenu');
     if ($_G['sanree_brand_menus']) {
         foreach ($_G['sanree_brand_menus'] as $row) {
             $row['url'] = str_replace('{tid}', $brandresult['tid'], $row['url']);
             $row['url'] = str_replace('{bid}', $brandresult['bid'], $row['url']);
             $row['url'] = str_replace('{pid}', $brandresult['pid'], $row['url']);
             $headermenulist[$row['name']] = $row;
         }
     }
     $isshowordinary == 1 && ($headermenulist['ordinary'] = array('url' => 'forum.php?mod=viewthread&amp;tid=' . $brandresult['tid'], 'title' => srlang('ordinary'), 'class' => ' class="normal"'));
     foreach ($menu as $row) {
         $row['url'] = str_replace('{tid}', $brandresult['tid'], $row['url']);
         $row['url'] = str_replace('{bid}', $brandresult['bid'], $row['url']);
         $row['url'] = str_replace('{pid}', $brandresult['pid'], $row['url']);
         $headermenulist['menu' . $row[id]] = $row;
     }
     $headermenulist[$active] && ($headermenulist[$active]['class'] = ' class="active"');
     $headermenulists = $headermenulist;
     $headermenulist = array();
     $menuorder = C::t('#sanree_brand#sanree_brand_menu_order')->fetch_all();
     asort($menuorder);
     foreach ($menuorder as $key => $row) {
         if ($headermenulists[$key]) {
             $headermenulist[$key] = $headermenulists[$key];
         }
     }
     if (intval($_G['uid']) === intval($brandresult['uid'])) {
         define('IN_BRAND_USER', TRUE);
         hookscript('sanreebrandmanagemenu', 'global', 'funcs', array('bid' => $brandresult['bid']), 'sanreebrandmanagemenu');
         $managemenulist = array();
         $_G['sanree_brand_managemenus'][] = array('displayorder' => 9999, 'window' => 0, 'name' => '', 'title' => '', 'url' => '', 'class' => '', 'image' => 'source/plugin/sanree_brand/tpl/good/images/add.png');
         if ($_G['sanree_brand_managemenus']) {
             foreach ($_G['sanree_brand_managemenus'] as $row) {
                 $row['url'] = str_replace('{tid}', $brandresult['tid'], $row['url']);
                 $row['url'] = str_replace('{bid}', $brandresult['bid'], $row['url']);
                 $row['url'] = str_replace('{pid}', $brandresult['pid'], $row['url']);
                 $managemenulist[] = $row;
             }
             $ncount = count($managemenulist);
             $mod = $ncount % 10;
             $mt = intval($ncount / 10);
             $oneh = 100;
             if ($mt == 0) {
                 $ih = $oneh;
             } else {
                 if ($mod == 0) {
                     $ih = $mt * $oneh;
                 } else {
                     $ih = ($mt + 1) * $oneh;
                 }
             }
             $ih += 10;
             $managemenulist = $this->array_sort($managemenulist, 'displayorder');
         }
     }
     $allowtemplate = intval($group['allowtemplate']);
     if ($allowtemplate == 1) {
         $templateconfig = unserialize($brandresult['templateconfig']);
         $bodystyle = $templateconfig['bodystyle'];
         $bodycss = '';
         if ($bodystyle) {
             if (intval($bodystyle['isuse']) == 1) {
                 $bodycss = "body {\r\n";
                 if ($bodystyle['notbackimg'] == 1) {
                     if (!empty($bodystyle['backgroundimage'])) {
                         $bodycss .= "background-image:url('" . $_G['setting']['attachurl'] . 'category/' . "{$bodystyle['backgroundimage']}');\r\n";
                     }
                 } else {
                     $bodycss .= "background:none;\r\n";
                 }
                 if (!empty($bodystyle['backgroundrepeat'])) {
                     $bodycss .= "background-repeat:{$bodystyle['backgroundrepeat']};\r\n";
                 }
                 if (!empty($bodystyle['backgroundcolor'])) {
                     $bodycss .= "background-color:{$bodystyle['backgroundcolor']};\r\n";
                 }
                 if (!empty($bodystyle['backgroundattachment'])) {
                     $bodycss .= "background-attachment:{$bodystyle['backgroundattachment']};\r\n";
                 }
                 if (!empty($bodystyle['backgroundpositionx']) && !empty($bodystyle['backgroundpositiony'])) {
                     $bodycss .= "background-position:{$bodystyle['backgroundpositionx']} {$bodystyle['backgroundpositiony']};\r\n";
                 }
                 $bodycss .= "}";
                 $ishideheader = intval($bodystyle['ishideheader']);
             }
         }
         if ($ishideheader == 1) {
             $appVer = $_G['setting']['version'];
             include templateEx($this->_identifier . ':' . $template . '/header_one_' . $appVer);
         }
     } else {
         $ishideheader = 0;
     }
     include templateEx($this->_identifier . ':' . $template . '/header');
     $this->_brand_header = $brand_header;
     $this->_brand_header_one = $brand_header_one;
 }
<?php

/**
 *      [Sanree] (C)2001-2099 Sanree Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: sanree_brand_branch.php sanree $
 */
if (!defined('IN_DISCUZ')) {
    exit('2014042523s4K4QUOUT9||5057||1411992002');
}
$bid = intval($_G['sr_tid']);
$brandresult = C::t('#sanree_brand#sanree_brand_businesses')->getbusinesses_by_bid($bid);
if (!$brandresult) {
    showmessage(srlang('nodengji'));
}
$pbidlist = array();
foreach (C::t('#sanree_brand#sanree_brand_businesses')->fetch_all_by_searchc(array('c.status=1', 't.pbid=' . $bid, 't.status=1'), 't.istop desc,t.displayorder, t.dateline desc', 0, 100) as $value) {
    $url = getburl($value);
    $pbidlist[] = array('name' => $value['name'], 'url' => $url);
}
$_G['style']['tplfile'] = $template = templateEx($plugin['identifier'] . ':' . $template . '/branch');
include $template;
    $href = str_replace("'", "\\'", $href);
    $url_forward = 'javascript:history.back()';
    $extra = array('showdialog' => false, 'extrajs' => "<script type=\"text/javascript\" reload=\"1\">///hideWindow;\r\nsetTimeout(\"window.location.href ='" . $href . "';\", 3000);</script>");
    showmessage(srlang('votersucceed'), $url_forward, array(), $extra);
} else {
    if (!$brandresult) {
        ajaxexit('');
    }
    if ($allowfastpost != 1) {
        ajaxexit(srlang('nofastpostcontrol'));
    }
    if ($brandresult[allowfastpost] != 1) {
        ajaxexit(srlang('nofastpostcontrol'));
    }
    $perpage = 5;
    $page = intval($_G[sr_page]);
    $page = max(1, intval($page));
    $start = ($page - 1) * $perpage;
    $start = max(0, $start);
    require_once libfile('function/discuzcode');
    $count = C::t('#sanree_brand#forum_post')->count_by_tid_post(0, $tid);
    if ($count > 0) {
        $postthread = C::t('#sanree_brand#forum_post')->fetch_all_by_tid(0, $tid, true, ' desc', ($page - 1) * $perpage, $perpage, 0, 0);
        foreach ($postthread as $key => $val) {
            $postthread[$key]['message'] = discuzcode($val['message'], 0, 0, 0, 1);
        }
        $murl = 'plugin.php?id=sanree_brand&mod=fastpost&tid=' . $tid . $extra;
        $multi = multi($count, $perpage, $page, $murl);
    }
    include templateEx($plugin['identifier'] . ':' . $template . '/fastpost');
}
Exemple #8
0
        }
        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);
}
$templatefile = templateEx($plugin['identifier'] . ':' . $template . '/index');
$_G['style']['tpldirectory'] = 'tpl/' . $_G['template'];
$_G['style']['tplfile'] = 'index';
$_G['style']['tplsavemod'] = 1;
include $templatefile;
                if (!empty($_G['member']['residedist'])) {
                    $district[] = $_G['member']['residedist'];
                }
                if (!empty($_G['member']['residecommunity'])) {
                    $district[] = $_G['member']['residecommunity'];
                }
            }
        }
        if (!empty($district)) {
            foreach (C::t('#sanree_brand#sanree_brand_district')->fetch_all_by_name($district) as $value) {
                $key = $value['level'] - 1;
                $values[$key] = $value['id'];
            }
            $level++;
        }
    }
}
if ($values[1]) {
    $level++;
}
if ($values[2]) {
    $level++;
}
if ($values[3]) {
    $level++;
}
$showlevel = $level;
$elems = array('srbirthprovince', 'srbirthcity', 'srbirthdist', 'srbirthcommunity');
$districthtml = srshowdistrict($values, $elems, $container, $showlevel, $containertype);
include templateEx($plugin['identifier'] . ':' . $template . '/district');
    include_once libfile('function/home');
    $picturecatelist = array();
    $aids = '[';
    $tmparray = array();
    foreach (C::t('#sanree_brand#sanree_brand_album')->fetch_all_by_searchex($where, 'ishome desc,displayorder,albumid desc', ($page - 1) * $perpage, $perpage) as $key => $album) {
        if ($config['isbird']) {
            $album['thumbpic'] = pic_cover_get($album['pic'], 1);
        } else {
            $album['thumbpic'] = $isalbumthumb == 1 ? sr_albumimage($album['pic'], 160, 160) : pic_cover_get($album['pic'], 1);
        }
        $album['pic'] = pic_cover_get($album['pic'], 1);
        $picturecatelist[$key] = $album;
        $tmparray[] = "'{$album['albumid']}'";
    }
    $aids .= implode($tmparray, ",");
    $aids .= ']';
    $murl = getalbumitemurl($catid);
    $multi = multi($count, $perpage, $page, $murl);
}
if (!$config['isbird']) {
    require_once libfile('class/' . $plugin['identifier'] . '_menu', 'plugin/' . $plugin['identifier']);
    $menuclass = new sanree_brand_menu($plugin['identifier']);
    $menuclass->getmenu($brandresult, 'myalbum');
    $brand_header = $menuclass->_brand_header;
    $brand_header_one = $menuclass->_brand_header_one;
}
$bid = $brandresult['bid'];
$group = C::t('#sanree_brand#sanree_brand_group')->get_by_groupid($brandresult['groupid']);
$allowbatchimage = intval($group['allowbatchimage']);
include templateEx($plugin['identifier'] . ':' . $template . '/albumshow');
Exemple #11
0
$do = $_G['sr_do'];
$doarray = array('show', 'marked');
$do = !in_array($do, $doarray) ? 'show' : $do;
if ($mapapi == 'google') {
    $defaultmappos = $googlemappos;
}
if ($do == 'show') {
    $bid = intval($_G['sr_bid']);
    $brandresult = C::t('#sanree_brand#sanree_brand_businesses')->getbusinesses_by_bid($bid);
    $lng = '';
    $lat = '';
    if ($mapapi == 'google') {
        $brandresult['mappos'] = $brandresult['googlemappos'];
    }
    if ($brandresult['mappos']) {
        $info = $brandresult[name];
        list($lng, $lat) = explode(',', $brandresult['mappos']);
    } else {
        $info = srlang('nomarked');
        list($lng, $lat) = explode(',', $defaultmappos);
    }
} elseif ($do == 'marked') {
    if (empty($_G['sr_mappoint'])) {
        list($lng, $lat) = explode(',', $defaultmappos);
    } else {
        list($lng, $lat) = explode(',', $_G['sr_mappoint']);
    }
}
$starlist = array(1, 2, 3, 4, 5);
include templateEx($plugin['identifier'] . ':' . $template . "/" . $mod . '_' . $mapapi);
 function get_menu_head($brandresult, $active)
 {
     global $_G, $template, $bodycss, $ishideheader, $allurl, $myhomeurl, $referer, $addgroup, $ismultiple;
     $bid = $brandresult['bid'];
     $tid = $brandresult['tid'];
     $group = C::t('#sanree_brand#sanree_brand_group')->get_by_groupid($brandresult['groupid']);
     $tmpconfig = $_G['cache']['plugin']['sanree_brand'];
     $allowsyngroup = intval($tmpconfig['allowsyngroup']);
     $isshowordinary = intval($tmpconfig['isshowordinary']);
     !defined('sr_brand_JS') && define('sr_brand_JS', sr_brand_TPL . '/' . $tmpconfig['template'] . '/js');
     !defined('SANREE_BRAND_TEMPLATE') && define('SANREE_BRAND_TEMPLATE', sr_brand_TPL . '/' . $tmpconfig['template']);
     $allurl = gethomeurl();
     $myhomeurl = !empty($brandresult['brandno']) ? getbrandnourl($brandresult['brandno']) : getmyburl_by_bid($brandresult['bid']);
     $referer = urlencode($myhomeurl);
     if (!isset($_G['cache']['sanree_brand_topmenu']) || !is_array($_G['cache']['sanree_brand_topmenu'])) {
         sanreeupdatecache('menu');
     }
     $menu = sanreeloadcache('topmenu');
     $headermenulist = array();
     $headermenulist['index'] = array('url' => getburl($brandresult), 'title' => srlang('frontpage'), 'class' => ' class="normal"');
     $headermenulist['detail'] = array('url' => getdetailurl($brandresult), 'title' => srlang('bird_item_detail'), 'class' => ' class="normal"');
     $brandresult['allowalbum'] == 1 && ($headermenulist['myalbum'] = array('url' => getalbumurl($brandresult['bid']), 'title' => srlang('myalbum'), 'class' => ' class="normal"'));
     $allowsyngroup == 1 && intval($group['allowsyngroup']) == 1 && $brandresult['syngrouptid'] && ($headermenulist['dzgroup'] = array('url' => 'forum.php?mod=group&amp;fid=' . $brandresult['syngrouptid'], 'title' => srlang('dzgroup'), 'class' => ' class="normal"'));
     hookscript('sanreebrandusermenu', 'global', 'funcs', array('bid' => $brandresult['bid']), 'sanreebrandusermenu');
     if ($_G['sanree_brand_menus']) {
         foreach ($_G['sanree_brand_menus'] as $row) {
             $row['url'] = str_replace('{tid}', $brandresult['tid'], $row['url']);
             $row['url'] = str_replace('{bid}', $brandresult['bid'], $row['url']);
             $row['url'] = str_replace('{pid}', $brandresult['pid'], $row['url']);
             $headermenulist[$row['name']] = $row;
         }
     }
     $isshowordinary == 1 && ($headermenulist['ordinary'] = array('url' => 'forum.php?mod=viewthread&amp;tid=' . $brandresult['tid'], 'title' => srlang('ordinary'), 'class' => ' class="normal"'));
     foreach ($menu as $row) {
         $row['url'] = str_replace('{tid}', $brandresult['tid'], $row['url']);
         $row['url'] = str_replace('{bid}', $brandresult['bid'], $row['url']);
         $row['url'] = str_replace('{pid}', $brandresult['pid'], $row['url']);
         $headermenulist['menu' . $row[id]] = $row;
     }
     $headermenulist[$active] && ($headermenulist[$active]['class'] = ' class="current"');
     $headermenulists = $headermenulist;
     $headermenulist = array();
     $menuorder = C::t('#sanree_brand#sanree_brand_menu_order')->fetch_all();
     asort($menuorder);
     foreach ($menuorder as $key => $row) {
         if ($headermenulists[$key]) {
             $headermenulist[$key] = $headermenulists[$key];
         }
         if (!$row) {
             $headermenulist['detail'] = $headermenulists['detail'];
         }
     }
     if (intval($_G['uid']) === intval($brandresult['uid'])) {
         define('IN_BRAND_USER', TRUE);
         hookscript('sanreebrandmanagemenu', 'global', 'funcs', array('bid' => $brandresult['bid']), 'sanreebrandmanagemenu');
         $managemenulist = array();
         $_G['sanree_brand_managemenus'][] = array('displayorder' => 9999, 'window' => 0, 'name' => '', 'title' => '', 'url' => '', 'class' => '', 'image' => 'source/plugin/sanree_brand/tpl/good/images/add.png');
         if ($_G['sanree_brand_managemenus']) {
             foreach ($_G['sanree_brand_managemenus'] as $row) {
                 $row['url'] = str_replace('{tid}', $brandresult['tid'], $row['url']);
                 $row['url'] = str_replace('{bid}', $brandresult['bid'], $row['url']);
                 $row['url'] = str_replace('{pid}', $brandresult['pid'], $row['url']);
                 $managemenulist[] = $row;
             }
             $ncount = count($managemenulist);
             $mod = $ncount % 10;
             $mt = intval($ncount / 10);
             $oneh = 100;
             if ($mt == 0) {
                 $ih = $oneh;
             } else {
                 if ($mod == 0) {
                     $ih = $mt * $oneh;
                 } else {
                     $ih = ($mt + 1) * $oneh;
                 }
             }
             $ih += 10;
         }
     }
     $allowtemplate = intval($group['allowtemplate']);
     if ($allowtemplate == 1) {
         $templateconfig = unserialize($brandresult['templateconfig']);
         $bodystyle = $templateconfig['bodystyle'];
         $bodycss = '';
         if ($bodystyle) {
             if (intval($bodystyle['isuse']) == 1) {
                 $bodycss = "body {\r\n";
                 if ($bodystyle['notbackimg'] == 1) {
                     if (!empty($bodystyle['backgroundimage'])) {
                         $bodycss .= "background-image:url('" . $_G['setting']['attachurl'] . 'category/' . "{$bodystyle['backgroundimage']}');\r\n";
                     }
                 } else {
                     $bodycss .= "background:none;\r\n";
                 }
                 if (!empty($bodystyle['backgroundrepeat'])) {
                     $bodycss .= "background-repeat:{$bodystyle['backgroundrepeat']};\r\n";
                 }
                 if (!empty($bodystyle['backgroundcolor'])) {
                     $bodycss .= "background-color:{$bodystyle['backgroundcolor']};\r\n";
                 }
                 if (!empty($bodystyle['backgroundattachment'])) {
                     $bodycss .= "background-attachment:{$bodystyle['backgroundattachment']};\r\n";
                 }
                 if (!empty($bodystyle['backgroundpositionx']) && !empty($bodystyle['backgroundpositiony'])) {
                     $bodycss .= "background-position:{$bodystyle['backgroundpositionx']} {$bodystyle['backgroundpositiony']};\r\n";
                 }
                 $bodycss .= "}";
                 $ishideheader = intval($bodystyle['ishideheader']);
             }
         }
         if ($ishideheader == 1) {
             $appVer = $_G['setting']['version'];
             include templateEx($this->_identifier . ':' . $template . '/header_one_' . $appVer);
             $GLOBALS['brand_header_one'] = $brand_header_one;
         }
     } else {
         $ishideheader = 0;
     }
     $slideid = 3;
     $slidelistarr = sanreeloadcache('slidelist');
     if (!$brandresult['newbanner']) {
         $slidelistarr[3] = array(array('pic' => 'source/plugin/sanree_brand/tpl/bird/images/c_banner.jpg', 'url' => 'http://dx.sanree.com/'), array('pic' => 'source/plugin/sanree_brand/tpl/bird/images/c_banner_01.jpg', 'url' => 'http://dx.sanree.com/'), array('pic' => 'source/plugin/sanree_brand/tpl/bird/images/c_banner_02.jpg', 'url' => 'http://dx.sanree.com/'), array('pic' => 'source/plugin/sanree_brand/tpl/bird/images/c_banner_05.jpg', 'url' => 'http://dx.sanree.com/'), array('pic' => 'source/plugin/sanree_brand/tpl/bird/images/c_banner_06.jpg', 'url' => 'http://dx.sanree.com/'));
     } else {
         $brandresult['newbanner'] = explode(',', $brandresult['newbanner']);
         $slidelistarr[3] = $brandresult['newbanner'];
     }
     $slidelist = $slidelistarr[$slideid];
     $slide_prefix = $_G['setting']['attachurl'] . 'category/';
     $mtfopen = $_G['cache']['plugin']['sanree_mcertification']['isopen'];
     if ($mtfopen) {
         $mcertification = C::t('#sanree_mcertification#sanree_mcertification')->gettype_by_bid(intval($bid));
         $mtf = 'source/plugin/sanree_mcertification/tpl/default/mcertification/brandimg/bignone.png';
         if ($mcertification) {
             $mtf = $mcertification['type'] ? 'source/plugin/sanree_mcertification/tpl/default/mcertification/brandimg/bigpersonal.png' : 'source/plugin/sanree_mcertification/tpl/default/mcertification/brandimg/bigcompany.png';
         }
     }
     $attention = $_G['cache']['plugin']['sanree_attention']['isopen'];
     if ($attention) {
         $addbtn = 'source/plugin/sanree_attention/tpl/default/img/addbtn.png';
         $delbtn = 'source/plugin/sanree_attention/tpl/default/img/delbtn.png';
         $uids = C::t('#sanree_attention#sanree_attention')->getuid_by_bid(intval($bid));
         $atnbtn = $addbtn;
         $flag = 0;
         $atnurl = 'plugin.php?id=sanree_attention&mod=addattention&bid=' . intval($bid);
         if ($uids) {
             foreach ($uids as $uid) {
                 if ($uid['uid'] == $_G['uid']) {
                     $atnbtn = $delbtn;
                     $flag = 1;
                     $atnurl = 'plugin.php?id=sanree_attention&mod=delattention&bid=' . intval($bid);
                     $deltip = attention_modlang('confirmationdel');
                     break;
                 }
             }
         }
     }
     $assistcount = C::t('#sanree_brand#sanree_brand_assist')->count_by_where(' && bid =' . intval($bid));
     $assistuids = C::t('#sanree_brand#sanree_brand_assist')->getuid_by_bid(intval($bid));
     if ($assistuids) {
         foreach ($assistuids as $uid) {
             if ($uid['uid'] == $_G['uid']) {
                 $assistflag = 1;
                 break;
             }
         }
     }
     if (!$brandresult['satisfaction']) {
         $voter = C::t('#sanree_brand#sanree_brand_voter')->getvotetotal_by_tid($tid);
         $brandresult['satisfaction'] = intval($voter[3]);
     }
     if ($ismultiple == 1 && $brandresult['allowmultiple'] == 1) {
         $tempresult = C::t('#sanree_brand#sanree_brand_businesses')->getbusinesses_by_bid($bid);
         $tellist = explode(',', $tempresult['tel']);
     } else {
         $brandresult['tel'] = getfirsticq($brandresult['tel']);
     }
     include templateEx($this->_identifier . ':' . $this->_template . '/srhead');
     $GLOBALS['srhead'] = $srhead;
 }