Skip to content

Commit 8bb4de9

Browse files
author
Hồ Ngọc Triển
committed
Module page: get thumb image
1 parent 9f21198 commit 8bb4de9

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

modules/page/theme.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,13 @@ function nv_page_main_list($array_data, $generate_page)
100100
if (! empty($array_data)) {
101101
foreach ($array_data as $row) {
102102
if (! empty($row['image'])) {
103-
$row['image'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/' . $row['image'];
103+
if(file_exists(NV_ROOTDIR . '/' . NV_ASSETS_DIR . '/' . $module_upload . '/' . $row['image'])){
104+
$row['image'] = NV_BASE_SITEURL . NV_ASSETS_DIR . '/' . $module_upload . '/' . $row['image'];
105+
}elseif(file_exists(NV_ROOTDIR . '/' . NV_UPLOADS_DIR . '/' . $module_upload . '/' . $row['image'])){
106+
$row['image'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . '/' . $module_upload . '/' . $row['image'];
107+
}else{
108+
$row['image'] = '';
109+
}
104110
$row['imagealt'] = ! empty($row['imagealt']) ? $row['imagealt'] : $row['title'];
105111
}
106112

uploads/news/hoptac 6.jpg

12.6 KB
Loading

0 commit comments

Comments
 (0)