本文整理汇总了PHP中zmf::config方法的典型用法代码示例。如果您正苦于以下问题:PHP zmf::config方法的具体用法?PHP zmf::config怎么用?PHP zmf::config使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类zmf
的用法示例。
在下文中一共展示了zmf::config方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
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);
// }
}
示例2: init
public function init()
{
parent::init();
$passwdErrorTimes = zmf::getCookie('checkWithCaptcha');
$time = zmf::config('adminErrorTimes');
if ($time > 0) {
if ($passwdErrorTimes >= $time) {
header('Content-Type: text/html; charset=utf-8');
echo '您暂时已被禁止访问';
Yii::app()->end();
}
}
$uid = zmf::uid();
if ($uid) {
// $randKey_cookie = zmf::getCookie('adminRandKey' . $uid);
// $randKey_cache = zmf::getFCache('adminRandKey' . $uid);
// if (!$randKey_cookie || ($randKey_cache != $randKey_cookie)) {
// Yii::app()->user->logout();
// $this->message(0, '登录已过期,请重新登录', Yii::app()->createUrl('admin/site/login'));
// }
$this->userInfo = Users::getOne($uid);
$this->uid = $uid;
} else {
$currentUrl = Yii::app()->request->url;
if (strpos($currentUrl, '/site/') === false) {
$this->message(0, '请先登录', Yii::app()->createUrl('/site/login'));
}
}
}
示例3: loadCssJs
public function loadCssJs($type = 'web')
{
$_staticUrl = zmf::config('cssJsStaticUrl');
$staticUrl = $_staticUrl ? $_staticUrl : zmf::config('baseurl');
$cs = Yii::app()->clientScript;
if ($type == 'wedding') {
$cs->registerCssFile($staticUrl . 'common/css/bootstrap.min.css');
$cs->registerCssFile($staticUrl . 'common/css/font-awesome.min.css');
$cs->registerCssFile($staticUrl . 'common/css/wedding.css');
$cs->registerCoreScript('jquery');
$cs->registerScriptFile($staticUrl . "common/js/bootstrap.min.js", CClientScript::POS_END);
$cs->registerScriptFile($staticUrl . "common/js/wedding.js", CClientScript::POS_END);
} elseif ($type == 'user') {
$cs->registerCssFile($staticUrl . 'common/css/bootstrap.min.css');
$cs->registerCssFile($staticUrl . 'common/css/font-awesome.min.css');
$cs->registerCssFile($staticUrl . 'common/css/user.css');
$cs->registerCoreScript('jquery');
$cs->registerScriptFile($staticUrl . "common/js/bootstrap.min.js", CClientScript::POS_END);
$cs->registerScriptFile($staticUrl . "common/js/wedding.js", CClientScript::POS_END);
} elseif ($type == 'group') {
$cs->registerCssFile($staticUrl . 'common/css/bootstrap.min.css');
$cs->registerCssFile($staticUrl . 'common/css/font-awesome.min.css');
$cs->registerCssFile($staticUrl . 'common/css/group.css');
$cs->registerCoreScript('jquery');
$cs->registerScriptFile($staticUrl . "common/js/bootstrap.min.js", CClientScript::POS_END);
$cs->registerScriptFile($staticUrl . "common/js/wedding.js", CClientScript::POS_END);
}
}
示例4: init
public function init()
{
if (!zmf::uid()) {
$this->redirect(zmf::config('baseurl'));
}
Users::checkPower('admin');
Yii::app()->language = 'zh_cn';
}
示例5: init
public function init()
{
if (zmf::config('mobile')) {
if (tools::checkmobile($this->platform)) {
Yii::app()->theme = 'mobile';
$this->isMobile = 'yes';
}
}
}
示例6: actionNotice
public function actionNotice()
{
$sql = "SELECT * FROM {{notification}} WHERE uid='{$this->uid}' ORDER BY cTime DESC";
Posts::getAll(array('sql' => $sql), $pages, $comLists);
Notification::model()->updateAll(array('new' => 0), 'uid=:uid', array(':uid' => $this->uid));
$data = array('posts' => $comLists, 'pages' => $pages);
$this->pageTitle = $this->userInfo['truename'] . '的提醒 - ' . zmf::config('sitename');
$this->render('notice', $data);
}
示例7: getTops
public static function getTops()
{
$keys = zmf::config('hotsearchs');
if ($keys) {
$arr = explode('#', $keys);
return $arr;
} else {
return false;
}
}
示例8: checkWeixin
public static function checkWeixin()
{
$wxId = zmf::config('weixin_app_id');
$wxSecret = zmf::config('weixin_app_key');
$callback = zmf::config('weixin_app_callback');
if (!$wxId || !$wxSecret || !$callback) {
return false;
}
return TRUE;
}
示例9: init
public function init()
{
//zh_tw\en_us
Yii::app()->language = 'zh_cn';
if (zmf::config('mobile')) {
if (tools::checkmobile($this->platform)) {
$this->isMobile = 'yes';
}
}
}
示例10: init
public function init()
{
parent::init();
$this->WB_AKEY = zmf::config('weibo_app_id');
$this->WB_SKEY = zmf::config('weibo_app_key');
$this->WB_CALLBACK_URL = zmf::config('weibo_app_callback');
if (!$this->WB_AKEY || !$this->WB_SKEY || !$this->WB_CALLBACK_URL) {
throw new CHttpException(403, '暂未开放');
}
$this->weiboService = new SinaWeibo($this->WB_AKEY, $this->WB_SKEY);
}
示例11: loadCssJs
public function loadCssJs($type = 'web', $action = '')
{
if (YII_DEBUG) {
$staticUrl = Yii::app()->baseUrl . '/';
} else {
$_staticUrl = zmf::config('cssJsStaticUrl');
$staticUrl = $_staticUrl ? $_staticUrl : zmf::config('baseurl');
}
$cs = Yii::app()->clientScript;
$c = Yii::app()->getController()->id;
$a = Yii::app()->getController()->getAction()->id;
$cssDir = Yii::app()->basePath . '/../common/css';
$jsDir = Yii::app()->basePath . '/../common/js';
$cssArr = array();
$jsArr = array();
if ($type == 'web') {
$cssArr = array('bootstrap', 'font-awesome', 'zmf');
$jsArr = array('bootstrap', 'zmf');
$cs->registerCoreScript('jquery');
} elseif ($type == 'mobile') {
$cssArr = array('frozen', 'font-awesome');
$jsArr = array('zepto', 'frozen');
$cssArr[] = 'mobile';
$jsArr[] = 'mobile';
} elseif ($type == 'admin') {
$cssArr = array('frozen');
$jsArr = array('zepto', 'frozen');
$cssArr[] = 'mobile';
$jsArr[] = 'mobile';
}
$cssDirArr = zmf::readDir($cssDir, false);
$jsDirArr = zmf::readDir($jsDir, false);
foreach ($cssArr as $cssFileName) {
foreach ($cssDirArr as $cssfile) {
if (strpos($cssfile, $type . '-' . $cssFileName) !== false) {
$cs->registerCssFile($staticUrl . 'common/css/' . $cssfile);
}
}
}
foreach ($jsArr as $jsFileName) {
foreach ($jsDirArr as $jsfile) {
if (strpos($jsfile, $type . '-' . $jsFileName) !== false) {
if (strpos($jsfile, 'head') !== false) {
$pos = CClientScript::POS_HEAD;
} else {
$pos = CClientScript::POS_END;
}
$cs->registerScriptFile($staticUrl . 'common/js/' . $jsfile, $pos);
}
}
}
}
示例12: actionView
public function actionView($code)
{
$code = zmf::filterInput($code, 't', 1);
$info = SiteInfo::model()->find('code=:code', array(':code' => $code));
if (!$info) {
throw new CHttpException(404, '您所查看的页面不存在');
}
$allInfos = SiteInfo::model()->findAll(array('select' => 'code,title', 'condition' => 'status=' . Posts::STATUS_PASSED));
//更新访问统计
Posts::updateCount($info['id'], 'SiteInfo');
$data = array('info' => $info, 'allInfos' => $allInfos, 'code' => $code);
$this->pageTitle = $info['title'] . ' - ' . zmf::config('sitename');
$this->render('/site/siteinfo', $data);
}
示例13: actionIndex
public function actionIndex()
{
$areas = Area::getTops();
$flashArr = Ads::getAllByPo('twindex', 'flash', '', 5);
if (!empty($flashArr)) {
foreach ($flashArr as $k => $val) {
$_imgurl = zmf::uploadDirs($val['cTime'], 'site', $val['classify'], 600) . $val['filePath'];
$flashArr[$k]['imgurl'] = $_imgurl;
}
}
$this->pageTitle = zmf::config('sitename');
$data = array('areas' => $areas, 'flashs' => $flashArr, 'posts' => $posts);
$this->render('/index/index', $data);
}
示例14: actionMap
public function actionMap()
{
$this->layout = 'common';
$sql = "SELECT id,title,lat,`long`,comments,favorite,cTime FROM {{posts}} WHERE lat!='' AND `long`!='' AND `status`=1 ORDER BY cTime ASC";
Posts::getAll(array('sql' => $sql, 'pageSize' => 100), $pages, $posts);
foreach ($posts as $k => $val) {
$posts[$k]['href'] = Yii::app()->createUrl('posts/view', array('id' => $val['id']));
$posts[$k]['cTime'] = zmf::formatTime($val['cTime']);
}
$posts = !empty($posts) ? $posts : array();
$data = array('postJson' => CJSON::encode($posts), 'loadMap' => empty($posts) ? false : true);
$this->pageTitle = '足迹 - ' . zmf::config('sitename');
$this->selectNav = 'map';
$this->render('/index/map', $data);
}
示例15: init
function init()
{
parent::init();
Yii::app()->theme = 'web';
if (zmf::config('mobile')) {
if (zmf::checkmobile($this->platform)) {
Yii::app()->theme = 'mobile';
$this->isMobile = true;
}
}
$uid = zmf::uid();
if ($uid) {
$this->uid = $uid;
$this->userInfo = Users::getOne($uid);
}
self::_referer();
}