Ejemplo n.º 1
0
	$diffSeconds = time() - strtotime($articleObj->getLockTime());
	$hours = floor($diffSeconds/3600);
	$diffSeconds -= $hours * 3600;
	$minutes = floor($diffSeconds/60);
	$lockUser = new User($articleObj->getLockedByUser());
	camp_html_add_msg(getGS('Could not save the article. It has been locked by $1 $2 hours and $3 minutes ago.', $lockUser->getRealName(), $hours, $minutes));
	camp_html_goto_page($BackLink);
	exit;
}

// Update the first comment if the article title has changed
if ($f_article_title != $articleObj->getTitle()) {
	$firstPostId = ArticleComment::GetCommentThreadId($articleObj->getArticleNumber(), $articleObj->getLanguageId());
	if ($firstPostId) {
		$firstPost = new Phorum_message($firstPostId);
		$firstPost->setSubject($f_article_title);
	}
}

// Update the article author
if (!empty($f_article_author)) {
    ArticleAuthor::OnArticleLanguageDelete($articleObj->getArticleNumber(), $articleObj->getLanguageId());
    $i = 0;
    foreach ($f_article_author as $author) {
        $authorObj = new Author($author);
        if (!$authorObj->exists()  && strlen(trim($author)) > 0) {
            $authorData = Author::ReadName($author);
            $authorObj->create($authorData);
        }
        // Sets the author type selected
        $author_type = $f_article_author_type[$i];
Ejemplo n.º 2
0
        if (!$comment->exists()) {
            continue;
        }
        switch ($value) {
            case "inbox":
                $comment->setStatus(PHORUM_STATUS_HOLD);
                break;
            case "hide":
                $comment->setStatus(PHORUM_STATUS_HIDDEN);
                break;
            case "delete":
            	// Not allowed to delete first post.
            	if ($comment->getMessageId() != $comment->getThreadId()) {
	                $comment->delete();
	                ArticleComment::Unlink(null, null, $messageId);
            	}
                break;
            case "approve":
                $comment->setStatus(PHORUM_STATUS_APPROVED);
                break;
        }
        $subjectStr = Input::Get('f_subject_'.$messageId, 'string', '', true);
        $comment->setSubject($subjectStr);
        $commentStr = Input::Get('f_comment_'.$messageId, 'string', '', true);
        $comment->setBody($commentStr);
    }
}
camp_html_goto_page("/$ADMIN/comments/index.php");

?>