當前位置: 首頁>>代碼示例>>PHP>>正文


PHP msg類代碼示例

本文整理匯總了PHP中msg的典型用法代碼示例。如果您正苦於以下問題:PHP msg類的具體用法?PHP msg怎麽用?PHP msg使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了msg類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: try_login

 function try_login()
 {
     $this->user = $this->facebook->getUser();
     //defaultni vypis problemu s prihlasenim
     $l = new lang("layout");
     $msg = new msg();
     if ($this->user == null) {
         $msg->set_text($l->t("bad_fb_login"), "error");
         redirect($l->l("prihlaseni"));
     }
     //nyni mame udaje o uzivateli
     //pokusime se zjistit, zda-li jiz v databazi nekdo takovy je (fb_id)
     $sql = sql_query("select id, nick from users\n\t\t\t\t\t\t\t\t\t\t\t\t\twhere (fb_id = '" . $this->user . "')");
     $data = sql_fetch_object($sql);
     //jiz v databzi existuje
     if ($data->id) {
         $_SESSION['uid'] = $data->id;
         $_SESSION['me'] = new me($data->id);
         $_SESSION['me']->homepage_redirect();
     } else {
         $new_login = $this->create_login();
         if ($new_login) {
             $_SESSION['uid'] = $new_login[0];
             $_SESSION['me'] = new me($new_login[0]);
             //prvotni presun po registraci na nastaveni a doplneni udaju
             header("location: " . $l->l("osobni-udaje") . "?first=true");
             return true;
         }
     }
     $msg->set_text($l->t("bad_fb_login"), "error");
     redirect($l->l("prihlaseni"));
 }
開發者ID:janda2,項目名稱:Fitness-shop,代碼行數:32,代碼來源:my_facebook.php

示例2: module_register

 protected function module_register()
 {
     if ($this->module_is_logedin()) {
         header("Location:" . cls_general::create_url(array('plugin', 'users', 'action', 'profile')));
     } elseif ($this->settings['register'] == '0') {
         //new register was closed
         $msg = new msg();
         return $msg->msg('Warrning!', 'Register new user was closed by Administrator.', 'danger');
     }
     return $this->view_register();
 }
開發者ID:MrMiM,項目名稱:sarkesh,代碼行數:11,代碼來源:module.php

