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


PHP flash_message函数代码示例

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


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

示例1: add

 public function add($id = NULL)
 {
     $this->load->library('form_validation');
     $data = array();
     if ($id !== NULL) {
         $data = $this->mongo_db->user->findOne(array('_id' => new MongoID($id)));
         if (!count($data)) {
             show_404();
         }
         $this->form_validation->set_rules('confirm_password', 'Şifre tekrarı', 'trim|xss_clean|matches[password]');
     } else {
         $this->form_validation->set_rules('password', 'Şifre', 'trim|required|xss_clean');
         $this->form_validation->set_rules('confirm_password', 'Şifre tekrarı', 'trim|required|xss_clean|matches[password]');
     }
     $this->form_validation->set_rules('email', 'E-posta', 'trim|required|xss_clean|valid_email');
     $this->form_validation->set_rules('name', 'İsim', 'trim|required|xss_clean');
     if ($this->form_validation->run()) {
         if ($id === NULL) {
             $data['name'] = set_value('name');
             $data['permissions'] = set_value('permissions');
             if ($this->auth->create(set_value('email'), set_value('password'), $data)) {
                 flash_message('success', 'Üye başarıyla eklendi.');
             } else {
                 flash_message('error', $this->auth->get_error_messages());
             }
         } else {
             $data = array('name' => set_value('name'), 'email' => set_value('email'), 'password' => set_value('password'), 'permissions' => set_value('permissions'));
             $this->auth->update($id, $data);
             flash_message('success', 'Üye başarıyla düzenlendi.');
         }
         redirect('admin/user/index');
     }
     $this->template->view('admin/add', $data)->render();
 }
开发者ID:navruzm,项目名称:navruz.net,代码行数:34,代码来源:admin.php

示例2: update

 private function update()
 {
     global $db, $mybb, $cache, $lang;
     $new_settings = $drop_settings = array();
     // Get the gid
     $query = $db->simple_select("settinggroups", "gid", "name='mytwconnect'");
     $gid = (int) $db->fetch_field($query, "gid");
     // 1.0.2
     if (version_compare($this->old_version, '1.0.1', "<")) {
         require_once MYBB_ROOT . "inc/adminfunctions_templates.php";
         find_replace_templatesets('mytwconnect_usercp_settings', '#' . preg_quote('<input type="submit" value="{$lang->mytwconnect_settings_save}" />') . '#i', '<input type="submit" class=\\"button\\" value="{$lang->mytwconnect_settings_save}" />{$unlink}');
     }
     // 2.0
     if (version_compare($this->old_version, '2.0', "<")) {
         $new_settings[] = array("name" => "mytwconnect_twavatar", "title" => $db->escape_string($lang->setting_mytwconnect_twavatar), "description" => $db->escape_string($lang->setting_mytwconnect_twavatar_desc), "optionscode" => "yesno", "value" => 1, "disporder" => 30, "gid" => $gid);
         $new_settings[] = array("name" => "mytwconnect_tweet", "title" => $db->escape_string($lang->setting_mytwconnect_tweet), "description" => $db->escape_string($lang->setting_mytwconnect_tweet_desc), "optionscode" => "yesno", "value" => 0, "disporder" => 31, "gid" => $gid);
         $new_settings[] = array("name" => "mytwconnect_tweet_message", "title" => $db->escape_string($lang->setting_mytwconnect_tweet_message), "description" => $db->escape_string($lang->setting_mytwconnect_tweet_message_desc), "optionscode" => "textarea", "value" => $lang->mytwconnect_default_tweet, "disporder" => 32, "gid" => $gid);
         // Let's at least try to change that, anyway, 2.0 has backward compatibility so it doesn't matter if this fails
         require_once MYBB_ROOT . "inc/adminfunctions_templates.php";
         find_replace_templatesets('header_welcomeblock_guest', '#' . preg_quote('twlogin') . '#i', 'login');
     }
     if ($new_settings) {
         $db->insert_query_multiple('settings', $new_settings);
     }
     if ($drop_settings) {
         $db->delete_query('settings', "name IN ('mytwconnect_" . implode("','mytwconnect_", $drop_settings) . "')");
     }
     rebuild_settings();
     // Update the current version number and redirect
     $this->plugins[$this->info['name']] = array('title' => $this->info['name'], 'version' => $this->version);
     $cache->update('shade_plugins', $this->plugins);
     flash_message($lang->sprintf($lang->mytwconnect_success_updated, $this->old_version, $this->version), "success");
     admin_redirect($_SERVER['HTTP_REFERER']);
 }
