• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Notify类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: actionSetMsg

 public function actionSetMsg()
 {
     $data = Yii::$app->request->post();
     $phone = User::findOne(['phone' => $data['phone']]);
     $info = CollectInteract::findOne(['userid' => $phone['id'], 'msg' => $data['msg']]);
     if ($info) {
         echo json_encode(array('flag' => 0, 'msg' => 'Already collect!'));
         return;
     }
     $to = Message::findOne(['id' => $data['msg']]);
     $model2 = new Notify();
     $model2->from = $phone['id'];
     $model2->to = $to['userid'];
     $model2->message = '收藏';
     $model2->created_at = time();
     if (!$model2->save()) {
         echo json_encode(array('flag' => 0, 'msg' => 'Collect fail!'));
         return;
     }
     $model = new CollectInteract();
     $model->userid = $phone['id'];
     $model->msg = $data['msg'];
     $model->created_at = time();
     if ($model->save()) {
         echo json_encode(array('flag' => 1, 'msg' => 'Collect success!'));
     } else {
         echo json_encode(array('flag' => 0, 'msg' => 'Collect fail!'));
     }
 }
开发者ID:Acker2015,项目名称:CustomizeLife,代码行数:29,代码来源:CollectController.php


示例2: controller_global

 public function controller_global()
 {
     $this->cms();
     $this->contact_form = new WaxForm(new GetInTouch());
     if ($data = $this->contact_form->save()) {
         $notify = new Notify();
         $notify->send_contact_details($data->row);
         $this->redirect_to("/thanks/contact");
     }
 }
开发者ID:eagermonkey,项目名称:signwebb,代码行数:10,代码来源:PageController.php


示例3: runTrigger

 /**
  * Function called when a Dolibarrr business event is done.
  * All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers or htdocs/module/code/triggers (and declared)
  *
  * @param string		$action		Event action code
  * @param Object		$object     Object
  * @param User		    $user       Object user
  * @param Translate 	$langs      Object langs
  * @param conf		    $conf       Object conf
  * @return int         				<0 if KO, 0 if no triggered ran, >0 if OK
  */
 public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
 {
     if (empty($conf->notification->enabled)) {
         return 0;
     }
     // Module not active, we do nothing
     dol_syslog("Trigger '" . $this->name . "' for action '{$action}' launched by " . __FILE__ . ". id=" . $object->id);
     require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
     $notify = new Notify($this->db);
     $notify->send($action, $object);
     return 1;
 }
开发者ID:Samara94,项目名称:dolibarr,代码行数:23,代码来源:interface_50_modNotification_Notification.class.php


示例4: actionNotifications

 public function actionNotifications($id = 0, $action = '')
 {
     if ($id) {
         $notify = Notify::model()->findByPK($id);
         if (!$notify) {
             throw new CHttpException(404, Yii::t('errors', 'Wrong notify'));
         } elseif ($action) {
             if ($notify->status == 2 || $notify->status == 3) {
                 throw new CHttpException(404, Yii::t('errors', 'Status already set'));
             }
             if ($notify->shared_id) {
                 $cam = Shared::model()->findByPK($notify->shared_id);
                 if (!$cam) {
                     $notify->delete();
                     throw new CHttpException(404, Yii::t('errors', 'Wrong cam'));
                 }
             } else {
                 $notify->delete();
                 throw new CHttpException(404, Yii::t('errors', 'Wrong cam'));
             }
             $n = new Notify();
             $id = Yii::app()->user->getId();
             if ($action == 'approve') {
                 //TODO specify user and cam
                 $n->note(Yii::t('user', 'User approve shared cam'), array($id, $notify->creator_id, 0));
                 $cam->is_approved = 1;
                 $cam->save();
                 $notify->status = 2;
                 $notify->save();
             } elseif ($action == 'disapprove') {
                 $n->note(Yii::t('user', 'User decline shared cam'), array($id, $notify->creator_id, 0));
                 $cam->is_approved = 0;
                 $cam->save();
                 $notify->status = 3;
                 $notify->save();
             } else {
                 throw new CHttpException(404, Yii::t('errors', 'Wrong action'));
             }
         } else {
             throw new CHttpException(404, Yii::t('errors', 'Wrong action'));
         }
     }
     $new = Notify::model()->findAllByAttributes(array('dest_id' => Yii::app()->user->getId(), 'status' => 1));
     $old = Notify::model()->findAllByAttributes(array('dest_id' => Yii::app()->user->getId(), 'status' => array(0, 2, 3)), array('order' => 'time DESC'));
     foreach ($new as $notify) {
         if ($notify->shared_id == 0) {
             $notify->status = 0;
             $notify->save();
         }
     }
     $this->render('notify', array('new' => $new, 'old' => $old));
 }
