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


PHP NewsStory::setExpired方法代码示例

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


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

示例1: isset

 $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();
     if ($xoopsModuleConfig['autoapprove'] == 1) {
         $notification_handler->triggerEvent('global', 0, 'new_story', $tags);
     } else {
         $tags['WAITINGSTORIES_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/index.php?op=newarticle';
         $notification_handler->triggerEvent('global', 0, 'story_submit', $tags);
     }
开发者ID:amjadtbssm,项目名称:website,代码行数:31,代码来源:submit.php

示例2: isset

 $notifypub = isset($_POST['notifypub']) ? intval($_POST['notifypub']) : 0;
 $story->setNotifyPub($notifypub);
 $story->setType($_POST['type']);
 if (!empty($_POST['autodate']) && $approveprivilege) {
     $publish_date = $_POST['publish_date'];
     $pubdate = strtotime($publish_date['date']) + $publish_date['time'];
     //$offset = $xoopsUser -> timezone() - $xoopsConfig['server_TZ'];
     //$pubdate = $pubdate - ( $offset * 3600 );
     $story->setPublished($pubdate);
 }
 if (!empty($_POST['autoexpdate']) && $approveprivilege) {
     $expiry_date = $_POST['expiry_date'];
     $expiry_date = strtotime($expiry_date['date']) + $expiry_date['time'];
     $offset = $xoopsUser->timezone() - $xoopsConfig['server_TZ'];
     $expiry_date = $expiry_date - $offset * 3600;
     $story->setExpired($expiry_date);
 } else {
     $story->setExpired(0);
 }
 if ($approveprivilege) {
     if (news_getmoduleoption('metadata')) {
         $story->Setdescription($_POST['description']);
         $story->Setkeywords($_POST['keywords']);
     }
     $story->setTopicdisplay($_POST['topicdisplay']);
     // Display Topic Image ? (Yes or No)
     $story->setTopicalign($_POST['topicalign']);
     // Topic Align, 'Right' or 'Left'
     $story->setIhome($_POST['ihome']);
     // Publish in home ? (Yes or No)
     if (isset($_POST['bodytext'])) {
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:31,代码来源:submit.php

示例3: NewsStory

         }
         $links .= _AMS_NW_EXTERNALLINK . ' [url=' . $link['link_link'] . ']' . $link['link_title'] . '[/url]' . "\n";
     }
 }
 // The forum
 $forum = '';
 if ($use_forum && $one_amstopic['forum_id'] != 0) {
     $forum = "\n\n" . '[url=' . XOOPS_URL . '/modules/newbb/viewforum.php?forum=' . $one_amstopic['forum_id'] . ']' . _AMS_AM_LINKEDFORUM . '[/url]' . "\n";
 }
 // We create the story
 $news = new NewsStory();
 $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']);
开发者ID:BackupTheBerlios,项目名称:haxoo-svn,代码行数:31,代码来源:amsimport.php

示例4: elseif

         $story->setPublished($pubdate);
     } elseif ($story->published() == 0 && !empty($_POST['approve'])) {
         $story->setPublished(time());
         $isnew = 1;
     } else {
         if (!empty($_POST['movetotop'])) {
             $story->setPublished(time());
         }
     }
     if (!empty($_POST['autoexpdate'])) {
         $expdate = mktime($_POST['autoexphour'], $_POST['autoexpmin'], 0, $_POST['autoexpmonth'], $_POST['autoexpday'], $_POST['autoexpyear']);
         if (!empty($autoexpdate)) {
             $offset = $xoopsUser->timezone() - $xoopsConfig['server_TZ'];
         }
         $expdate = $expdate - $offset * 3600;
         $story->setExpired($expdate);
     }
 }
 $story->setApproved($_POST['approve']);
 $story->setTopicId($_POST['topicid']);
 $story->setTitle($_POST['title']);
 $story->setHometext($_POST['hometext']);
 $story->setBodytext($_POST['bodytext']);
 $nohtml = empty($_POST['nohtml']) ? 0 : 1;
 $nosmiley = empty($_POST['nosmiley']) ? 0 : 1;
 $story->setNohtml($nohtml);
 $story->setNosmiley($nosmiley);
 $story->setIhome($_POST['ihome']);
 $story->setTopicalign($_POST['topicalign']);
 $story->setTopicdisplay($_POST['topicdisplay']);
 $story->store();
开发者ID:koki-h,项目名称:xoops_utf8,代码行数:31,代码来源:index.php

示例5: NewsStory

	$post_handler =& xoops_getmodulehandler('post', 'xforum');
	$post=$post_handler->get($post_id);

	$story = new NewsStory();
	$story->setTitle($post->getVar('subject','e'));/**/
	$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);/**/
	$story->setApproved(0);/**/

	//save the story
	$result = $story->store();

	//notify
	if ($result)
	{
		$notification_handler =& xoops_gethandler('notification');
开发者ID:severnaya99,项目名称:Sg-2010,代码行数:31,代码来源:posttonews.php


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