Пример #1
0
function cnodearr($urlstr, $sid = 0)
{
    global $subsites, $cmsinfos;
    if ($cnode = read_cnode($urlstr, $sid)) {
        view_cnurl($urlstr, $cnode);
        $cnode['sitename'] = empty($cnode['sid']) ? lang('msite') : $subsites[$cnode['sid']]['sitename'];
        $cnode['siteurl'] = view_siteurl($cnode['sid']);
    }
    return $cnode ? $cnode : false;
}
Пример #2
0
            include_once M_ROOT . "./include/cparse.fun.php";
            cn_blank('', $nsid, 0);
            amessage('subaddfin', '?entry=subsites&action=subsitesedit');
        } else {
            amessage('subaddfai', '?entry=subsites&action=subsitesedit');
        }
    }
} elseif ($action == 'subsitesedit') {
    if (!submitcheck('bsubsitesedit')) {
        url_nav(lang('subsitemanager'), $urlsarr, 'admin');
        tabheader(lang('subsitemanager'), 'subsitesedit', '?entry=subsites&action=subsitesedit', '10');
        trcategory(array(lang('id'), lang('close'), lang('subsitecname'), lang('order'), lang('subsstadir'), lang('look'), lang('admin'), lang('delete'), lang('transtomsite')));
        $query = $db->query("SELECT * FROM {$tblprefix}subsites ORDER BY vieworder,sid");
        while ($row = $db->fetch_array($query)) {
            $nsid = $row['sid'];
            $row['siteurl'] = view_siteurl($nsid);
            echo "<tr class=\"txt\">\n" . "<td class=\"txtC w30\">{$row['sid']}</td>\n" . "<td class=\"txtC w30\"><input class=\"checkbox\" type=\"checkbox\" name=\"subsitesnew[{$nsid}][closed]\" value=\"1\"" . (empty($row['closed']) ? '' : ' checked') . "></td>\n" . "<td class=\"txtL\"><input type=\"text\" name=\"subsitesnew[{$nsid}][sitename]\" value=\"" . mhtmlspecialchars($row['sitename']) . "\" size=\"25\"></td>\n" . "<td class=\"txtC w60\"><input type=\"text\" name=\"subsitesnew[{$nsid}][vieworder]\" value=\"{$row['vieworder']}\" size=\"4\"></td>\n" . "<td class=\"txtC\">{$row['dirname']}</td>\n" . "<td class=\"txtC w30\"><a href=\"{$row['siteurl']}\" target=\"_blank\">" . lang('index') . "</a></td>\n" . "<td class=\"txtC w30\"><a href=\"?sid={$nsid}\" target=\"_blank\">" . lang('admin') . "</a></td>\n" . "<td class=\"txtC w30\"><a href=\"?entry=subsites&action=subsitedel&nsid={$nsid}\">" . lang('delete') . "</a></td>\n" . "<td class=\"txtC w60\"><a href=\"?entry=subsites&action=tomsite&nsid={$nsid}\">>>" . lang('start') . "</a></td>\n" . "</tr>\n";
        }
        tabfooter('bsubsitesedit');
        a_guide('subsitesedit');
    } else {
        if (!empty($subsitesnew)) {
            foreach ($subsitesnew as $k => $v) {
                $v['closed'] = empty($v['closed']) ? 0 : 1;
                $v['vieworder'] = max(0, intval($v['vieworder']));
                $v['sitename'] = trim($v['sitename']);
                !$v['sitename'] && ($v['sitename'] = $subsites[$k]['sitename']);
                $db->query("UPDATE {$tblprefix}subsites SET sitename='{$v['sitename']}',closed='{$v['closed']}',vieworder='{$v['vieworder']}' WHERE sid='{$k}'");
            }
        }
        updatecache('subsites');
Пример #3
0
 function pre_deal()
 {
     $this->temparr['limits'] = empty($this->tag['limits']) ? 10 : $this->tag['limits'];
     switch ($this->tclass) {
         case 'archives':
             global $db, $tblprefix;
             if ($sqlstr = arc_sqlstr($this->tag, $this->temparr, $this->tmode)) {
                 $sqlstr .= " LIMIT " . ($this->tmode == 'p' ? ($this->nowpage - 1) * $this->temparr['limits'] : (empty($this->tag['startno']) ? 0 : $this->tag['startno'])) . "," . $this->temparr['limits'];
                 $query = $db->query($sqlstr);
                 while ($archive = $db->fetch_array($query)) {
                     $this->items[] = $archive;
                 }
             }
             break;
         case 'marchives':
             global $db, $tblprefix;
             if ($sqlstr = marc_sqlstr($this->tag, $this->temparr, $this->tmode)) {
                 $sqlstr .= " LIMIT " . ($this->tmode == 'p' ? ($this->nowpage - 1) * $this->temparr['limits'] : (empty($this->tag['startno']) ? 0 : $this->tag['startno'])) . "," . $this->temparr['limits'];
                 $query = $db->query($sqlstr);
                 while ($archive = $db->fetch_array($query)) {
                     $this->items[] = $archive;
                 }
             }
             break;
         case 'alarchives':
             //辑内文档列表
             global $db, $tblprefix;
             if ($sqlstr = alarc_sqlstr($this->tag, $this->temparr, $this->tmode)) {
                 $sqlstr .= " LIMIT " . ($this->tmode == 'p' ? ($this->nowpage - 1) * $this->temparr['limits'] : (empty($this->tag['startno']) ? 0 : $this->tag['startno'])) . "," . $this->temparr['limits'];
                 $query = $db->query($sqlstr);
                 while ($archive = $db->fetch_array($query)) {
                     $this->items[] = $archive;
                 }
             }
             break;
         case 'functions':
             //自定函数列表
             global $templatedir;
             @(include_once M_ROOT . "./template/{$templatedir}/function/utags.fun.php");
             $this->temparr['nowpage'] = $this->nowpage;
             $this->items = functions_arr($this->tag, $this->temparr, $this->tmode);
             break;
         case 'relates':
             //相关文档列表
             global $db, $tblprefix;
             if ($sqlstr = rel_sqlstr($this->tag, $this->temparr, $this->tmode)) {
                 $sqlstr .= " LIMIT " . ($this->tmode == 'p' ? ($this->nowpage - 1) * $this->temparr['limits'] : 0) . "," . $this->temparr['limits'];
                 $query = $db->query($sqlstr);
                 while ($archive = $db->fetch_array($query)) {
                     $this->items[] = $archive;
                 }
             }
             break;
         case 'farchives':
             //附属信息列表
             global $db, $tblprefix, $m_thumb;
             if ($sqlstr = farc_sqlstr($this->tag, $this->temparr, $this->tmode)) {
                 $sqlstr .= " LIMIT " . ($this->tmode == 'p' ? ($this->nowpage - 1) * $this->temparr['limits'] : (empty($this->tag['startno']) ? 0 : $this->tag['startno'])) . "," . $this->temparr['limits'];
                 $query = $db->query($sqlstr);
                 while ($row = $db->fetch_array($query)) {
                     $row['arcurl'] = view_farcurl($row['aid'], $row['arcurl']);
                     arr_tag2atm($row, 'f');
                     $this->items[] = $row;
                 }
             }
             break;
         case 'commus':
             //交互记录列表
             global $db, $tblprefix, $commus, $fields, $curuser;
             if ($sqlstr = cu_sqlstr($this->tag, $this->temparr, $this->tmode)) {
                 $sqlstr .= " LIMIT " . ($this->tmode == 'p' ? ($this->nowpage - 1) * $this->temparr['limits'] : 0) . "," . $this->temparr['limits'];
                 $query = $db->query($sqlstr);
                 while ($row = $db->fetch_array($query)) {
                     $this->items[] = $row;
                 }
             }
             break;
         case 'mcommus':
             //交互记录列表
             global $db, $tblprefix, $mcommus, $fields, $curuser;
             if ($sqlstr = mcu_sqlstr($this->tag, $this->temparr, $this->tmode)) {
                 $sqlstr .= " LIMIT " . ($this->tmode == 'p' ? ($this->nowpage - 1) * $this->temparr['limits'] : 0) . "," . $this->temparr['limits'];
                 $query = $db->query($sqlstr);
                 while ($row = $db->fetch_array($query)) {
                     $this->items[] = $row;
                 }
             }
             break;
         case 'members':
             //会员列表
             global $db, $tblprefix;
             if ($sqlstr = mem_sqlstr($this->tag, $this->temparr, $this->tmode)) {
                 $sqlstr .= " LIMIT " . ($this->tmode == 'p' ? ($this->nowpage - 1) * $this->temparr['limits'] : 0) . "," . $this->temparr['limits'];
                 $query = $db->query($sqlstr);
                 while ($row = $db->fetch_array($query)) {
                     $this->items[] = $row;
                 }
             }
             $this->no_ctag = 1;
             break;
         case 'searchs':
             //搜索文档列表
             global $db, $tblprefix, $timestamp;
             $sqlstr = empty($this->tag['detail']) || empty($this->temparr['chid']) ? "SELECT a.* " : "SELECT a.*,c.*";
             $validstr = !empty($this->tag['validperiod']) ? " AND (a.enddate='0' OR a.enddate>'{$timestamp}')" : '';
             //有效期分析
             $sqlstr .= $this->temparr['sqlstr'] . $validstr . ' ' . $this->temparr['orderstr'] . " LIMIT " . ($this->nowpage - 1) * $this->temparr['limits'] . "," . $this->temparr['limits'];
             $query = $db->query($sqlstr);
             while ($archive = $db->fetch_array($query)) {
                 $this->items[] = $archive;
             }
             break;
         case 'masearchs':
             //搜索文档列表
             global $db, $tblprefix, $timestamp, $coyptes;
             $sqlstr = 'ma.*,m.mchid,m.caid';
             foreach ($cotypes as $k => $v) {
                 $sqlstr .= ",m.ccid{$k}";
             }
             $sqlstr .= $this->temparr['sqlstr'] . " LIMIT " . ($this->nowpage - 1) * $this->temparr['limits'] . "," . $this->temparr['limits'];
             $query = $db->query($sqlstr);
             while ($archive = $db->fetch_array($query)) {
                 $this->items[] = $archive;
             }
             break;
         case 'msearchs':
             //搜索文档列表
             global $db, $tblprefix;
             if ($this->tmode == 'c') {
                 //可以引用$timestamp及其它公用参数
                 $sqlstr = "SELECT m.*,s.* ";
                 $this->tag['sqlstr'] = stripslashes(str_replace('{$tblprefix}', $tblprefix, $this->tag['sqlstr']));
                 $this->tag['sqlstr'] = sqlstr_replace($this->tag['sqlstr'], $this->temparr);
             } else {
                 $sqlstr = empty($this->tag['detail']) || empty($this->temparr['mchid']) ? "SELECT m.*,s.* " : "SELECT m.*,s.*,c.*";
             }
             $sqlstr .= ($this->tmode == 'p' ? $this->temparr['sqlstr'] : $this->tag['sqlstr']) . " LIMIT " . ($this->tmode == 'p' ? ($this->nowpage - 1) * $this->temparr['limits'] : 0) . "," . $this->temparr['limits'];
             $query = $db->query($sqlstr);
             while ($row = $db->fetch_array($query)) {
                 $this->items[] = $row;
             }
             break;
         case 'outinfos':
             //自由调用列表
             $this->items = outinfos_arr($this->tag, $this->temparr, $this->tmode, $this->nowpage);
             break;
         case 'catalogs':
             //类目列表//只需要先取出id
             global $acatalogs, $cotypes, $sid;
             $nsid = empty($this->tag['nsid']) ? 0 : intval($this->tag['nsid']);
             if (!$nsid) {
                 $nsid = isset($temparr['nsid']) ? $temparr['nsid'] : $sid;
                 //当前子站需要分析是否有传下来的id,否则认为是全局id
             } elseif ($nsid == -1) {
                 $nsid = 0;
             }
             if ($nsid == -2) {
                 $ncatalogs =& $acatalogs;
                 $nsid = $sid;
                 //为没有栏目因素的节点
             } else {
                 $ncatalogs = read_cache('catalogs', '', '', $nsid);
             }
             if ($this->tag['listby'] == 'ca') {
                 $caids = array();
                 if (empty($this->tag['casource'])) {
                     foreach ($ncatalogs as $k => $v) {
                         if (empty($v['level'])) {
                             $caids[] = $k;
                         }
                     }
                 } elseif ($this->tag['casource'] == 1) {
                     if (!empty($this->tag['caids'])) {
                         $tcaids = explode(',', $this->tag['caids']);
                         foreach ($tcaids as $k) {
                             if (isset($ncatalogs[$k])) {
                                 $caids[] = $k;
                             }
                         }
                     }
                 } elseif ($this->tag['casource'] == 2) {
                     //激活栏目的子栏目
                     if (!empty($this->temparr['caid'])) {
                         foreach ($ncatalogs as $k => $v) {
                             if ($v['pid'] == $this->temparr['caid']) {
                                 $caids[] = $k;
                             }
                         }
                     }
                 } elseif ($this->tag['casource'] == 3) {
                     if (!empty($this->temparr['caid'])) {
                         foreach ($ncatalogs as $k => $v) {
                             if ($v['pid'] == $ncatalogs[$this->temparr['caid']]['pid']) {
                                 $caids[] = $k;
                             }
                         }
                     }
                 } elseif ($this->tag['casource'] == 4) {
                     foreach ($ncatalogs as $k => $v) {
                         if ($v['level'] == 1) {
                             $caids[] = $k;
                         }
                     }
                 } elseif ($this->tag['casource'] == 5) {
                     foreach ($ncatalogs as $k => $v) {
                         if ($v['level'] == 2) {
                             $caids[] = $k;
                         }
                     }
                 }
                 if (!empty($this->tag['orderstr']) && $caids) {
                     $dorder = array();
                     foreach ($caids as $k) {
                         $catalog = read_cache('catalog', $k, '', $ncatalogs[$k]['sid']);
                         if (!isset($catalog[$this->tag['orderstr']])) {
                             break;
                         }
                         $dorder[] = $catalog[$this->tag['orderstr']];
                     }
                     if ($dorder) {
                         array_multisort($dorder, empty($this->tag['asc']) ? SORT_DESC : SORT_ASC, $caids);
                     }
                 }
                 foreach ($caids as $k) {
                     if ($this->temparr['limits'] > count($this->items)) {
                         $this->items[] = array('caid' => $k, 'sid' => $ncatalogs[$k]['sid']);
                     }
                 }
             } else {
                 $coid = str_replace('co', '', $this->tag['listby']);
                 if (!($coclasses = read_cache('coclasses', $coid))) {
                     return;
                 }
                 $ccids = array();
                 if (empty($this->tag['cosource' . $coid])) {
                     foreach ($coclasses as $k => $v) {
                         if (empty($v['level'])) {
                             $ccids[] = $k;
                         }
                     }
                 } elseif ($this->tag['cosource' . $coid] == 1 && !empty($this->tag['ccids' . $coid])) {
                     $tccids = explode(',', $this->tag['ccids' . $coid]);
                     foreach ($tccids as $k) {
                         if (isset($coclasses[$k])) {
                             $ccids[] = $k;
                         }
                     }
                 } elseif ($this->tag['cosource' . $coid] == 2 && !empty($this->temparr['ccid' . $coid])) {
                     foreach ($coclasses as $k => $v) {
                         if ($v['pid'] == $this->temparr['ccid' . $coid]) {
                             $ccids[] = $k;
                         }
                     }
                 } elseif ($this->tag['cosource' . $coid] == 3 && !empty($this->temparr['ccid' . $coid])) {
                     foreach ($coclasses as $k => $v) {
                         if ($v['pid'] == $coclasses[$this->temparr['ccid' . $coid]]['pid']) {
                             $ccids[] = $k;
                         }
                     }
                 } elseif ($this->tag['cosource' . $coid] == 4) {
                     foreach ($coclasses as $k => $v) {
                         if ($v['level'] == 1) {
                             $ccids[] = $k;
                         }
                     }
                 } elseif ($this->tag['cosource' . $coid] == 5) {
                     foreach ($coclasses as $k => $v) {
                         if ($v['level'] == 2) {
                             $ccids[] = $k;
                         }
                     }
                 }
                 if (!empty($this->tag['orderstr']) && $ccids) {
                     $dorder = array();
                     foreach ($ccids as $k) {
                         $coclass = read_cache('coclass', $coid, $k);
                         if (!isset($coclass[$this->tag['orderstr']])) {
                             break;
                         }
                         $dorder[] = $coclass[$this->tag['orderstr']];
                     }
                     if ($dorder) {
                         array_multisort($dorder, empty($this->tag['asc']) ? SORT_DESC : SORT_ASC, $ccids);
                     }
                 }
                 foreach ($ccids as $k) {
                     if ($this->temparr['limits'] > count($this->items)) {
                         $this->items[] = array('ccid' => $k, 'sid' => $nsid);
                     }
                 }
             }
             unset($ncatalogs, $coclasses, $catalog, $coclass);
             break;
         case 'mcatalogs':
             //会员空间的类目列表
             global $mcatalogs, $uclasses;
             //这里的空间栏目必须首先是当前所用模板方案的有效栏目
             if ($this->tag['listby'] == 'ca') {
                 //全部栏目
                 $caids = array();
                 if (empty($this->tag['casource'])) {
                     foreach ($mcatalogs as $k => $v) {
                         $this->items[] = $v;
                     }
                 } elseif ($this->tag['casource'] == 1) {
                     //指定栏目
                     if (!empty($this->tag['caids'])) {
                         $caids = explode(',', $this->tag['caids']);
                         foreach ($mcatalogs as $k => $v) {
                             if (in_array($k, $caids)) {
                                 $this->items[] = $v;
                             }
                         }
                     }
                 }
             } elseif ($this->tag['listby'] == 'uc') {
                 if (!empty($this->temparr['mcaid'])) {
                     //一定必须是激活栏目下的分类
                     foreach ($uclasses as $k => $v) {
                         if ($v['mcaid'] == $this->temparr['mcaid']) {
                             $this->items[] = $v;
                         }
                     }
                 }
             }
             break;
         case 'vote':
             //投票模块
             global $db, $tblprefix, $timestamp;
             $this->no_ctag = 1;
             $vid = empty($this->tag['vid']) ? empty($this->temparr['vid']) ? 0 : $this->temparr['vid'] : $this->tag['vid'];
             if (!$vid) {
                 $this->ret_null = 1;
                 return;
             }
             if (!($vote = $db->fetch_one("SELECT * FROM {$tblprefix}votes WHERE vid='{$vid}' AND checked=1 AND (enddate=0 OR enddate>{$timestamp})"))) {
                 $this->ret_null = 1;
                 return;
             }
             $vote['content'] = mnl2br($vote['content']);
             foreach (array('vid', 'subject', 'content', 'totalnum', 'enddate', 'mid', 'mname', 'createdate') as $var) {
                 $this->temparr[$var] = $vote[$var];
             }
             $query = $db->query("SELECT * FROM {$tblprefix}voptions WHERE vid='{$vid}' ORDER BY vieworder,vopid");
             while ($item = $db->fetch_array($query)) {
                 $item['input'] = !$vote['ismulti'] ? "<input type=\"radio\" value=\"" . $item['vopid'] . "\" name=\"vopids[]\">" : "<input type=\"checkbox\" value=\"" . $item['vopid'] . "\" name=\"vopids[]\">";
                 $item['percent'] = $vote['totalnum'] ? @round($item['votenum'] / $vote['totalnum'], 3) : 0;
                 $item['percent'] = $item['percent'] * 100 . '%';
                 $this->items[] = $item;
             }
             unset($vote, $item);
             break;
         case 'votes':
             //投票列表
             global $db, $tblprefix;
             if ($sqlstr = v_sqlstr($this->tag, $this->tmode)) {
                 $sqlstr .= " LIMIT " . ($this->tmode == 'p' ? ($this->nowpage - 1) * $this->temparr['limits'] : 0) . "," . $this->temparr['limits'];
                 $query = $db->query($sqlstr);
                 while ($item = $db->fetch_array($query)) {
                     $this->items[] = $item;
                 }
             }
             break;
         case 'images':
             //有分页
             $tempfiles = @marray_slice(unserialize($this->temparr[$this->tag['tname']]), ($this->nowpage - 1) * $this->temparr['limits'], $this->temparr['limits']);
             if (!empty($tempfiles)) {
                 foreach ($tempfiles as $k => $v) {
                     $v['fid'] = $k;
                     $v['url'] = view_atmurl($v['remote']);
                     $this->items[] = $v;
                 }
             }
             unset($tempfiles, $v);
             $this->no_ctag = 1;
             break;
         case 'files':
             $tempfiles = @marray_slice(unserialize($this->temparr[$this->tag['tname']]), 0, $this->temparr['limits']);
             if (!empty($tempfiles)) {
                 foreach ($tempfiles as $k => $v) {
                     $item = array();
                     $item['fid'] = $k;
                     $item['url'] = view_atmurl($v['remote']);
                     $item['title'] = $v['title'];
                     !empty($this->temparr['aid']) && ($item['aid'] = $this->temparr['aid']);
                     $item['tname'] = $this->tag['tname'];
                     $this->items[] = $item;
                 }
             }
             unset($tempfiles, $v, $item);
             $this->no_ctag = 1;
             break;
         case 'medias':
             $tempfiles = @marray_slice(unserialize($this->temparr[$this->tag['tname']]), 0, $this->temparr['limits']);
             if (!empty($tempfiles)) {
                 foreach ($tempfiles as $k => $v) {
                     $item = array();
                     $item['fid'] = $k;
                     $item['url'] = view_atmurl($v['remote']);
                     $item['title'] = $v['title'];
                     $item['player'] = empty($v['player']) ? 0 : $v['player'];
                     !empty($this->temparr['aid']) && ($item['aid'] = $this->temparr['aid']);
                     $item['tname'] = $this->tag['tname'];
                     $this->items[] = $item;
                 }
             }
             unset($tempfiles, $v, $item);
             $this->no_ctag = 1;
             break;
         case 'flashs':
             $tempfiles = @marray_slice(unserialize($this->temparr[$this->tag['tname']]), 0, $this->temparr['limits']);
             if (!empty($tempfiles)) {
                 foreach ($tempfiles as $k => $v) {
                     $item = array();
                     $item['fid'] = $k;
                     $item['url'] = view_atmurl($v['remote']);
                     $item['title'] = $v['title'];
                     $item['player'] = empty($v['player']) ? 0 : $v['player'];
                     !empty($this->temparr['aid']) && ($item['aid'] = $this->temparr['aid']);
                     $item['tname'] = $this->tag['tname'];
                     $this->items[] = $item;
                 }
             }
             unset($tempfiles, $v, $item);
             $this->no_ctag = 1;
             break;
         case 'arcfee':
             $temps = fee_arr($this->tag, $this->temparr);
             empty($temps) && ($this->ret_null = 1);
             foreach ($temps as $k => $v) {
                 $this->items[] = $v;
             }
             unset($temps, $v);
             $this->no_ctag = 1;
             break;
         case 'keywords':
             global $uwordlinks;
             load_cache('uwordlinks');
             if (empty($uwordlinks)) {
                 return;
             }
             $temps = @marray_slice($uwordlinks, 0, $this->temparr['limits']);
             foreach ($temps['swords'] as $k => $v) {
                 $this->items[] = array('word' => $v, 'wordlink' => $temps['rwords'][$k]);
             }
             unset($temps, $k, $v);
             $this->no_ctag = 1;
             break;
         case 'subsites':
             global $subsites, $cmsname;
             if (empty($this->tag['source']) || $this->tag['source'] == 2 && is_array($this->tag['sids']) && in_array('0', $this->tag['sids'])) {
                 $this->items[] = array('sid' => 0, 'siteurl' => view_siteurl(0), 'sitename' => $cmsname);
             }
             $i = 1;
             foreach ($subsites as $k => $v) {
                 if ($i > $this->temparr['limits']) {
                     break;
                 }
                 if ($this->tag['source'] < 2 || $this->tag['source'] == 2 && in_array($k, explode(',', $this->tag['sids']))) {
                     $this->items[] = array('sid' => $k, 'siteurl' => view_siteurl($k), 'sitename' => $v['sitename']);
                     $i++;
                 }
             }
             break;
         case 'channels':
             global $channels;
             if (empty($channels) || !empty($this->tag['chsource']) && empty($this->tag['chids'])) {
                 return;
             }
             $i = 1;
             foreach ($channels as $k => $v) {
                 if ($i > $this->temparr['limits']) {
                     break;
                 }
                 if (empty($this->tag['chsource']) || !empty($this->tag['chsource']) && in_array($k, explode(',', $this->tag['chids']))) {
                     $this->items[] = array('chid' => $k, 'title' => $v['cname']);
                     $i++;
                 }
             }
             break;
         case 'mchannels':
             global $mchannels;
             if (empty($mchannels) || !empty($this->tag['chsource']) && empty($this->tag['chids'])) {
                 return;
             }
             $i = 1;
             foreach ($mchannels as $k => $v) {
                 if ($i > $this->temparr['limits']) {
                     break;
                 }
                 if (empty($this->tag['chsource']) || !empty($this->tag['chsource']) && in_array($k, explode(',', $this->tag['chids']))) {
                     $this->items[] = array('mchid' => $k, 'title' => $v['cname']);
                     $i++;
                 }
             }
             break;
     }
 }
Пример #4
0
}
</script>
</head>

<body style="margin:4px;">
<?php 
$menuid = 0;
$menu = empty($menu) ? $sid ? 39 : 1 : $menu;
if ($curuser->info['isfounder']) {
    $a_usergroup = lang('founder');
} else {
    $a_usergroups = read_cache('usergroups', 2);
    $a_usergroup = $a_usergroups[$curuser->info['grouptype2']]['cname'];
    unset($a_usergroups);
}
echo '<div class="left2">' . "<a href=\"###\" onclick=\"change_menu('" . $menuid . "')\"><div class=\"left2_out\" id=\"dv{$menuid}\" style=\"cursor:pointer;\"><b>" . $a_usergroup . lang('backarea') . "</b></div></a>" . "<div class=\"left2_break\" style=\"display:none;\" id=\"dvShow{$menuid}\">\n" . "<div class=\"left2_break_2\">" . lang('member') . '&nbsp; ' . $curuser->info['mname'] . "</div>\n" . "<div class=\"left2_break_2\"><a href=\"" . view_siteurl($sid) . "\" target=\"_blank\">" . lang($sid ? 'subsiteindex' : 'websiteindex') . "</a>&nbsp; &nbsp;<a href=\"adminm.php\" target=\"_blank\">" . lang('membercenter1') . "</a></div>\n" . "<div class=\"left2_break_2\"><a href=\"#\"  onClick=\"parent.menu.location='?entry=menu{$param_suffix}'; parent.main.location='?entry=home{$param_suffix}';return false;\">" . lang('adminindex') . "</a>&nbsp; &nbsp;<a href=\"?entry=logout\" target=\"_top\">" . lang('logoutadmin') . "</a></div>\n" . '</div></div>';
$menuid++;
foreach ($a_menus as $k => $v) {
    echo '<div class="left2" id="mheader_' . $k . '" style="display:' . ($k == $menu ? 'block' : 'none') . ';">';
    showamenus($k);
    echo '</div>';
}
function showamenus($headermenu = '1')
{
    global $a_menus, $menuid, $param_suffix;
    foreach ($a_menus[$headermenu] as $k0 => $v0) {
        $menuid++;
        echo "<a href=\"###\" onclick=\"change_menu('" . $menuid . "')\"><div class=\"left2_on\" id=\"dv{$menuid}\" style=\"cursor:pointer;\"><b>" . lang('menutype_' . $k0) . "</b></div></a>" . "<div class=\"left2_break\" style=\"display:block;\" id=\"dvShow{$menuid}\">\n";
        foreach ($v0 as $k1 => $v1) {
            echo "<div class=\"left2_break_2\" id=\"{$k1}\"><a href=\"{$v1}{$param_suffix}\" target=\"main\">" . lang('menuitem_' . $k1) . "</a></div>\n";
        }
Пример #5
0
function arc_parse(&$item)
{
    //一个文档解析时需要分析的相关内容
    global $acatalogs, $cotypes, $channels, $subsites, $cms_abs;
    view_arcurl($item, -1);
    $item['sitename'] = empty($item['sid']) ? lang('msite') : $subsites[$item['sid']]['sitename'];
    $item['siteurl'] = view_siteurl($item['sid']);
    $item['catalog'] = $acatalogs[$item['caid']]['title'];
    $item['channel'] = @$channels[$item['chid']]['cname'];
    foreach ($cotypes as $k => $cotype) {
        $item['ccid' . $k . 'title'] = '';
        if ($item["ccid{$k}"]) {
            $coclasses = read_cache('coclasses', $k);
            $item['ccid' . $k . 'title'] = cnstitle($item["ccid{$k}"], $cotype['asmode'], $coclasses);
        }
    }
    $item['cms_counter'] = "<script type=\"text/javascript\" src=\"" . $cms_abs . "tools/counter.php?aid=" . $item['aid'] . "&mid=" . $item['mid'] . "\"></script>";
    fetch_txt($item);
    arr_tag2atm($item);
    foreach (array(0, 1) as $k) {
        str_arcfee($item, $k);
    }
    //得到arcfee,atmfee
}