Tinymce编辑器图像上传插件添加完整图像URL

Tinymce编辑器图像上传插件添加完整图像URL

本文介绍了Tinymce编辑器图像上传插件添加完整图像URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一个名为justboil.com的图像上传器插件用于tinymce编辑器。

I am using an image uploader plugin called justboil.com for tinymce editor.

它很棒,并上传图像以显示它们但我希望它能够将完整的网址添加到图片的路径中,如:

It word great, and uploads images to display them but i want it to be able to add the full web URL to the path of the image like:

* *

而不是

* / upload_img / img1.jpg *

*/upload_img/img1.jpg*

这里是插件的配置代码

| -------------------------------------------------------------------
|
| Path to upload target folder, relative to domain name. NO TRAILING SLASH!
| Example: if an image is acessed via http://www.example.com/images/somefolder/image.jpg, you should specify here:
|
| $config['img_path'] = '/images/somefolder';
|
| -------------------------------------------------------------------*/


    $config['img_path'] = '/upload_img'; // Relative to domain name

    $config['upload_path'] = $_SERVER['DOCUMENT_ROOT'] . $config['img_path']; // Physical path. [Usually works fine like this]

我试过更改 $ _ SERVER [ 'DOCUMENT_ROOT'] 到完整的域名,但如果我这样做,它就不会上传图片

i have tried changing the $_SERVER['DOCUMENT_ROOT'] to the full domain name but it doesn't upload the images if i do that

任何想法?

推荐答案

在你的tinymce init中,你可以设置以下标签:

Inside your tinymce init, you can set the following tags:

relative_urls: false,
remove_script_host: false

这将是使用TinyMCE编辑器中添加的所有项目的完整地址启用绝对URL。

This will then enable absolute urls with the full address for all items added in the TinyMCE editor.

这篇关于Tinymce编辑器图像上传插件添加完整图像URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 16:14