开发者ID:mrtos,项目名称:OpenNVR,代码行数:52,代码来源:UsersController.php


示例5: addDigg

 public function addDigg($feedId, $uid)
 {
     $data["feedid"] = $feedId;
     $data["uid"] = $uid;
     $data["uid"] = !$data["uid"] ? Ibos::app()->user->uid : $data["uid"];
     if (!$data["uid"]) {
         $this->addError("addDigg", "未登录不能赞");
         return false;
     }
     $isExit = $this->getIsExists($feedId, $uid);
     if ($isExit) {
         $this->addError("addDigg", "你已经赞过");
         return false;
     }
     $data["ctime"] = time();
     $res = $this->add($data);
     if ($res) {
         $feed = Source::getSourceInfo("feed", $feedId);
         Feed::model()->updateCounters(array("diggcount" => 1), "feedid = " . $feedId);
         Feed::model()->cleanCache($feedId);
         $user = User::model()->fetchByUid($uid);
         $config["{user}"] = $user["realname"];
         $config["{sourceContent}"] = StringUtil::filterCleanHtml($feed["source_body"]);
         $config["{sourceContent}"] = str_replace("◆", "", $config["{sourceContent}"]);
         $config["{sourceContent}"] = StringUtil::cutStr($config["{sourceContent}"], 34);
         $config["{url}"] = $feed["source_url"];
         $config["{content}"] = Ibos::app()->getController()->renderPartial("application.modules.message.views.remindcontent", array("recentFeeds" => Feed::model()->getRecentFeeds()), true);
         Notify::model()->sendNotify($feed["uid"], "message_digg", $config);
         UserUtil::updateCreditByAction("diggweibo", $uid);
         UserUtil::updateCreditByAction("diggedweibo", $feed["uid"]);
     }
     return $res;
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:33,代码来源:FeedDigg.php


示例6: notify

 function notify()
 {
     $order_id = $_GET['order_id'];
     $type = strtolower($_GET['type']);
     $type_arr = array('cancel', 'alert');
     if (!in_array($type, $type_arr)) {
         echo 'no_type';
         exit;
     }
     $order_model = M('Order');
     // 查找订单
     $order = $order_model->find($order_id);
     if (empty($order)) {
         echo 'no_order';
         exit;
     }
     if ($order['status'] > 1) {
         echo 'type_error';
         exit;
     }
     // 更改订单状态
     if ($type == 'cancel') {
         $order_model->setStatus($order['store_id'], $order['order_id'], 5);
         echo 'ok';
         exit;
     }
     if ($type == 'alert') {
         import('source.class.Notify');
         Notify::alert('尊敬的会员' . $order['address_user'] . '您好,您的订单号:' . $order_id . '未付款,请及时付款');
     }
 }
开发者ID:fkssei,项目名称:pigcms10,代码行数:31,代码来源:notify_controller.php


示例7: do_private_post

function do_private_post($content, $results)
{
    global $config, $speak;
    $results = Mecha::O($results);
    $results = $config->is->post ? Get::postHeader($results->path, POST . DS . $config->page_type, '/', $config->page_type . ':') : false;
    if ($results === false) {
        return $speak->plugin_private_post->description;
    }
    $s = isset($results->fields->pass) ? $results->fields->pass : "";
    if (strpos($s, ':') !== false) {
        $s = explode(':', $s, 2);
        if (isset($s[1])) {
            $speak->plugin_private_post->hint = ltrim($s[1]);
        }
        // override password hint
        $s = $s[0];
    }
    $hash = md5($s . PRIVATE_POST_SALT);
    $html = Notify::read(false) . '<div class="overlay--' . File::B(__DIR__) . '"></div><form class="form--' . File::B(__DIR__) . '" action="' . $config->url . '/' . File::B(__DIR__) . '/do:access" method="post">' . NL;
    $html .= TAB . Form::hidden('token', Guardian::token()) . NL;
    $html .= TAB . Form::hidden('_', $hash) . NL;
    $html .= TAB . Form::hidden('kick', $config->url_current) . NL;
    $html .= TAB . '<p>' . $speak->plugin_private_post->hint . '</p>' . NL;
    $html .= TAB . '<p>' . Form::text('access', "", $speak->password . '&hellip;', array('autocomplete' => 'off')) . ' ' . Form::button($speak->submit, null, 'submit') . '</p>' . NL;
    $html .= '</form>' . O_END;
    if ($results && isset($results->fields->pass) && trim($results->fields->pass) !== "") {
        if (!Guardian::happy() && Session::get('is_allow_post_access') !== $hash) {
            return $html;
        }
    }
    return $content;
}
开发者ID:tovic,项目名称:private-post-plugin-for-mecha-cms,代码行数:32,代码来源:launch.php


示例8: setFocus

 public function setFocus($setFocus, $runId, $uid)
 {
     $run = $this->fetchByPk(intval($runId));
     $focusUser = $run["focususer"];
     if ($setFocus) {
         if (StringUtil::findIn($focusUser, $uid)) {
             return false;
         } else {
             $focusUser = array_unique(array_merge(array($uid), !empty($focusUser) ? explode(",", $focusUser) : array()));
             $allUser = FlowRunProcess::model()->fetchAllUidByRunId($runId);
             if (!empty($allUser)) {
                 $config = array("{runName}" => $run["name"], "{userName}" => User::model()->fetchRealNameByUid($uid));
                 Notify::model()->sendNotify($allUser, "workflow_focus_notice", $config);
             }
         }
     } elseif (!StringUtil::findIn($focusUser, $uid)) {
         return false;
     } else {
         $userPart = explode(",", $focusUser);
         $index = array_search($uid, $userPart);
         if (is_int($index)) {
             unset($userPart[$index]);
         }
         $focusUser = $userPart;
     }
     return $this->modify($runId, array("focususer" => implode(",", $focusUser)));
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:27,代码来源:FlowRun.php


示例9: featured

 /**
  * Method to toggle the featured setting of a list of articles.
  *
  * @return	void
  * @since	1.6
  */
 function featured()
 {
     // Check for request forgeries
     Session::checkToken() or exit(Lang::txt('JINVALID_TOKEN'));
     // Initialise variables.
     $ids = Request::getVar('cid', array(), '', 'array');
     $values = array('featured' => 1, 'unfeatured' => 0);
     $task = $this->getTask();
     $value = \Hubzero\Utility\Arr::getValue($values, $task, 0, 'int');
     // Access checks.
     foreach ($ids as $i => $id) {
         if (!$user->authorise('core.edit.state', 'com_content.article.' . (int) $id)) {
             // Prune items that you can't change.
             unset($ids[$i]);
             Notify::warning(Lang::txt('JLIB_APPLICATION_ERROR_EDITSTATE_NOT_PERMITTED'));
         }
     }
     if (empty($ids)) {
         Notify::error(Lang::txt('JERROR_NO_ITEMS_SELECTED'));
     } else {
         // Get the model.
         $model = $this->getModel();
         // Publish the items.
         if (!$model->featured($ids, $value)) {
             throw new Exception($model->getError(), 500);
         }
     }
     $this->setRedirect('index.php?option=com_content&view=articles');
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:35,代码来源:articles.php


示例10: actionSetup

 public function actionSetup()
 {
     $formSubmit = EnvUtil::submitCheck("formhash");
     if ($formSubmit) {
         $data =& $_POST;
         foreach (array("sendemail", "sendsms", "sendmessage") as $field) {
             if (!empty($data[$field])) {
                 $ids = array_keys($data[$field]);
                 $idstr = implode(",", $ids);
                 Notify::model()->updateAll(array($field => 1), sprintf("FIND_IN_SET(id,'%s')", $idstr));
                 Notify::model()->updateAll(array($field => 0), sprintf("NOT FIND_IN_SET(id,'%s')", $idstr));
             } else {
                 Notify::model()->updateAll(array($field => 0));
             }
         }
         CacheUtil::update("NotifyNode");
         $this->success(Ibos::lang("Save succeed", "message"));
     } else {
         $nodeList = Notify::model()->getNodeList();
         foreach ($nodeList as &$node) {
             $node["moduleName"] = Module::model()->fetchNameByModule($node["module"]);
         }
         $this->render("setup", array("nodeList" => $nodeList));
     }
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:25,代码来源:NotifyController.php


示例11: delete

 /**
  * Removes an item
  */
 function delete()
 {
     // Check for request forgeries
     Session::checkToken() or exit(Lang::txt('JINVALID_TOKEN'));
     // Initialise variables.
     $ids = Request::getVar('cid', array(), '', 'array');
     // Access checks.
     foreach ($ids as $i => $id) {
         if (!User::authorise('core.delete', 'com_content.article.' . (int) $id)) {
             // Prune items that you can't delete.
             unset($ids[$i]);
             Notify::warning(Lang::txt('JERROR_CORE_DELETE_NOT_PERMITTED'));
         }
     }
     if (empty($ids)) {
         Notify::error(Lang::txt('JERROR_NO_ITEMS_SELECTED'));
     } else {
         // Get the model.
         $model = $this->getModel();
         // Remove the items.
         if (!$model->featured($ids, 0)) {
             throw new Exception($model->getError(), 500);
         }
     }
     $this->setRedirect('index.php?option=com_content&view=featured');
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:29,代码来源:featured.php


示例12: sms

 public function sms($params)
 {
     $module = $params['module'];
     $url = "";
     if ($params['params']) {
         $url = $this->OAuth2Url($this->buildUrl($params), $this->_base_config['APP']['sms']['agentid']);
     }
     $postData = array();
     switch ($params['module']) {
         case "email":
             $content = $url != "" ? $params['content'] . ("\n<a href='" . $url . "'>") . _("ÔĶÁÓʼþ") . "</a>" : $params['content'];
             $postData = array("touser" => $this->cUser($params['user']), "toparty" => $this->cDept($params['dept']), "msgtype" => "text", "agentid" => $this->_base_config['APP']['sms']['agentid'], "text" => array("content" => $content), "safe" => "0");
             break;
         case "news":
             $picurl = "";
             include_once "oa.news.php";
             //( );
             $News = new News();
             $row = $News->getById("SUBJECT,CONTENT,ATTACHMENT_ID,ATTACHMENT_NAME,TO_ID,USER_ID,SUMMARY", $params['params']);
             $picurl = $News->getFirstImage("news", $row['ATTACHMENT_ID'], $row['ATTACHMENT_NAME']);
             $description = $row['SUMMARY'] == "" ? csubstr(strip_tags($this->cContent($row['CONTENT'])), 0, 30, TRUE, 1) . "..." : strip_tags($this->cContent($row['SUMMARY']));
             if ($picurl != "") {
                 $picurl = $this->buildAttachUrl("http://" . BASE_URL . $picurl, $this->_base_config['APP']['sms']['agentid']);
             }
             $postData = array("touser" => $this->cUser($row['USER_ID'], $row['TO_ID']), "toparty" => $row['TO_ID'] == "ALL_DEPT" ? "" : $this->cDept($row['TO_ID']), "msgtype" => "news", "agentid" => $this->_base_config['APP']['sms']['agentid'], "news" => array("articles" => array(array("title" => strip_tags($row['SUBJECT']), "description" => $description, "url" => $url, "picurl" => $picurl))));
             //parent::logs("test",$url);
             break;
         case "notify":
             $picurl = "";
             include_once "oa.notify.php";
             //( );
             $Notify = new Notify();
             $row = $Notify->getById("SUBJECT,CONTENT,ATTACHMENT_ID,ATTACHMENT_NAME,TO_ID,USER_ID,SUMMARY", $params['params']);
             $picurl = $Notify->getFirstImage("notify", $row['ATTACHMENT_ID'], $row['ATTACHMENT_NAME']);
             $description = $row['SUMMARY'] == "" ? csubstr(strip_tags($this->cContent($row['CONTENT'])), 0, 30, TRUE, 1) . "..." : strip_tags($this->cContent($row['SUMMARY']));
             if ($picurl != "") {
                 $picurl = $this->buildAttachUrl("http://" . BASE_URL . $picurl, $this->_base_config['APP']['sms']['agentid']);
             }
             $postData = array("touser" => $this->cUser($row['USER_ID'], $row['TO_ID']), "toparty" => $row['TO_ID'] == "ALL_DEPT" ? "" : $this->cDept($row['TO_ID']), "msgtype" => "news", "agentid" => $this->_base_config['APP']['sms']['agentid'], "news" => array("articles" => array(array("title" => strip_tags($row['SUBJECT']), "description" => $description, "url" => $url, "picurl" => $picurl))));
             //parent::logs("test",$url);
             break;
         default:
             $postData = array("touser" => $this->cUser($params['user']), "toparty" => $this->cDept($params['dept']), "msgtype" => "text", "agentid" => $this->_base_config['APP']['sms']['agentid'], "text" => array("content" => $params['content']), "safe" => "0");
     }
     $rs = $this->postData($this->url['send'], $postData);
 }
开发者ID:sany217,项目名称:WeiXin,代码行数:46,代码来源:weixinqy.message.funcs.php


示例13: readNotify

 public function readNotify($array)
 {
     $criteria = new CDbCriteria();
     foreach ($array as $id) {
         $criteria->addCondition('id=' . (int) $id, 'OR');
     }
     Notify::model()->updateAll(array('read' => Notify::READ), $criteria);
 }
开发者ID:bookin,项目名称:yii-notification-center,代码行数:8,代码来源:NotifyUrlHandler.php


示例14: ProcessRequest

 function ProcessRequest()
 {
     $objNotify = new Notify();
     if (isset($_GET['notifId'])) {
         $arrModule = $objNotify->GetModuleFromNotify($_GET['notifId']);
         $urlRedirect = Dispatcher::Instance()->GetUrl($arrModule['module'], $arrModule['submodule'], $arrModule['action'], $arrModule['type']) . $arrModule['notifyUrl'];
         return array('exec' => 'GtfwAjax.replaceContentWithUrl("subcontent-element","' . $urlRedirect . '&ascomponent=1")');
     }
     if (isset($_GET['readNotifyId'])) {
         $objNotify->setReadNotify($_GET['readNotifyId']);
     }
     if (isset($_GET['statusMessage'])) {
         $message = $objNotify->GetAllNotify();
     } else {
         $message = $objNotify->GetUnloadNotify();
     }
     return array("exec" => "setNotify(" . json_encode($message) . ")");
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:18,代码来源:ViewNotify.json.class.php


示例15: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store()
 {
     $lesson = Lesson::create(Input::all());
     // Alternatively, fire and listen for an event
     // Then, call this from the listener.
     Notify::lessonSubscribers($lesson);
     return 'Success';
     // or redirect or whatever
 }
开发者ID:billwaddyjr,项目名称:Email-Notifications-With-Mailchimp,代码行数:14,代码来源:LessonsController.php


示例16: addTask

 /**
  * Create a new member
  *
  * @return     void
  */
 public function addTask()
 {
     Request::setVar('hidemainmenu', 1);
     // Set any errors
     foreach ($this->getErrors() as $error) {
         \Notify::error($error);
     }
     // Output the HTML
     $this->view->setLayout('add')->display();
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:15,代码来源:members.php


示例17: cargo

 /**
  * Default Shortcut Variable(s)
  * ----------------------------
  */
 public static function cargo()
 {
     $config = Config::get();
     $token = Guardian::token();
     $results = array('config' => $config, 'speak' => $config->speak, 'articles' => $config->articles, 'article' => $config->article, 'pages' => $config->pages, 'page' => $config->page, 'pager' => $config->pagination, 'manager' => Guardian::happy(), 'token' => $token, 'messages' => Notify::read(false), 'message' => Notify::read(false));
     Session::set(Guardian::$token, $token);
     unset($config, $token);
     self::$lot = array_merge(self::$lot, $results);
     return self::$lot;
 }
开发者ID:AdeHaze,项目名称:mecha-cms,代码行数:14,代码来源:shield.php


示例18: run

 /**
  * @inheritdoc
  */
 public function run()
 {
     if ($this->requiresPjax()) {
         echo Notify::widget($this->notifyOptions);
     }
     $id = $this->options['id'];
     if ($this->modal) {
         $this->getView()->registerJs("Admin.Modal.pjax('#{$id}');");
     }
     parent::run();
 }
开发者ID:skoro,项目名称:yii2-admin-template,代码行数:14,代码来源:Pjax.php


示例19: send

 public function send($bodyId, $bodyData, $inboxId = EmailBaseController::INBOX_ID)
 {
     $toids = $bodyData["toids"] . "," . $bodyData["copytoids"] . "," . $bodyData["secrettoids"];
     $toid = StringUtil::filterStr($toids);
     foreach (explode(",", $toid) as $uid) {
         $email = array("toid" => $uid, "fid" => $inboxId, "bodyid" => $bodyId);
         $newId = $this->add($email, true);
         $config = array("{sender}" => Ibos::app()->user->realname, "{subject}" => $bodyData["subject"], "{url}" => Ibos::app()->urlManager->createUrl("email/content/show", array("id" => $newId)), "{content}" => Ibos::app()->getController()->renderPartial("application.modules.email.views.remindcontent", array("body" => $bodyData), true));
         Notify::model()->sendNotify($uid, "email_message", $config);
     }
 }
开发者ID:AxelPanda,项目名称:ibos,代码行数:11,代码来源:Email.php


示例20: testGetSegment

 /**
  * @covers NativeURI::getSegment
  * @depends testGetCurrentUrl
  */
 public function testGetSegment($data)
 {
     $url = $data['url'];
     $index0 = 0;
     $expected = 'localhost';
     $actual = $this->object->getSegment($index0, $url);
     $this->assertEquals($expected, $actual);
     $index1 = 1;
     $expected = 'NotifyNativeDemo';
     $actual = $this->object->getSegment($index1, $url);
     $this->assertEquals($expected, $actual);
 }
开发者ID:jeykeu,项目名称:notify,代码行数:16,代码来源:NativeURITest.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP NullStatsPage类代码示例发布时间:2022-05-23
下一篇:
PHP Notifier类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap