예제 #1
0
 function show($is_rewrite)
 {
     global $_G;
     $did = intval($_G['sr_did']);
     $act = $cateid < 1 ? ' class="cateon"' : '';
     $this->_category_list = array();
     $this->_navigation = srlang('region');
     $region = array('', 'birthprovince', 'birthcity', 'birthdist', 'birthcommunity');
     $this->search = array();
     for ($i = 1; $i < 5; $i++) {
         if ($this->_locationdata["{$i}"]) {
             $this->_search[$region[$i]] = $this->_locationdata[$i]['name'];
             $this->_navigation .= "<em>-</em>" . $this->_locationdata[$i]['name'];
             $this->_category_list[$i] = array();
             foreach (C::t('#sanree_brand#common_district')->fetch_all_by_upid($this->_locationdata[$i]['upid']) as $key => $value) {
                 if ($value['id'] == $did || $value['id'] == $this->_locationdata[$i]['id']) {
                     $value['class'] = ' class="cateon"';
                 }
                 $value['url'] = getcateurl(array('did' => $value['id']));
                 $this->_category_list[$i]['data'][$key] = array('class' => $value['class'], 'name' => $value['name'], 'url' => $value['url']);
             }
             $this->_category_list[$i]['allname'] = srlang('notlimited');
             $this->_category_list[$i]['pidurl'] = getcateurl(array('did' => $this->_locationdata[$i]['upid']));
             $this->_category_list[$i]['pidclass'] = ' class="districtl' . $i . '"';
             $this->_category_list[$i]['class'] = ' dshow' . $i;
             $this->_category_list[$i]['id'] = $i;
         }
     }
     foreach (C::t('#sanree_brand#common_district')->fetch_all_by_toupid($did) as $key => $value) {
         $value['url'] = getcateurl(array('did' => $value['id']));
         $this->_category_list[5]['data'][$key] = array('class' => $value['class'], 'name' => $value['name'], 'url' => $value['url']);
     }
     if ($this->_category_list[5]) {
         $this->_category_list[5]['allname'] = srlang('notlimited');
         $this->_category_list[5]['pidurl'] = getcateurl(array('did' => $did));
         $this->_category_list[5]['pidclass'] = ' class="cateon"';
         $this->_category_list[5]['class'] = ' dshow' . ($this->_nowrow['level'] + 1);
         $this->_category_list[5]['id'] = $this->_nowrow['level'] + 1;
     }
 }
예제 #2
0
 function getsubcategory_bird($category_list)
 {
     global $_G;
     $cateid = intval($_G['sr_tid']);
     $subcategory_list = array();
     foreach ($category_list as $key => $value) {
         if (!$key) {
             $subcategory_list[] = $value;
             continue;
         }
         $subcategory = C::t('#sanree_brand#sanree_brand_category')->getcategory_by_pcateid(intval($key));
         $sub_lsit = array();
         $subcate_list = array('class' => $cateid == $key ? ' class="cateon"' : '', 'name' => srlang('notlimited'), 'url' => getcateurl(array('tid' => $key)));
         $sub_lsit[] = $subcate_list;
         foreach ($subcategory as $subcate) {
             $subcate_list = array('class' => $cateid == $subcate['cateid'] ? ' class="cateon"' : '', 'name' => $subcate['name'], 'url' => getcateurl(array('tid' => $subcate['cateid'])));
             $sub_lsit[] = $subcate_list;
         }
         $subcategory_list[] = $sub_lsit;
     }
     return $subcategory_list;
 }
