Beispiel #1
0
     if ($xoopsUser->isAdmin($xoopsModule->mid())) {
         $nohtml_db = empty($nohtml) ? 0 : 1;
     }
 } else {
     if ($wfsConfig['anonpost'] == 1) {
         $uid = 0;
     } else {
         redirect_header("index.php", 3, _NW_ANONNOTALLOWED);
         exit;
     }
 }
 $story = new WfsArticle();
 $story->setTitle($subject);
 $story->setMainText($message);
 $story->setSummary($summary);
 $story->setUid($uid);
 $story->setCategoryid($id);
 $story->setNohtml($nohtml_db);
 $nosmiley = isset($nosmiley) ? intval($nosmiley) : 0;
 $notifypub = isset($notifypub) ? intval($notifypub) : 0;
 $story->setHtmlpage("");
 $story->setIshtml(0);
 $story->setWeight(100);
 //$story->setGroupid($groupid);
 $story->setGroupid($groupid);
 $story->setNosmiley($nosmiley);
 $story->setPublished(0);
 $story->setExpired(0);
 $story->setNotifyPub($notifypub);
 echo $story->articleid;
 $story->setType('user');
Beispiel #2
0
                echo _AM_NOTITLE."<br />";
                echo"</td></tr></table>";
                break;
	        }
        	if(!empty($_POST['articleid'])){
 		   		$article = new WfsArticle($_POST['articleid']);
           		if ($_POST['changeuser'] == '-1') {
            		$article->setUid($article->uid());
				} else {
					$article->setUid($_POST['changeuser']);
				}								
			}else{
				$article = new WfsArticle();
				if ($_POST['changeuser'] == '-1') {
            		$uid = $xoopsUser->getvar('uid');
					$article->setUid($uid);
				} else {
					$article->setUid($_POST['changeuser']);
				}				
				$article->settype("admin");
		        $article->setPublished(time());
			}

			$article->loadPostVars();

// supress notice: Undefined index: ishtml
//			if (empty($_POST['maintext']) || $_POST['ishtml']) {
			if (empty($_POST['maintext']) || (isset($_POST['ishtml']) && $_POST['ishtml'] ) )
			{
                xoops_cp_header();
                echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"even\">";
Beispiel #3
0
     echo _AM_NOTITLE . "<br />";
     echo "</td></tr></table>";
     break;
 }
 if (!empty($HTTP_POST_VARS['articleid'])) {
     $article = new WfsArticle($HTTP_POST_VARS['articleid']);
     if ($HTTP_POST_VARS['changeuser'] == '-1') {
         $article->setUid($article->uid());
     } else {
         $article->setUid($HTTP_POST_VARS['changeuser']);
     }
 } else {
     $article = new WfsArticle();
     if ($HTTP_POST_VARS['changeuser'] == '-1') {
         $uid = $xoopsUser->getvar('uid');
         $article->setUid($uid);
     } else {
         $article->setUid($HTTP_POST_VARS['changeuser']);
     }
     $article->settype("admin");
     $article->setPublished(time());
 }
 $article->loadPostVars();
 if (empty($HTTP_POST_VARS['maintext']) || $HTTP_POST_VARS['ishtml']) {
     xoops_cp_header();
     echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"even\">";
     //echo $HTTP_POST_VARS['ishtml'];
     echo _AM_NOMAINTEXT . "<br />";
     echo "</td></tr></table>";
     break;
 }
Beispiel #4
0
function db_store($maintext,$title,$time)
{
	global $xoopsUser, $wfsConfig;

	$cid       = $_POST['categoryid'];
	$flag_test = $_POST['test'];

	if ($flag_test) { return; }
	if (!$maintext) { return false; }
	if (!$title)    { return false; }
	if (!$time)     { return false; }
	if (!$cid)      { return false; }

	$article = new WfsArticle();

// bug 
// title occure error in DB processing, whiche have an escape character
//	$article->setTitle($title);

// bug
// double addslashes when magic_quotes_gpc is off 
//	$article->setTitle( addslashes($title) );
//	$article->setMainText( addslashes($maintext) );

	if (get_magic_quotes_gpc()) 
	{
		$title    = addslashes($title);
		$maintext = addslashes($maintext);
	}

	$article->setTitle( $title );
	$article->setMainText( $maintext );

	$article->setPublished($time);
	$article->setCategoryid($cid);
	$article->setUid( $xoopsUser->getvar('uid') );

	$article->settype("admin");
	$article->groupid = saveAccess('1 3 2'); // admin guest user
	$article->setChangeuser(-1);
	$article->setHtmlpage('');
	$article->setWeight(0);
	$article->setExpired(0);
	$article->noshowart = 0;
	$article->nohtml    = 0;
	$article->nosmiley  = 0;
	$article->approved  = 0;
	$article->offline   = 0;
	$article->notifypub = 0;
	$article->ishtml    = 0;
	$article->nobr      = 1;
	$article->enaamp    = 1;

	if ( $article->store() ) { return true; }
	else { return false; }
}