Procházet zdrojové kódy

#115 - albums module: incorrect next/prev items for popular context

Alex Trofimov před 11 roky
rodič
revize
3550b155a7

+ 1 - 1
modules/boonex/albums/classes/BxAlbumsDb.php

@@ -49,7 +49,7 @@ class BxAlbumsDb extends BxBaseModTextDb
 
     public function getMediaInfoById($iMediaId)
     {
-        $sQuery = $this->prepare ("SELECT `f2e`.*, `f`.`added`, `e`.`views` FROM `" . $this->_oConfig->CNF['TABLE_FILES2ENTRIES'] . "` AS `f2e` INNER JOIN `" . $this->_oConfig->CNF['TABLE_FILES'] . "` AS `f` ON (`f`.`id` = `f2e`.`file_id`) INNER JOIN `" . $this->_oConfig->CNF['TABLE_ENTRIES'] . "` AS `e` ON (`e`.`id` = `f2e`.`content_id`) WHERE `f2e`.`id` = ?", $iMediaId);
+        $sQuery = $this->prepare ("SELECT `f2e`.*, `f`.`added` FROM `" . $this->_oConfig->CNF['TABLE_FILES2ENTRIES'] . "` AS `f2e` INNER JOIN `" . $this->_oConfig->CNF['TABLE_FILES'] . "` AS `f` ON (`f`.`id` = `f2e`.`file_id`) INNER JOIN `" . $this->_oConfig->CNF['TABLE_ENTRIES'] . "` AS `e` ON (`e`.`id` = `f2e`.`content_id`) WHERE `f2e`.`id` = ?", $iMediaId);
         return $this->getRow($sQuery);
     }
 

+ 1 - 0
modules/boonex/albums/classes/BxAlbumsSearchResult.php

@@ -121,6 +121,7 @@ class BxAlbumsSearchResult extends BxBaseModTextSearchResult
                 $aSql['order'] = ' ORDER BY `bx_albums_albums`.`views` DESC';
                 break;
         }
+
         return $aSql;
     }
 

+ 2 - 2
modules/boonex/albums/classes/BxAlbumsSearchResultMedia.php

@@ -32,7 +32,7 @@ class BxAlbumsSearchResultMedia extends BxBaseModTextSearchResult
             'object_metatags' => 'bx_albums_media',
             'title' => _t('_bx_albums_media'),
             'table' => 'bx_albums_files2albums',
-            'ownFields' => array('id', 'title', 'data', 'content_id', 'file_id', 'order'),
+            'ownFields' => array('id', 'title', 'data', 'content_id', 'file_id', 'order', 'views'),
             'searchFields' => array('title'),
             'restriction_sql' => '',
             'restriction' => array(
@@ -45,7 +45,7 @@ class BxAlbumsSearchResultMedia extends BxBaseModTextSearchResult
                     'table' => 'bx_albums_albums',
                     'mainField' => 'content_id',
                     'onField' => 'id',
-                    'joinFields' => array('views'),
+                    'joinFields' => array(),
                 ),
                 'files' => array(
                     'type' => 'INNER',