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


PHP NewsStory::setNotifyPub方法代碼示例

本文整理匯總了PHP中NewsStory::setNotifyPub方法的典型用法代碼示例。如果您正苦於以下問題:PHP NewsStory::setNotifyPub方法的具體用法?PHP NewsStory::setNotifyPub怎麽用?PHP NewsStory::setNotifyPub使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在NewsStory的用法示例。


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

示例1: newPost

 function newPost()
 {
     if (!$this->_checkUser($this->params[1], $this->params[2])) {
         $this->response->add(new XoopsXmlRpcFault(104));
     } else {
         if (!($fields =& $this->_getPostFields(null, $this->params[0]))) {
             $this->response->add(new XoopsXmlRpcFault(106));
         } else {
             $missing = array();
             foreach ($fields as $tag => $detail) {
                 if (!isset($this->params[3][$tag])) {
                     $data = $this->_getTagCdata($this->params[3]['xoops_text'], $tag, true);
                     if (trim($data) == '') {
                         if ($detail['required']) {
                             $missing[] = $tag;
                         }
                     } else {
                         $post[$tag] =& $data;
                     }
                 } else {
                     $post[$tag] =& $this->params[3][$tag];
                 }
             }
             if (count($missing) > 0) {
                 $msg = '';
                 foreach ($missing as $m) {
                     $msg .= '<' . $m . '> ';
                 }
                 $this->response->add(new XoopsXmlRpcFault(109, $msg));
             } else {
                 // will be removed... don't worry if this looks bad
                 include_once XOOPS_ROOT_PATH . '/modules/news/class/class.newsstory.php';
                 $story = new NewsStory();
                 $error = false;
                 if (intval($this->params[4]) > 0) {
                     if (!$this->_checkAdmin()) {
                         // non admin users cannot publish
                         $error = true;
                         $this->response->add(new XoopsXmlRpcFault(111));
                     } else {
                         $story->setType('admin');
                         $story->setApproved(true);
                         $story->setPublished(time());
                     }
                 } else {
                     if (!$this->_checkAdmin()) {
                         $story->setType('user');
                     } else {
                         $story->setType('admin');
                     }
                 }
                 if (!$error) {
                     if (isset($post['categories']) && !empty($post['categories'][0])) {
                         $story->setTopicId(intval($post['categories'][0]['categoryId']));
                     } else {
                         $story->setTopicId(1);
                     }
                     $story->setTitle(addslashes(trim($post['title'])));
                     if (isset($post['moretext'])) {
                         $story->setBodytext(addslashes(trim($post['moretext'])));
                     }
                     if (!isset($post['hometext'])) {
                         $story->setHometext(addslashes(trim($this->params[3]['xoops_text'])));
                     } else {
                         $story->setHometext(addslashes(trim($post['hometext'])));
                     }
                     $story->setUid($this->user->getVar('uid'));
                     $story->setHostname($_SERVER['REMOTE_ADDR']);
                     if (!$this->_checkAdmin()) {
                         $story->setNohtml(1);
                     } else {
                         $story->setNohtml(0);
                     }
                     $story->setNosmiley(0);
                     $story->setNotifyPub(1);
                     $story->setTopicalign('R');
                     $ret = $story->store();
                     if (!$ret) {
                         $this->response->add(new XoopsXmlRpcFault(106));
                     } else {
                         $this->response->add(new XoopsXmlRpcString($ret));
                     }
                 }
             }
         }
     }
 }
開發者ID:BackupTheBerlios,項目名稱:haxoo-svn,代碼行數:87,代碼來源:xoopsapi.php

示例2: empty

 /**/
 $story->setHometext($post->getVar('post_text', 'e'));
 /**/
 $story->setUid($post->getVar('uid'));
 /**/
 $story->setTopicId(1);
 /**/
 $story->setHostname(xoops_getenv('REMOTE_ADDR'));
 /**/
 $dohtml = $post->getVar('dohtml');
 $nohtml = empty($dohtml) ? 1 : 0;
 $story->setNohtml($nohtml);
 /**/
 $story->setNosmiley(0);
 /**/
 $story->setNotifyPub(0);
 /**/
 $story->setType('admin');
 $story->setExpired(0);
 /**/
 $story->setTopicdisplay(0);
 /**/
 $story->setTopicalign('R');
 /**/
 $story->setIhome(0);
 /**/
 $story->setBodytext(' ');
 /**/
 $story->setExpired(0);
 /**/
 $story->setPublished(0);
開發者ID:BackupTheBerlios,項目名稱:soopa,代碼行數:31,代碼來源:posttonews.php

示例3: NewsStory

     } else {
         redirect_header("index.php", 3, _NOPERM);
         exit;
     }
 }
 $story = new NewsStory();
 $story->setTitle($subject);
 $story->setHometext($message);
 $story->setUid($uid);
 $story->setTopicId($topic_id);
 $story->setHostname(xoops_getenv('REMOTE_ADDR'));
 $story->setNohtml($nohtml_db);
 $nosmiley = isset($nosmiley) ? intval($nosmiley) : 0;
 $notifypub = isset($notifypub) ? intval($notifypub) : 0;
 $story->setNosmiley($nosmiley);
 $story->setNotifyPub($notifypub);
 $story->setType('user');
 if ($xoopsModuleConfig['autoapprove'] == 1) {
     $approve = 1;
     $story->setApproved($approve);
     $story->setPublished(time());
     $story->setExpired(0);
     $story->setTopicalign('R');
 }
 $result = $story->store();
 if ($result) {
     // Notification
     $notification_handler =& xoops_gethandler('notification');
     $tags = array();
     $tags['STORY_NAME'] = $subject;
     $tags['STORY_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/article.php?storyid=' . $story->storyid();
開發者ID:amjadtbssm,項目名稱:website,代碼行數:31,代碼來源:submit.php

示例4: while

 $news->setUid($text_lastversion['uid']);
 $news->setTitle($article['title']);
 $news->created = $article['created'];
 $news->setPublished($article['published']);
 $news->setExpired($article['expired']);
 $news->setHostname($article['hostname']);
 $news->setNohtml($article['nohtml']);
 $news->setNosmiley($article['nosmiley']);
 $news->setHometext($text_lastversion['hometext']);
 $news->setBodytext($text_lastversion['bodytext'] . $links . $forum);
 $news->Setkeywords('');
 $news->Setdescription('');
 $news->counter = $article['counter'];
 $news->setTopicId($news_topicid);
 $news->setIhome($article['ihome']);
 $news->setNotifyPub($article['notifypub']);
 $news->story_type = $article['story_type'];
 $news->setTopicdisplay($article['topicdisplay']);
 $news->setTopicalign($article['topicalign']);
 $news->setComments($article['comments']);
 $news->rating = $article['rating'];
 $news->votes = $votes['cpt'];
 $approved = $article['published'] > 0 ? true : false;
 $news->approved = $approved;
 $news->store($approved);
 echo '<br>&nbsp;&nbsp;This story was imported : ' . $news->title();
 $news_newsid = $news->storyid();
 // ********************
 // The files
 $result4 = $db->query('SELECT * FROM ' . $ams_files . ' WHERE storyid=' . $ams_newsid);
 while ($file = $db->fetchArray($result4)) {
開發者ID:BackupTheBerlios,項目名稱:haxoo-svn,代碼行數:31,代碼來源:amsimport.php


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