本文整理汇总了PHP中show_message函数的典型用法代码示例。如果您正苦于以下问题:PHP show_message函数的具体用法?PHP show_message怎么用?PHP show_message使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了show_message函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: signup
public function signup()
{
switch ($_SERVER['REQUEST_METHOD']) {
case 'GET':
if (isset($_SESSION['user'])) {
show_message('message success', "You're already connected as " . $_SESSION['user']);
include 'views/home.php';
} else {
include 'views/signup.php';
}
break;
case 'POST':
if (isset($_POST['login']) && isset($_POST['password']) && isset($_POST['password_check'])) {
$exist = User::exist_login($_POST['login']);
if (!$exist) {
if ($_POST['password'] == $_POST['password_check']) {
User::insert(htmlspecialchars($_POST['login']), sha1($_POST['password']), htmlspecialchars($_POST['email']));
show_message('message success', "Signup of " . $_POST['login'] . ' !');
include 'views/signin.php';
} else {
show_message('message error', "Not same password");
include 'views/signup.php';
}
} else {
show_message('message error', "Enter other information");
include 'views/signup.php';
}
} else {
show_message('message error', "Incomplete data!");
include 'views/signup.php';
}
break;
}
}
示例2: actionCreate
public function actionCreate()
{
global $db_url;
$url = parse_url($db_url);
$url['path'] = urldecode($url['path']);
$dbname = substr($url['path'], 1);
is_admin();
$dir = "data/{$dbname}/";
if (!class_exists('ZipArchive')) {
show_message(t('BACKUP_NOTSUPPORT'), true, 'index.php?action=control_panel&subtab=message');
}
if (!is_flatfile()) {
show_message(t('BACKUP_TYPE_NOTSUPPORT'), true, 'index.php?action=control_panel&subtab=message');
}
$zip = new ZipArchive();
$filename = $dir . "backup-" . date('Ymd', time()) . ".zip";
if ($zip->open($filename, ZIPARCHIVE::CREATE) !== TRUE) {
exit("cannot open <{$filename}>\n");
}
$d = dir($dir);
while (false !== ($entry = $d->read())) {
if (substr($entry, -4) == '.txt') {
$zip->addFile($dir . $entry);
}
}
$d->close();
$zip->close();
header("Location:{$filename}");
}
示例3: user_has_got_integral
function user_has_got_integral($type, $user_id, $ever_validated = 0)
{
switch ($type) {
case 'phone':
if ($ever_validated == '0' || $ever_validated == 0) {
$ever_validated = 2;
}
if ($ever_validated == '1' || $ever_validated == 1) {
$ever_validated = 3;
}
break;
case 'email':
if ($ever_validated == '0' || $ever_validated == 0) {
$ever_validated = 1;
}
if ($ever_validated == '2' || $ever_validated == 2) {
$ever_validated = 3;
}
break;
default:
break;
}
$sql = "UPDATE " . $GLOBALS['ecs']->table('users') . " SET ever_validated = '{$ever_validated}' WHERE user_id='{$user_id}'";
if (!$GLOBALS['db']->query($sql)) {
show_message('标记用户验证手机/邮箱失败', $_LANG['profile_lnk'], 'user.php');
}
}
示例4: procdn_requirements_check
/**
* check plugin requirements
*/
public static function procdn_requirements_check()
{
// WordPress version check
if (version_compare($GLOBALS['wp_version'], PROCDN_MIN_WP . 'alpha', '<')) {
show_message(sprintf('<div class="error"><p>%s</p></div>', sprintf(__("PROCDN is optimized for WordPress %s. Please disable the plugin or upgrade your WordPress installation (recommended).", "cdn"), PROCDN_MIN_WP)));
}
}
示例5: modify_pwd
function modify_pwd()
{
$this->load->library('form_validation');
//验证
$validation = array(array('field' => 'oldpwd', 'label' => '旧密码', 'rules' => 'required|callback_oldpwd_check'), array('field' => 'newpwd', 'label' => '新密码', 'rules' => 'required'), array('field' => 'reqpwd', 'label' => '确认密码', 'rules' => 'required|matches[newpwd]'));
$this->form_validation->set_rules($validation);
//设置验证
//设置验证消息
$this->form_validation->set_message('required', '%s不能为空!');
$this->form_validation->set_message('oldpwd_check', '%s验证失!');
$this->form_validation->set_message('matches', '%s与%s不匹配!');
$this->form_validation->set_error_delimiters('<span class="round alert label">', '</span>');
//修改错误提示定界符
//表单提交验证
if ($this->form_validation->run() === FALSE) {
$data['title'] = '管理员修改密码';
$this->load->view('templates/header', $data);
$this->load->view('templates/top_navbar');
$this->load->view('user/modify_pwd', $data);
$this->load->view('templates/footer');
} else {
//验证成功是显示的消息
$data = array('password' => md5($this->input->post('newpwd')));
$this->admin_model->update($_SESSION['auth_admin'], $data);
show_message($this, get_message_data('修改密码', '密码修改成功,下次登录时请使用新密码!', 0, current_url(), 3));
}
}
示例6: or_query
function or_query($query, $pars = array())
{
global $db;
$id = start_query_timer($query, $pars);
try {
if (is_array($pars) && count($pars) > 0) {
// parametrized query
$stmt = $db->prepare($query);
if (isset($pars[0]) && is_array($pars[0])) {
foreach ($pars as $tpars) {
$stmt->execute($tpars);
}
} else {
$stmt->execute($pars);
}
} else {
// non-parametrized query
$stmt = $db->query($query);
}
} catch (PDOException $e) {
show_message('<pre>Query error: ' . $e->getMessage() . "\nQuery: " . $query . "</pre>");
}
$end = stop_query_timer($id);
return $stmt;
}
示例7: update_xpress
/**
* Upgrade the XPressME .
*
* @param string $from New release unzipped path.
* @param string $to Path to old WordPress installation.
* @return WP_Error|null WP_Error on failure, null on success.
*/
function update_xpress($from, $to) {
global $wp_filesystem, $_old_xpress_files, $wpdb;
show_message( __('Disable overwrite of wp-config.php...', 'xpressme') );
// remove wp-config.php from the new version into place.
$wp_config = $from . 'wp-config.php';
if ( !$wp_filesystem->delete($wp_config, true)){
return new WP_Error('delete_failed', $this->strings['delete_failed']);
}
// Copy new versions of XPressME Integration Kit files into place.
show_message( __('Copy new versions of XPressME Integration Kit files into place...', 'xpressme') );
$result = copy_dir($from . $distro, $to);
if ( is_wp_error($result) ) {
$wp_filesystem->delete($maintenance_file);
$wp_filesystem->delete($from, true);
return $result;
}
// Remove old files
show_message( __('Remove an unnecessary, old file...', 'xpressme') );
foreach ( $_old_xpress_files as $old_file ) {
$old_file = $to . $old_file;
if ( !$wp_filesystem->exists($old_file) )
continue;
$wp_filesystem->delete($old_file, true);
}
show_message( __('Set templates directory chmod 777', 'xpressme') );
$wp_filesystem->chmod($to . 'templates/', 0777);
// Remove working directory
$working_dir = dirname(dirname($from));
show_message( sprintf(__('Remove working directory(%s)...', 'xpressme'),$working_dir) );
$wp_filesystem->delete($working_dir, true);
}
示例8: do_login
public function do_login()
{
/** 检查登陆 */
if ($this->auth->is_admin()) {
redirect('admin/login/index');
}
$data['title'] = '用户登录';
if ($_POST) {
$data = array('username' => $this->input->post('username', TRUE), 'password' => $this->input->post('password', TRUE));
if ($this->user_m->login($data)) {
$uid = $this->session->userdata('uid');
//更新积分
$this->config->load('userset');
$this->user_m->update_credit($uid, $this->config->item('credit_login'));
//更新最后登录时间
$this->user_m->update_user($uid, array('lastlogin' => time()));
redirect('admin/login/index');
} else {
show_message('用户名或密错误!');
}
$captcha = $this->input->post('captcha_code');
if ($this->config->item('show_captcha') == 'on' && $this->session->userdata('yzm') != $captcha) {
show_message('验证码不正确');
}
} else {
$data['csrf_name'] = $this->security->get_csrf_token_name();
$data['csrf_token'] = $this->security->get_csrf_hash();
$this->load->view('do_login', $data);
}
}
示例9: show
public function show($tag_title, $page = 1)
{
$data['title'] = urldecode(strip_tags($tag_title));
//分页
$limit = 10;
$config['uri_segment'] = 4;
$config['use_page_numbers'] = TRUE;
$config['base_url'] = url('tag_show', '', $data['title']);
$data['tag'] = $this->db->select('topics')->where('tag_title', $data['title'])->get('tags')->row_array();
$config['total_rows'] = @$data['tag']['topics'];
$config['per_page'] = $limit;
$config['first_link'] = '首页';
$config['last_link'] = '尾页';
$config['num_links'] = 10;
$this->load->library('pagination');
$this->pagination->initialize($config);
$start = ($page - 1) * $limit;
$data['pagination'] = $this->pagination->create_links();
$data['tag_list'] = $this->tag_m->get_tag_topics_list($start, $limit, $data['title']);
if ($data['tag_list']) {
$this->load->view('tag_show', $data);
} else {
show_message('标签不存在', site_url());
}
}
示例10: after
function after()
{
$plugin_file = $this->upgrader->plugin_info();
$install_actions = array();
$from = isset($_GET['from']) ? stripslashes($_GET['from']) : 'plugins';
// One-Click flow
if (!empty($_GET['also']) && $_GET['also'] == 'activate') {
if (!$this->result || is_wp_error($this->result)) {
show_message(__('Cannot activate plugin.', 'wpsc'));
} else {
show_message(__('Activating the plugin…', 'wpsc'));
echo '<iframe style="border:0;overflow:hidden" width="100%" height="170px" src="' . wp_nonce_url('update.php?action=activate-plugin&networkwide=0&plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '"></iframe>';
}
} else {
$install_actions['activate_plugin'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin', 'wpsc') . '" target="_parent">' . __('Activate Plugin', 'wpsc') . '</a>';
if (is_multisite() && current_user_can('manage_network_plugins')) {
$install_actions['network_activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&networkwide=1&plugin=' . $plugin_file, 'activate-plugin_' . $plugin_file) . '" title="' . esc_attr__('Activate this plugin for all sites in this network', 'wpsc') . '" target="_parent">' . __('Network Activate', 'wpsc') . '</a>';
unset($install_actions['activate_plugin']);
}
}
$install_actions['store'] = '<a href="' . Sputnik_Admin::build_url() . '" title="' . esc_attr__('Return to Store', 'wpsc') . '" target="_parent" class="close">' . __('Return to Store', 'wpsc') . '</a>';
if (!$this->result || is_wp_error($this->result)) {
unset($install_actions['activate_plugin']);
unset($install_actions['network_activate']);
}
$install_actions = apply_filters('install_plugin_complete_actions', $install_actions, $this->api, $plugin_file);
if (!empty($install_actions)) {
$this->feedback(implode(' | ', (array) $install_actions));
}
}
示例11: show_profile_edit_form
function show_profile_edit_form($db)
{
//require 'CUsers.php';
// Get information of logged user.
$cUsers = new CUsers($db);
$ret = $cUsers->getUserInfo($_SESSION['id']);
// Create birthdate in correct format.
$tmp = explode('-', $ret[0]['birthdate']);
$ret[0]['birthdate'] = $tmp[2] . '.' . $tmp[1] . '.' . $tmp[0];
// Fields to add in form
$fields = array('id' => 'hidden', 'firstname' => 'text', 'lastname' => 'text', 'city' => 'text', 'homepage' => 'text', 'birthdate' => 'text', 'email' => 'text', 'password' => 'password', 'password_again' => 'password');
// Field names
$field_names = array('firstname' => 'Etunimi', 'lastname' => 'Sukunimi', 'password' => 'Salasana', 'password_again' => 'Salasana uudelleen', 'city' => 'Kaupunki', 'homepage' => 'Kotisivu', 'birthdate' => 'Syntymäpäivä (pv.kk.vvvv)', 'email' => 'Sähköposti');
echo '<div class="edit_profile">';
// Show message if there is any.
// For example message will be shown if user has changed
// his/her profile.
show_message();
echo '<form action="edit_profile.php" method="post">';
echo '<table>';
// Add every field in the form.
foreach ($fields as $key => $value) {
echo '<tr>';
// We do not want add empty input boxes for hidden values!
if ($value != 'hidden') {
echo '<td>';
echo $field_names[$key];
echo '</td>';
echo '<td>';
// If text field is other than password, then we
// should get user information as an default value.
if ($key != 'password' && $key != 'password_again') {
// If we are going to show birthdate, let's check
// if it is empty value, eg. 00.00.0000. If it is,
// then we want to show just empty string instead
// of that 00.00.0000.
if ($key == 'birthdate' && $ret[0][$key] == '00.00.0000') {
$ret[0][$key] = '';
}
echo '<input type="' . $value . '" value="' . $ret[0][$key] . '" name="' . $key . '">';
} else {
echo '<input type="' . $value . '" name="' . $key . '">';
}
echo '</td>';
}
echo '</tr>';
}
// "Päivitä tiedot" -button.
echo '<tr>';
echo '<td colspan="2">';
echo '<input type="submit" value="Päivitä">';
echo '</td>';
echo '</tr>';
echo '</table>';
echo '<div class="bottom_note">';
echo 'Huom! Jos jätät salasanakentät tyhjäksi, salasana ' . 'pysyy muuttamattomana!';
echo '</div>';
echo '</form>';
echo '</div>';
}
示例12: user_login
function user_login($username = '', $password = '', $ret = false)
{
if (empty($username)) {
if (!$ret) {
show_message('Please enter your username!');
} else {
$GLOBALS['smarty']->assign('error_mesg', 'Please enter your username!');
return false;
}
}
if (empty($password)) {
if (!$ret) {
show_message('Please enter your password!');
} else {
$GLOBALS['smarty']->assign('error_mesg', 'Please enter your password!');
return false;
}
}
$password = md5($password);
$user = $GLOBALS['db']->getRow("select * from author where username='{$username}' and password='{$password}'");
if (empty($user['user_id'])) {
if (!$ret) {
show_message('Wrong username or password!');
} else {
$GLOBALS['smarty']->assign('error_mesg', 'Wrong username or password!');
return false;
}
}
setcookie('user_id', $user['user_id'], time() + $GLOBALS['cookie_expire'] * 24 * 60 * 60);
setcookie('password', $user['password'], time() + $GLOBALS['cookie_expire'] * 24 * 60 * 60);
$GLOBALS['login_user'] = $user;
$GLOBALS['smarty']->assign('login_user', $user);
return true;
}
示例13: logout
public function logout($value = '')
{
$this->session->unset_userdata($this->session->userdata('user'));
$this->session->sess_destroy();
show_message("已退出登录。", "/", 302);
// header("location: http://".$_SERVER['HTTP_HOST']."/dede/bishe/index.php");
}
示例14: show
public function show($node_id, $page = 1)
{
//权限
if (!$this->auth->user_permit($node_id)) {
show_message('您无限访问此节点', site_url());
} else {
//分页
$limit = 10;
$config['uri_segment'] = 4;
$config['use_page_numbers'] = TRUE;
$config['base_url'] = site_url('node/show/' . $node_id);
$config['total_rows'] = $this->topic_m->count_topics($node_id);
$config['per_page'] = $limit;
$config['first_link'] = '首页';
$config['last_link'] = '尾页';
$config['num_links'] = 10;
$this->load->library('pagination');
$this->pagination->initialize($config);
$start = ($page - 1) * $limit;
$data['pagination'] = $this->pagination->create_links();
//获取列表
$data['topic_list'] = $this->topic_m->get_topics_list($start, $limit, $node_id);
$data['category'] = $this->cate_m->get_category_by_node_id($node_id);
$data['title'] = strip_tags($data['category']['cname']);
//获取分类
$this->load->model('cate_m');
$data['catelist'] = $this->cate_m->get_all_cates();
$this->load->view('node_show', $data);
}
}
示例15: __construct
function __construct()
{
parent::__construct();
/** 检查登陆 */
if (!$this->auth->is_admin()) {
show_message('非管理员或未登录', site_url('admin/login/do_login'));
}
}