Exemplo n.º 1
0
						$links .= _AMS_MA_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_NW_LINKEDFORUM.'[/url]'."\n";
				}

				// We create the story
				$news = new nw_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']);
Exemplo n.º 2
0
		$story->setHometext($_POST['hometext']);
		$story->setTopicId(intval($_POST['topic_id']));
		$story->setHostname(xoops_getenv('REMOTE_ADDR'));
		$story->setNohtml($nohtml_db);
		$nosmiley = isset($_POST['nosmiley']) ? intval($_POST['nosmiley']) : 0;
		$story->setNosmiley($nosmiley);
		$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(nw_getmoduleoption('metadata', NW_MODULE_DIR_NAME)) {
				$story->Setdescription($_POST['description']);
        		$story->Setkeywords($_POST['keywords']);