예제 #3
0
$do = $_G['sr_do'];
$doarray = array('album');
if (!in_array($do, $doarray)) {
    showmessage(srlang('unknowact'));
}
if ($do == 'album') {
    $bid = intval($_G['sr_bid']);
    $brandresult = C::t('#sanree_brand#sanree_brand_businesses')->getbusinesses_by_bid($bid);
    if (!$brandresult) {
        showmessage(srlang('nodengji'));
    }
    $brandgroup = C::t('#sanree_brand#sanree_brand_group')->get_by_groupid($brandresult['groupid']);
    if (intval($brandgroup['allowdeletealbum']) != 1) {
        showmessage(srlang('notallowdeletealbum'));
    }
    $albumid = intval($_G['sr_albumid']);
    $albumresult = C::t('#sanree_brand#sanree_brand_album')->userget_by_albumid($albumid, intval($_G['uid']));
    if (!$albumresult) {
        showmessage(srlang('nopic'));
    }
    if ($_G['uid'] != $albumresult['uid']) {
        showmessage(srlang('erroruser'));
    }
    $result = C::t('#sanree_brand#sanree_brand_album_category')->get_by_catid(intval($albumresult['catid']));
    if (md5($result['pic']) == md5($albumresult['pic'])) {
        fixalbumpic(intval($albumresult['catid']), array('pic' => NULL));
    }
    mydeletepics($albumid);
    $rurl = 'plugin.php?id=sanree_brand&mod=mybrand&view=myalbum&st=album&bid=' . $bid . '&catid=' . intval($albumresult['catid']);
    showmessage(srlang('succeed'), $rurl);
}
예제 #4
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);
 }
예제 #5
0
    if ($isalbum != 1) {
        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');
 $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();
     $catid = intval($_G['sr_catid']);
     $catid = $catid < 1 ? -1 : $catid;
     if ($catid > 0) {
         $extra .= '&catid=' . $catid;
     }
     $catname = $catid < 1 ? '' : C::t('#sanree_brand#sanree_brand_album_category')->fetch_catname_by_catid($catid);
     $where[] = 'a.uid=' . $_G['uid'];
예제 #7
0
    }
} 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) {
                $search[] = "(" . $v . " LIKE '%" . $skeyword . "%')";
            }
            $searchtext .= " AND (" . implode(' OR ', $search) . ")";
            $extra = '&skeyword=' . urlencode($skeyword);
        }
        $count = C::t('#sanree_brand#sanree_brand_tag')->count_by_where($searchtext);