开发者ID:forumwatt,项目名称:MyTwitter-Connect,代码行数:34,代码来源:class_update.php

示例3: uploadTop

 function uploadTop()
 {
     $this->load->library('file_lib');
     $this->session->set_userdata(array(config_item('session_admin') . 'menu_current' => 1));
     $cauhinh = new Cauhinh();
     $cauhinh->where('fieldname', "topBanner");
     $cauhinh->get();
     if (!$cauhinh->exists()) {
         show_404();
     }
     if ($_SERVER['REQUEST_METHOD'] == "POST") {
         $dataupload = $this->file_lib->upload('image', "img/banner");
         $this->resize_image("img/banner/" . $dataupload['file_name'], 1015, 267);
         if (!is_array($dataupload)) {
             flash_message('error', "Hình ảnh :" . $dataupload);
             $flag_error = true;
         } else {
             $cauhinh->value = $dataupload['file_name'];
             $cauhinh->save();
         }
     }
     $dis['cauhinh'] = $cauhinh;
     $dis['view'] = 'util/topBanner';
     $dis['menu_active'] = 'Banner top';
     $dis['title'] = "Thay đổi hình đại diện trang web";
     $dis['base_url'] = base_url();
     $this->viewadmin($dis);
 }
开发者ID:lxthien,项目名称:batdongsan,代码行数:28,代码来源:util.php

示例4: tslink_install

function tslink_install()
{
    global $db, $PL, $lang, $mybb;
    if (!$lang->tslink) {
        $lang->load('tslink');
    }
    if (!file_exists(PLUGINLIBRARY)) {
        flash_message($lang->tslink_pluginlibrary_missing, 'error');
        admin_redirect('index.php?module=config-plugins');
    }
    $PL or (require_once PLUGINLIBRARY);
    $PL->settings('tslink_settings', $lang->setting_group_tslink, $lang->setting_group_tslink_desc, ['enabled' => ['title' => $lang->setting_tslink_enable, 'description' => $lang->setting_tslink_enable_desc, 'value' => '1'], 'onregister' => ['title' => $lang->setting_tslink_onregister, 'description' => $lang->setting_tslink_onregister_desc, 'value' => '1'], 'admincp' => ['title' => $lang->setting_tslink_admincp, 'description' => $lang->setting_tslink_admincp_desc, 'value' => '1'], 'modcp' => ['title' => $lang->setting_tslink_modcp, 'description' => $lang->setting_tslink_modcp_desc, 'value' => '1'], 'usercp' => ['title' => $lang->setting_tslink_usercp, 'description' => $lang->setting_tslink_usercp_desc, 'value' => '1']]);
    if ($db->field_exists('memberstatus', 'users')) {
        // Don't do anything
    } else {
        // Insert our memberstatus column into the database.
        $db->query('ALTER TABLE ' . TABLE_PREFIX . 'users ADD (`memberstatus` int(10) NOT NULL DEFAULT 0)');
    }
    $db->query('CREATE TABLE IF NOT EXISTS ' . TABLE_PREFIX . 'tslink_uids (
          uid int(10) NOT NULL,
          ts_uid varchar(50) NOT NULL,
          ts_cldbid int(10) DEFAULT NULL,
          UNIQUE KEY (uid)
        ) ');
}
开发者ID:f0nt4,项目名称:TSLink,代码行数:25,代码来源:tslink.php

示例5: pages

function pages($params)
{
    global $pages_schema;
    $data = array('schema' => $pages_schema);
    $db = connect_database();
    //
    if (isset($params[0])) {
        $data['page'] = $params[0];
        //
        $found = false;
        $content = $db->query('SELECT stub, en, ch FROM content WHERE stub = \'' . $params[0] . '\'');
        if ($content = mysql_fetch_assoc($content)) {
            $data['content'] = $content;
            $found = true;
        }
        //
        if (isset($params['en'])) {
            if ($found) {
                $db->update('content', array('ch' => $params['ch'], 'en' => $params['en']), 'stub = \'' . $params['stub'] . '\'');
            } else {
                $db->insert('content', $params);
            }
            flash_message('Content is saved', 'success');
            redirect('admin', 'pages');
        }
    } else {
        $data['pages'] = $db->query('SELECT stub FROM content');
    }
    //
    $data['html_head'] = array('title' => 'Pages: Admin Dashboard');
    return $data;
}
开发者ID:vishva8kumara,项目名称:tinyF-x2-,代码行数:32,代码来源:admin.module.php

