/** * 架构函数,处理核心变量 * 使用字符串返回 不能有任何输出 */ public function __construct() { //当前登录者uid $GLOBALS['ts']['mid'] = $this->mid = intval($_SESSION['mid']); //当前访问对象的uid $GLOBALS['ts']['uid'] = $this->uid = intval($_REQUEST['uid'] == 0 ? $this->mid : $_REQUEST['uid']); // 赋值当前访问者用户 $GLOBALS['ts']['user'] = $this->user = model('User')->getUserInfo($this->mid); if ($this->mid != $this->uid) { $GLOBALS['ts']['_user'] = model('User')->getUserInfo($this->uid); } else { $GLOBALS['ts']['_user'] = $GLOBALS['ts']['user']; } //当前用户的所有已添加的应用 $GLOBALS['ts']['_userApp'] = $userApp = model('UserApp')->getUserApp($this->uid); //当前用户的统计数据 $GLOBALS['ts']['_userData'] = $userData = model('UserData')->getUserData($this->uid); $this->site = D('Xdata')->get('admin_Config:site'); $this->site['logo'] = getSiteLogo($this->site['site_logo']); $GLOBALS['ts']['site'] = $this->site; //语言包判断 if (TRUE_APPNAME != 'public' && APP_NAME != TRUE_APPNAME) { addLang(TRUE_APPNAME); } Addons::hook('core_filter_init_widget'); }
/** * 站点信息初始化 * @access private * @return void */ private function initSite() { //载入站点配置全局变量 $this->site = model('Xdata')->get('admin_Config:site'); if ($this->site['site_closed'] == 0 && APP_NAME != 'admin') { //TODO 跳转到站点关闭页面 $this->page404($this->site['site_closed_reason']); exit; } //检查是否启用rewrite if (isset($this->site['site_rewrite_on'])) { C('URL_ROUTER_ON', $this->site['site_rewrite_on'] == 1); } //初始化语言包 $cacheFile = C('F_CACHE_PATH') . '/initSiteLang.lock.php'; if (!file_exists($cacheFile)) { model('Lang')->initSiteLang(); } //LOGO处理 $this->site['logo'] = getSiteLogo($this->site['site_logo']); //默认登录后首页 if (intval($this->site['home_page'])) { $appInfo = model('App')->where('app_id=' . intval($this->site['home_page']))->find(); $this->site['home_url'] = U($appInfo['app_name'] . '/' . $appInfo['app_entry']); } else { $this->site['home_url'] = U('public/Index/index'); } //赋值给全局变量 $GLOBALS['ts']['site'] = $this->site; //网站导航 $GLOBALS['ts']['site_top_nav'] = model('Navi')->getTopNav(); $GLOBALS['ts']['site_bottom_nav'] = model('Navi')->getBottomNav(); $GLOBALS['ts']['site_bottom_child_nav'] = model('Navi')->getBottomChildNav($GLOBALS['ts']['site_bottom_nav']); if (!$this->mid) { //游客导航 $GLOBALS['ts']['site_guest_nav'] = model('Navi')->getGuestNav(); $this->assign('site_guest_nav', $GLOBALS['ts']['site_guest_nav']); } //获取可搜索的内容列表 if (false === ($searchSelect = S('SearchSelect'))) { $searchSelect = D('SearchSelect')->findAll(); S('SearchSelect', $searchSelect); } //网站所有的应用 $GLOBALS['ts']['site_nav_apps'] = model('App')->getAppList(array('status' => 1, 'add_front_top' => 1), 9); //网站全局变量过滤插件 Addons::hook('core_filter_init_site'); $this->assign('site', $this->site); $this->assign('site_top_nav', $GLOBALS['ts']['site_top_nav']); $this->assign('site_bottom_nav', $GLOBALS['ts']['site_bottom_nav']); $this->assign('site_bottom_child_nav', $GLOBALS['ts']['site_bottom_child_nav']); $this->assign('site_nav_apps', $GLOBALS['ts']['site_nav_apps']); $this->assign('menuList', $searchSelect); return true; }
public function core_display_tpl($param) { if (!$this->checkPage()) { return; } $templateFile = dirname(dirname(__FILE__)) . '/html/login.html'; // 获取配置 $registerConf = model('Xdata')->get('admin_Config:register'); $siteConf = model('Xdata')->get('admin_Config:site'); $param['vars'] = $this->login_vars($param['vars']); $param['vars']['register_type'] = $registerConf['register_type']; $param['vars']['site_slogan'] = $siteConf['site_slogan']; $param['vars']['site_name'] = $siteConf['site_name']; $param['vars']['site_logo'] = getSiteLogo($siteConf['site_logo']); //seo $seo = model('Xdata')->get("admin_Config:seo_login"); $param['vars']['_title'] = !empty($seo['title']) ? $seo['title'] : $siteConf['site_slogan']; $param['vars']['_keywords'] = !empty($seo['keywords']) ? $seo['keywords'] : $siteConf['site_header_keywords']; $param['vars']['_description'] = !empty($seo['des']) ? $seo['des'] : $siteConf['site_header_description']; echo fetch($templateFile, $param['vars'], $param['charset'], $param['contentType']); exit; }
public function core_display_tpl() { if (!$this->checkAvailability()) { return; } $config = $config ? $config : model('AddonData')->lget('beautifyLogin'); if (!$config['template']) { $config['template'] = 1; } if (!$config['color']) { $config['color'] = "FFFFFF"; } switch ($config['template']) { case 1: // By Zue $templateFile = dirname(dirname(__FILE__)) . '/html/zue/login.html'; break; case 2: // By Cali $templateFile = dirname(dirname(__FILE__)) . '/html/cali/login.html'; break; } $siteConf = model('Xdata')->get('admin_Config:site'); $config['login_bg'] = getImageUrlByAttachId($siteConf['login_bg']); $config['_title'] = $siteConf['site_slogan']; $config['_keywords'] = $siteConf['site_header_keywords']; $config['_description'] = $siteConf['site_header_description']; $config['site']['site_slogan'] = $siteConf['site_slogan']; $config['site']['site_name'] = $siteConf['site_name']; $config['site']['logo'] = getSiteLogo($siteConf['site_logo']); $config['site']['sys_version'] = $siteConf['sys_version']; // 获取当前Js语言包 $this->langJsList = setLangJavsScript(); $config['langJsList'] = $this->langJsList; echo fetch($templateFile, $config, $param['charset'], $param['contentType']); exit; }
/** * 站点信息初始化 */ private function initSite() { //初始化语言包 $cacheFile = DATA_PATH . '/lang/_initSiteLang.lock'; if (!file_exists($cacheFile)) { model('Lang')->initSiteLang(); } $GLOBALS['time_run_detail']['action_init_site_start'] = microtime(true); //载入网站全局配置 $this->site = F('global_site_config'); if ($this->site === false) { //载入站点配置全局变量 $this->site = model('Xdata')->get('admin_Config:site'); $GLOBALS['time_run_detail']['action_init_site_siteconfig'] = microtime(true); $GLOBALS['time_run_detail']['action_init_site_language'] = microtime(true); //LOGO处理 $this->site['logo'] = getSiteLogo($this->site['site_logo']); $GLOBALS['time_run_detail']['action_init_site_logo'] = microtime(true); //默认登录后首页 if (intval($this->site['home_page'])) { $appInfo = model('App')->where('app_id=' . intval($this->site['home_page']))->find(); $this->site['home_url'] = U($appInfo['app_name'] . '/' . $appInfo['app_entry']); } else { $this->site['home_url'] = U('public/Index/index'); } $GLOBALS['time_run_detail']['action_init_site_homepage'] = microtime(true); //网站导航 $this->site['site_top_nav'] = model('Navi')->getTopNav(); $this->site['site_bottom_nav'] = model('Navi')->getBottomNav(); $this->site['site_bottom_child_nav'] = model('Navi')->getBottomChildNav($GLOBALS['ts']['site_bottom_nav']); if (!$this->mid) { //游客导航 $this->site['site_guest_nav'] = model('Navi')->getGuestNav(); } $GLOBALS['time_run_detail']['action_init_site_language'] = microtime(true); //获取可搜索的内容列表 $this->site['search_menu_list'] = D('SearchSelect')->findAll(); $GLOBALS['time_run_detail']['action_init_site_search'] = microtime(true); //网站所有的应用 $this->site['site_nav_apps'] = model('App')->getAppList(array('status' => 1, 'add_front_top' => 1), 9); $GLOBALS['time_run_detail']['action_init_site_applist'] = microtime(true); //获取当前Js语言包 $this->site['langJsList'] = setLangJavsScript(); //分享字数 $this->site['initNums'] = model('Xdata')->getConfig('weibo_nums', 'feed'); //赋值给全局变量 F('global_site_config', $this->site); } //检查站点是否关闭 if ($this->site['site_closed'] == 0 && APP_NAME != 'admin') { $this->page404($this->site['site_closed_reason']); exit; } // 检查网页端是否关闭 if ($this->site['web_closed'] == 0 && APP_NAME != 'admin' && APP_NAME != 'w3g' && IS_GET) { $this->page404('网页版已经关闭'); exit; } $GLOBALS['time_run_detail']['action_init_site_closed'] = microtime(true); //检查是否启用IP控制 // if (!isIpAccess('ipaccess') && APP_NAME !='admin') { // $this->site['site_closed'] = 0; // $this->page404('你的IP地址已被禁止'); exit(); // } // $GLOBALS['time_run_detail']['action_init_site_ipaccess'] = microtime(true); //检查是否启用rewrite if (isset($this->site['site_rewrite_on'])) { C('URL_ROUTER_ON', $this->site['site_rewrite_on'] == 1); } $GLOBALS['time_run_detail']['action_init_site_rewrite'] = microtime(true); $this->langJsList = $this->site['langJsList']; $this->site['sys_version'] = C('VERSION'); $GLOBALS['ts']['site'] = $this->site; //网站全局变量过滤插件 Addons::hook('core_filter_init_site'); $this->assign('site', $this->site); $this->assign('site_top_nav', $this->site['site_top_nav']); $this->assign('site_bottom_nav', $this->site['site_bottom_nav']); $this->assign('site_bottom_child_nav', $this->site['site_bottom_child_nav']); $this->assign('site_guest_nav', $this->site['site_guest_nav']); $this->assign('site_nav_apps', $this->site['site_nav_apps']); $this->assign('menuList', $this->site['search_menu_list']); $this->assign('initNums', $this->site['initNums']); $GLOBALS['time_run_detail']['action_init_site_end'] = microtime(true); return true; }
public function core_display_tpl() { if (!$this->checkPage()) { return; } $this->mid = $GLOBALS['ts']['mid']; $this->uid = $this->getUserUid(); $user_info = model('User')->getUserInfo($this->uid); // 添加积分 model('Credit')->setUserCredit($this->uid, 'space_access'); // 获取头部相关信息 $data = $this->_top(); // 获取用户_tab_menu信息 $data['appArr'] = $this->_tab_menu(); // 用户uid $data['uid'] = $this->uid; // 用户信息 $data['user_info'][$this->uid] = $user_info; $data['initNums'] = model('Xdata')->getConfig('weibo_nums', 'feed'); // 用户为空,则跳转用户不存在 if (empty($user_info)) { $this->error(L('PUBLIC_USER_NOEXIST')); } // 判断隐私设置 $userPrivacy = $this->privacy($this->uid); if ($userPrivacy['space'] !== 1) { // 右边栏信息_sidebar $data['sidebar'] = $this->_sidebar(); // 加载微博筛选信息 $d['feed_type'] = t($_REQUEST['feed_type']) ? t($_REQUEST['feed_type']) : ''; $d['feed_key'] = t($_REQUEST['feed_key']) ? t($_REQUEST['feed_key']) : ''; $data['feed_type'] = $d['feed_type']; $data['feed_key'] = $d['feed_key']; } else { $data['sidebar']['user_info'] = $this->_assignUserInfo($this->uid); } $data['userPrivacy'] = $userPrivacy; $data['mid'] = $this->mid; $data['user'] = model('User')->getUserInfo($this->mid); $data['site_top_nav'] = model('Navi')->getTopNav(); $data['site_nav_apps'] = $GLOBALS['ts']['site_nav_apps']; $data['site_bottom_nav'] = model('Navi')->getBottomNav(); $data['site_bottom_child_nav'] = model('Navi')->getBottomChildNav($GLOBALS['ts']['site_bottom_nav']); // seo $siteConf = model('Xdata')->get('admin_Config:site'); $seo = model('Xdata')->get("admin_Config:seo_user_profile"); $replace['uname'] = $user_info['uname']; if ($feed_id = model('Feed')->where('uid=' . $this->uid)->order('publish_time desc')->limit(1)->getField('feed_id')) { $replace['lastFeed'] = D('feed_data')->where('feed_id=' . $feed_id)->getField('feed_content'); } $replaces = array_keys($replace); foreach ($replaces as &$v) { $v = "{" . $v . "}"; } $seo['title'] = str_replace($replaces, $replace, $seo['title']); $seo['keywords'] = str_replace($replaces, $replace, $seo['keywords']); $seo['des'] = str_replace($replaces, $replace, $seo['des']); $data['_title'] = !empty($seo['title']) ? $seo['title'] : $siteConf['site_slogan']; $data['_keywords'] = !empty($seo['keywords']) ? $seo['keywords'] : $siteConf['site_header_keywords']; $data['_description'] = !empty($seo['des']) ? $seo['des'] : $siteConf['site_header_description']; $data['site']['site_slogan'] = $siteConf['site_slogan']; $data['site']['site_name'] = $siteConf['site_name']; $data['site']['logo'] = getSiteLogo($siteConf['site_logo']); $data['site']['sys_version'] = $siteConf['sys_version']; // 获取当前Js语言包 $this->langJsList = setLangJavsScript(); $data['langJsList'] = $this->langJsList; // 显示模板 if (ACTION_NAME == 'index') { $templateFile = dirname(dirname(__FILE__)) . '/html/index.html'; } else { if (ACTION_NAME == 'follower') { $data['follower_list'] = $this->follower(); $data['_title'] = $data['follower_list']['user_info'][$this->uid]['uname'] . '的粉丝'; $data['_keywords'] = $data['follower_list']['user_info'][$this->uid]['uname'] . '的粉丝'; $templateFile = dirname(dirname(__FILE__)) . '/html/follower.html'; } else { if (ACTION_NAME == 'following') { $data['following_list'] = $this->following(); $data['_title'] = $data['following_list']['user_info'][$this->uid]['uname'] . '的关注'; $data['_keywords'] = $data['following_list']['user_info'][$this->uid]['uname'] . '的关注'; $templateFile = dirname(dirname(__FILE__)) . '/html/following.html'; } else { if (ACTION_NAME == 'appList') { $data['appList'] = $this->appList(); $data['_title'] = $data['user_info'][$this->uid]['uname'] . '的' . $data['appArr'][$data['appList']['type']]; $data['_keywords'] = $data['user_info'][$this->uid]['uname'] . '的' . $data['appArr'][$data['appList']['type']]; $templateFile = dirname(dirname(__FILE__)) . '/html/appList.html'; } else { if (ACTION_NAME == 'feed') { $data['feed'] = $this->feed(); $data['_title'] = $data['user_info'][$this->uid]['uname'] . '的微博'; $data['_keywords'] = $data['user_info'][$this->uid]['uname'] . '的微博'; $templateFile = dirname(dirname(__FILE__)) . '/html/feed.html'; } else { $data['data'] = $this->data(); $data['_title'] = $data['user_info'][$this->uid]['uname'] . '的资料'; $data['_keywords'] = $data['user_info'][$this->uid]['uname'] . '的资料'; $templateFile = dirname(dirname(__FILE__)) . '/html/data.html'; } } } } } echo fetch($templateFile, $data, $param['charset'], $param['contentType']); exit; }
* are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign * Patents, patents in process, and are protected by trade secret or copyright law. * * Dissemination of this information or reproduction of this material is strictly forbidden * unless prior written permission is obtained from SocialApparatus. * * Contact Shane Barron admin@socia.us for more information. */ namespace SocialApparatus; denyDirect(); $attributes = getAttributes("navbar"); if (!$attributes) { $attributes = "class='navbar navbar-default navbar-fixed-top' role='navigation'"; } $logo = getSiteLogo(); echo display("navigation:before"); $scope = getScope(); if ($scope == "web") { ?> <nav <?php echo $attributes; ?> > <div class="container"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span>
<?php /* * *********************************************************************** * * SocialApparatus CONFIDENTIAL * __________________ * * [2002] - [2017] SocialApparatus (http://SocialApparatus.co) * All Rights Reserved. * * NOTICE: All information contained herein is, and remains the property of SocialApparatus * and its suppliers, if any. The intellectual and technical concepts contained herein * are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign * Patents, patents in process, and are protected by trade secret or copyright law. * * Dissemination of this information or reproduction of this material is strictly forbidden * unless prior written permission is obtained from SocialApparatus. * * Contact Shane Barron admin@socia.us for more information. */ namespace SocialApparatus; denyDirect(); echo display("page_elements/page_header", array("text" => "Site Logo")); echo getSiteLogo(); echo "<p class='lead'>Upload a new logo, or leave blank to keep existing.</p>"; echo "<p>Ideal size is 150px x 72px.</p>"; echo drawForm(array("name" => "upload_logo", "method" => "post", "action" => "UploadLogo", "enctype" => "multipart/form-data"));