AntonLV 9 lat temu
rodzic
commit
4e1925c948

+ 24 - 0
inc/classes/BxDolDb.php

@@ -537,6 +537,30 @@ class BxDolDb extends BxDolFactory implements iBxDolSingleton
         return $aResult;
     }
 
+    public function fetchField($oStatement, $iField, $aBindings = array())
+    {
+        $aResult = array();
+        if(!$oStatement)
+            return $aResult;
+
+        else if(!($oStatement instanceof PDOStatement) && is_string($oStatement)) {
+            $oStatement = $this->prepare($oStatement);
+            if(!$this->res($oStatement, $aBindings))
+                return $aResult;
+        }
+
+        return $oStatement->getColumnMeta($iField);
+    }
+
+    public function isTableExists($sTable)
+    {
+        $aTableNames = $this->listTables();
+        foreach($aTableNames as $iKey => $sTableName)
+            $aTableNames[$iKey] = strtoupper($sTableName);
+
+        return in_array(strtoupper($sTable), $aTableNames);
+    }
+
     public function isFieldExists($sTable, $sFieldName)
     {
         $aFields = $this->getFields($sTable);

+ 1 - 1
modules/base/text/classes/BxBaseModTextTemplate.php

@@ -118,7 +118,7 @@ class BxBaseModTextTemplate extends BxBaseModGeneralTemplate
 
         $sPhotoThumb = '';
         $sPhotoGallery = '';
-        if(!empty($CNF['FIELD_THUMB']) && $aData[$CNF['FIELD_THUMB']]) {
+        if(!empty($CNF['FIELD_THUMB']) && !empty($aData[$CNF['FIELD_THUMB']])) {
 
             $oImagesTranscoder = BxDolTranscoderImage::getObjectInstance($CNF['OBJECT_IMAGES_TRANSCODER_PREVIEW']);
             if ($oImagesTranscoder)

+ 1 - 1
modules/boonex/forum/classes/BxForumSearchResult.php

@@ -21,7 +21,7 @@ class BxForumSearchResult extends BxBaseModTextSearchResult
             'object_metatags' => 'bx_forum',
             'title' => _t('_bx_forum_page_title_browse'),
             'table' => 'bx_forum_discussions',
-            'ownFields' => array('id', 'title', 'text', 'author', 'added', 'comments', 'lr_profile_id'),
+            'ownFields' => array('id', 'title', 'text', 'thumb', 'author', 'added', 'comments', 'lr_profile_id'),
             'searchFields' => array(),
             'restriction' => array(
                 'author' => array('value' => '', 'field' => 'author', 'operator' => '='),