예제 #8
0
}
chkformtitle($bindingforum);
if ($creditunit < 1) {
    showmessage(srlang('nocreditunit'));
}
if (!file_exists(sr_brand_TPL . '/' . $template . '/copyright.xml')) {
    $template = 'default';
}
$entrydir = DISCUZ_ROOT . './source/plugin/sanree_brand/tpl/' . $template;
if (file_exists($entrydir . '/copyright.xml')) {
    $importtxt = @implode('', file($entrydir . '/copyright.xml'));
}
require_once libfile('class/xml');
$xmldata = xml2array($importtxt);
if (!is_array($xmldata)) {
    showmessage(srlang('error_template'));
}
define('sr_brand_IMG', sr_brand_TPL . '/' . $template . '/images');
define('sr_brand_JS', sr_brand_TPL . '/' . $template . '/js');
define('SANREE_BRAND_TEMPLATE', sr_brand_TPL . '/' . $template);
$_G['template'] = $template;
$allurl = gethomeurl();
$sanreeurl = 'http://dx.sanree.com/';
srhooks();
if (($config['isbird'] || $ishello == 1) && $mod == 'index') {
    $mod = 'hello';
}
if ($is_rewrite == 1) {
    $_G['basefilename'] = $_G['basescript'] = trim($config['urlhomemode']);
} else {
    $_GET['id'] = $plugin['identifier'] . ':' . $plugin['identifier'];
예제 #9
0
    $favoritelist[] = $value;
}
$newlist = array();
$where = array();
$where[] = 'c.status=1';
$where[] = 't.status=1';
$where[] = 't.isshow=1';
$orderby = 't.bid desc';
foreach (C::t('#sanree_brand#sanree_brand_businesses')->fetch_all_by_searchc($where, $orderby, 0, 9) as $value) {
    $value[url] = getburl($value);
    $voter = C::t('#sanree_brand#sanree_brand_voter')->getvotetotal_by_tid(intval($value['tid']));
    $value['satisfaction'] = intval($voter[3]);
    $value['poster'] = $_G['setting']['attachurl'] . 'category/' . $value['poster'];
    $newlist[] = $value;
}
$navigation = '<em>&raquo;</em><a href="' . $brandresult['url'] . '">' . $brandresult['name'] . '</a><em>&raquo;</em><a href="' . getalbumurl($brandresult['bid']) . '">' . srlang('albumlshow') . '</a>&nbsp;&raquo;&nbsp;' . $cate[catname];
$navtitle = $cate[catname] . '-' . $brandresult['name'] . ' - ' . $config['title'];
$perpage = $albumshowperpage;
$page = intval($_G[sr_page]);
$page = max(1, intval($page));
$start = ($page - 1) * $perpage;
$start = max(0, $start);
$where = 'AND catid=' . $catid;
$count = C::t('#sanree_brand#sanree_brand_album')->count_by_where($where);
$aids = "''";
if ($count > 0) {
    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) {
예제 #10
0
function diytemplate($diytemplateid = 0)
{
    global $_G;
    $style = '';
    $condition = array();
    $condition[] = 'status=1';
    if ($diytemplateid > 0) {
        $condition[] = 'diytemplateid=' . $diytemplateid;
    }
    $orderby = 'displayorder, diytemplateid';
    $stamplist = C::t('#sanree_brand#sanree_brand_diytemplate')->fetch_all_by_search($condition, $orderby);
    foreach ($stamplist as $key => $val) {
        $val['name'] = $val['issys'] == 1 ? srlang('neizhi') . $val['name'] : $val['name'];
        $arr = array('name' => $val['name'], 'blockclass' => 'sanree_brand');
        $val['content'] = fixhtmlstr($val['content']);
        add_diy_template($val['content'], $arr);
    }
}
예제 #11
0
    $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);
    }
    $value['forum_thread'] = C::t('#sanree_brand#forum_thread')->fetch($value['tid']);
    $recommendlist[] = array('views' => $value['forum_thread']['views'], 'name' => $value['name'], 'img' => '<img src="' . $value['recommendimg'] . '" alt="' . $value['name'] . '" />', 'url' => $url);
}
$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);
}
$mflist = array();
$mfliststr = srlang('zanwustr');
if ($brandresult['brandmf']) {
    foreach (C::t('#sanree_brand#sanree_brand_mf')->fetch_all_by_searchc(array(' mfid IN (' . $brandresult['brandmf'] . ')'), 'displayorder') as $data) {
        $mflist[] = $data['mfname'];
    }
    $mfliststr = implode($mflist, '&nbsp;&nbsp;&nbsp;&nbsp;');
}
$tagdata = array();
if ($brandresult['brandtag']) {
    $taglist = explode(',', $brandresult['brandtag']);
    foreach ($taglist as $tag) {
        $tagid = C::t('#sanree_brand#sanree_brand_tag')->gettagid_by_tagname($tag);
        if ($tagid > 0) {
            $url = gettagurl($tagid);
            $tagdata[] = array('url' => $url, 'tagname' => $tag);
        }
예제 #12
0
$orderby = 't.bid desc';
foreach (C::t('#sanree_brand#sanree_brand_businesses')->fetch_all_by_searchc($where, $orderby, 0, 9) as $value) {
    $value['url'] = getburl($value);
    $voter = C::t('#sanree_brand#sanree_brand_voter')->getvotetotal_by_tid(intval($value['tid']));
    $value['satisfaction'] = intval($voter[3]);
    $value['poster'] = $_G['setting']['attachurl'] . 'category/' . $value['poster'];
    $newlist[] = $value;
}
$navigation = '<em>&raquo;</em><a href="' . $brandresult['url'] . '">' . $brandresult['name'] . '</a><em>&raquo;</em>' . srlang('myalbum');
$navtitle = srlang('myalbum') . '-' . $brandresult['name'] . ' - ' . $config['title'];
$where = array();
$where[] = 'uid=' . $brandresult['uid'];
$where[] = 'bid=' . $bid;
$albumcatelist = array();
include_once libfile('function/home');
$picshowtipformat = srlang('picshowtip');
foreach (C::t('#sanree_brand#sanree_brand_album_category')->fetch_all_by_searchd($where, 'displayorder,dateline DESC') as $data) {
    if ($config['isbird']) {
        $data['pic'] = empty($data['pic']) ? 'static/image/common/nophoto.gif' : pic_cover_get($data['pic'], 1);
    } else {
        if ($isalbumthumb == 1) {
            $data['pic'] = sr_albumimage($data['pic'], 120, 120);
        } else {
            $data['pic'] = empty($data['pic']) ? 'static/image/common/nophoto.gif' : pic_cover_get($data['pic'], 1);
        }
    }
    $data['url'] = getalbumitemurl($data[catid]);
    $wherealbumsub = array();
    $wherealbumsub[] = 'catid = ' . $data[catid];
    $data['num'] = C::t('#sanree_brand#sanree_brand_album')->count_by_wherec($wherealbumsub);
    $data['picshowtip'] = str_replace("{picnum}", $data['num'], $picshowtipformat);
예제 #13
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);
예제 #14
0
 function group_nav_extra_output()
 {
     global $_G;
     $config = $_G['cache']['plugin']['sanree_brand'];
     if (intval($config['allowsyngroup']) != 1) {
         return '';
     }
     $brandresult = C::t('#sanree_brand#sanree_brand_businesses')->fetch_first_byfid(intval($_GET['fid']));
     if (!brandresult) {
         return '';
     }
     $group = C::t('#sanree_brand#sanree_brand_group')->get_by_groupid($brandresult['groupid']);
     if (intval($group['allowsyngroup']) != 1) {
         return '';
     }
     $modfile = DISCUZ_ROOT . './source/plugin/sanree_brand/function/function_core.php';
     @(require_once $modfile);
     $url = getburl($brandresult);
     return "<li ><a href=\"{$url}\" target=\"_blank\">" . srlang('group_nav_extra') . "</a></li>";
 }
예제 #15
0
    require libfile('forum/post', 'module');
    C::t('#sanree_brand#sanree_brand_voter')->updatestar_by_tid($_G['uid'], $_G['username'], $tid, intval($_G['sr_star']));
    $href = $_POST['portal_referer'];
    $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);
예제 #16
0
            $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);
}
$templatefile = templateEx($plugin['identifier'] . ':' . $template . '/index');
$_G['style']['tpldirectory'] = 'tpl/' . $_G['template'];
$_G['style']['tplfile'] = 'index';
$_G['style']['tplsavemod'] = 1;
예제 #17
0
$repeat[] = array('repeat-y', srlang('selectrepeaty'));
$attachment = array();
$attachment[] = array('', srlang('selectnull'));
$attachment[] = array('inherit', srlang('selectdefault'));
$attachment[] = array('fixed', srlang('selectfixed'));
$attachment[] = array('scroll', srlang('selectscroll'));
$positionx = array();
$positionx[] = array('', srlang('selectnull'));
$positionx[] = array('top', srlang('selecttop'));
$positionx[] = array('center', srlang('selectcenter'));
$positionx[] = array('bottom', srlang('selectbottom'));
$positiony = array();
$positiony[] = array('', srlang('selectnull'));
$positiony[] = array('left', srlang('selectleft'));
$positiony[] = array('center', srlang('selectcenter'));
$positiony[] = array('right', srlang('selectright'));
if ($do == 'ajax') {
    include template('common/header');
    echo '<h3 class="flb mn"><span><a href="javascript:;" class="flbc" onclick="MyhideWindow();" title="' . $lang['close'] . '">' . $lang['close'] . '</a></span>' . $langs['selecttag'] . '</h3>';
    $skeyword = $_G['sr_skeyword'];
    ?>
		<script language="javascript" reload="1">
		Array.prototype.S=String.fromCharCode(2);  
		Array.prototype.in_array=function(e)  
		{  
			var r=new RegExp(this.S+e+this.S);  
			return (r.test(this.S+this.join(this.S)+this.S));  
		}  		
		function MyhideWindow() {
			hideWindow('settag',1,0);
			$('domfx').innerHTML = '<style type="text/css">object{visibility:visible;}</style>';
예제 #18
0
    $category_list = array();
    $category = sanreeloadcache('usercate');
    foreach ($category as $value) {
        $category_list[] = $value;
    }
    $navtitle = srlang('dengjititle');
    $addteltitle = $config['djtitle'] ? $config['djtitle'] : srlang('teladd');
    if ($isselfdistrict == 1) {
        $districthtml = brand_setting('birthcity', $result);
    } else {
        include_once libfile('function/profile');
        $districthtml = profile_setting('birthcity', $result);
    }
    $discounthtml = brand_discountsetting($result['discount']);
    $pubtip_price = srlang('pubtip_price');
    $pubtip_price = str_replace(array('{regprice}', '{creditunitname}'), array($regprice, $creditunitname), $pubtip_price);
    $pubtip_shen = srlang('pubtip_shen');
    $pubtip_shen = str_replace(array('{admintel}'), array($admintel), $pubtip_shen);
    $pubtip_ok = srlang('pubtip_ok');
    $pubtip_ok = str_replace(array('{admintel}'), array($admintel), $pubtip_ok);
    if ($_G['inajax'] == 1) {
        include templateEx($plugin['identifier'] . ':' . $template . "/" . $mod . '_ajax');
    } else {
        $newlist = array();
        foreach (C::t('#sanree_brand#sanree_brand_businesses')->fetch_all_by_searchc(array('c.status=1', 't.status=1', 't.isshow=1'), 't.bid desc', 0, 8) as $value) {
            $value[url] = getburl($value);
            $newlist[] = $value;
        }
        include templateEx($plugin['identifier'] . ':' . $template . "/" . $mod);
    }
}
예제 #19
0
<?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;
예제 #20
0
/**
 *      [Sanree] (C)2001-2099 Sanree Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: sanree_brand_upload.php sanree $
 */
if (!defined('IN_DISCUZ')) {
    exit('2014042523s4K4QUOUT9||5057||1411992002');
}
if (!$_G['uid']) {
    showmessage(srlang('nologin'), '', array(), array('login' => true));
}
if (!in_array($_G['group']['groupid'], $addgroup)) {
    showmessage($stopaddtip);
}
if ($regprice > 0) {
    $account = getuserprofile('extcredits' . $creditunit);
    if ($regprice > $account) {
        showmessage(srlang('nomoney'));
    }
}
$type = 'image';
$attachexts = $imgexts = '';
$imgexts = 'jpg, jpeg, gif, png, bmp';
if (!$_G['group']['allowpostimage'] || !$imgexts) {
    showmessage('no_privilege_postimage');
}
$input_imagetip = srlang('input_imagetip');
$input_imagetip = str_replace('{w}', intval($_G['sr_w']), $input_imagetip);
$input_imagetip = str_replace('{h}', intval($_G['sr_h']), $input_imagetip);
include templateEx($plugin['identifier'] . ':' . $template . "/" . $mod);
예제 #21
0
<?php

/**
 *      [Sanree] (C)2001-2099 Sanree Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: sanree_brand_brandno.php sanree $
 */
if (!defined('IN_DISCUZ')) {
    exit('2014042523s4K4QUOUT9||5057||1411992002');
}
$brandno = dhtmlspecialchars(trim($_G['sr_tid']));
preg_match("/[^0-9a-zA-Z]/", $brandno, $matches);
if (count($matches) > 0) {
    showmessage(srlang('errorbrandno'));
}
if (!$brandno) {
    showmessage(srlang('nodengji'));
}
$brandresult = C::t('#sanree_brand#sanree_brand_businesses')->get_by_brandno($brandno);
if (!$brandresult) {
    showmessage(srlang('nodengji'));
}
if ($brandresult['status'] != 1) {
    showmessage(srlang('nostatus'));
}
chkbrandend($brandresult);
$_G['sr_tid'] = $brandresult['bid'];
$_G['item_detail'] = 'detail';
require_once sanree_libfile('module/' . $plugin['identifier'] . '/item', $plugin['identifier']);
예제 #22
0
}
$perpage = 10;
$page = intval($_G[sr_page]);
$page = max(1, intval($page));
$start = ($page - 1) * $perpage;
$start = max(0, $start);
$multi = '';
$where = array();
$bid = intval($_G[sr_bid]);
$where[] = 'uid=' . $_G['uid'];
$where[] = 'typeid=2';
if ($bid > 0) {
    $where[] = 'bid=' . $bid;
}
$count = C::t('#sanree_brand#sanree_brand_msg')->count_by_wherec($where);
if ($count > 0) {
    require_once libfile('function/discuzcode');
    $orderby = 'dateline desc,msgid desc';
    $datalist = C::t('#sanree_brand#sanree_brand_msg')->fetch_all_by_searchc($where, $orderby, ($page - 1) * $perpage, $perpage);
    $list = array();
    foreach ($datalist as $msg) {
        $msg[dateline] = dgmdate($msg[dateline]);
        $msg[message] = $msg[words];
        $msg[subject] = substr($msg[words], 0, 10);
        $list[] = $msg;
    }
    $murl = 'plugin.php?id=sanree_brand&mod=mybrand&view=mymsg' . $extra;
    $multi = multi($count, $perpage, $page, $murl);
}
$msgcounttip = str_replace('{count}', $count, srlang('msgcounttip'));
include templateEx($plugin['identifier'] . ':' . $template . "/" . $mod . '_' . $view);
예제 #23
0
 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;
 }
