A solution to the invalid Dedecms v5.7 watermark function

Source: Internet
Author: User
Keywords DEDECMS Watermark function

Wind Network (ithov.com) original article: Today, test dedecms watermark function, found in the actual production environment has no effect, before the use of Dedecms v5.6, there is no such situation, in order to check whether the relevant functions have been opened.

Login http://www.aliyun.com/zixun/aggregation/8984.html > Website management background, click System--> System Setup--> system basic Parameters--> attachment settings,

Find out if the Atlas uses watermarks (small graphs can also be affected) this, we choose "yes",

Click System--> System to set--> image watermark settings,

Take a look at the DEDECMS system configuration Parameters-whether the corresponding function in the picture watermark setting is turned on,

Upload pictures using the image watermark function: Open

Whether to use the image watermark function: Open

Check that the file type selected for the watermark is correct and that the watermark file exists.

After the above setup, we need to open the dede\swfupload.php file and find

Waterimg ($cfg _basedir. $fileurl, ' up ');

Remove the front//save, overwrite the original file,

    $fileurl = $filedir. /'. $filename. $sname;
    $rs = Copy ($FiledataNew, $cfg _basedir. $fileurl);
    unlink ($FILEDATANEW);
    if (! $rs)
    {
        echo "ERROR: Copy UploadFile error! ";
        exit (0);
   }
    waterimg ($cfg _basedir. $fileurl, ' up ');
    $title = $filename. $sname;

$inquery = "INSERT into ' dede_uploads ' (title,url,mediatype,width,height,playtime,filesize,uptime,mid)
VALUES (' $title ', ' $fileurl ', ' $ftype ', ' 0 ', ' 0 ', ' 0 ', ' ". FileSize ($cfg _basedir. $fileurl)." ', ' ". Time (). Cuserlogin->getuserid (). "');
if (!empty ($ARCID))
{
$inquery = "INSERT into ' dede_uploads ' (arcid,title,url,mediatype,width,height,playtime,filesize,uptime,mid)
VALUES (' $arcid ', ' $title ', ' $fileurl ', ' $ftype ', ' 0 ', ' 0 ', ' 0 ', ', '. FileSize ($cfg _basedir. $fileurl). Time (). "', '" . $cuserLogin->getuserid ();
}

Test upload image watermark function success!

Related Article

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.