示例6: onPageRequest

 public function onPageRequest(PageRequestEvent $event)
 {
     global $database, $page, $user;
     if ($event->page_matches("untag")) {
         if ($user->can("ban_image")) {
             if ($event->get_arg(0) == "add") {
                 $tag = $_POST["tag"];
                 $redirect = isset($_POST['redirect']) ? $_POST['redirect'] : "DNP";
                 $database->Execute("INSERT INTO untags(tag, redirect) VALUES (?, ?)", array($tag, $redirect));
                 $page->set_mode("redirect");
                 $page->set_redirect($_SERVER['HTTP_REFERER']);
             } else {
                 if ($event->get_arg(0) == "remove") {
                     if (isset($_POST['tag'])) {
                         $database->Execute("DELETE FROM untags WHERE tag = ?", array($_POST['tag']));
                         flash_message("Image ban removed");
                         $page->set_mode("redirect");
                         $page->set_redirect($_SERVER['HTTP_REFERER']);
                     }
                 } else {
                     if ($event->get_arg(0) == "list") {
                         $page_num = 0;
                         if ($event->count_args() == 2) {
                             $page_num = int_escape($event->get_arg(1));
                         }
                         $page_size = 100;
                         $page_count = ceil($database->get_one("SELECT COUNT(tag) FROM untags") / $page_size);
                         $this->theme->display_untags($page, $page_num, $page_count, $this->get_untags($page_num, $page_size));
                     }
                 }
             }
         }
     }
 }
开发者ID:thelectronicnub,项目名称:shimmie2,代码行数:34,代码来源:main.php

示例7: index

 public function index()
 {
     if ($this->mongo_db->user->find()->count() && !$this->input->get('ok')) {
         show_error('Kurulum zaten yapılmış!');
     }
     $this->load->library('form_validation');
     $this->load->library('user/auth');
     $data = array();
     $this->form_validation->set_rules('password', 'Şifre', 'trim|required|xss_clean');
     $this->form_validation->set_rules('confirm_password', 'Şifre tekrarı', 'trim|required|xss_clean|matches[password]');
     $this->form_validation->set_rules('email', 'E-posta', 'trim|required|xss_clean|valid_email');
     $this->form_validation->set_rules('name', 'İsim', 'trim|required|xss_clean');
     if ($this->form_validation->run()) {
         $data['name'] = set_value('name');
         $data['permissions'] = set_value('permissions');
         if ($this->auth->create(set_value('email'), set_value('password'), $data, TRUE)) {
             set_option('site_name', set_value('site_name'));
             set_option('site_email', set_value('site_email'));
             set_option('per_page', 10);
             set_option('per_page_admin', 20);
             set_option('debug', 0);
             $navigation = array('slug' => 'HEAD_MENU', 'title' => 'Üst Menü', 'items' => array(array('title' => 'Anasayfa', 'url' => '/', 'access_level' => '0', 'target' => ''), array('title' => 'İletişim', 'url' => '/contact', 'access_level' => '0', 'target' => '')));
             $this->mongo_db->navigation->insert($navigation);
             flash_message('success', 'Üye başarıyla eklendi.');
             redirect('install?ok=1');
         }
     }
     $this->load->view('index', $data);
 }
开发者ID:navruzm,项目名称:navruz.net,代码行数:29,代码来源:install.php

示例8: mytwconnect_uninstall

function mytwconnect_uninstall()
{
    global $db, $PL, $cache, $lang;
    if (!$lang->mytwconnect) {
        $lang->load('mytwconnect');
    }
    if (!file_exists(PLUGINLIBRARY)) {
        flash_message($lang->mytwconnect_pluginlibrary_missing, "error");
        admin_redirect("index.php?module=config-plugins");
    }
    $PL or (require_once PLUGINLIBRARY);
    // Drop settings
    $PL->settings_delete('mytwconnect');
    // Delete our columns
    $db->query("ALTER TABLE " . TABLE_PREFIX . "users DROP `twavatar`, DROP `twbio`, DROP `twlocation`, DROP `mytw_uid`");
    // Delete the plugin from cache
    $info = mytwconnect_info();
    $shadePlugins = $cache->read('shade_plugins');
    unset($shadePlugins[$info['name']]);
    $cache->update('shade_plugins', $shadePlugins);
    $PL->templates_delete('mytwconnect');
    // Try to update templates
    require_once MYBB_ROOT . 'inc/adminfunctions_templates.php';
    find_replace_templatesets('header_welcomeblock_guest', '#' . preg_quote('&mdash; <a href="{$mybb->settings[\'bburl\']}/mytwconnect.php?action=login">{$lang->mytwconnect_login}</a>') . '#i', '');
}
开发者ID:forumwatt,项目名称:MyTwitter-Connect,代码行数:25,代码来源:mytwconnect.php

