After modifying several files, Dedecms version 5.3 (GB) can delete pictures and other attachments while deleting files

Source: Internet
Author: User

After several days of testing, modify a few files, version 5.3 (GB) in the delete file can delete pictures and other accessories. Specifically tested the topic. Article class. The Atlas class. These several categories of

Several other categories tested the classification information only once but did not succeed.

(Expect high man to solve classified information in the deletion of the article at the same time can be the pictures and other attachments to delete all. Thanks for the first. ) Note: My station is not on the line, only the local test.

None of the other classes have been tested. The files that need to be modified are:

inc_fun_funadmin.php inc_fun_funstring.php inc_stat.php in Inc in the Include folder

Replace the following code

//把新上传的图片信息保存到媒体文档管理档案中
        $inquery = "
        INSERT INTO dede_uploads(title,url,mediatype,width,height,playtime,filesize,uptime,mid)

替换修改如下:
//把新上传的图片信息保存到媒体文档管理档案中
        INSERT INTO dede_uploads "
        INSERT INTO dede_uploads(arcid,title,url,mediatype,width,height,playtime,filesize,uptime,mid($arcID))

Inc_archives_functi*****.php in Inc in the Dede folder

Album_add.php album_edit.php in the Dede folder

select_soft_post.php in the dialog in the Include folder

The above changes are similar, specific reference here: (sorry original author URL did not find) the following for the Dede forum a master's content, I can not find the original URL. Post the original text for your reference:

Find all files, find insert into dede_uploads

Check to see if there is any arcid in the brackets, no manual plus, and the parentheses at the back remember to add ' $arcID '

Find $arcid = Getindexkey, make sure that you have at least the front of the insert into dede_uploads, preferably the front of the code, if $arcid = Getindexkey This paragraph is already in insert into Dede_ Uploads, you don't have to move in front of this part.

Then open inc/inc_batchup.php to find 155 lines, followed by the following code

$dsql->SetQuery("Select * from `dede_uploads` where arcid='$aid'");
$dsql->Execute();
while($row = $dsql->GetObject())
{
  $file=$row->url;
  @unlink("..".$file);
}
$dsql->ExecuteNoneQuery("Delete From `dede_uploads` where arcid='$aid' ");

Can solve the problem that does not delete the picture, the main is must uploads the table to deposit into the thing to get

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.