diff options
| -rw-r--r-- | BitArticle.php | 11 | ||||
| -rw-r--r-- | BitArticleTopic.php | 25 | ||||
| -rw-r--r-- | templates/article_display.tpl | 2 | ||||
| -rw-r--r-- | templates/center_list_articles.php | 2 | ||||
| -rw-r--r-- | templates/center_list_articles.tpl | 4 |
5 files changed, 24 insertions, 20 deletions
diff --git a/BitArticle.php b/BitArticle.php index bc33a19..55910fe 100644 --- a/BitArticle.php +++ b/BitArticle.php @@ -389,8 +389,12 @@ class BitArticle extends LibertyMime { $thumbHash['source_file'] = $pParamHash['image_attachment_path']; $ret = liberty_fetch_thumbnails( $thumbHash ); } elseif( !empty( $pParamHash['has_topic_image'] ) && $pParamHash['has_topic_image'] == 'y' ) { - $thumbHash['source_file'] = preg_replace( "#^/+#", "", BitArticleTopic::getTopicImageStorageUrl( $pParamHash['topic_id'] )); - $ret = liberty_fetch_thumbnails( $thumbHash ); + if( $topicImage = BitArticleTopic::getTopicImageStorageUrl( $pParamHash['topic_id'] ) ) { + global $gThumbSizes; + foreach( array_keys( $gThumbSizes ) as $size ) { + $ret[$size] = $topicImage; + } + } } return $ret; @@ -532,10 +536,11 @@ class BitArticle extends LibertyMime { a.`article_id`, a.`description`, a.`author_name`, a.`publish_date`, a.`expire_date`, a.`rating`, atopic.`topic_id`, atopic.`topic_name`, atopic.`has_topic_image`, atopic.`active_topic`, astatus.`status_id`, astatus.`status_name`, - lch.`hits`, + lch.`hits`, uu.`login`, atype.*, lc.*, la.`attachment_id` AS `primary_attachment_id`, lf.`file_name` AS `image_attachment_path` $selectSql FROM `".BIT_DB_PREFIX."articles` a INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON( lc.`content_id` = a.`content_id` ) + INNER JOIN `".BIT_DB_PREFIX."users_users` uu ON( uu.`user_id` = lc.`user_id` ) INNER JOIN `".BIT_DB_PREFIX."article_status` astatus ON( astatus.`status_id` = a.`status_id` ) LEFT OUTER JOIN `".BIT_DB_PREFIX."liberty_content_hits` lch ON( lc.`content_id` = lch.`content_id` ) LEFT OUTER JOIN `".BIT_DB_PREFIX."article_topics` atopic ON( atopic.`topic_id` = a.`topic_id` ) diff --git a/BitArticleTopic.php b/BitArticleTopic.php index 915857d..8fd2f4e 100644 --- a/BitArticleTopic.php +++ b/BitArticleTopic.php @@ -175,10 +175,7 @@ class BitArticleTopic extends BitBase { } if( @BitBase::verifyId( $pTopicId )) { - $ret = liberty_fetch_thumbnail_url( array( - 'source_file' => BitArticleTopic::getTopicImageBaseUrl( $pTopicId ), - 'default_image' => $gBitSystem->getConfig( 'articles_image_size', 'small' ) - )); + $ret = STORAGE_PKG_URL.ARTICLES_PKG_NAME.'/topic_'.$pTopicId.'.jpg'; } return $ret; } @@ -207,7 +204,7 @@ class BitArticleTopic extends BitBase { while( $res = $result->fetchRow() ) { $res["num_articles"] = $gBitSystem->mDb->getOne( "SELECT COUNT(*) FROM `".BIT_DB_PREFIX."articles` WHERE `topic_id`= ?", array( $res["topic_id"] ) ); if( empty( $res['topic_image_url'] ) && $res['has_topic_image'] == 'y' ) { - $res['topic_image_url'] = BitArticleTopic::getTopicImageStorageUrl( $res['topic_id'] ); + $res['topic_image_url'] = self::getTopicImageStorageUrl( $res['topic_id'] ); } $ret[] = $res; @@ -315,7 +312,7 @@ class BitArticleTopic extends BitBase { * @access public **/ function getTopicImageStoragePath( $pTopicId = NULL, $pBasePathOnly = FALSE ) { - $path = BitArticleTopic::getArticleImageStoragePath( NULL, TRUE ); + $path = self::getArticleImageStoragePath( NULL, TRUE ); if( $pBasePathOnly ) { return $path; @@ -330,7 +327,7 @@ class BitArticleTopic extends BitBase { } if( !empty( $pTopicId ) ) { - return $path.BitArticleTopic::getTopicImageStorageName( $pTopicId ); + return $path.self::getTopicImageStorageName( $pTopicId ); } else { return FALSE; } @@ -348,8 +345,8 @@ class BitArticleTopic extends BitBase { $ret = FALSE; // first we check to see if this is a new type thumbnail. if that fails we'll use the old method - if( !( $ret = BitArticleTopic::getTopicImageThumbUrl( $pTopicId ))) { - $url = BitArticleTopic::getArticleImageStorageUrl( NULL, TRUE ); + if( !( $ret = self::getTopicImageThumbUrl( $pTopicId ))) { + $url = self::getArticleImageStorageUrl( NULL, TRUE ); if( $pBasePathOnly ) { return $url; } @@ -362,8 +359,8 @@ class BitArticleTopic extends BitBase { } } - if( is_file( BitArticleTopic::getTopicImageStoragePath( NULL, TRUE ).BitArticleTopic::getTopicImageStorageName( $pTopicId ))) { - $ret = $url.BitArticleTopic::getTopicImageStorageName( $pTopicId ).( $pForceRefresh ? "?".$gBitSystem->getUTCTime() : '' ); + if( is_file( self::getTopicImageStoragePath( NULL, TRUE ).self::getTopicImageStorageName( $pTopicId ))) { + $ret = $url.self::getTopicImageStorageName( $pTopicId ).( $pForceRefresh ? "?".$gBitSystem->getUTCTime() : '' ); } } @@ -429,7 +426,7 @@ class BitArticleTopic extends BitBase { } if( !empty( $pArticleId ) ) { - return $path.BitArticleTopic::getArticleImageStorageName( $pArticleId ); + return $path.self::getArticleImageStorageName( $pArticleId ); } else { return FALSE; } @@ -457,8 +454,8 @@ class BitArticleTopic extends BitBase { } } - if( is_file( BitArticleTopic::getArticleImageStoragePath( NULL, TRUE ).BitArticleTopic::getArticleImageStorageName( $pArticleId ) ) ) { - return $url.BitArticleTopic::getArticleImageStorageName( $pArticleId ).( $pForceRefresh ? "?".$gBitSystem->getUTCTime() : '' ); + if( is_file( self::getArticleImageStoragePath( NULL, TRUE ).self::getArticleImageStorageName( $pArticleId ) ) ) { + return $url.self::getArticleImageStorageName( $pArticleId ).( $pForceRefresh ? "?".$gBitSystem->getUTCTime() : '' ); } else { return FALSE; } diff --git a/templates/article_display.tpl b/templates/article_display.tpl index 66f9be4..33610f9 100644 --- a/templates/article_display.tpl +++ b/templates/article_display.tpl @@ -25,7 +25,7 @@ <div class="date"> {if $article.show_author eq 'y'} {* can't really use the link here since it only works when the user uses his login name *} - {$article.author_name} + {displayname hash=$article} {/if} {if $article.show_pubdate eq 'y'} diff --git a/templates/center_list_articles.php b/templates/center_list_articles.php index 22d45f8..1f6c578 100644 --- a/templates/center_list_articles.php +++ b/templates/center_list_articles.php @@ -43,7 +43,7 @@ $_template->tpl_vars['articles'] = new Smarty_variable( $articles ); $_template->tpl_vars['listInfo'] = new Smarty_variable( $listHash['listInfo'] ); // show only descriptions on listing page -$gBitSmarty->assign( 'showDescriptionsOnly', TRUE ); +$_template->tpl_vars['showDescriptionsOnly'] = new Smarty_variable( TRUE ); // display submissions if we have the perm to approve them if( $gBitUser->hasPermission( 'p_articles_approve_submission' ) || ( $gBitSystem->isFeatureActive( 'articles_auto_approve' ) && $gBitUser->isRegistered() )) { diff --git a/templates/center_list_articles.tpl b/templates/center_list_articles.tpl index 1531e1b..897df09 100644 --- a/templates/center_list_articles.tpl +++ b/templates/center_list_articles.tpl @@ -28,7 +28,9 @@ {/if} {foreach from=$articles item=article} - {include file="bitpackage:articles/article_display.tpl"} + <div class="clear"> + {include file="bitpackage:articles/article_display.tpl"} + </div> {foreachelse} <p class="norecords"> {tr}No records found{/tr}<br /> |
