<?php /** * @version $Header$ * @package articles * @subpackage functions */ /** * Initialization */ $gBitSmarty->assignByRef('article', $gContent->mInfo); // get all the services that want to display something on this page $displayHash = array('perm_name' => 'p_articles_read'); $gContent->invokeServices('content_display_function', $displayHash); $topics = BitArticleTopic::getTopicList(); $gBitSmarty->assignByRef('topics', $topics); // Comments engine! if (@$gContent->mInfo['allow_comments'] == 'y') { $comments_vars = array('article'); $comments_prefix_var = 'article:'; $comments_object_var = 'article'; $commentsParentId = $gContent->mContentId; $comments_return_url = $_SERVER['SCRIPT_NAME'] . "?article_id=" . $_REQUEST['article_id']; include_once LIBERTY_PKG_PATH . 'comments_inc.php'; } // Display the Index Template $gBitSystem->display('bitpackage:articles/read_article.tpl', @$gContent->mInfo['title'], array('display_mode' => 'display'));
if (empty($_REQUEST['rating'])) { $_REQUEST['rating'] = 0; } if (empty($_REQUEST['topic_id'])) { $_REQUEST['topic_id'] = 0; } if ($gContent->store($_REQUEST)) { if (isset($gContent->mInfo['status_id']) and $gContent->mInfo['status_id'] == ARTICLE_STATUS_PENDING) { bit_redirect(ARTICLES_PKG_URL . "index.php?feedback=" . urlencode(tra('Your article has been submitted and is awaiting approval.'))); } else { bit_redirect(ARTICLES_PKG_URL . ($gBitSystem->isFeatureActive('pretty_urls_extended') || $gBitSystem->isFeatureActive('pretty_urls') ? $gContent->mArticleId : "read.php?article_id=" . $gContent->mArticleId)); } } } // Get a topic list $topics = BitArticleTopic::getTopicList(array('active_topic' => TRUE)); $gBitSmarty->assign_by_ref('topics', $topics); if (!empty($_REQUEST['topic'])) { $gBitSmarty->assign('topic', $_REQUEST['topic']); } // get list of valid types $types = BitArticleType::getTypeList(); $gBitSmarty->assign_by_ref('types', $types); if (!empty($gContent->mErrors) || !empty($feedback)) { $article = $gContent->preparePreview($_REQUEST); $gBitSmarty->assign_by_ref('article', $article); } $gBitSmarty->assign_by_ref('errors', $gContent->mErrors); $gBitSmarty->assign('feedback', !empty($feedback) ? $feedback : NULL); // Display the Index Template $gBitSmarty->assign('show_page_bar', 'n');