当前位置: 首页>>代码示例>>PHP>>正文


PHP message函数代码示例

本文整理汇总了PHP中message函数的典型用法代码示例。如果您正苦于以下问题:PHP message函数的具体用法?PHP message怎么用?PHP message使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了message函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __set

 function __set($key, $value)
 {
     if (isset($this->filters[$key]) and !$this->is_filter[$this->filters[$key]]($value)) {
         message(App::$lang_common['Bad request'] . ' Passed parameter is invalid');
     }
     parent::__set($key, $value);
 }
开发者ID:mdb-webdev,项目名称:punbb_extensions,代码行数:7,代码来源:controller.php

示例2: SaveConfig

 function SaveConfig()
 {
     global $config, $langmessage;
     $possible = $this->variables;
     foreach ($possible as $key => $curr_possible) {
         if ($curr_possible == 'boolean') {
             if (isset($_POST[$key]) && $_POST[$key] == 'true') {
                 $config[$key] = true;
             } else {
                 $config[$key] = false;
             }
         } elseif ($curr_possible == 'integer') {
             if (isset($_POST[$key]) && is_numeric($_POST[$key])) {
                 $config[$key] = $_POST[$key];
             }
         } elseif (isset($_POST[$key])) {
             $config[$key] = $_POST[$key];
         }
     }
     $config['history_limit'] = min($config['history_limit'], gp_backup_limit);
     if (!admin_tools::SaveConfig()) {
         message($langmessage['OOPS']);
         return false;
     }
     if (isset($_GET['gpreq']) && $_GET['gpreq'] == 'json') {
         message($langmessage['SAVED'] . ' ' . $langmessage['REFRESH']);
     } else {
         message($langmessage['SAVED']);
     }
 }
开发者ID:VTAMAGNO,项目名称:gpEasy-CMS,代码行数:30,代码来源:admin_configuration.php

示例3: fieldsFormSubmit

 public function fieldsFormSubmit($rid = 0)
 {
     global $_GPC, $_W;
     $id = intval($_GPC['reply_id']);
     $credit = intval($_GPC['credit']);
     $insert = array('rid' => $rid, 'start_time' => strtotime($_GPC['start_time']), 'end_time' => strtotime($_GPC['end_time']), 'awardrules' => $_GPC['awardrules'], 'awardinfo' => $_GPC['awardinfo'], 'days' => $_GPC['days'], 'credit' => $credit);
     if (!empty($_FILES['thumb']['tmp_name'])) {
         file_delete($_GPC['thumb_old']);
         $upload = file_upload($_FILES['thumb']);
         if (is_error($upload)) {
             message($upload['message'], '', 'error');
         }
         $insert['thumb'] = $upload['path'];
     } else {
         $tmp_file = array(name => "registration_top.jpg", tmp_name => "{$_SERVER['DOCUMENT_ROOT']}/source/modules/cgtsignin/template/style/images/registration_top.jpg");
         $upload = file_upload($tmp_file);
         if (is_error($upload)) {
             message($upload['message'], '', 'error');
         }
         $insert['thumb'] = $upload['path'];
     }
     if (empty($id)) {
         pdo_insert($this->tablename, $insert);
     } else {
         pdo_update($this->tablename, $insert, array('id' => $id));
     }
 }
开发者ID:alextiannus,项目名称:wormwood_wechat,代码行数:27,代码来源:module.php

示例4: sendnewpassword

