예제 #1
0
		    $editmode = false;
		} else {
	    	$story = new nw_NewsStory($storyid);
	    	$editmode = true;
		}
		$story->setUid($uid);
		$story->setTitle($_POST['title']);
		$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 {