phpcms V9.6.0版本整合百度ueditor1.4.3.2,包括水图片上传水印
发布日期:2021-05-09 09:26:08 浏览次数:20 分类:博客文章

本文共 8988 字,大约阅读时间需要 29 分钟。

���������������������������������������������������������

 

phpcms���������Ueditor���������������������������������������������������������������������������������������������������������������������������������������������������������������������okay���������so easy������������������������������������������������������ phpcms���ckeditor������������������

������������

������������Ueditor,���������static/js/���������

������������������������

���toolbar������������������

toolbars: [     [         'anchor', //������         'undo', //������         'redo', //������         'bold', //������         'indent', //������������         'snapscreen', //������         'italic', //������         'underline', //���������         'strikethrough', //���������         'subscript', //������         'fontborder', //������������         'superscript', //������         'formatmatch', //���������         'source', //���������         'blockquote', //������         'pasteplain', //���������������������         'selectall', //������         //'print', //������         'preview', //������         'horizontal', //���������         'removeformat', //������������         'time', //������         'date', //������         'unlink', //������������         'insertrow', //������������         'insertcol', //������������         'mergeright', //������������������         'mergedown', //������������������         'deleterow', //���������         'deletecol', //���������         'splittorows', //������������         'splittocols', //������������         'splittocells', //���������������������         'deletecaption', //������������������         'inserttitle', //������������         'mergecells', //���������������������         'deletetable', //������������         'cleardoc', //������������         'insertparagraphbeforetable', //"������������������"         'insertcode', //������������         'fontfamily', //������         'fontsize', //������         'paragraph', //������������         'simpleupload', //������������         'insertimage', //������������         'edittable', //������������         'edittd', //���������������         'link', //���������         'emotion', //������         'spechars', //������������         'searchreplace', //������������         'map', //Baidu������         //'gmap', //Google������         'insertvideo', //������         'help', //������         'justifyleft', //������������         'justifyright', //������������         'justifycenter', //������������         'justifyjustify', //������������         'forecolor', //������������         'backcolor', //���������         'insertorderedlist', //������������         'insertunorderedlist', //������������         'fullscreen', //������         'directionalityltr', //������������������         'directionalityrtl', //������������������         'rowspacingtop', //���������         'rowspacingbottom', //���������         'pagebreak', //������         'insertframe', //������Iframe         'imagenone', //������         'imageleft', //���������         'imageright', //���������         'attachment', //������         'imagecenter', //������         'wordimage', //������������         'lineheight', //���������         'edittip ', //������������         'customstyle', //���������������         'autotypeset', //������������         //'webapp', //������������         'touppercase', //������������         'tolowercase', //������������         'background', //������         'template', //������         'scrawl', //������         'music', //������         'inserttable', //������������         'drafts', // ������������������         'charts', // ������     ] ]

initialFrameWidth������������650������������������������������������������������������������

        ,initialFrameWidth:650  //������������������������,������1000

        //,initialFrameHeight:320  //������������������������,������320

���������������

������������������������������

������������������

/zhoulujun/uploadfile/image/{yyyy}/{mm}{dd}/{yyyy}{mm}{dd}{hh}{ii}{ss}{rand:9}

 

���������������������:

������������������������������������������������������class������������������������������

private function imageWaterMark($groundImage,$waterPos=0,$waterImage="",$waterText="",$textFont=5,$textColor="#FF0000"){    $isWaterImage = FALSE;    $formatMsg = "������������������������������������������������������������������������GIF���JPG���PNG���������";    //������������������    if(!empty($waterImage) && file_exists($waterImage))    {        $isWaterImage = TRUE;        $water_info = getimagesize($waterImage);        $water_w = $water_info[0];//������������������������        $water_h = $water_info[1];//������������������������        switch($water_info[2])//���������������������������        {            case 1:$water_im = imagecreatefromgif($waterImage);break;            case 2:$water_im = imagecreatefromjpeg($waterImage);break;            case 3:$water_im = imagecreatefrompng($waterImage);break;            default:die($formatMsg);        }    }    //������������������    if(!empty($groundImage) && file_exists($groundImage))    {        $ground_info = getimagesize($groundImage);        $ground_w = $ground_info[0];//������������������������        $ground_h = $ground_info[1];//������������������������        switch($ground_info[2])//���������������������������        {            case 1:$ground_im = imagecreatefromgif($groundImage);break;            case 2:$ground_im = imagecreatefromjpeg($groundImage);break;            case 3:$ground_im = imagecreatefrompng($groundImage);break;            default:die($formatMsg);        }    }    else    {        die("������������������������������������");    }    //������������    if($isWaterImage)//������������    {        $w = $water_w;        $h = $water_h;        $label = "���������";    }    else//������������    {        $temp = imagettfbbox(ceil($textFont*5),0,"./cour.ttf",$waterText);//������������ TrueType ������������������������        $w = $temp[2] - $temp[6];        $h = $temp[3] - $temp[7];        unset($temp);        $label = "������������";    }    if( ($ground_w<$w) || ($ground_h<$h) )    {        echo "���������������������������������������������������".$label."������������������������������";        return;    }    switch($waterPos)    {        case 0://������            $posX = rand(0,($ground_w - $w));            $posY = rand(0,($ground_h - $h));            break;        case 1://1���������������            $posX = 0;            $posY = 0;            break;        case 2://2���������������            $posX = ($ground_w - $w) / 2;            $posY = 0;            break;        case 3://3���������������            $posX = $ground_w - $w;            $posY = 0;            break;        case 4://4���������������            $posX = 0;            $posY = ($ground_h - $h) / 2;            break;        case 5://5���������������            $posX = ($ground_w - $w) / 2;            $posY = ($ground_h - $h) / 2;            break;        case 6://6���������������            $posX = $ground_w - $w;            $posY = ($ground_h - $h) / 2;            break;        case 7://7���������������            $posX = 0;            $posY = $ground_h - $h;            break;        case 8://8���������������            $posX = ($ground_w - $w) / 2;            $posY = $ground_h - $h;            break;        case 9://9���������������            $posX = $ground_w - $w - 10;   // -10 ���������������10px ������������������            $posY = $ground_h - $h - 10;   // -10 ���������������10px ������������������            break;        default://������            $posX = rand(0,($ground_w - $w));            $posY = rand(0,($ground_h - $h));            break;    }    //���������������������������    imagealphablending($ground_im, true);    if($isWaterImage)//������������    {        imagecopy($ground_im, $water_im, $posX, $posY, 0, 0, $water_w,$water_h);//���������������������������    }    else//������������    {        if( !emptyempty($textColor) && (strlen($textColor)==7) )        {            $R = hexdec(substr($textColor,1,2));            $G = hexdec(substr($textColor,3,2));            $B = hexdec(substr($textColor,5));        }        else        {            die("������������������������������������");        }        imagestring ( $ground_im, $textFont, $posX, $posY, $waterText, imagecolorallocate($ground_im, $R, $G, $B));    }    //������������������������    @unlink($groundImage);    switch($ground_info[2])//���������������������������    {        case 1:imagegif($ground_im,$groundImage);break;        case 2:imagejpeg($ground_im,$groundImage);break;        case 3:imagepng($ground_im,$groundImage);break;        default:die($errorMsg);    }    //������������    if(isset($water_info)) unset($water_info);    if(isset($water_im)) imagedestroy($water_im);    unset($ground_info);    imagedestroy($ground_im);}

���������������������

������������������

���������������

(���������������������������������������������,���������������������

 

上一篇:jsp <% <% ! 区别
下一篇:github无法访问问题解决方法

发表评论

最新留言

表示我来过!
[***.240.166.169]2025年04月05日 14时39分10秒