function sendnewpassword($email)
{
    $ExistMail = doquery("SELECT `email` FROM {{table}} WHERE `email` = '" . $email . "' LIMIT 1;", 'users', true);
    if (empty($ExistMail['email'])) {
        message('That address is not found !', 'Error');
    } else {
        $Caracters = "aazertyuiopqsdfghjklmwxcvbn���AZERTYUIOPQSDFGHJKLMWXCVBN���1234567890";
        $Count = strlen($Caracters);
        $NewPass = "";
        $Taille = 6;
        srand((double) microtime() * 1000000);
        for ($i = 0; $i < $Taille; $i++) {
            $CaracterBoucle = rand(0, $Count - 1);
            $NewPass = $NewPass . substr($Caracters, $CaracterBoucle, 1);
        }
        $Title = "Rogue Universe : Nytt l�senord";
        $Body = "H�r �r ditt nya l�senord : ";
        $Body .= $NewPass;
        mail($email, $Title, $Body);
        $NewPassSql = md5($NewPass);
        $QryPassChange = "UPDATE game_users SET ";
        $QryPassChange .= "`password` ='" . $NewPassSql . "' ";
        $QryPassChange .= "WHERE `email`='" . $email . "' LIMIT 1;";
        doquery($QryPassChange, 'users');
    }
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:26,代码来源:SendNewPassword.php

示例5: doInsert

function doInsert()
{
    if (isset($_POST['save'])) {
        $NAME = $_POST['subjectname'];
        $DESCRIPTION = $_POST['description'];
        $SECTOR = $_POST['sector'];
        $DOMAIN = $_POST['domain'];
        $subject = new subject();
        $subject->name = $NAME;
        $subject->description = $DESCRIPTION;
        $subject->sector_id = $SECTOR;
        $subject->domain_id = $DOMAIN;
    }
    if ($NAME == "") {
        message('Subject Name is required!', "error");
        redirect('index.php?view=add');
    } elseif ($DESCRIPTION == "") {
        message('Description is required!', "error");
        redirect('index.php?view=add');
    } elseif ($SECTOR == "") {
        message('Sector ID is required!', "error");
        redirect('index.php?view=add');
    } elseif ($DOMAIN == "") {
        message('Domain ID is required!', "error");
        redirect('index.php?view=add');
    } else {
        $subject->create();
        message('New subject addedd successfully!', "success");
        redirect('index.php?view=list');
    }
}
开发者ID:allybitebo,项目名称:ucb,代码行数:31,代码来源:controller.php

示例6: settingsDisplay

 public function settingsDisplay($settings)
 {
     // 声明为全局才可以访问到.
     global $_W, $_GPC;
     if (checksubmit()) {
         // $_GPC 可以用来获取 Cookies,表单中以及地址栏参数
         $data = $_GPC['data'];
         // message() 方法用于提示用户操作提示
         empty($data['name']) && message('请填写便利店名称');
         empty($data['logo']) && message('请填写便利店 LOGO');
         empty($data['linkman']) && message('请填写便利店联系人');
         empty($data['phone']) && message('请填写便利店联系电话');
         empty($data['address']) && message('请填写便利店地址');
         empty($data['description']) && message('请填写便利店介绍');
         //字段验证, 并获得正确的数据$dat
         if (!$this->saveSettings($data)) {
             message('保存信息失败', '', 'error');
         } else {
             message('保存信息成功', '', 'success');
         }
     }
     // 模板中需要用到 "tpl" 表单控件函数的话, 记得一定要调用此方法.
     load()->func('tpl');
     //这里来展示设置项表单
     include $this->template('setting');
 }
开发者ID:lrf1999,项目名称:we7_store,代码行数:26,代码来源:module.php

示例7: process_form

function process_form()
{
    global $phpcid, $vars, $phpcdb, $phpc_script;
    verify_token();
    if (empty($vars['user_name'])) {
        return message(__('You must specify a user name'));
    }
    if (empty($vars['password1'])) {
        return message(__('You must specify a password'));
    }
    if (empty($vars['password2']) || $vars['password1'] != $vars['password2']) {
        return message(__('Your passwords did not match'));
    }
    $make_admin = empty($vars['make_admin']) ? 0 : 1;
    $passwd = md5($vars['password1']);
    if ($phpcdb->get_user_by_name($vars["user_name"])) {
        return message(__('User already exists.'));
    }
    $uid = $phpcdb->create_user($vars["user_name"], $passwd, $make_admin);
    if (!empty($vars['groups'])) {
        foreach ($vars['groups'] as $gid) {
            $phpcdb->user_add_group($uid, $gid);
        }
    }
    return message(__('Added user.'));
}
开发者ID:php-calendar,项目名称:php-calendar,代码行数:26,代码来源:user_create.php

示例8: payResult

 /**
  * 支付完成后更改业务状态
  */
 public function payResult($params)
 {
     /*
      * $params 结构
      * 
      * weid 公众号id 兼容低版本
      * uniacid 公众号id
      * result 支付是否成功 failed/success
      * type 支付类型 credit 积分支付 alipay 支付宝支付 wechat 微信支付  delivery 货到付款
      * tid 订单号
      * user 用户id
      * fee 支付金额
      * 
      * 注意:货到付款会直接返回支付失败,请在订单中记录货到付款的订单。然后发货后收取货款
      */
     $fee = intval($params['fee']);
     $data = array('status' => $params['result'] == 'success' ? 1 : 0);
     //如果是微信支付,需要记录transaction_id。
     if ($params['type'] == 'wechat') {
         $data['transid'] = $params['tag']['transaction_id'];
     }
     //此处更改业务方面的记录,例如把订单状态更改为已付款
     //pdo_update('shopping_order', $data, array('id' => $params['tid']));
     //如果消息是用户直接返回(非通知),则提示一个付款成功
     if ($params['from'] == 'return') {
         if ($params['type'] == 'credit') {
             message('支付成功!', $this->createMobileUrl('index1'), 'success');
         } elseif ($params['type'] == 'delivery') {
             message('请您在收到货物时付清货款!', $this->createMobileUrl('index1'), 'success');
         } else {
             message('支付成功!', '../../' . $this->createMobileUrl('index1'), 'success');
         }
     }
 }
开发者ID:randyli,项目名称:redstar,代码行数:37,代码来源:site.php

示例9: sendnewpassword

/**
 * This file is part of XNova:Legacies
 *
 * @license http://www.gnu.org/licenses/gpl-3.0.txt
 * @see http://www.xnova-ng.org/
 *
 * Copyright (c) 2009-2010, XNova Support Team <http://www.xnova-ng.org>
 * All rights reserved.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *                                --> NOTICE <--
 *  This file is part of the core development branch, changing its contents will
 * make you unable to use the automatic updates manager. Please refer to the
 * documentation for further information about customizing XNova.
 *
 */
function sendnewpassword($mail)
{
    $ExistMail = doquery("SELECT `email` FROM {{table}} WHERE `email` = '" . $mail . "' LIMIT 1;", 'users', true);
    if (empty($ExistMail['email'])) {
        message('L\'adresse n\'existe pas !', 'Erreur');
    } else {
        //Caractere qui seront contenus dans le nouveau mot de passe
        $Caracters = "aazertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBN1234567890";
        $Count = strlen($Caracters);
        $NewPass = "";
        $Taille = 6;
        srand((double) microtime() * 1000000);
        for ($i = 0; $i < $Taille; $i++) {
            $CaracterBoucle = rand(0, $Count - 1);
            $NewPass = $NewPass . substr($Caracters, $CaracterBoucle, 1);
        }
        //Et un nouveau mot de passe tout chaud ^^
        //On va maintenant l'envoyer au destinataire
        $Title = "XNova : Nouveau mot de passe";
        $Body = "Voici votre nouveau mot de passe : ";
        $Body .= $NewPass;
        mail($mail, $Title, $Body);
        //Email envoy�, maintenant place au changement dans la BDD
        $NewPassSql = md5($NewPass);
        $QryPassChange = "UPDATE {{table}} SET ";
        $QryPassChange .= "`password` ='" . $NewPassSql . "' ";
        $QryPassChange .= "WHERE `email`='" . $mail . "' LIMIT 1;";
        doquery($QryPassChange, 'users');
    }
}
开发者ID:sonicmaster,项目名称:RPG,代码行数:58,代码来源:SendNewPassword.php

示例10: process_form

function process_form()
{
    global $vars, $phpcdb, $phpc_script;
    verify_token();
    $cid = $phpcdb->create_calendar();
    foreach (get_config_options() as $item) {
        $name = $item[0];
        $type = $item[2];
        if ($type == PHPC_CHECK) {
            if (isset($vars[$name])) {
                $value = "1";
            } else {
                $value = "0";
            }
        } else {
            if (isset($vars[$name])) {
                $value = $vars[$name];
            } else {
                soft_error(__("{$name} was not set."));
            }
        }
        $phpcdb->create_config($cid, $name, $value);
    }
    message(__('Calendar created.'));
}
开发者ID:php-calendar,项目名称:php-calendar,代码行数:25,代码来源:calendar_form.php

示例11: deletepost

 public function deletepost($id)
 {
     global $lang_common, $lang_post, $pd;
     if ($this->user->g_read_board == '0') {
         message($lang_common['No view'], '403');
     }
     // Fetch some informations about the post, the topic and the forum
     $cur_post = $this->model->get_info_delete($id);
     if ($this->config['o_censoring'] == '1') {
         $cur_post['subject'] = censor_words($cur_post['subject']);
     }
     // Sort out who the moderators are and if we are currently a moderator (or an admin)
     $mods_array = $cur_post['moderators'] != '' ? unserialize($cur_post['moderators']) : array();
     $is_admmod = $this->user->g_id == FEATHER_ADMIN || $this->user->g_moderator == '1' && array_key_exists($this->user->username, $mods_array) ? true : false;
     $is_topic_post = $id == $cur_post['first_post_id'] ? true : false;
     // Do we have permission to edit this post?
     if (($this->user->g_delete_posts == '0' || $this->user->g_delete_topics == '0' && $is_topic_post || $cur_post['poster_id'] != $this->user->id || $cur_post['closed'] == '1') && !$is_admmod) {
         message($lang_common['No permission'], '403');
     }
     if ($is_admmod && $this->user->g_id != FEATHER_ADMIN && in_array($cur_post['poster_id'], get_admin_ids())) {
         message($lang_common['No permission'], '403');
     }
     // Load the delete.php language file
     require FEATHER_ROOT . 'lang/' . $this->user->language . '/delete.php';
     if ($this->feather->request()->isPost()) {
         $this->model->handle_deletion($is_topic_post, $id, $cur_post['tid'], $cur_post['fid']);
     }
     $page_title = array(feather_escape($this->config['o_board_title']), $lang_delete['Delete post']);
     define('FEATHER_ACTIVE_PAGE', 'delete');
     $this->header->setTitle($page_title)->display();
     require FEATHER_ROOT . 'include/parser.php';
     $cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']);
     $this->feather->render('delete.php', array('lang_common' => $lang_common, 'lang_delete' => $lang_delete, 'cur_post' => $cur_post, 'id' => $id, 'is_topic_post' => $is_topic_post));
     $this->footer->display();
 }
开发者ID:beaver-dev,项目名称:featherbb,代码行数:35,代码来源:delete.php

示例12: error

 function error($message, $title)
 {
     global $link, $game_config;
     if ($game_config['debug'] == 1) {
         echo "<h2>{$title}</h2><br><font color=red>{$message}</font><br><hr>";
         echo "<table>" . $this->log . "</table>";
     }
     //else{
     //A futuro, se creara una tabla especial, para almacenar
     //los errores que ocurran.
     global $user, $xnova_root_path, $phpEx;
     include $xnova_root_path . 'config.' . $phpEx;
     if (!$link) {
         die('mySQL error.');
     }
     mysql_query("rollback");
     $query = "INSERT INTO {{table}} SET\r\n\t\t\t\t`error_sender` = '{$user['id']}' ,\r\n\t\t\t\t`error_time` = '" . time() . "' ,\r\n\t\t\t\t`error_type` = '{$title}' ,\r\n\t\t\t\t`error_text` = '" . mysql_escape_string($message) . "';";
     $sqlquery = mysql_query(str_replace("{{table}}", $dbsettings["prefix"] . 'errors', $query)) or die('error fatal');
     $query = "explain select * from {{table}}";
     $q = mysql_fetch_array(mysql_query(str_replace("{{table}}", $dbsettings["prefix"] . 'errors', $query))) or die('error fatal: ');
     if (!function_exists('message')) {
         echo "Error, thank you to contact the admin. error:<b>" . $q['rows'] . "</b>";
     } else {
         message("Error, thank you to contact the admin. error:<b>" . $q['rows'] . "</b>", "Error");
     }
     //}
     die;
 }
开发者ID:GaryHuang-CL,项目名称:y1910061,代码行数:28,代码来源:debug.class.php

示例13: display_message

function display_message($message_id)
{
    $message = message($message_id);
    if (!$message) {
        return;
    }
    $message_title = $message->message_title;
    $message_description = $message->message_description;
    ?>
<style>
	#message_box a {
		color:#888;
	}
</style>
<div id="message_box_container" style="position:relative;z-index:1000;position:absolute;left:0px;top:0px;width:100%;height:100%;font-size:14px;background-color:rgba(255,255,255,0.5);">
	<div id="message_box" style="width:350px;font-family:Arial,sans-serif;background-color:#fdfdfd;border-width:1px;border-style:solid;border-color:#ddd;padding:5px;margin:auto;margin-top:20%;">
		<h1 style="font-size:20pt;margin:0px;"><?php 
    echo $message_title;
    ?>
</h1>
		<p style="margin-bottom:10px;"><?php 
    echo $message_description;
    ?>
</p>
		<a href="http://unify.lukebarnard.co.uk">Home</a> -
		<a id="close_link" href="javascript:return false;" onclick="c = document.getElementById('message_box_container');c.parentNode.removeChild(c);event.preventDefault();">Close this message box</a>
		<script>
			document.getElementById("close_link").focus();
		</script>
	</div>
</div>
<?php 
}
开发者ID:ThisIsGJ,项目名称:unify,代码行数:33,代码来源:display_message.php

