summaryrefslogtreecommitdiff
path: root/includes/lookup_article_topic_inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/lookup_article_topic_inc.php')
-rw-r--r--includes/lookup_article_topic_inc.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/includes/lookup_article_topic_inc.php b/includes/lookup_article_topic_inc.php
new file mode 100644
index 0000000..373164c
--- /dev/null
+++ b/includes/lookup_article_topic_inc.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * @version $Header$
+ * @package articles
+ * @subpackage functions
+ */
+
+/**
+ * Initialization
+ */
+ global $gContent;
+ require_once( ARTICLES_PKG_CLASS_PATH.'BitArticle.php');
+
+ // if we already have a gContent, we assume someone else created it for us, and has properly loaded everything up.
+ if( empty( $gContent ) || !is_object( $gContent ) ) {
+ if (!empty($_REQUEST['topic_id']) && is_numeric($_REQUEST['topic_id'])) {
+ $gContent = new BitArticleTopic( $_REQUEST['topic_id'] );
+ } else {
+ $gContent = new BitArticleTopic();
+ }
+
+ if( empty( $gContent->mTopicId ) ) {
+ //handle legacy forms that use plain 'article' form variable name
+ } else {
+ $gContent->loadTopic();
+ }
+ $gBitSmarty->assignByRef( 'gContent', $gContent );
+ }