本文整理汇总了PHP中showmessage函数的典型用法代码示例。如果您正苦于以下问题:PHP showmessage函数的具体用法?PHP showmessage怎么用?PHP showmessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了showmessage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: space_open
function space_open($uid, $username, $gid = 0, $email = '')
{
global $_SGLOBAL, $_SCONFIG;
if (empty($uid) || empty($username)) {
return array();
}
//验证空间是否被管理员删除
$query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('spacelog') . " WHERE uid='{$uid}' AND flag='-1'");
if ($value = $_SGLOBAL['db']->fetch_array($query)) {
showmessage('the_space_has_been_closed');
}
$space = array('uid' => $uid, 'username' => $username, 'dateline' => $_SGLOBAL['timestamp'], 'groupid' => $gid);
inserttable('space', $space, 0, true);
inserttable('spacefield', array('uid' => $uid, 'email' => $email), 0, true);
//发送PM
if ($_SGLOBAL['supe_uid'] && $_SGLOBAL['supe_uid'] != $uid) {
include_once S_ROOT . './uc_client/client.php';
uc_pm_send($_SGLOBAL['supe_uid'], $uid, cplang('space_open_subject'), cplang('space_open_message', array(getsiteurl())), 1, 0, 0);
}
//产生feed
include_once S_ROOT . './source/function_cp.php';
$_uid = $_SGLOBAL['supe_uid'];
$_username = $_SGLOBAL['supe_username'];
$_SGLOBAL['supe_uid'] = $uid;
$_SGLOBAL['supe_username'] = addslashes($username);
feed_add('profile', cplang('feed_space_open'));
$_SGLOBAL['supe_uid'] = $_uid;
$_SGLOBAL['supe_username'] = $_username;
return $space;
}
示例2: update
public function update()
{
set_time_limit(120);
$old_attachment_path = isset($_POST['old_attachment_path']) && trim($_POST['old_attachment_path']) ? trim($_POST['old_attachment_path']) : showmessage(L('old_attachment_address_empty'));
$new_attachment_path = isset($_POST['new_attachment_path']) && trim($_POST['new_attachment_path']) ? trim($_POST['new_attachment_path']) : showmessage(L('new_attachment_address_empty'));
//获取数据表列表
$db = pc_base::load_model('site_model');
$r = $db->query("show tables");
$r = $db->fetch_array($db_list);
foreach ($r as $k => $v) {
$v = array_pop($v);
if (strpos($v, $db->db_tablepre) === false) {
continue;
}
$table_name = str_replace($db->db_tablepre, '', $v);
//获取每个表的数据表结构
if (!($modle_table_db = pc_base::load_model($table_name . '_model'))) {
$modle_table_db = $db;
}
$s = $modle_table_db->get_fields($table_name);
if ($s) {
$sql = '';
foreach ($s as $key => $val) {
//对数据表进行过滤,只有CHAR、TEXT或mediumtext类型的字段才可以保存下附件的地址。
if (preg_match('/(char|text|mediumtext)+/i', $val)) {
$sql .= !empty($sql) ? ", `{$key}`=replace(`{$key}`, '{$old_attachment_path}', '{$new_attachment_path}')" : "`{$key}`=replace(`{$key}`, '{$old_attachment_path}', '{$new_attachment_path}')";
}
}
if (!empty($sql)) {
$modle_table_db->query("UPDATE " . $db->db_tablepre . $table_name . " SET {$sql}");
}
}
}
showmessage(L('operation_success'));
}
示例3: check_ip
/**
*
* IP禁止判断接口,供外部调用 ...
*/
public function check_ip()
{
$ip_array = array();
//当前IP
$ip = ip();
//加载IP禁止缓存
$ipbanned_cache = getcache('ipbanned', 'commons');
if (!empty($ipbanned_cache)) {
foreach ($ipbanned_cache as $data) {
$ip_array[$data['ip']] = $data['ip'];
//是否是IP段
if (strpos($data['ip'], '*')) {
$ip_min = $this->convert_ip("min", $data['ip']);
$ip_max = $this->convert_ip("max", $data['ip']);
$result = $this->ipforbidden($ip, $ip_min, $ip_max);
if ($result == 0 && $data['expires'] > SYS_TIME) {
//被封
showmessage('你在IP禁止段内,所以禁止你访问');
}
} else {
//不是IP段,用绝对匹配
if ($ip == $data['ip'] && $data['expires'] > SYS_TIME) {
showmessage('IP地址绝对匹配,禁止你访问');
}
}
}
}
}
示例4: init
/**
* 推送选择界面
*/
public function init()
{
if ($_POST['dosubmit']) {
$c = pc_base::load_model('content_model');
$c->set_model($_POST['modelid']);
$info = array();
$ids = explode('|', $_POST['id']);
if (is_array($ids)) {
foreach ($ids as $id) {
$info[$id] = $c->get_content($_POST['catid'], $id);
}
}
$_GET['add_action'] = $_GET['add_action'] ? $_GET['add_action'] : $_GET['action'];
$this->push->{$_GET}['add_action']($info, $_POST);
showmessage(L('success'), '', '', 'push');
} else {
pc_base::load_app_func('global', 'template');
if (method_exists($this->push, $_GET['action'])) {
$html = $this->push->{$_GET['action']}(array('modelid' => $_GET['modelid'], 'catid' => $_GET['catid']));
$tpl = isset($_GET['tpl']) ? 'push_to_category' : 'push_list';
include $this->admin_tpl($tpl);
} else {
showmessage('CLASS METHOD NO EXISTS!', 'blank');
}
}
}
示例5: init
public function init()
{
$page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1;
$userid = param::get_cookie('_userid');
$sql = " `userid` = '{$userid}'";
if (isset($_GET['dosubmit'])) {
$type = isset($_GET['type']) && intval($_GET['type']) ? intval($_GET['type']) : '';
$endtime = isset($_GET['endtime']) && trim($_GET['endtime']) ? strtotime(trim($_GET['endtime'])) : '';
$starttime = isset($_GET['starttime']) && trim($_GET['starttime']) ? strtotime(trim($_GET['starttime'])) : '';
if (!empty($starttime) && empty($endtime)) {
$endtime = SYS_TIME;
}
if (!empty($starttime) && !empty($endtime) && $endtime < $starttime) {
showmessage(L('wrong_time_over_time_to_time_less_than'));
}
if (!empty($starttime)) {
$sql .= $sql ? " AND `creat_at` BETWEEN '{$starttime}' AND '{$endtime}' " : " `creat_at` BETWEEN '{$starttime}' AND '{$endtime}' ";
}
if (!empty($type)) {
$sql .= $sql ? " AND `type` = '{$type}' " : " `type` = '{$type}'";
}
}
$list = $this->spend_db->listinfo($sql, '`id` desc', $page);
$pages = $this->spend_db->pages;
include template('pay', 'spend_list');
}
示例6: checkcloudstatus
function checkcloudstatus($showMessage = true)
{
global $_G;
$res = false;
$cloudStatus = $_G['setting']['cloud_status'];
$site_id = $_G['setting']['my_siteid'];
$site_key = $_G['setting']['my_sitekey'];
if ($site_id && $site_key) {
switch ($cloudStatus) {
case 1:
$res = 'cloud';
break;
case 2:
$res = 'unconfirmed';
break;
default:
$res = 'upgrade';
}
} elseif (!$cloudStatus && !$site_id && !$site_key) {
$res = 'register';
} elseif ($showMessage) {
if (defined('IN_ADMINCP')) {
cpmsg_error('cloud_status_error');
} else {
showmessage('cloud_status_error');
}
}
return $res;
}
示例7: usesubmit
function usesubmit()
{
global $_G;
$info = array('credits' => intval($_POST['credits']), 'percredit' => intval($_POST['percredit']), 'credittype' => $_G['gp_credittype'], 'left' => intval($_POST['credits']), 'magicid' => intval($this->magic['magicid']), 'receiver' => array());
if ($info['credits'] < 1) {
showmessage(lang('magic/gift', 'gift_bad_credits_input'));
}
if ($info['percredit'] < 1 || $info['percredit'] > $info['credits']) {
showmessage(lang('magic/gift', 'gift_bad_percredit_input'));
}
$member = array();
if (preg_match('/^extcredits[1-8]$/', $info['credittype'])) {
$member = DB::fetch_first('SELECT * FROM ' . DB::table('common_member_count') . " WHERE uid = '{$_G['uid']}'");
if ($member[$info['credittype']] < $info['credits']) {
showmessage(lang('magic/gift', 'gift_credits_out_of_own'));
}
$extcredits = str_replace('extcredits', '', $info['credittype']);
updatemembercount($_G['uid'], array($extcredits => -$info['credits']), 1, 'BGC', $this->magic['magicid']);
} else {
showmessage(lang('magic/gift', 'gift_bad_credittype_input'));
}
DB::update('common_member_field_home', array('magicgift' => addslashes(serialize($info))), array('uid' => $_G['uid']));
usemagic($this->magic['magicid'], $this->magic['num']);
updatemagiclog($this->magic['magicid'], '2', '1', '0', '0', 'uid', $_G['uid']);
showmessage(lang('magic/gift', 'gift_succeed'), dreferer(), array(), array('showdialog' => 1, 'locationtime' => true));
}
示例8: register
/**
* 申请友情链接
*/
public function register()
{
if (isset($_POST['dosubmit'])) {
if ($_POST['name'] == "") {
showmessage(L('sitename_noempty'), U('link/index/register'));
}
if ($_POST['url'] == "") {
showmessage(L('siteurl_not_empty'), U('link/index/register'));
}
if (!in_array($_POST['linktype'], array('0', '1'))) {
$_POST['linktype'] = '0';
}
$link_db = Loader::model('link_model');
$_POST['logo'] = String::htmlspecialchars($_POST['logo']);
if ($_POST['linktype'] == '0') {
$sql = array('typeid' => $_POST['typeid'], 'linktype' => $_POST['linktype'], 'name' => $_POST['name'], 'url' => $_POST['url']);
} else {
$sql = array('typeid' => $_POST['typeid'], 'linktype' => $_POST['linktype'], 'name' => $_POST['name'], 'url' => $_POST['url'], 'logo' => $_POST['logo']);
}
$link_db->insert($sql);
showmessage(L('add_success'), U('link/index'));
} else {
$setting = S('common/link');
if (isset($setting['is_post']) && $setting['is_post'] == '0') {
showmessage(L('suspend_application'), HTTP_REFERER);
}
$this->type = Loader::model('type_model');
$types = $this->type->get_types();
// 获取站点下所有友情链接分类
$SEO = seo('', L('application_links'), '', '');
include template('link', 'register');
}
}
示例9: edit
function edit() {
if(isset($_POST['dosubmit'])) {
$urlruleid = intval($_POST['urlruleid']);
$_POST['info']['urlrule'] = rtrim(trim($_POST['info']['urlrule']),'.php');
$_POST['info']['urlrule'] = $this->url_replace($_POST['info']['urlrule']);
if($this->url_ifok($_POST['info']['urlrule'])==false){
showmessage('url规则里含有非法php字符');
}
$this->db->update($_POST['info'],array('urlruleid'=>$urlruleid));
$this->public_cache_urlrule();
showmessage(L('update_success'),'','','edit');
} else {
$show_validator = $show_header = '';
$urlruleid = $_GET['urlruleid'];
$r = $this->db->get_one(array('urlruleid'=>$urlruleid));
extract($r);
$modules_arr = $this->module_db->select('','module,name');
$modules = array();
foreach ($modules_arr as $r) {
$modules[$r['module']] = $r['name'];
}
include $this->admin_tpl('urlrule_edit');
}
}
示例10: global_header
function global_header()
{
global $_G;
if(!$_G[uid])
{
loadcache('plugin');
$config = $_G['cache']['plugin']['ct_login_yinxiangpai'];
$login_url = $config['login_url'] ? unserialize($config['login_url']) : '';
$isopen = $config['isopen'] ? $config['isopen'] : 0 ;
if(empty($login_url))showmessage(lang('plugin/ct_login_yinxiangpai','login_url'));
$login_arr = explode('[ct]', str_replace(array("\n", "\t"), array('', ''), $config['m_url']));
//$m_url = array_diff($login_arr,array(''));
if($login_arr){
foreach($login_arr as $k=>$v){
if(empty($v))continue;
$m_url[$k]=strtolower(trim($v));
}
}
$http = isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'http://';
$get_url = $http.strtolower($_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);
$current_page = CURSCRIPT . '_' . CURMODULE;
if((in_array($current_page,$login_url) || in_array( $get_url,$m_url) )&& !$_G[uid] && $isopen )
{
$target_url = $_G['siteurl'].'plugin.php?id=ct_login_yinxiangpai:index';
header('Location: '.$target_url);
}
}
}
示例11: register
/**
* 申请友情链接
*/
public function register() {
$siteid = SITEID;
if(isset($_POST['dosubmit'])){
if($_POST['name']==""){
showmessage(L('sitename_noempty'),"?m=link&c=index&a=register&siteid=$siteid");
}
if($_POST['url']==""){
showmessage(L('siteurl_not_empty'),"?m=link&c=index&a=register&siteid=$siteid");
}
if(!in_array($_POST['linktype'],array('0','1'))){
$_POST['linktype'] = '0';
}
$link_db = pc_base::load_model(link_model);
$_POST['logo'] =new_html_special_chars($_POST['logo']);
if($_POST['linktype']=='0'){
$sql = array('siteid'=>$siteid,'typeid'=>$_POST['typeid'],'linktype'=>$_POST['linktype'],'name'=>$_POST['name'],'url'=>$_POST['url']);
}else{
$sql = array('siteid'=>$siteid,'typeid'=>$_POST['typeid'],'linktype'=>$_POST['linktype'],'name'=>$_POST['name'],'url'=>$_POST['url'],'logo'=>$_POST['logo']);
}
$link_db->insert($sql);
showmessage(L('add_success'), "?m=link&c=index&siteid=$siteid");
} else {
$setting = getcache('link', 'commons');
$setting = $setting[$siteid];
if($setting['is_post']=='0'){
showmessage(L('suspend_application'), HTTP_REFERER);
}
$this->type = pc_base::load_model('type_model');
$types = $this->type->get_types($siteid);//获取站点下所有友情链接分类
pc_base::load_sys_class('form', '', 0);
$SEO = seo(SITEID, '', L('application_links'), '', '');
include template('link', 'register');
}
}
示例12: readRemoteAkSk
function readRemoteAkSk()
{
global $_G;
$siteUrl = null;
$adminEmail = '';
$bbsName = '';
if (isset($_G['siteurl'])) {
$siteUrl = $_G['siteurl'] . 'api/mobile/iyz_index.php';
$siteUrl = str_replace('api/mobile/api/mobile/', 'api/mobile/', $siteUrl);
}
if (isset($_G['setting']['adminemail'])) {
$adminEmail = $_G['setting']['adminemail'];
}
if (isset($_G['setting']['bbname'])) {
$bbsName = $_G['setting']['bbname'];
}
if (empty($siteUrl)) {
showmessage(lang('plugin/bigapp', 'no_site_url'), '', array(), array('alert' => 'error'));
}
$obj = new BkSvr(1, 2, 30);
//fake ak/sk
$aksk = $obj->getInfo(BigAppConf::$ucRegUrl, array('method' => 'regist', 'site_url' => $siteUrl, 'bbs_name' => $bbsName, 'admin_email' => $adminEmail));
if (isset($aksk['app_key']) && isset($aksk['app_secret'])) {
$ak = $aksk['app_key'];
$sk = $aksk['app_secret'];
}
if (empty($ak) || empty($sk)) {
showmessage(lang('plugin/bigapp', 'get_ak_sk_fail'));
}
return array($ak, $sk);
}
示例13: __construct
function __construct()
{
parent::__construct();
//检查 session 是否已经登录
$users = session('admin_info');
if ($users) {
if (md5($users['admin_id'] . C('secret_key')) != $users['secret_key']) {
session_destroy();
redirect(U('Public/login'));
exit;
}
$this->admin_id = $users['admin_id'];
$this->admin_name = $users['admin_name'];
} else {
redirect(U('Public/login'));
exit;
}
$this->assign('loginUser', $users);
/***----------权限控制-----------***/
$AuthLogic = new \Admin\Logic\AuthLogic($this->admin_id);
if (true === $AuthLogic->check_auth()) {
} else {
if (IS_AJAX) {
$this->error('没有操作权限');
exit;
} else {
showmessage('没有该页面权限');
exit;
}
}
}
示例14: respond_get
/**
* return_url get形式响应
*/
public function respond_get()
{
if (isset($_GET['code'])) {
$payment = $this->get_by_code($_GET['code']);
if (!$payment) {
showmessage(L('payment_failed'));
}
$cfg = unserialize_config($payment['config']);
$pay_name = ucwords($payment['pay_code']);
Loader::lib('pay:pay_factory', false);
$payment_handler = new pay_factory($pay_name, $cfg);
$return_data = $payment_handler->receive();
if ($return_data) {
if ($return_data['order_status'] == 0) {
$this->update_member_amount_by_sn($return_data['order_id']);
}
$this->update_recode_status_by_sn($return_data['order_id'], $return_data['order_status']);
showmessage(L('pay_success'), SITE_URL . 'index.php?app=pay&controller=deposit');
} else {
showmessage(L('pay_failed'), SITE_URL . 'index.php?app=pay&controller=deposit');
}
} else {
showmessage(L('pay_success'));
}
}
示例15: _list
function _list()
{
global $_G;
$id = intval($_GET['id']);
$and = '';
$url = URL . "m=article&a=list";
if ($id > 0) {
foreach ($_G[setting][article_tag] as $k => $v) {
if ($k == $id) {
$tag = $v;
}
}
if (!$tag) {
showmessage('未找到分类');
return false;
}
$and .= " AND tag = " . $id;
$url .= "&id=" . $id;
}
$rs = D(array('and' => $and . ' AND `hide` = 0 ', 'table' => 'article', 'order' => '`sort` DESC,`id` DESC'), array('size' => 10, 'url' => $url));
foreach ($rs[goods] as $k => $v) {
$rs[goods][$k][message] = trim_html($v[message], 1);
}
$this->add(array('tag' => $tag));
$this->add($rs);
seo('文章列表' . ' - ' . $_G['setting'][title]);
$this->show();
}