diff options
| author | wjames5 <will@tekimaki.com> | 2007-03-18 18:49:59 +0000 |
|---|---|---|
| committer | wjames5 <will@tekimaki.com> | 2007-03-18 18:49:59 +0000 |
| commit | 13cdbe4e44888495cb095de79fa3ad03725a2e42 (patch) | |
| tree | d7e791357b872a70b9e55190ea81dd5c9f0f4d4e /lookup_post_inc.php | |
| parent | 7570b789f79e7120aaa046327d6004ffc3503423 (diff) | |
| download | blogs-13cdbe4e44888495cb095de79fa3ad03725a2e42.tar.gz blogs-13cdbe4e44888495cb095de79fa3ad03725a2e42.tar.bz2 blogs-13cdbe4e44888495cb095de79fa3ad03725a2e42.zip | |
init blogs refactoring
Diffstat (limited to 'lookup_post_inc.php')
| -rw-r--r-- | lookup_post_inc.php | 47 |
1 files changed, 37 insertions, 10 deletions
diff --git a/lookup_post_inc.php b/lookup_post_inc.php index 5c2f7f0..0f14e68 100644 --- a/lookup_post_inc.php +++ b/lookup_post_inc.php @@ -4,17 +4,44 @@ * @subpackage functions */ - global $gContent, $gBitSmarty; - + global $gContent; //, $gBitSmarty; + require_once( BLOGS_PKG_PATH.'BitBlogPost.php'); + require_once( LIBERTY_PKG_PATH.'lookup_content_inc.php' ); + if( empty( $gContent ) || !is_object( $gContent ) || !$gContent->isValid() ) { - $postId = !empty( $_REQUEST['post_id'] ) ? $_REQUEST['post_id'] : NULL; - $conId = !empty( $_REQUEST['content_id'] ) ? $_REQUEST['content_id'] : NULL; - $gContent = new BitBlogPost( $postId, $conId ); - $gContent->load(); - $comments_return_url = $_SERVER['PHP_SELF']."?post_id=$postId"; + // if blog_id supplied, use that + if( @BitBase::verifyId( $_REQUEST['post_id'] ) ) { + $gContent = new BitBlogPost( $_REQUEST['post_id'] ); + $gContent->load(); + } elseif( @BitBase::verifyId( $_REQUEST['content_id'] ) ) { + $gContent = new BitBlogPost( NULL, $_REQUEST['content_id'] ); + $gContent->load(); + } else { + $gContent = new BitBlogPost(); + } + $gBitSmarty->assign_by_ref( 'gContent', $gContent ); } + + + +/* OLD WAY OF WRITING THE ABOVE - DELETE - wjames5 +if( empty( $gContent ) || !is_object( $gContent ) || !$gContent->isValid() ) { + $postId = !empty( $_REQUEST['post_id'] ) ? $_REQUEST['post_id'] : NULL; + $conId = !empty( $_REQUEST['content_id'] ) ? $_REQUEST['content_id'] : NULL; + $gContent = new BitBlogPost( $postId, $conId ); + $gContent->load(); + $comments_return_url = $_SERVER['PHP_SELF']."?post_id=$postId"; + $gBitSmarty->assign_by_ref( 'gContent', $gContent ); +} +*/ + + + + +// MOVE THIS TO display_bitblogpost_inc.php -wjames5 +/* global $gContent_previous; if (!empty( $gContent) && !empty( $gContent->mInfo['blog_id'] ) ) { @@ -88,9 +115,9 @@ if (!empty( $gContent) && !empty( $gContent->mInfo['blog_id'] ) ) { # echo "gContent_next=" . serialize($gContent_next); # echo "Next title=" . $blogpost['title']; - } - - $gBitSmarty->assign_by_ref( 'gContent_next', $gContent_next ); } + $gBitSmarty->assign_by_ref( 'gContent_next', $gContent_next ); +} +*/ ?> |
