Beispiel #1
0
  				$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) ) {
					$sfile = new nw_sFiles();
  					$sfile->setFileRealName($file['filerealname']);
  					$sfile->setStoryid($news_newsid);
  					$sfile->date=$file['date'];
  					$sfile->setMimetype($file['mimetype']);
  					$sfile->setDownloadname($file['downloadname']);
  					$sfile->counter=$file['counter'];
  					$sfile->store();
  					echo '<br>&nbsp;&nbsp;&nbsp;&nbsp;This file was imported : '.$sfile->getDownloadname();
Beispiel #2
0
								@unlink($fullPictureName);
								rename($newName, $fullPictureName);
							}
							$story->Setpicture(basename($destname));
						} else {
							echo _AM_NW_UPLOAD_ERROR. ' ' . $uploader->getErrors();
						}
					} else {
						echo $uploader->getErrors();
					}
				}
			}
		}
		$destname = '';

		$result = $story->store();
		if ($result) {
			if ($approveprivilege && nw_getmoduleoption('tags', NW_MODULE_DIR_NAME)) {
				$tag_handler = xoops_getmodulehandler('tag', 'tag');
				$tag_handler->updateByItem($_POST['item_tag'], $story->storyid(), $xoopsModule->getVar('dirname'), 0);
	    	}

			if(!$editmode) {
				// 	Notification
				// TODO: modifier afin qu'en cas de prépublication, la notification ne se fasse pas
				$notification_handler =& xoops_gethandler('notification');
				$tags = array();
				$tags['STORY_NAME'] = $story->title();
				$tags['STORY_URL'] = NW_MODULE_URL . '/article.php?storyid=' . $story->storyid();
				// If notify checkbox is set, add subscription for approve
				if ($notifypub && $approve) {