示例3: onDefault

 public function onDefault()
 {
     if (form::isPostBack()) {
         msg::error('開發中', '數據保存開發中,請稍後……');
     }
     $header['title'] = '係統設置';
     page::header($header);
     page::top();
     page::navbar($this->navbar(), 'main');
     form::header();
     block::header('網站基本信息');
     form::field(array('type' => 'text', 'label' => zotop::t('網站名稱'), 'name' => 'zotop.site.title', 'value' => zotop::config('zotop.site.title'), 'description' => zotop::t('網站名稱,將顯示在標題和導航中')));
     form::field(array('type' => 'text', 'label' => zotop::t('網站域名'), 'name' => 'zotop.site.domain', 'value' => zotop::config('zotop.site.domain'), 'description' => zotop::t('網站域名地址,不包含http://,如:www.zotop.com')));
     form::field(array('type' => 'text', 'label' => zotop::t('備案信息'), 'name' => 'zotop.site.icp', 'value' => zotop::config('zotop.site.icp'), 'description' => zotop::t('頁麵底部可以顯示 ICP 備案信息,如果網站已備案,在此輸入您的授權碼,它將顯示在頁麵底部,如果沒有請留空')));
     form::field(array('type' => 'select', 'options' => array('0' => '不顯示', '1' => '顯示'), 'label' => zotop::t('授權信息'), 'name' => 'zotop.site.license', 'value' => zotop::config('zotop.site.license'), 'description' => zotop::t('頁腳部位顯示程序官方網站鏈接')));
     form::field(array('type' => 'textarea', 'label' => zotop::t('網站簡介'), 'name' => 'zotop.site.about', 'value' => zotop::config('zotop.site.about')));
     block::footer();
     block::header('聯係信息設置');
     form::field(array('type' => 'text', 'label' => zotop::t('公司名稱'), 'name' => 'zotop.site.title', 'value' => '', 'description' => zotop::t('網站隸屬的公司或者組織名稱')));
     form::field(array('type' => 'textarea', 'label' => zotop::t('網站簡介'), 'name' => 'zotop.site.about', 'value' => ''));
     block::footer();
     form::buttons(array('type' => 'submit'), array('type' => 'back'));
     form::footer();
     page::bottom();
     page::footer();
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:26,代碼來源:setting.php

示例4: actionIndex

 public function actionIndex()
 {
     $db = zotop::db();
     if ($db->connect()) {
         zotop::redirect(zotop::url('database/table'));
     }
     msg::error('連接數據庫失敗,請檢查數據庫配置是否正確');
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:8,代碼來源:index.php

示例5: alert

 public static function alert($title, $content = '', $life = 0)
 {
     $msg = array();
     $msg['type'] = 'alert';
     $msg['title'] = empty($content) ? 'alert' : $title;
     $msg['content'] = empty($content) ? $title : $content;
     $msg['content'] = empty($content) ? $title : $content;
     $msg['life'] = $life;
     msg::show($msg);
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:10,代碼來源:msg.php

示例6: try_login

 function try_login()
 {
     //defaultni vypis problemu s prihlasenim
     $l = new lang("layout");
     $msg = new msg();
     //pokud nam google vrati code, muzeme se autentifikovat a ziksat token
     $code = clear("code");
     if ($code) {
         $this->client->authenticate();
         $this->token = $this->client->getAccessToken();
     }
     /*
     				//kdybychom chteli na nejake jine strance zase s uctem u googlu pracovat
     				// musimve vytvorit to spojeni a pomoci se token ze session se autorizovat u googlu
     				//ale mi tady session token nulujeme, takze uz se dal pouzit neda
     						if ($_SESSION['token']) {
     						  $this->client->setAccessToken($_SESSION['token']);
     						}
     				//kdyz ho chceme ziskat
     							  $_SESSION['token'] = $this->client->getAccessToken();
     */
     if ($this->token) {
         $my_data = $this->plus->people->get('me');
         $gp_id = $my_data['id'];
         //nyni mame udaje o uzivateli
         //pokusime se zjistit, zda-li jiz v databazi nekdo takovy je (gp_id)
         $sql = sql_query("select id, nick from users\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere (gp_id = '" . $gp_id . "')");
         $data = sql_fetch_object($sql);
         //jiz v databazi existuje
         if ($data->id) {
             $_SESSION['uid'] = $data->id;
             $_SESSION['me'] = new me($data->id);
             $_SESSION['me']->homepage_redirect();
         } else {
             $new_login = $this->create_login($my_data);
             if ($new_login) {
                 $_SESSION['uid'] = $new_login[0];
                 $_SESSION['me'] = new me($new_login[0]);
                 //prvotni presun po registraci na nastaveni a doplneni udaju
                 header("location: " . $l->l("osobni-udaje") . "?first=true");
                 return true;
             }
         }
     }
     $msg->set_text($l->t("bad_gplus_login"), "error");
     redirect($l->l("prihlaseni"));
 }
開發者ID:janda2,項目名稱:Fitness-shop,代碼行數:47,代碼來源:my_gplus.php

示例7: onDefault

 public function onDefault()
 {
     $db = zotop::db();
     if ($db->connect()) {
         zotop::redirect('database/table');
     }
     msg::error('連接數據庫失敗', '請檢查數據庫配置是否正確');
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:8,代碼來源:index.php

示例8: actionDelete

 public function actionDelete($id)
 {
     $file = zotop::model('zotop.file');
     $delete = $file->delete($id);
     if ($delete) {
         msg::success('刪除成功', request::referer());
     }
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:8,代碼來源:file.php

示例9: sqlAction

 public function sqlAction()
 {
     if (form::isPostBack()) {
         msg::error('該功能已經被禁用,請進入設置開啟');
     }
     $page = new dialog();
     $page->title = '數據庫管理:' . $database['database'] . ' @ ' . $database['hostname'] . '<i>></i> 執行sql語句';
     $page->display();
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:9,代碼來源:table.php

示例10: actionDelete

 public function actionDelete($id)
 {
     $category = zotop::model('blog.category');
     $category->id = $id;
     $category->delete();
     if (!$category->error()) {
         msg::success('刪除成功', zotop::url('blog/category/index'));
     }
     msg::error($category->msg());
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:10,代碼來源:category.php

示例11: actionImageFromUrl

 public function actionImageFromUrl($globalid, $field, $image)
 {
     if (form::isPostBack()) {
         msg::error('遠程獲取中……');
     }
     $page = new dialog();
     $page->set('title', '網絡圖片');
     $page->set('navbar', $this->navbar($globalid, $field, $image));
     $page->display();
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:10,代碼來源:upload.php

示例12: success

 /**
  * 顯示成功消息
  *
  */
 public static function success($content = '', $url = '', $life = 2)
 {
     $msg = array('type' => 'success', 'title' => zotop::t('success'), 'content' => '', 'detail' => '', 'url' => $url, 'life' => $life, 'action' => '');
     if (is_array($content)) {
         $msg = array_merge($msg, $content, array('type' => 'success'));
     } else {
         $msg['content'] = $content;
     }
     msg::show($msg);
 }
開發者ID:dalinhuang,項目名稱:zotop,代碼行數:14,代碼來源:msg.php

示例13: get_msg

 function get_msg()
 {
     $out = '';
     if (!empty($_SESSION['msg'])) {
         $out = $_SESSION['msg'];
     }
     $_SESSION['msg'] = '';
     msg::reset();
     return $out;
 }
開發者ID:salomay,項目名稱:refreshin,代碼行數:10,代碼來源:msg.php

示例14: update

 function update()
 {
     $manager = new manager();
     $manager->db->where('id=' . (int) $_GET['id']);
     $res = $manager->db->update($_POST);
     if ($res === false) {
         msg::info('back', $manager->db->msg, 'error');
     } else {
         msg::info('?c=manager');
     }
 }
開發者ID:robinhunan,項目名稱:coolphp,代碼行數:11,代碼來源:manager.php

示例15: update

 function update()
 {
     $__table__ = new __table__();
     $__table__->db->where('id=' . (int) $_GET['id']);
     $arr = $__table__->checkData($_POST);
     $res = $__table__->db->update($arr);
     if ($res === false) {
         msg::info('back', $__table__->db->msg, 'error');
     } else {
         msg::info('?c=__table__');
     }
 }
開發者ID:robinhunan,項目名稱:coolphp,代碼行數:12,代碼來源:modules.php


注:本文中的msg類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。