联系官方销售客服
QQ1835022299
028-61286886
在ftable里面加个图片上传的字段,可配置;
内容发布的时候,图片字段能够满足预览、上传、浏览、删除的需求
不影响cms升级!不影响cms升级!不影响cms升级!不影响cms升级!
放在dayrui/My/Field/Ftable.php
dr_lang('不使用'), 1 => dr_lang('文本框'), 2 => dr_lang('下拉选择框'), 3 => dr_lang('图片'), ]; $html = ''; return $html; } protected function _field_type_html($config, $cname, $value, $hang, $lie) { $html = ''; if ($config['type'] == 1) { $html.= ''; } elseif ($config['type'] == 2) { $html = ''; } elseif ($config['type'] == 3) { if ($value[$hang][$lie]) { $pp = dr_get_file($value[$hang][$lie]); } $html = ''; } return $html; } /** * 字段显示 * * @return string */ public function show($field, $value = null) { // 字段默认值 $value = dr_string2array($value); $str = ''; $str.= dr_get_ftable($field['id'], $value); $str.= ''; return $this->input_format($field['fieldname'], $field['name'], $str); } /** * 字段表单输入 */ public function input($field, $value = '') { // 字段禁止修改时就返回显示字符串 if ($this->_not_edit($field, $value)) { return $this->show($field, $value); } $html = parent::input($field, $value); $p = dr_authcode([ 'size' => 10, 'count' => 1, 'exts' => 'jpg,gif,png', 'attachment' => 0, 'image_reduce' => 0, ], 'ENCODE'); $url = '/index.php?s=api&c=file&m=input_file_list&token='.dr_get_csrf_token().'&siteid='.SITE_ID.'&p='.$p.'&ct=0&one=1'; $html.=" "; return $html; } }
很实用,学习一下!!!