public function _initialize() { /* # 验证是否开启 */ json_decode(json_encode(model('Xdata')->get('admin_Mobile:setting')), false)->switch or $this->error('手机版已经关闭无法访问', '3', U('public/Index/index')); // 登录验证 if (!$this->mid) { $publicAccess = (include APPS_PATH . '/w3g/Conf/access.inc.php'); $publicAccess = $publicAccess['access']; if (!($publicAccess[APP_NAME . '/' . MODULE_NAME . '/' . ACTION_NAME] === true || $publicAccess[APP_NAME . '/' . MODULE_NAME . '/*'] === true || $publicAccess[APP_NAME . '/*/*'] === true)) { redirect(U('w3g/Public/login')); exit; } } global $ts; // 站点名称 $this->_title = $ts['site']['site_name'] . ' 3G版'; $this->assign('site_name', $this->_title); // 分页 $_GET['page'] = $_POST['page'] ? intval($_POST['page']) : intval($_GET['page']); $this->_page = $_GET['page'] > 0 ? $_GET['page'] : 1; $this->assign('page', $this->_page); $this->_item_count = 10; $this->assign('item_count', $this->_item_count); // 来源类型 // if(is_iphone()){ // $this->_type_wap = 3; // }elseif(is_android()){ // $this->_type_wap = 2; // }else{ $this->_type_wap = 1; // } $this->_from_type = array('0' => '网站', '1' => '3G版', '2' => 'Android客户端', '3' => 'iPhone客户端'); $this->assign('from_type', $this->_from_type); // 关注状态 $this->_follow_status = array('eachfollow' => '相互关注', 'havefollow' => '已关注', 'unfollow' => '未关注'); $this->assign('follow_status', $this->_follow_status); // 当前URL $this->_self_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; if (isset($_POST['key'])) { $this->_self_url .= "&key={$_POST['key']}"; $this->_self_url .= isset($_POST['user']) ? '&user=1' : '&weibo=1'; } $this->assign('self_url', $this->_self_url); // 是否为owner $this->assign('is_owner', $this->uid == $this->mid ? '1' : '0'); $data['user_id'] = $this->uid; $data['page'] = $this->_page; // 用户资料 $this->profile = api('User')->data($data)->show(); $this->assign('profile', $this->profile); $logo = ''; if ($logo = model('Xdata')->get('admin_Mobile:w3gLogo')) { $logo = getAttachUrlByAttachId($logo['logo']); } $this->assign('logo', $logo); }
public function index() { $this->pageKeyList = array('id', 'img', 'url', 'ctime', 'DOACTION'); $this->pageTab[] = array('title' => '数据列表', 'tabHash' => 'index', 'url' => U('admin/SatPublic/index')); $this->pageButton[] = array('title' => '添加图片', 'onclick' => "javascript:location.href='" . U('admin/SatPublic/addImg', array('tabHash' => 'addImg')) . "'"); $list = M('sat_ad')->findPage(); foreach ($list['data'] as &$v) { $v['img'] = '<img width="150" height="150" src="' . getAttachUrlByAttachId($v['img']) . '" />'; $v['ctime'] = friendlyDate($v['ctime'], 'full'); $v['DOACTION'] = '<a href="' . U('admin/SatPublic/editImg', array('id' => $v['id'], 'tabHash' => 'editImg')) . '">编辑</a> ' . '<a href="javascript:admin.delsatimg(' . $v['id'] . ')">删除</a>'; } $this->assign('pageTitle', '铃铛广告'); $this->displayList($list); }
public function home() { // 登录验证 $passport = model('Passport'); //载入站点配置全局变量 // if($GLOBALS['ts']['site']['site_logo_w3g']==''){ // $w3gLogoUrl='img/logo.png'; // }else{ // $attach = model('Attach')->getAttachById($GLOBALS['ts']['site']['site_logo_w3g']); // $w3gLogoUrl = getImageUrl($attach['save_path'].$attach['save_name']); // } $logo = ''; if ($logo = model('Xdata')->get('admin_Mobile:w3gLogo')) { $logo = getAttachUrlByAttachId($logo['logo']); } $this->assign('logo', $logo); $this->assign('is_register_open', $this->isRegisterOpen() ? '1' : '0'); // # 幻灯 $list = D('w3g_slide_show')->field('`image`, `url`')->select(); $this->assign('slide', $list); $this->display(); }
</div> <div class="footer-wrap"> <div class="footer"> <div class="login-footer"> <div class="attend-official clearfix"> <dl> <dt> <div class="mb15">关注我们</div> <a href="<?php echo $GLOBALS["ts"]["site"]["sina_weibo_link"]; ?> " target="_blank" rel="nofollow me"><i class="ico-weibo"></i>加关注</a> <!--<a><i class="ico-weixin"></i>加关注</a>--> </dt> <dd><img src="<?php echo getAttachUrlByAttachId($GLOBALS['ts']['site']['site_qr_code']); ?> "></dd> </dl> </div> <?php if (!empty($site_bottom_nav) && $site_bottom_child_nav) { ?> <div class="foot clearfix right"> <?php if (is_array($site_bottom_nav)) { $i = 0; $__LIST__ = $site_bottom_nav; if (count($__LIST__) == 0) { echo ""; } else {
public function _initialize() { // 登录验证 $passport = model('Passport'); // if (ACTION_NAME != 'detail') { // if (! $passport->isLogged () && MODULE_NAME != 'Weixin') { // if ($_REQUEST ['openid']) { // $map ['openid'] = t ( $_REQUEST ['openid'] ); // session ( 'openid', $map ['openid'] ); // $user = M ( 'user' )->where ( $map )->find (); // if (! empty ( $user ['email'] )) { // $passport->loginLocal ( $user ['email'] ); // } else { // $url = GetCurUrl (); // session ( '__BACK_URL__', $url ); // redirect ( U ( 'w3g/Public/login' ) ); // } // } else { // redirect ( U ( 'w3g/Public/login' ) ); // } // } // } // 登录验证 if (!$this->mid) { $publicAccess = (include APPS_PATH . '/w3g/Conf/access.inc.php'); $publicAccess = $publicAccess['access']; if (!($publicAccess[APP_NAME . '/' . MODULE_NAME . '/' . ACTION_NAME] === true || $publicAccess[APP_NAME . '/' . MODULE_NAME . '/*'] === true || $publicAccess[APP_NAME . '/*/*'] === true)) { redirect(U('w3g/Public/login')); exit; } } global $ts; // 站点名称 $this->_title = $ts['site']['site_name'] . ' 3G版'; $this->assign('site_name', $this->_title); // 分页 $_GET['page'] = $_POST['page'] ? intval($_POST['page']) : intval($_GET['page']); $this->_page = $_GET['page'] > 0 ? $_GET['page'] : 1; $this->assign('page', $this->_page); $this->_item_count = 10; $this->assign('item_count', $this->_item_count); // 来源类型 // if(is_iphone()){ // $this->_type_wap = 3; // }elseif(is_android()){ // $this->_type_wap = 2; // }else{ $this->_type_wap = 1; // } $this->_from_type = array('0' => '网站', '1' => '3G版', '2' => 'Android客户端', '3' => 'iPhone客户端'); $this->assign('from_type', $this->_from_type); // 关注状态 $this->_follow_status = array('eachfollow' => '相互关注', 'havefollow' => '已关注', 'unfollow' => '未关注'); $this->assign('follow_status', $this->_follow_status); // 当前URL $this->_self_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; if (isset($_POST['key'])) { $this->_self_url .= "&key={$_POST['key']}"; $this->_self_url .= isset($_POST['user']) ? '&user=1' : '&weibo=1'; } $this->assign('self_url', $this->_self_url); // 是否为owner $this->assign('is_owner', $this->uid == $this->mid ? '1' : '0'); $data['user_id'] = $this->uid; $data['page'] = $this->_page; // 用户资料 $this->profile = api('User')->data($data)->show(); $this->assign('profile', $this->profile); $logo = ''; if ($logo = model('Xdata')->get('admin_Mobile:w3gLogo')) { $logo = getAttachUrlByAttachId($logo['logo']); } $this->assign('logo', $logo); return; }