示例14: doWebList

 public function doWebList($ischeck = 1)
 {
     global $_GPC, $_W;
     // AJAX
     if ($_W['isajax']) {
         $op = $_GPC['op'];
         $id = intval($_GPC['id']);
         $result = array('state' => -1, 'message' => '');
         if ($op == 'delete') {
             $item = $this->item_fetch($id);
             if ($item['id']) {
                 load()->func('file');
                 file_delete($item['photo']);
                 pdo_delete('qiyue_canvas', array('id' => $item['id']));
                 $result['state'] = 0;
             }
         } elseif ($op == 'check') {
             if ($this->item_check($id)) {
                 $result['state'] = 0;
             }
         }
         message($result, '', 'ajax');
     }
     $title = '图片管理';
     $result = $this->all_list(array('ischeck' => $ischeck));
     include $this->template('manage');
 }
开发者ID:keycoolkui,项目名称:weixinfenxiao,代码行数:27,代码来源:site.php

示例15: main

function main()
{
    global $G;
    $db = $G['db'];
    $tn = TABLE_NAME;
    message('%s version %s', TITLE, VERSION);
    message('bwSQLite3 version %s', bwSQLite3::VERSION);
    message('file name: %s, table name: %s', DB_FILENAME, TABLE_NAME);
    $query_start_time = microtime(TRUE);
    message('There are %d rows in the table.', $db->count_recs());
    // database operations go here
    try {
        foreach ($db->get_recs() as $row) {
            message('id: %d: The %s says %s.', $row['id'], $row['animal'], $row['sound']);
        }
        $id = 3;
        message('deleting id %d', $id);
        $db->sql_do("DELETE FROM {$tn} WHERE id = ?", $id);
        message('after delete: The are %d records in the table', $db->count_recs());
        foreach ($db->get_recs() as $row) {
            message('id: %d: The %s says %s.', $row['id'], $row['animal'], $row['sound']);
        }
        $id = 2;
        message('deleting id %d', $id);
        $db->delete($id);
        message('after delete: The are %d records in the table', $db->count_recs());
        foreach ($db->get_recs() as $row) {
            message('id: %d: The %s says %s.', $row['id'], $row['animal'], $row['sound']);
        }
    } catch (PDOException $e) {
        error($e->getMessage());
    }
    $elapsed_time = microtime(TRUE) - $query_start_time;
    message('elapsed time: %s ms', number_format($elapsed_time * 1000, 2));
}
开发者ID:kbglobal51,项目名称:yii-trackstar-sample,代码行数:35,代码来源:01_delete-end.php


注:本文中的message函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。