Ejemplo n.º 1
0
	$auto['month'] = isset( $_POST['auto']['month'] ) ? intval( $_POST['auto']['month'] ) : formatTimestamp($time, 'n');
	$auto['day']   = isset( $_POST['auto']['day'] )   ? intval( $_POST['auto']['day'] )   : formatTimestamp($time, 'd');
	$auto['hour']  = isset( $_POST['auto']['hour'] )  ? intval( $_POST['auto']['hour'] )  : formatTimestamp($time, 'H');
	$auto['min']   = isset( $_POST['auto']['min'] )   ? intval( $_POST['auto']['min'] )   : formatTimestamp($time, 'i');
	$auto['sec']   = isset( $_POST['auto']['sec'] )   ? intval( $_POST['auto']['sec'] )   : date('s');
	$autoexp['year']  = isset( $_POST['autoexp']['year'] )  ? intval( $_POST['autoexp']['year'] )  : formatTimestamp($time, 'Y');
	$autoexp['month'] = isset( $_POST['autoexp']['month'] ) ? intval( $_POST['autoexp']['month'] ) : formatTimestamp($time, 'n');
	$autoexp['day']   = isset( $_POST['autoexp']['day'] )   ? intval( $_POST['autoexp']['day'] )   : formatTimestamp($time, 'd');
	$autoexp['hour']  = isset( $_POST['autoexp']['hour'] )  ? intval( $_POST['autoexp']['hour'] )  : formatTimestamp($time, 'H');
	$autoexp['min']   = isset( $_POST['autoexp']['min'] )   ? intval( $_POST['autoexp']['min'] )   : formatTimestamp($time, 'i');
	$autoexp['sec']   = isset( $_POST['autoexp']['sec'] )   ? intval( $_POST['autoexp']['sec'] )   : date('s');
	// new post
	if ( empty( $storyid ) ){
		$story->setVar('hostname', xoops_getenv('REMOTE_ADDR'));
		$story->setVar('uid', $my_uid);
		$story->devideHomeTextAndBodyText();

		// Whether the automatic approval
		// approve this article
		$approved = 0;
		if( $gperm->group_perm(2) ){
			$story->setVar('type', $story->getVar('approve') ); // GIJ
			$approved = $story->getVar('approve');
		}else{
			if( $gperm->proceed4topic("post_auto_approved",$topicid)){
				$story->setVar('type', 1);
				$approved = 1;
			}else{
				$story->setVar('type', 0);
				$approved = 0;
			}