一个好的图片库要配上简单的说明摘要才能让读者更容易读懂,phpcms的组图字段长度太短,现教你如何修改phpcms组图说明字段的长度,系统自带是,input 字段类型为char(50),我们修改为 textarea 字段类型为text.
具体步骤:
1、修改数据库字段类型。
更改phpcms_attachment表中的description字段,类型修改为text
2、修改input为textarea
文件一:/data/cache_model/content_form.class.php,找到481行:
- $data .= "<div id='file_uploaded_$aid'><span style='width:30px'><input type='checkbox' name='{$field}_delete[]' value='$aid' title='删除'></span><span style='width:40px'><input type='text' name='{$field}_listorder[$aid]' value='$v[listorder]' size='3' title='排序'></span><span style='width:60px'><input type='text' name='{$field}_description[$aid]' value='$v[description]' size='20' title='修改图片说明'></span> <a href='###' onMouseOut='javascript:FilePreview(/"$url/", 0);' onMouseOver='javascript:FilePreview(/"$url/", 1);'>$v[filename] ".($v['description'] ? '('.$v['description'].')' : '')."</a></div>/n";
- //替换为:
- $data .= "<div id='file_uploaded_$aid'><span style='width:30px'><input type='checkbox' name='{$field}_delete[]' value='$aid' title='删除'></span><span style='width:40px'><input type='text' name='{$field}_listorder[$aid]' value='$v[listorder]' size='3' title='排序'></span><span style='width:60px'><textarea rows='2' name='{$field}_description[$aid]' title='修//改图片说明' cols='60'>$v[description]</textarea></span> <a href='###' onMouseOut='javascript:FilePreview(/"$url/", 0);' onMouseOver='javascript:FilePreview(/"$url/", 1);'>$v[filename] ".($v['description'] ? '('.$v['description'].')' : '')."</a></div>/n";
- //找到490行:
- $data .= '<div id="file_1"><input type="file" name="'.$field.'[1]" size="20" onchange="javascript:AddInputFile(/''.$field.'/')"> <input type="text" name="'.$field.'_description[1]" size="20" title="名称"> <input type="button" value="删除" name="Del" onClick="DelInputFile(1);">
- '.$addmorepic.'</div>'; //Vevb.com
- //替换为:
- $data .= '<div id="file_1"><input type="file" name="'.$field.'[1]" size="20" onchange="javascript:content_form.class.php(/''.$field.'/')"> <textarea rows="2" name="'.$field.'_description[1]" title="名称" cols="60"></textarea> <input type="button" value="删除" name="Del" onClick="DelInputFile(1);">
文件二:/images/js/common.js,找到283行:
- var fileTag = "<div id='file_"+FileNum+"'><input type='file' name='"+Field+"["+FileNum+"]' size='20' onchange='javascript:AddInputFile(/""+Field+"/")'> <input type='text' name='"+Field+"_description["+FileNum+"]' size='20' title='名称'> <input type='button' value='删除' name='Del' onClick='DelInputFile("+FileNum+");'></div>";
- //替换为:
- var fileTag = "<div id='file_"+FileNum+"'><input type='file' name='"+Field+"["+FileNum+"]' size='20' onchange='javascript:AddInputFile(/""+Field+"/")'> <textarea rows='2' name='"+Field+"_description["+FileNum+"]' title='名称' cols='60'></textarea> <input type='button' value='删除' name='Del' onClick='DelInputFile("+FileNum+");'></div>";
新闻热点
疑难解答