public function _initialize() { if (SERVER_ENVIRONMENT == 'LOCAL_HOST') { session('openid', 'oZcK7wtW4NB-hr5I1_XKKfoC6zV8'); //测试openid } if (ACTION_NAME != 'notifyurl') { //支付通知--过滤掉 if (!session('openid')) { $this->_session_openid(); } } $weobj = wechatInstance(); $signature = $weobj->getJsSign(currentUrl(), time(), md5(rand(1, 9999)), C('WECHAT_APPID')); $signature['jsApiList'] = ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone']; $this->assign('signature', str_replace("\\/", "/", json_encode($signature))); $sharetitle = getSysConfig('share-title'); $sharedesc = getSysConfig('share-desc'); $shareimgUrl = getSysConfig('share-imgUrl'); $sharelink = getSysConfig('share-link'); $this->assign('sharetitle', $sharetitle); $this->assign('sharedesc', $sharedesc); $this->assign('shareimgUrl', $shareimgUrl); $this->assign('inviteurl', domainurl() . UC($sharelink, array('invate' => getOpenid()))); }
public function indexAct() { $weobj = wechatInstance(); $userinfo = \Wechat\Logic\UserLogic::getUserinfo(getOpenid()); $this->assign('userinfo', $userinfo); $this->assign('invitetext', getSysConfig('recommend-text')); $this->assign('activity_text', getSysConfig('share-info')); $this->display(); }
function loadXML() { global $opt; @mkdir($opt['rootpath'] . 'cache2/geokrety'); $path = $opt['rootpath'] . 'cache2/geokrety/import.xml'; $this->removeXML($path); $modifiedsince = strtotime(getSysConfig('geokrety_lastupdate', '2005-01-01 00:00:00')); if (!@copy('http://geokrety.org/export.php?modifiedsince=' . date('YmdHis', $modifiedsince - 1), $path)) { return false; } return $path; }
function loadXML() { global $opt; @mkdir($opt['rootpath'] . 'cache2/geokrety'); $path = $opt['rootpath'] . 'cache2/geokrety/import-' . date('Ymd-His') . '.xml'; // Changed default-value for getSysConfig() from '2005-01-01 00:00:00' to 'NOW - 9d 12h' // to safely stay in api-limit, even when client and server are in different time zones. $modifiedsince = strtotime(getSysConfig('geokrety_lastupdate', date($opt['db']['dateformat'], time() - 60 * 60 * 24 * 9.5))); if (!@copy('http://geokrety.org/export.php?modifiedsince=' . date('YmdHis', $modifiedsince - 1), $path)) { return false; } return $path; }
/** * 列表 */ public function tickeListAct() { slog("test"); $areainfo = R('Api/areainfo'); foreach ($areainfo['data'] as $k => $v) { //如果是成都地区,过滤佛山的场馆 if (DISTRICT_SERVER == 'CHENGDU' && $v['id'] == 3) { continue; } $venuesinfo = R('Api/venuesinfo', array($v['id'])); foreach ($venuesinfo['data'] as $k1 => $v1) { $areaName[$v1['id']]['id'] = $v1['id']; $areaName[$v1['id']]['name'] = $v['name'] . $v1['name']; } } $this->assign('activity_text', getSysConfig('activity-text')); $this->assign('isHasCoupon', \Wechat\Logic\CouponLogic::isHasCoupon(getOpenid())); $this->assign('venuesinfo', $areaName); $this->display(); }
public function receiveAct() { $activity_id = I('get.id'); $nowtime = time(); $couponlist = D('activity_coupon')->where("activity_id={$activity_id} and stime<{$nowtime} and etime>{$nowtime}")->select(); foreach ($couponlist as $coupon) { $isexist = D('user_activitycoupon')->where(array('open_id' => getOpenid(), 'activitycoupon_id' => $coupon['id']))->find(); if ($isexist) { continue; } $info['open_id'] = getOpenid(); $info['activitycoupon_id'] = $coupon['id']; $info['ctime'] = $nowtime; $info['status'] = 0; D('user_activitycoupon')->add($info); //小提示 \Wechat\Logic\CouponLogic::ticketTip(getOpenid()); } //设置提示 \Wechat\Logic\PushLogic::pushTextMsg(getOpenid(), getSysConfig('coupon-text')); redirect(UC('/Wechat/Coupon/index'), 0, '页面跳转中...'); }
public function reciveCouponAct() { $openid = getOpenid(); $invate = I('get.invate'); $userinfo = \Wechat\Logic\UserLogic::getUserinfo($openid); $this->assign('userinfo', $userinfo); //先领分享优惠券,然后判断是否已经领取了新人优惠券 \Wechat\Logic\CouponLogic::receviceShareCoupon($openid, $invate); $receviCount = \Wechat\Logic\CouponLogic::countCoupon($openid, NewerCouponID); if ($receviCount > 0) { redirect('/Wechat/Coupon/index', 0, '页面跳转中...'); return; } //再领新人优惠券 if (IS_POST) { $phone = I('post.phone'); if (preg_match("/1[3458]{1}\\d{9}\$/", $phone)) { if ($openid == $invate) { $this->assign("msg", "本人不可领取"); } else { \Wechat\Logic\UserLogic::updateByOpenid($openid, array('phone' => $phone, 'inviter' => $invate)); //赠送优惠券 \Wechat\Logic\CouponLogic::giveCoupon($openid, NewerCouponID); //给本人 \Wechat\Logic\CouponLogic::giveCoupon($invate, InviteCouponID1); //给推荐者 $username = D('User')->where(array('open_id' => $openid))->getField('nickname'); $invatename = D('User')->where(array('open_id' => $invate))->getField('nickname'); \Wechat\Logic\PushLogic::pushTextMsg($invate, "非常感谢您的分享,您的好友@" . $username . "成功领取了一张魔乐城优惠劵。"); \Wechat\Logic\PushLogic::pushTextMsg($openid, getSysConfig('coupon-text')); redirect('/Wechat/Coupon/index', 0, '页面跳转中...'); return; } } else { $this->assign("msg", "手机号码填写不正确"); } } $this->display(); }
function importxmlfile($file) { echo 'Importing file ' . $file . "\n"; $xmlReader = new xmlReader(); $xmlReader->open($file); $xmlReader->read(); if ($xmlReader->nodeType != XMLReader::DOC_TYPE) { echo 'error: DOCTYPE expected, aborted'; return false; } if ($xmlReader->name != 'oc11xml') { echo 'error: wrong DOCTYPE, aborted'; return false; } $xmlReader->read(); if ($xmlReader->nodeType != XMLReader::ELEMENT) { echo 'error: First element expected, aborted'; return false; } if ($xmlReader->name != 'oc11xml') { echo 'error: first element not valid, aborted'; return false; } $xmlReader->moveToFirstAttribute(); while ($xmlReader->name != 'date' && $xmlReader->moveToNextAttribute()) { } if ($xmlReader->name == 'date') { $starttime = strtotime($xmlReader->value); } else { $starttime = strtotime('2005-08-01 00:00:00'); } // ok ... machen wir mal ... $xmlReader->read(); do { if ($xmlReader->nodeType == XMLReader::ELEMENT) { $elementName = mb_strtoupper($xmlReader->name); /* ... diese Node in Array umwandeln $node['USER']['__DATA'] = ''; $node['USER']['ID']['__ATTR']['ID'] = '101016'; $node['USER']['ID']['__DATA'] = 'B97CE517-4D74-B6CE-BED8-EF76662FB7EE'; $node['USER']['USERNAME']['__DATA'] = 'Team BMW-Biker'; $node['USER']['PMR']['__DATA'] = '0'; $node['USER']['DATECREATED']['__DATA'] = '2005-08-14 00:00:00'; $node['USER']['LASTMODIFIED']['__DATA'] = '2005-10-30 19:26:51'; */ unset($node); $node[$elementName]['__DATA'] = ''; $sSubElement = ''; $nRecursionLevel = 1; while ($xmlReader->read() && $nRecursionLevel > 0) { if ($xmlReader->nodeType == XMLReader::TEXT) { if ($sSubElement != '') { $node[$elementName][$sSubElement]['__DATA'] = $xmlReader->value; } else { $node[$elementName]['__DATA'] = $xmlReader->value; } } else { if ($xmlReader->nodeType == XMLReader::CDATA) { if ($sSubElement != '') { $node[$elementName][$sSubElement]['__DATA'] = $xmlReader->value; } else { $node[$elementName]['__DATA'] = $xmlReader->value; } } else { if ($xmlReader->nodeType == XMLReader::ELEMENT) { if ($sSubElement != '') { // vorheriges element zuerst schlißen $sSubElement = ''; $nRecursionLevel--; } $sSubElement = mb_strtoupper($xmlReader->name); $nRecursionLevel++; // attribute auslesen if ($xmlReader->moveToFirstAttribute()) { $node[$elementName][$sSubElement]['__ATTR'][mb_strtoupper($xmlReader->name)] = $xmlReader->value; while ($xmlReader->moveToNextAttribute()) { $node[$elementName][$sSubElement]['__ATTR'][mb_strtoupper($xmlReader->name)] = $xmlReader->value; } } } else { if ($xmlReader->nodeType == XMLReader::END_ELEMENT) { $sSubElement = ''; $nRecursionLevel--; } } } } } switch ($elementName) { case 'USER': ImportUserArray($node['USER']); break; case 'CACHE': ImportCacheArray($node['CACHE']); break; case 'CACHEDESC': ImportCacheDescArray($node['CACHEDESC']); break; case 'CACHELOG': ImportCachelogArray($node['CACHELOG']); break; case 'PICTURE': ImportPictureArray($node['PICTURE']); break; case 'REMOVEDOBJECT': ImportRemovedObjectArray($node['REMOVEDOBJECT']); break; default: echo 'Unknown Element "' . $xmlReader->name . '", skipping' . "\n"; break; } } } while ($xmlReader->read()); $xmlReader->close(); $xmlReader = null; // zeitstempel notieren $oldstarttime = strtotime(getSysConfig('ocxml11client_lastupdate', '2005-08-01 00:00:00')); if ($oldstarttime < $starttime) { setSysConfig('ocxml11client_lastupdate', date('Y-m-d H:i:s', $starttime)); } }
addClassesDirecotriesToDirlist('libse'); $tpl->name = 'translate'; $tpl->menuitem = MNU_ADMIN_TRANSLATE; $login->verify(); $access = new translateAccess(); if (!$access->hasAccess()) { $tpl->error(ERROR_NO_ACCESS); } $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : ''; // zu übersetzende Sprache anzeigen $translang = isset($_REQUEST['translang']) ? strtoupper($_REQUEST['translang']) : strtoupper($opt['template']['locale']); if (!isset($opt['locale'][$translang])) { $action = 'selectlang'; } // prüfen, ob die aktuelle data.sql eingespielt wurde if (calcDataSqlChecksum(true) != getSysConfig('datasql_checksum', '')) { $tpl->assign('datasqlfailed', true); } else { $tpl->assign('datasqlfailed', false); } if ($action == 'selectlang') { } else { if ($action == 'verify') { verify(); } else { if ($action == 'resetids') { resetIds(); } else { if ($action == 'clearcache') { clearCache(); } else {
/** * @取得远程字符集编码 * @return string * */ function getRemoteCode() { return getSysConfig("remoteCode"); }
<!DOCTYPE html> <?php global $hideMenu, $mainframe; $tmpl = Request::getVar('tmpl', null); ?> <html lang="en"> <?php echo $this->renderPartial('/block/header'); ?> <body class="<?php echo "tmpl-{$tmpl}"; ?> "> <div id="wrapper" <?php if (getSysConfig("sidebar.display", 1) == 0) { echo 'style="padding:0; "'; } ?> > <!-- Sidebar --> <?php if ($tmpl !== "app") { ?> <?php echo $this->renderPartial('/block/sidebar'); ?> <?php YiiMessage::showMessage(); ?>
<html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <title><?php echo getSysConfig("seopage.title"); ?> </title> <meta name="description" content="<?php echo getSysConfig("seopage.description"); ?> " /> <meta name="keywords" content="<?php echo getSysConfig("seopage.keyword"); ?> " /> <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?> /templates/dist/css/bootstrap.min.css" /> <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?> /templates/dist/font-awesome/css/font-awesome.css" /> <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?> /templates/dist/css/color.css" /> <link rel="stylesheet" type="text/css" href="<?php
if ($showChartColumn == 1) { ?> <div class="box-std box-chart-column"> <div class="box-title"> <h3 class="head">Đồ thị Giá dầu trên sàn Nymex </h3> </div> <div class="inner"> <a href="/bieu-do"> <img src="/images/xangdau/bieu-do-gia-dau-1y.png" /> </a> <a href="/bieu-do"> <img src="/images/xangdau/bieu-do-gia-dau-brent-1y.png" /> </a> </div> </div> <?php } if (getSysConfig("showNewsColumn", 1) == 1) { $controll = Yii::app()->controller->id; $action = Yii::app()->controller->action->id; $cat_alias = Request::getVar('cat_alias', null); $alias = Request::getVar('alias', null); $cid = Request::getInt('cid', null); if ($controll != "news" or $action != "category" or $alias != "minh-bach-xang-dau") { fnShowNewColRight("*", 7, 10); } fnShowNewColRight("*", 20, 10); } ?> </div>
echo Yii::app()->request->baseUrl; ?> /templates/giaxang/js/jscookies.js"></script> </head> <body> <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=134419533373955"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <?php $pageClassSuffix = getSysConfig("page.classSuffix", ""); ?> <div class="wrapper <?php echo $pageClassSuffix; ?> " > <!-- Begin header --> <div class="header"> <div class="header-inner"> <div class="left" style="cursor: pointer;" onclick="location.href='<?php echo WEB_URL; ?> ';" title="<?php echo CHtml::encode($this->pageTitle); ?> ">
public function activityInfoAct() { $this->assign('activity_text', getSysConfig('activity-text')); $this->display(); }
public static function receviceShareCoupon($receter, $inviter) { if ($receter == $inviter) { return; } $readyusers = S('sharecoupon_user' . $inviter); if (in_array($receter, $readyusers)) { //如果已经领取就直接返回 return; } $couponlist = S('sharecoupon_' . $inviter); $coupon = array_pop($couponlist); if (!$coupon) { return; } self::giveCoupon($inviter, $coupon); //$invatename = D('User')->where(array('open_id'=>$receter))->getField('nickname'); \Wechat\Logic\PushLogic::pushTextMsg($inviter, getSysConfig('coupon-text')); //更新优惠券 S('sharecoupon_' . $inviter, $couponlist); //更新领取人 $readyusers[] = $receter; S('sharecoupon_user' . $inviter, $readyusers); }