예제 #24
0
}
$brandresult[albumurl] = getalbumurl($brandresult[bid]);
$where = array();
$where[] = 'uid=' . $brandresult['uid'];
$where[] = 'bid=' . $bid;
$albumcat = C::t('#sanree_brand#sanree_brand_album_category')->fetch_all_by_searchd($where, 'displayorder,dateline DESC');
$bids = array();
foreach ($albumcat as $data) {
    $bids[] = $data[catid];
}
$maxpic = $maxishomepic;
$albumlist = array();
for ($i = 0; $i < $maxpic; $i++) {
    $albumlist[$i]['pic'] = 'source/plugin/sanree_brand/tpl/good/images/nophoto.gif';
    $albumlist[$i]['thumbpic'] = 'source/plugin/sanree_brand/tpl/good/images/nophoto.gif';
    $albumlist[$i]['albumname'] = srlang('no_pic');
}
$aids = "''";
if ($bids) {
    $where = "AND catid in(" . implode($bids, ",") . ") AND ishome=1";
    $albumdata = C::t('#sanree_brand#sanree_brand_album')->fetch_all_by_searchex($where, 'ishome desc,displayorder,albumid desc', 0, $maxpic);
    include_once libfile('function/home');
    $aids = '[';
    $tmparray = array();
    foreach ($albumdata as $key => $album) {
        $album['thumbpic'] = $isalbumthumb == 1 ? sr_albumimage($album['pic'], 165, 165) : pic_cover_get($album['pic'], 1);
        $album['pic'] = pic_cover_get($album['pic'], 1);
        $albumlist[$key] = $album;
        $tmparray[] = "'{$album['albumid']}'";
    }
    $aids .= implode($tmparray, ",");
예제 #25
0
            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);
}
예제 #26
0
<?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;
예제 #27
0
            $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);
예제 #28
0
 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;
 }