Disneyland 1972 Love the old s
Mod lấy file đính kèm làm thumbinal topic johncms | Johncms | Wapmaster - Forum-VN #ref-menu
▼ Mod lấy file đính kèm làm thumbinal topic johncms
* Tamhoangdk
- Cấp bậc: admin
19-04-2016
@axma
mở mainmenu.php tìm
while ($res = mysql_fetch_array($req)) {
Copy code

chèn vào bên dưới :
$post_dt= mysql_fetch_array(mysql_query("SELECT * FROM `forum` WHERE `type` = 'm' AND `close` != '1' AND `refid` = '" . $res['id'] . "' ORDER BY `time` ASC LIMIT 1"));
$anh =mysql_result(mysql_query("SELECT * FROM `cms_forum_files` WHERE `post` = '" . $post_dt['id'] . "'"),0);
$file_anh =mysql_fetch_array(mysql_query("SELECT * FROM `cms_forum_files` WHERE `post` = '" . $post_dt['id'] . "'"));
if ($anh > 0){
$att_ext = strtolower(functions::format('./files/forum/attach/' . $file_anh['filename']));
$pic_ext = array('gif','jpg','jpeg','png');
if(in_array($att_ext, $pic_ext)){
$hienthi_anh='<img src="../files/forum/attach/' . (urlencode($file_anh['filename'])) . '" alt="hình ảnh" />';
} else {
$hienthi_anh="link ảnh khi không có đính kèm";
}
} else {
$hienthi_anh="link ảnh khi không có đính kèm";
}
Copy code

chèn vào chỗ muốn hiển thị :
echo $hienthi_anh;
Copy code

p/s: vừa viết xong chưa test nhá :troll2:
Nguồn: Inuwap.Mobi
▲ Tổng số: 1
- Share:
BBCode:

Link:
Online: Guests: 1

Từ khóa: Mod , lấy , file , lấy , kèm