本文整理匯總了PHP中MSG函數的典型用法代碼示例。如果您正苦於以下問題:PHP MSG函數的具體用法?PHP MSG怎麽用?PHP MSG使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了MSG函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: active_email
public function active_email()
{
if (!isset($GLOBALS['auth']) || !isset($GLOBALS['uid']) || !isset($GLOBALS['email']) || !isset($GLOBALS['t'])) {
MSG('驗證失敗!');
}
$auth = $GLOBALS['auth'];
$uid = intval($GLOBALS['uid']);
$email = $GLOBALS['email'];
$t = $GLOBALS['t'];
if (decode($auth) != $t . $uid . $email) {
MSG('驗證失敗!');
}
if ($t < SYS_TIME - 3600) {
MSG('郵件驗證超時,請重新驗證!', 'index.php?m=member&f=index&v=edit_email');
}
$this->db->update('member', array('ischeck_email' => 1), array('uid' => $uid));
$point_config = get_cache('point_config');
$credit_api = load_class('credit_api', 'credit');
$keyid = 'em' . $uid;
//驗證郵箱,隻送一次
if (!$credit_api->get($keyid)) {
$credit_api->handle($uid, '+', $point_config['email_check'], '驗證郵箱:' . $email, '', $keyid);
}
MSG('郵件驗證成功!', 'index.php?m=member&f=index&v=account_safe');
}
示例2: show
public function show()
{
load_function('common', 'member');
$siteconfigs = $this->siteconfigs;
$id = isset($GLOBALS['id']) ? intval($GLOBALS['id']) : MSG(L('parameter_error'));
$categorys = get_cache('category', 'content');
//查詢數據
$models = get_cache('model_guestbook', 'model');
$model_r = $models[15];
$master_table = $model_r['master_table'];
$data = $this->db->get_one($master_table, array('id' => $id));
require get_cache_path('content_format', 'model');
$form_format = new form_format($model_r['modelid']);
$data = $form_format->execute($data);
foreach ($data as $_key => $_value) {
${$_key} = $_value['data'];
}
$_template = TPLID . ':show';
$styles = explode(':', $_template);
$project_css = isset($styles[0]) ? $styles[0] : 'default';
$_template = isset($styles[1]) ? $styles[1] : 'show';
$seo_title = $title . '_' . $siteconfigs['sitename'];
$seo_keywords = !empty($keywords) ? implode(',', $keywords) : '';
$seo_description = $remark;
$this->db->update($master_table, "`hits`=(`hits`+1)", array('id' => $id));
include T('guestbook', 'show');
}
示例3: setstatus
public function setstatus()
{
$id = intval($GLOBALS['id']);
$status = intval($GLOBALS['status']);
$this->db->update('order_subscribe', array('status' => $status), array('id' => $id));
MSG('設置成功', HTTP_REFERER);
}
示例4: index
/**
* 邀請注冊
*/
function index()
{
$uid = intval($GLOBALS['uid']);
if (!$uid) {
header("Location:" . WEBURL);
exit;
}
$_uid = get_cookie('_uid');
if ($_uid && is_numeric($_uid)) {
//已經登錄的用戶不算成功推廣的下線
header("Location:" . WEBURL);
exit;
} else {
$times = SYS_TIME + 86400 * 7;
set_cookie('ppc_uid', $uid, $times);
$db = load_class('db');
$ip = get_ip();
$db->insert('ppc', array('uid' => $uid, 'addtime' => SYS_TIME, 'ip' => $ip));
//後台配置推廣頁麵跳轉地址
$setting = get_cache('setting', 'ppc');
if (empty($setting['redirect_url'])) {
MSG('請在後台配置推廣頁麵地址');
}
header("Location:" . $setting['redirect_url']);
}
}
示例5: cache_select
public function cache_select()
{
$uid = $_SESSION['uid'];
if (isset($GLOBALS['setcache'])) {
$ids = get_cache('cache_all-' . $uid);
} else {
if (!isset($GLOBALS['ids']) || empty($GLOBALS['ids'])) {
$where = array('keyid' => 'cache_all');
$result = $this->db->get_list('setting', $where, '*', 0, 100);
$ids = array();
foreach ($result as $r) {
$ids[] = $r['id'];
}
} else {
$ids = array_map('intval', $GLOBALS['ids']);
}
set_cache('cache_all-' . $uid, $ids);
}
if (empty($ids)) {
MSG('緩存更新完成', '?m=core&f=cache_all&v=index' . $this->su(), 2000);
}
$id = array_shift($ids);
$r = $this->db->get_one('setting', array('id' => $id));
$caches = load_class($r['f'], $r['m']);
if ($caches->{$r}['v']()) {
set_cache('cache_all-' . $uid, $ids);
MSG($r['data'] . L('update success'), '?m=core&f=cache_all&v=cache_select&setcache=1&' . $this->su(), 200);
} else {
MSG(L('operation failure'));
}
}
示例6: sync_notify
/**
* 同步通知
*/
public function sync_notify()
{
$payment = isset($GLOBALS['payment']) ? intval($GLOBALS['payment']) : exit('payment error');
$pay_r = $this->db->get_one('payment', array('id' => $payment, 'status' => 1));
if (!$pay_r) {
exit('payment error');
}
$setting = unserialize($pay_r['setting']);
$_pay = load_class($pay_r['classname'] . '_callback', 'pay', $setting);
$verify_result = $_pay->verify();
if ($verify_result == false) {
MSG('認證失敗!!!');
}
$return_text = $_pay->response_status($verify_result);
$status = $_pay->status;
$order_no = $_pay->response_order_no;
$this->db->update('pay', array('status' => $status), array('order_no' => $order_no));
if ($status == 1 || $status == 7) {
if (isset($GLOBALS['module']) && !empty($GLOBALS['module'])) {
$callapi = load_class($GLOBALS['file'], $GLOBALS['module']);
$callapi->update($order_no);
} else {
$pay_res = $this->db->get_one('pay', array('order_no' => $order_no));
if ($pay_res['memberpay'] == 0) {
$this->db->update('pay', array('memberpay' => 1), array('id' => $pay_res['id']));
$this->db->update('member', "`money`=(`money`+" . $pay_res['money'] . ")", array('uid' => $pay_res['uid']));
}
}
MSG('支付成功!', 'index.php?m=pay&f=payment&v=listing', 3000);
} else {
MSG('支付失敗!');
}
}
示例7: init
/**
*
*/
public function init()
{
$id = intval($GLOBALS['id']);
$siteid = intval($GLOBALS['siteid']);
$res = $this->db->get_one('copyfrom', array('fromid' => $id));
$siteconfigs = $this->siteconfigs;
$seo_title = $siteconfigs['sitename'];
$seo_keywords = $siteconfigs['seo_keywords'];
$seo_description = $siteconfigs['seo_description'];
$categorys = get_cache('category', 'content');
$cids = array();
foreach ($categorys as $cid => $r) {
if ($r['siteid'] == $siteid) {
$cids[] = $cid;
}
}
if (!empty($cids)) {
$cids = implode(',', $cids);
$where = "`copyfrom`='" . $res['fromid'] . "' AND `status`=9 AND `cid` IN ({$cids})";
$rs = $this->db->get_list('content_share', array('copyfrom' => $id), '*', 0, 20, 0, 'id DESC');
} else {
MSG('參數錯誤');
}
$rs = $this->db->get_list('content_share', $where, '*', 0, 100, 0, 'id DESC');
include T('content', 'copyfrom', TPLID);
}
示例8: getit
/**
* 優惠券激活
*/
public function getit()
{
$order_no = sql_replace($GLOBALS['order_no']);
$r = $this->db->get_one('coupon_card', "`card_no`='{$order_no}'");
if ($r) {
if ($r['status'] == 2) {
MSG('您輸入的優惠券已經被激活,不能重複使用');
}
$memberinfo = $this->memberinfo;
$formdata = array();
$formdata['cardid'] = $r['cardid'];
$formdata['card_no'] = $r['card_no'];
$formdata['title'] = $r['title'];
$formdata['remark'] = $r['remark'];
$formdata['mount'] = $r['mount'];
$formdata['id'] = $r['id'];
$formdata['addtime'] = SYS_TIME;
$formdata['endtime'] = $r['endtime'];
$formdata['url'] = $r['url'];
$formdata['uid'] = $memberinfo['uid'];
$formdata['status'] = 0;
$this->db->insert('coupon_card_active', $formdata);
$formdata2 = array();
if ($r['usetype']) {
$formdata2 = array('uid' => $memberinfo['uid']);
} else {
//僅能使用一次
$formdata2 = array('uid' => $memberinfo['uid'], 'status' => 2);
}
$this->db->update('coupon_card', $formdata2, array('cardid' => $r['cardid']));
MSG('優惠券激活成功', 'index.php?m=coupon&f=coupon&v=listing');
} else {
MSG('您輸入的優惠券不存在');
}
}
示例9: upload_url_safe
/**
* 上傳的url訪問安全認證
*
* @author tuzwu
* @createtime
* @modifytime
* @param
* @return
*/
function upload_url_safe()
{
if (empty($_SERVER['HTTP_REFERER'])) {
MSG(L('operation_failure'), '', 3000);
}
//上傳彈窗必然由上級頁麵加載
}
示例10: download
/**
* 文件下載/或輸出顯示
* @param $filepath 文件路徑
* @param $filename 文件名稱
*/
function download($filepath, $filename = '', $output = 0)
{
if (!$filename) {
$filename = basename($filepath);
}
if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'msie ') !== false) {
$filename = rawurlencode($filename);
}
$filetype = get_ext($filename);
if (!file_exists($filepath)) {
MSG('文件不存在');
}
$filesize = sprintf("%u", filesize($filepath));
if (ob_get_length() !== false) {
@ob_end_clean();
}
header('Pragma: public');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: pre-check=0, post-check=0, max-age=0');
header('Content-Transfer-Encoding: binary');
header('Content-Encoding: none');
header('Content-type: ' . $filetype);
if (!$output) {
header('Content-Disposition: attachment; filename="' . $filename . '"');
}
header('Content-length: ' . $filesize);
readfile($filepath);
exit;
}
示例11: delete
public function delete()
{
$addressid = intval($GLOBALS['addressid']);
$memberinfo = $this->memberinfo;
$this->db->delete('express_address', array('addressid' => $addressid));
MSG('刪除成功!', 'index.php?m=order&f=address&v=listing');
}
示例12: url_rule
/**
* 處理tags的url
*
* @author tuzwu
* @createtime
* @modifytime
* @param string type 類型,首頁index||索引letter||內容show
* @param array param url變量參數數組,允許的值如下: $page,$pinyin,$letter,$urlencode_tag,$tagid
* @param int $maxpage 返回的最大頁數,大於1時返回數組,比如傳入8,返回從1-8索引的數組
* @return
*/
public function url_rule($type = 'show', $param = array(), $maxpage = 1)
{
if (!isset($param['page'])) {
$param['page'] = max(output($GLOBALS, 'page'), 1);
}
if (!isset($this->_cache[$type . '_url_rule'])) {
MSG(L('url_rule_empty'), HTTP_REFERER, 3000);
}
$url_rule = explode('|', $this->_cache[$type . '_url_rule']);
$replace_from_arr = array('{$page}', '{$pinyin}', '{$letter}', '{$urlencode_tag}', '{$tagid}');
$replace_to_arr = array($param['page'], output($param, 'pinyin'), output($param, 'letter'), output($param, 'urlencode_tag'), output($param, 'tagid'));
if ($param['page'] > 1 || $maxpage > 1) {
$url = $url_rule[1];
if ($maxpage <= 1) {
$url = str_ireplace($replace_from_arr, $replace_to_arr, $url);
} else {
$url_arr = array();
$url_arr[1] = str_ireplace($replace_from_arr, $replace_to_arr, $url_rule[0]);
//第一頁
unset($replace_to_arr[0], $replace_from_arr[0]);
$url = str_ireplace($replace_from_arr, $replace_to_arr, $url);
for ($i = 2; $i <= $maxpage; $i++) {
$url_arr[$i] = str_ireplace('{$page}', $i, $url);
}
$url =& $url_arr;
}
} else {
$url = $url_rule[0];
$url = str_ireplace($replace_from_arr, $replace_to_arr, $url);
}
return $url;
}
示例13: search
/**
* 搜索用戶
*/
public function search()
{
$page = isset($GLOBALS['page']) ? intval($GLOBALS['page']) : 1;
$page = max($page, 1);
$uid = $this->memberinfo['uid'];
$publisher = $this->memberinfo['username'];
$username = isset($GLOBALS['username']) ? sql_replace($GLOBALS['username']) : MSG('請輸入會員名');
$cityid = get_cookie('cityid');
$result_rs = $this->db->get_list('member', "`username` LIKE '%{$username}%'", '*', 0, 20, $page, 'uid DESC');
$result = array();
foreach ($result_rs as $r) {
$r['member_info'] = $r;
$v1 = $this->db->get_one('myfriend', array('myuid' => $r['uid'], 'uid' => $uid));
$v2 = $this->db->get_one('myfriend', array('myuid' => $uid, 'uid' => $r['uid']));
if ($v2 && $v1) {
//相互關注
$r['rtype'] = 1;
} elseif ($v2) {
$r['rtype'] = 2;
//已添加
} elseif ($v1) {
$r['rtype'] = 3;
//請求添加
}
$result[] = $r;
}
$pages = $this->db->pages;
$total = $this->db->number;
include T('member', 'friend_search_listing');
}
示例14: check
/**
* 審核
*/
public function check()
{
$id = intval($GLOBALS['id']);
$status = intval($GLOBALS['status']);
$formdata = array('status' => $status);
$this->db->update('receipt', $formdata, array('id' => $id));
MSG('設置成功', HTTP_REFERER);
}
示例15: show
public function show()
{
$seo_title = '係統公告';
$GLOBALS['acbar'] = 4;
$id = isset($GLOBALS['id']) ? intval($GLOBALS['id']) : MSG('參數錯誤');
$memberinfo = $this->memberinfo;
$r = $this->db->get_one('affiche', array('id' => $id));
include T('affiche', 'member_show');
}