/app/index.php?,app/index.php · zjc/weiqing - Gitee.com

/**

* [WeEngine System] Copyright (c) 2014 WE7.CC

* WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.

*/

define('IN_MOBILE', true);

require '../framework/bootstrap.inc.php';

load()->app('common');

load()->app('template');

load()->model('app');

require IA_ROOT . '/app/common/bootstrap.app.inc.php';

$acl = array(

'home' => array(

'default' => 'home',

),

'mc' => array(

'default' => 'home'

)

);

if ($_W['setting']['copyright']['status'] == 1) {

$_W['siteclose'] = true;

message('抱歉,站点已关闭,关闭原因:' . $_W['setting']['copyright']['reason']);

}

$multiid = intval($_GPC['t']);

if(empty($multiid)) {

$multiid = intval($unisetting['default_site']);

unset($setting);

}

$multi = pdo_fetch("SELECT * FROM ".tablename('site_multi')." WHERE id=:id AND uniacid=:uniacid", array(':id' => $multiid, ':uniacid' => $_W['uniacid']));

$multi['site_info'] = @iunserializer($multi['site_info']);

$styleid = !empty($_GPC['s']) ? intval($_GPC['s']) : intval($multi['styleid']);

$style = pdo_fetch("SELECT * FROM ".tablename('site_styles')." WHERE id = :id", array(':id' => $styleid));

$templates = uni_templates();

$templateid = intval($style['templateid']);

$template = $templates[$templateid];

$_W['template'] = !empty($template) ? $template['name'] : 'default';

$_W['styles'] = array();

if(!empty($template) && !empty($style)) {

$sql = "SELECT `variable`, `content` FROM " . tablename('site_styles_vars') . " WHERE `uniacid`=:uniacid AND `styleid`=:styleid";

$params = array();

$params[':uniacid'] = $_W['uniacid'];

$params[':styleid'] = $styleid;

$stylevars = pdo_fetchall($sql, $params);

if(!empty($stylevars)) {

foreach($stylevars as $row) {

if (strexists($row['variable'], 'img')) {

$row['content'] = tomedia($row['content']);

}

$_W['styles'][$row['variable']] = $row['content'];

}

}

unset($stylevars, $row, $sql, $params);

}

$_W['page'] = array();

$_W['page']['title'] = $multi['title'];

if(is_array($multi['site_info'])) {

$_W['page'] = array_merge($_W['page'], $multi['site_info']);

}

unset($multi, $styleid, $style, $templateid, $template, $templates);

$controllers = array();

$handle = opendir(IA_ROOT . '/app/source/');

if(!empty($handle)) {

while($dir = readdir($handle)) {

if($dir != '.' && $dir != '..') {

$controllers[] = $dir;

}

}

}

if(!in_array($controller, $controllers)) {

$controller = 'home';

}

$init = IA_ROOT . "/app/source/{$controller}/__init.php";

if(is_file($init)) {

require $init;;

}

$actions = array();

$handle = opendir(IA_ROOT . '/app/source/' . $controller);

if(!empty($handle)) {

while($dir = readdir($handle)) {

if($dir != '.' && $dir != '..' && strexists($dir, '.ctrl.php')) {

$dir = str_replace('.ctrl.php', '', $dir);

$actions[] = $dir;

}

}

}

if(empty($actions)) {

$str = '';

if(uni_is_multi_acid()) {

$str = "&j={$_W['acid']}";

}

header("location: index.php?i={$_W['uniacid']}{$str}&c=home?refresh");

}

if(!in_array($action, $actions)) {

$action = $acl[$controller]['default'];

}

if(!in_array($action, $actions)) {

$action = $actions[0];

}

require _forward($controller, $action);

function _forward($c, $a) {

$file = IA_ROOT . '/app/source/' . $c . '/' . $a . '.ctrl.php';

return $file;

}

一键复制

编辑

Web IDE

原始数据

按行查看

历史

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值