예제 #1
0
 function init()
 {
     parent::init();
     $this->layout = '/layouts/user';
     $this->currentModule = 'user';
     if ($this->isMobile == 'yes') {
         $this->message(0, '感谢你的支持!本页面暂还在拼命制作中...');
     }
     $this->uid = zmf::filterInput($_GET['id']);
     if (!$this->uid) {
         $this->uid = zmf::uid();
     }
     if (!$this->uid) {
         $this->redirect(array('site/login'));
     }
     if ($this->uid == zmf::uid()) {
         $this->mySelf = 'yes';
     }
     if ($this->mySelf != 'yes') {
         if (zmf::uid()) {
             $_favorinfo = Favorites::checkFavored($this->uid, 'user');
             if ($_favorinfo) {
                 $this->favored = true;
             }
         }
     }
     $this->userInfo = Users::getUserInfo($this->uid);
     if ($this->userInfo['tagids'] != '') {
         $this->userTags = Tags::getByIds($this->userInfo['tagids']);
     }
     $this->pageTitle = $this->userInfo['truename'] . ' - ' . zmf::config('sitename');
     $this->pageDescription = $this->userInfo['truename'] . '的【' . zmf::config('sitename') . '】的个人主页,包括TA的原创文章、精美图片及各类悉心收藏,快来看看吧!';
 }
예제 #2
0
파일: Wedding.php 프로젝트: ph7pal/wedding
 public function init()
 {
     parent::init();
     if (zmf::config('closeSite')) {
         header("Content-type: text/html; charset=utf-8");
         exit(zmf::config('closeSiteReason'));
     }
     $this->layout = '//layouts/wedding';
     $this->currentModule = 'wedding';
     //        Yii::app()->theme = 'web';
     //        if (isset($_GET['lang']) && in_array($_GET['lang'], array('zh_cn', 'zh_tw', 'en'))) {
     //            Yii::app()->language = $_GET['lang'];
     //            zmf::delCookie('lang');
     //            zmf::setCookie('lang', $_GET['lang']);
     //        }
     //        $lang = zmf::getCookie('lang');
     //        if ($lang != '') {
     //            Yii::app()->language = $lang;
     //        } else {
     //            $countryCode = zmf::getCountryByIp();
     //            $countryCode = strtoupper($countryCode);
     //            if ($countryCode == 'CN') {
     //                Yii::app()->language = 'zh_cn';
     //            } elseif (in_array($countryCode, array('HK', 'MO', 'TW'))) {
     //                Yii::app()->language = 'zh_tw';
     //            } elseif ($countryCode == 'IANA') {
     //                Yii::app()->language = 'zh_cn';
     //            } else {
     //                Yii::app()->language = 'en';
     //            }
     //            zmf::setCookie('lang', Yii::app()->language);
     //        }
 }
예제 #3
0
파일: tracker.php 프로젝트: demental/m
 public function init($lang, $verbose = false)
 {
     parent::init($lang, $verbose);
     $file = T::getConfig('path') . $this->locale . "_usage.php";
     if (file_exists($file)) {
         $this->strings_usage = unserialize(file_get_contents($file));
     }
 }
예제 #4
0
파일: Q.php 프로젝트: ph7pal/mei
 function init()
 {
     parent::init();
     if (zmf::config('closeSite')) {
         header("Content-type: text/html; charset=utf-8");
         exit(zmf::config('closeSiteReason'));
     }
     $this->uid = zmf::uid();
     if (!Yii::app()->user->isGuest) {
         $uid = Yii::app()->user->id;
         $userInfo = Users::getUserInfo($uid);
         $this->truename = $userInfo['username'];
         $this->userInfo = $userInfo;
     }
     $this->pageTitle = zmf::config('sitename');
     self::_referer();
     $this->mobileTitle = zmf::config('sitename');
 }
예제 #5
0
파일: Q.php 프로젝트: ph7pal/naodong
 function init()
 {
     parent::init();
     if (zmf::config('closeSite')) {
         header("Content-type: text/html; charset=utf-8");
         exit(zmf::config('closeSiteReason'));
     }
     $this->uid = zmf::uid();
     if ($this->uid) {
         $uid = $this->uid;
         $userInfo = Users::getUserInfo($uid);
         $this->truename = $userInfo['truename'];
         $this->userInfo = $userInfo;
         $this->userCode = zmf::jiaMi('zmf#' . $this->uid);
     }
     $this->pageTitle = zmf::config('sitename');
     $this->mobileTitle = zmf::config('sitename');
     if ($this->isMobile == 'yes') {
         Yii::app()->theme = 'mobile';
     } else {
         Yii::app()->theme = 'naodong';
     }
     self::_referer();
 }
예제 #6
0
    $groupdata = DB::fetch_first("SELECT SUM(todayposts) AS todayposts, COUNT(fid) AS groupnum FROM " . DB::table('forum_forum') . " WHERE status='3' AND type='sub'");
    $groupindex['todayposts'] = $groupdata['todayposts'];
    $groupindex['groupnum'] = $groupdata['groupnum'];
    save_syscache('groupindex', $groupindex);
    DB::query("TRUNCATE " . DB::table('forum_groupfield'));
    $tpl = dir(DISCUZ_ROOT . './data/template');
    while ($entry = $tpl->read()) {
        if (preg_match("/\\.tpl\\.php\$/", $entry)) {
            @unlink(DISCUZ_ROOT . './data/template/' . $entry);
        }
    }
    $tpl->close();
    header('Location: tools.php?action=updatesuccess');
} else {
    $t = new T();
    $t->init();
    $config = $t->config;
    if ($action == 'index') {
        //首页
        show_header();
        print <<<END
\t\t<p>欢迎使用 Tools 之 Discuz! 急诊箱功能!我们致力于为您解决 Discuz! 站点的紧急故障,欢迎各位站长朋友们使用。</p>
\t\t<tr><td>
\t\t<h5>适用版本:</h5>
\t\t<ul>
\t\t\t<li>{$tools_discuz_version}</li>
\t\t</ul>
\t\t<h5>主要功能:</h5>
\t\t<ul>
\t\t\t<li>重置管理员账号:将把您指定的会员设置为管理员</li>
\t\t\t<li>开启关闭站点:  此处可以进行站点“关闭/打开”的操作</li>