指定上傳的 URL: window.UMEDITOR\_CONFIG.upload\_url
<?php include\_include(ADMIN\_PATH.'view/htm/footer.inc.htm');?>
<link href="../plugin/xn\_umeditor/umeditor/themes/default/css/umeditor.css<?phpecho $static\_version;?>"type="text/css"rel="stylesheet"/>
<linkhref="../plugin/xn\_umeditor/umeditor/umeditor-bbs.css<?phpecho$static\_v ersion;?>"type="text/css"rel="stylesheet"/>
<script type="text/javascript"src="../plugin/xn\_umeditor/umeditor/umeditor.config.js<?php echo $static\_version;?>"></script>
<script>window.UMEDITOR\_CONFIG.upload\_url=xn.url('product-upload\_image');</script>
<script type="text/javascript"src="../plugin/xn\_umeditor/umeditor/umeditor.js<
?php echo $static\_version;?>"></script>
<script type="text/javascript"src="../plugin/xn\_umeditor/umeditor/umeditor-insertcode.js<?php echo $static\_version;?>"></script>
<script type="text/javascript"src="../plugin/xn\_umeditor/umeditor/umeditor-bbs
.js<?php echo $static\_version;?>"></script>
<script type="text/javascript"src="../plugin/xn\_umeditor/umeditor/lang/zh-cn/zh-cn.js<?php echo $static\_version;?>"></script>
服務端處理上傳,范例:
<?php
// ...
if($action=='upload\_image') {
$width =param('width',0);
$height =param('height',0);
$is\_image=param('is\_image',0);
$name =param('name');
$data =param\_base64('data');
$conf\['upload\_url'\]=substr(http\_url\_path(),0,-6) .$conf\['upload\_url'\];
$product\_image\_path=$conf\['upload\_path'\].'product\_image/'.date('Ym').
'/';
$product\_image\_url =$conf\['upload\_url'\].'product\_image/'.date('Ym').'/';
xn\_mkdir($product\_image\_path,0777,TRUE);
empty($group\['allowattach'\])AND$gid!=1ANDmessage(-1,'您無權上傳');empty($data)ANDmessage(-1,lang('data\_is\_empty'));
$filesize=strlen($data);
//$size>20480000ANDmessage(-1,lang('filesize\_too\_large',array('maxsiz e'=>'20M','size'=>$size)));
// 111.php.shtmll
$ext =file\_ext($name,7);
$filetypes=include APP\_PATH.'conf/attach.conf.php';
!in\_array($ext,$filetypes\['all'\])AND $ext='\_'.$ext;
$filetype=attach\_type($name,$filetypes);
$tmpanme=$uid.'\_'.xn\_rand(15) .'.'.$ext;
$tmpfile=$product\_image\_path.$tmpanme;
$tmpurl =$product\_image\_url.$tmpanme;
file\_put\_contents($tmpfile,$data)ORmessage(-1,lang('write\_to\_file\_faile d'));
$attach=array(
'url' =>$tmpurl,
'path' =>$tmpfile,'orgfilename'=>$name,'filetype' =>$filetype,'filesize' =>$filesize,'width' =>$width,
'height' =>$height,'isimage' =>$is\_image,
);
message(0,$attach);
}
?>
- Xiuno BBS 入門
- Xiuno BBS 是什么?
- 如何獲取?
- 如何安裝?
- URL-Rewrite 網址美化
- URL-Rewrite 網址美化
- 轉發規則Nginx:
- Apache:
- Apache .htaccess
- Apache httpd.conf
- 性能優化
- 前端技術棧
- Bootstrap 4
- Bootstrap 4.0
- 效果:
- 中文資料:
- JQuery 3
- JQuery 3.1
- 效果:
- Tether.js
- Tether.js
- 效果:
- 官方網站:
- Fontawesome
- Fontawesome
- 部分圖標預覽
- xiuno.js
- xiuno.js 是什么?
- Xiuno.js 是什么?
- 效果:
- $.alert()
- $.alert()
- 程序結構
- 目錄結構
- Xiuno BBS 4.0 目錄結構
- 表結構
- Xiuno BBS 4.0 表結構
- MVC 分層架構
- MVC 分層架構
- 圖例:
- 插件開發
- Hello, Xiuno Plugin!
- Hello, Xiuno Plugin!
- 補充:
- hook 機制
- Hook 機制
- overwrite 機制
- Overwrite 機制
- 風格模板
- 風格模板
- 發布你的插件
- 風格模板
- 插件示例
- 插件示例
- 一個單頁的例子
- 一個單頁的例子
- 常見問題
- post 表中的 message message_fmt 字段的區別?
- 論壇帖子數據
- 如何調用百度編輯器?
- 如何調用百度編輯器?
- Xiuno BBS 4.0 中的幾種緩存 API
- 插件互相卸載機制
- 插件互相卸載機制
- 其他
- JSON API
- GET:
- POST:
- 注意: