示例#1
0
/**
 * 取得用户后台模型mid
 * return array
 */
function getuserspacemid()
{
    $cachefile = S_ROOT . './cache/model/model.cache.php';
    $cacheinfo = '';
    if (file_exists($cachefile)) {
        include_once $cachefile;
    }
    if (!empty($cacheinfo) && is_array($cacheinfo)) {
        return $cacheinfo;
    } else {
        include_once S_ROOT . './function/cache.func.php';
        return updateuserspacemid();
    }
}
示例#2
0
            }
            if (!empty($datas)) {
                $_SGLOBAL['db']->query("INSERT INTO " . tname('categories') . " (`name`, `type`) VALUES (" . implode('),(', $datas) . ")");
                $_SGLOBAL['db']->query("UPDATE " . tname('categories') . " SET subcatid=catid");
            }
        }
        //添加
        $sqlarr['nameid'] = $nameid;
        $sqlarr['type'] = user;
        inserttable('channels', saddslashes($sqlarr));
    } else {
        updatetable('channels', $sqlarr, array('nameid' => $nameid));
    }
    //更新缓存
    updatesettingcache();
    updateuserspacemid();
    showmessage('do_success', $theurl);
}
//GET METHOD
$addclass = $viewclass = '';
if (empty($_GET['op'])) {
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('channels') . " ORDER BY displayorder");
    while ($value = $_SGLOBAL['db']->fetch_array($query)) {
        if (empty($value['name'])) {
            $value['name'] = $lang[$value['nameid']];
        }
        $value['visit'] = $value['url'];
        if (empty($value['visit'])) {
            if ($value['type'] == 'user' && $value['upnameid'] != 'news') {
                $value['visit'] = geturl("action/channel/name/{$value['nameid']}");
            } elseif ($value['type'] == 'model') {