summaryrefslogtreecommitdiff
path: root/lookup_article_topic_inc.php
blob: b6619ba95da346ca74d072572943083c8e7f0ead (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
/**
 * @version $Header$
 * @package articles
 * @subpackage functions
 */

/**
 * Initialization
 */
	global $gContent;
	require_once( ARTICLES_PKG_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 );
	}