一、增加一个上传的js函数。
在common\images\js\manage.js中加入以下函数(根据insert_images()改动而来)
[CODE=JavaScript]
function insert_attachments(strid, strurl, strntype, strtype, strbase,strname)
{
var tstrtype;
if (strtype == -1)
{tstrtype = strntype;}
else
{
var thtype = request[“htype”];
if (thtype == undefined)
{tstrtype = strtype;}
else
{tstrtype = get_num(thtype);}
}
if (tstrtype == 1)
{
itextner(strid, “[url=” + strurl + “]”+strname+”[/url]”);
}
else
{
if (tstrtype == 0)
{
editor_insert(strid, ““+strname+”“);
}
}
}
[/CODE]
二、增加语言节点。
在.lng.lng_config里增加节点attachment,值为自己选(我的是:"附件:下载").修改insert的值为插入图片(方便自己查看),增加insertfile值为插入附件。
三、增加页面调用。
另外在文章manage.jtbc中292行add和423(第一个地方增加之后,第二个行数423可能变为424)行edit相应位置加入<input type="button" class="button" value="{$=itake(‘global.lng_config.insertfile’,’lng’)}" onclick="insert_attachments(‘content’, get_id(‘content_images’).value, {$=ncttype}, -1, ‘{$=get_lrstr(nuri, "/", "leftr")}’,'{$=itake("global.lng_config.attachment","lng")}’)">