zoukankan      html  css  js  c++  java
  • ecshop新增一个编辑器

    在ecshop的后台新增一个编辑器框

    步骤一:找到lib_main.php 文件:admin/includes/lib_main.php。

    找到变量:function create_html_editor(),在它的下面重新新建一个变量 create_html_editor2。代码如下

    function create_html_editor2($input_name, $input_value = '')
    {
        global $smarty;
    
        $editor = new FCKeditor($input_name);
        $editor->BasePath   = '../includes/fckeditor/';
        $editor->ToolbarSet = 'Normal';
        $editor->Width      = '100%';
        $editor->Height     = '320';
        $editor->Value      = $input_value;
        
        $FCKeditor = $editor->CreateHtml();
        $smarty->assign('FCKeditor2', $FCKeditor); /*这个FCKeditor2是以后需要调用的变量*/ 
    }

    步骤二:goods.php 文件:admin/goods.php 

    找到create_html_editor,在他的下面 新创建一个create_html_editor2。代码如下:

    /* 创建 html editor */
     create_html_editor('goods_desc', $goods['goods_desc']);
        
     /*创建第二编辑器 Author: Sky*/
     create_html_editor2('goods_desc2', $goods['goods_desc2']); /*goods_desc2 与数据库字段要保持一直*/

    前台调用方法:{$FCKeditor2} ,此时,编辑器创建成功。

    步骤三:数据入库。编辑器创建成功,该如何入库呢。文件goods.php

    找到sql。在第916行。新增一段代码。代码如下:

    "goods_desc = '$_POST[goods_desc]', " .
    "goods_desc2 = '$_POST[goods_desc2]', " .           //新增官方描述

    $db->query($sql);在第941行。 是执行插入。

  • 相关阅读:
    SPOJ 149 FSHEEP Fencing in the Sheep ( 计算几何 + 二分 )
    UVa 11806
    UVa 1445
    HDU 4725 The Shortest Path in Nya Graph( 建图 + 最短路 )
    HDU 4661 Message Passing ( 树DP + 推公式 )
    从远程库克隆库
    添加远程库
    远程仓库
    删除文件
    撤销修改
  • 原文地址:https://www.cnblogs.com/wesky/p/3347598.html
Copyright © 2011-2022 走看看