$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, ","); $aids .= ']'; } include templateEx($plugin['identifier'] . ':' . $template . '/album');
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']; $where[] = 'a.bid=' . $bid; if ($catid > 0) { $where[] = 'a.catid=' . $catid; } $count = C::t('#sanree_brand#sanree_brand_album')->count_by_wherec($where); if ($count > 0) { require_once libfile('function/discuzcode'); $orderby = 'a.ishome desc,a.displayorder,a.albumid desc'; $datalist = C::t('#sanree_brand#sanree_brand_album')->fetch_all_by_searchc($where, $orderby, ($page - 1) * $perpage, $perpage); $list = array(); foreach ($datalist as $value) { $ishomestr = $value['ishome'] == 1 ? ' checked="checked"' : ''; if ($isalbumthumb == 1) { $value['thumbpic'] = sr_albumimage($value['pic'], 120, 120); } else { $value['thumbpic'] = empty($value['pic']) ? 'static/image/common/nophoto.gif' : $_G['setting']['attachurl'] . 'album/' . $value['pic']; } $value['pic'] = empty($value['pic']) ? 'static/image/common/nophoto.gif' : $_G['setting']['attachurl'] . 'album/' . $value['pic']; $list[] = array('albumid' => $value['albumid'], 'displayorder' => $value['displayorder'], 'ishomestr' => $ishomestr, 'ishome' => $value['ishome'], 'description' => $value['description'], 'catid' => $value['catid'], 'uid' => $value['uid'], 'name' => $value['name'], 'id' => $value['catid'], 'pic' => $value['pic'], 'thumbpic' => $value['thumbpic']); } $murl = 'plugin.php?id=sanree_brand&mod=mybrand' . $extra; $multi = multi($count, $perpage, $page, $murl); } } } include templateEx($plugin['identifier'] . ':' . $template . "/" . $mod . '_' . $view);
$newlist[] = $value; } $navigation = '<em>»</em><a href="' . $brandresult['url'] . '">' . $brandresult['name'] . '</a><em>»</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); $albumcatelist[] = $data; } if (!$config['isbird']) { require_once libfile('class/' . $plugin['identifier'] . '_menu', 'plugin/' . $plugin['identifier']); $menuclass = new sanree_brand_menu($plugin['identifier']); $menuclass->getmenu($brandresult, 'myalbum');