diff options
Diffstat (limited to 'includes/lookup_article_inc.php')
| -rw-r--r-- | includes/lookup_article_inc.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/includes/lookup_article_inc.php b/includes/lookup_article_inc.php new file mode 100644 index 0000000..75dfb92 --- /dev/null +++ b/includes/lookup_article_inc.php @@ -0,0 +1,32 @@ +<?php +/** + * @version $Header$ + * @package articles + * @subpackage functions + */ + +/** + * Initialization + */ +require_once( ARTICLES_PKG_CLASS_PATH.'BitArticle.php'); +require_once( LIBERTY_PKG_INCLUDE_PATH.'lookup_content_inc.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 (@BitBase::verifyId( $_REQUEST['article_id'] ) ) { + $gContent = new BitArticle( $_REQUEST['article_id'] ); + } elseif( @BitBase::verifyId( $_REQUEST['content_id'] ) ) { + $gContent = new BitArticle( NULL, $_REQUEST['content_id'] ); + } else { + $gContent = new BitArticle(); + $gContent->mInfo['expire_date'] = strtotime( "+1 year" ); + } + + if( empty( $gContent->mArticleId ) && empty( $gContent->mContentId ) ) { + //handle legacy forms that use plain 'article' form variable name + } else { + $gContent->load(); + } + $gBitSmarty->clearAssign( 'gContent' ); + $gBitSmarty->assign( 'gContent', $gContent ); +} |
