コード例 #1
0
ファイル: post.php プロジェクト: amjadtbssm/website
             } else {
                 redirect_header("viewforum.php?forum=" . $forum, 2, _MD_ANONNOTALLOWED);
             }
             exit;
         }
     }
     $forumpost = new ForumPosts();
     $forumpost->setForum($forum);
     if (isset($pid) && $pid != "") {
         $forumpost->setParent($pid);
     }
     if (!empty($topic_id)) {
         $forumpost->setTopicId($topic_id);
         $isreply = 1;
     }
     $forumpost->setIp($HTTP_SERVER_VARS['REMOTE_ADDR']);
     $forumpost->setUid($uid);
 }
 $subject = xoops_trim($HTTP_POST_VARS['subject']);
 $subject = $subject == '' ? _NOTITLE : $subject;
 $forumpost->setSubject($subject);
 $forumpost->setText($HTTP_POST_VARS['message']);
 $forumpost->setNohtml($HTTP_POST_VARS['nohtml']);
 $forumpost->setNosmiley($HTTP_POST_VARS['nosmiley']);
 $forumpost->setIcon($HTTP_POST_VARS['icon']);
 $forumpost->setAttachsig($HTTP_POST_VARS['attachsig']);
 if (!($postid = $forumpost->store())) {
     include_once XOOPS_ROOT_PATH . '/header.php';
     xoops_error('Could not insert forum post');
     include_once XOOPS_ROOT_PATH . '/footer.php';
     exit;
コード例 #2
0
         $uid = $xoopsUser->getVar('uid');
     } else {
         // guest's post
         $uid = 0;
         // Insert guest name into the top of message (origined from Ryuji)
         if (!empty($_POST['guestname'])) {
             $_POST['message'] = sprintf(_MD_XHNEWBB_FMT_GUESTSPOSTHEADER, $_POST['guestname']) . @$_POST['message'];
         }
     }
     $forumpost = new ForumPosts();
     $forumpost->setForum($forum);
     if ($mode == 'reply') {
         $forumpost->setParent($pid);
         $forumpost->setTopicId($topic_id);
     }
     $forumpost->setIp(@$_SERVER['REMOTE_ADDR']);
     $forumpost->setUid($uid);
 }
 $subject = xoops_trim(@$_POST['subject']);
 $subject = $subject ? $subject : _NOTITLE;
 $icon = preg_match('/^icon[1-7]\\.gif$/', @$_POST['icon']) ? $_POST['icon'] : 'icon7.gif';
 $solved = empty($_POST['solved']) ? 0 : 1;
 $forumpost->setSubject($subject);
 $forumpost->setText(@$_POST['message']);
 $forumpost->setNohtml(@$_POST['nohtml']);
 $forumpost->setNosmiley(@$_POST['nosmiley']);
 $forumpost->setIcon($icon);
 if (!empty($xoopsModuleConfig['xhnewbb_use_solved']) && $isadminormod) {
     $forumpost->setSolved(@$_POST['solved']);
 }
 if ($forumdata['allow_sig']) {