php专区

 首页 > php专区 > PHP应用 > CMS建站 > ecshop后台增加商品描述字段 - ecshop

ecshop后台增加商品描述字段 - ecshop

分享到:
【字体:
导读:
          注:如在后台添加商品为例子1.在数据库中添加相应的字段名称(如:my_text) 2.修改后台中的编辑器FCKeditor 先到 admin includes lib_main php 中参照 create_html_editor 函数添加一个新的函数...

ecshop后台增加商品描述字段

:如在后台添加商品为例子

1.在数据库中添加相应的字段名称(如:my_text).

2.修改后台中的编辑器FCKeditor.先到 admin/includes/lib_main.php 中参照 create_html_editor 函数添加一个新的函数用来生成后台编辑器.

  1. //原始的 
  2. function create_html_editor($input_name$input_value = ''
  3.     global $smarty
  4.  
  5.     $editor = new FCKeditor($input_name); 
  6.     $editor->BasePath   = '../includes/fckeditor/'
  7.     $editor->ToolbarSet = 'Normal'
  8.     $editor->Width      = '100%'
  9.     $editor->Height     = '320'
  10.     $editor->Value      = $input_value
  11.     $FCKeditor = $editor->CreateHtml(); 
  12.     $smarty->assign('FCKeditor'$FCKeditor); 
  13.  
  14. //自己加的 
  15. function pv_create_html_editor($input_name$input_value = ''$i)  
  16. {  
  17.  global $smarty;  
  18.  $editor = new FCKeditor($input_name);  
  19.  $editor->BasePath   = '../includes/fckeditor/';  
  20.  $editor->ToolbarSet = 'Normal';  
  21.  $editor->Width      = '100%';  
  22.  $editor->Height     = '320';  
  23.  $editor->Value      = $input_value;  
  24.  $FCKeditorx = $editor->CreateHtml();  
  25.  $smarty->assign('FCKeditor'.$i$FCKeditorx);  

3.打开 admin/goods.php,查找 create_html_editor

  1. //原始的  create_html_editor('goods_desc', $goods['goods_desc']); 
  2. //并在其后添加如下语句: 
  3. //要自己加的 pv_create_html_editor(my_text, $goods[my_text],1); 

继续在admin/goods.php中查找所有 goods_desc,相应新增 my_text.如: 'goods_desc' => ' ',后面加 'my_text' => ' ',(注意是所有的).

4.修改添加商品和修改商品的SQL语句,如下:

  1. $sql = "INSERT INTO " . $ecs->table('goods') . " (my_text) VALUES ('$_POST[my_text]')";//此处只是例子,请根据实际情况修改 

5. 修改后台中相应的模版文件,添加/修改商品的模版是admin/templates/goods_info.htm

查找{$lang.tab_article},在后面加自己的内容,再在下面添加一个自己的表格,(注:如果要添加多个字段,请参照上面的修改,在此处FCKeditor后面修改数字).{$FCKeditor1}

分享到:
解决ECSHOP后台订单无法发货怎么办? - e...
解决ECSHOP后台订单无法发货怎么办? Ecshop后台有些订单不能发货,会跳转到这个订单的详细信息页面,下面由小编我帮你解决. 错误现象: 点了发货之后,会sys_msg弹出一个警告/错误,然后跳转到该订单的详细页面了. 可能的原因是: 发货时,操作上有无,检查一下该订单的order_goods表里面的数据...
将Ecshop后台fckeditor编辑修改|升级|器...
将Ecshop后台fckeditor编辑修改|升级|器更改为kindeditor编辑器 说明:Ecshop后台的fckeditor编辑器很丑陋了,经常有漏洞,今天干脆就把它换了,其实也早想换了,之前一直也为比较麻烦,就没动手,今天看看,也挺简单的,就两步. 第一步:下载kindeditor,下载地址为:http://www.kindsoft.net/down.php...
  •         php迷,一个php技术的分享社区,专属您自己的技术摘抄本、收藏夹。
  • 在这里……