示例9: edit

 function edit($id = 0)
 {
     $this->load->library('file_lib');
     $metro = new metro($id);
     if ($_SERVER['REQUEST_METHOD'] == "GET") {
     } else {
         $metro->title = $this->input->post('title');
         $metro->link = $this->input->post('link');
         $metro->dir = 'img/metro';
         $metro->type = $this->input->post('type');
         $new_image = $this->input->post('newimage');
         $dataupload = $this->file_lib->upload('image', 'img/metro');
         if (!is_array($dataupload)) {
             //flash_message('error',$dataupload);
         } else {
             $metro->img = 'img/metro/' . $dataupload['file_name'];
         }
         if ($metro->save()) {
             flash_message('success', 'Thành công. Thao tác đã được thực hiện.');
             redirect($this->admin . 'metros/edit/' . $metro->id);
         }
     }
     $dis['base_url'] = base_url();
     $dis['title'] = "Add/Edit Metro Slideshow";
     $dis['menu_active'] = "Metro";
     $dis['view'] = "metro/edit";
     $dis['object'] = $metro;
     $dis['nav_menu'] = array(array("type" => "back", "text" => "Back", "link" => "{$this->admin_url}metros", "onclick" => ""));
     $this->viewadmin($dis);
 }
开发者ID:lxthien,项目名称:batdongsan,代码行数:30,代码来源:metros.php

示例10: inquiry

function inquiry($params)
{
    $data = array();
    //
    flash_message('Under Construction', 'warning');
    //
    $data['html_head'] = array('title' => 'Inquiry: Admin Dashboard');
    return $data;
}
开发者ID:Villvay,项目名称:veev,代码行数:9,代码来源:admin.module.php

示例11: vcs

function vcs($params)
{
    $data = array();
    //
    flash_message('Under Construction', 'warning');
    //
    $data['html_head'] = array('title' => 'Version Control System');
    return $data;
}
开发者ID:Villvay,项目名称:veev,代码行数:9,代码来源:developer.module.php

示例12: do_upgrade

	function do_upgrade() {
		if(!$this->upgrade_model->do_upgrade())
		{
			$this->upgrade_model->clean();
			log_message('error', 'upgrade.php do_upgrade(): failed upgrade');
			flash_message('error', _('Upgrade failed: check file permissions.'));
		}
		echo json_encode(array('href' => site_url('admin/upgrade')));
	}
开发者ID:Nakei,项目名称:FoOlSlide,代码行数:9,代码来源:upgrade.php

示例13: loginconvert_activate

function loginconvert_activate()
{
    global $db;
    // Don't activate the plugin if it isn't needed
    if (!$db->field_exists("passwordconvert", "users")) {
        flash_message("There's no need to activate this plugin as there aren't any passwords which need to be converted", "error");
        admin_redirect("index.php?module=config-plugins");
    }
}
开发者ID:styv300,项目名称:ToRepublic2.5,代码行数:9,代码来源:loginconvert.php

示例14: delete

 function delete()
 {
     $id = $this->uri->segment(4);
     $direction = new Estatedirection($id);
     //delete direction
     $direction->delete();
     flash_message('success', 'Xóa thành công');
     //redirect to direction
     redirect($this->admin . 'estatedirections/list_all');
 }
开发者ID:lxthien,项目名称:batdongsan,代码行数:10,代码来源:estatedirections.php

示例15: delete

 function delete()
 {
     $id = $this->uri->segment(4);
     $catalogue = new Landcategory($id);
     //delete catalogue
     $catalogue->delete();
     flash_message('success', 'Xóa thành công');
     //redirect to catalogue
     redirect($this->admin . 'landcategories/list_all');
 }
开发者ID:lxthien,项目名称:batdongsan,代码行数:10,代码来源:landcategories.php


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