• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Share mod xóa file đính kèm cho john cms

Hotro

Member
Mở forum/includes. Tạo 1 file với tên xoafile.php với nội dung:
PHP:
<?php
// code xoa file
defined('_IN_JOHNCMS') or die('Error: restricted access');
$error = false;
if ($rights >= 6) {
if ($id) {
//---Get info file---//
$req = mysql_query("SELECT * FROM `cms_forum_files` WHERE `id` = '$id'");
if (mysql_num_rows($req)) {
$res = mysql_fetch_array($req);
mysql_query("DELETE FROM `cms_forum_files` WHERE `id` = '$id'");
if (file_exists('../files/forum/attach/' . $res['filename'])) {
unlink('../files/forum/attach/' . $res['filename']);
}
require('../incfiles/head.php');
echo'<div class="rmenu">Đã xóa thành công</div>';
require('../incfiles/end.php');
} else {
$error = true;
}
if ($error) {
require('../incfiles/head.php');
echo '<div class="rmenu">Không thể xóa</div>';
require('../incfiles/end.php');
exit;
}
} else {
require('../incfiles/head.php');
echo functions::display_error($lng['error_wrong_data']);
require('../incfiles/end.php');
exit;
}
} else {
echo functions::display_error($lng['access_forbidden']);
}
?>
+Tiếp theo mở file index.php trong forum ra và tìm
PHP:
'vip',
'vote',
Chèn bên dưới:
PHP:
'xoafile',
Tìm tiếp:
PHP:
$file_id = $fres['id'];
Thêm bên dưới:
PHP:
if ($rights >= 6)
echo' <a href="index.php?act=xoafile&id=' . $fres['id'] . '">Xóa</a>';
if ($fls == 0) {
echo'
File đã bị xóa';
}
 

Facebook Comments

New posts New threads New resources

Back
Top