标题: SMARTY调用问题!
kylingood
版主
Rank: 7Rank: 7Rank: 7



UID 104
精华 1
积分 10
帖子 31
翻译 0
原创 0
阅读权限 100
注册 2007-6-22
状态 离线
发表于 2007-7-5 16:37  资料  短消息  加为好友 
SMARTY调用问题!

本人想在一body.tpl模板中调用FCKeditor,不知道如何做。急~~~

我在的主页面是index.php如下:

  <?php
              require "main.php";
               $smarty->assign("title", "首页");

               //下面是运有FCK
        include("fckeditor/fckeditor.php") ;
        $oFCKeditor = new FCKeditor('FCKeditor1') ;
        $oFCKeditor->BasePath = '../FCKeditor/';
        $oFCKeditor->Value ='';
        $oFCKeditor->Width='270';
        $oFCKeditor->Height='120';
        $oFCKeditor->Create();

                $smarty->display('header.tpl');  //显示首页
        $smarty->display('body.tpl');    //本人就是想在这body.tpl中把$oFCKeditor->Create();显示出来        $smarty->display('footer.tpl');  //显示页脚
?>

在这个 body.tpl 模板中我要把FCK编辑器放在这个表单中如下:

<form action="text.php" method="post"  >
                                                        
<p >
<span  class="liuyan">留言内容<span>
   想把FCK编辑器放这里面。不知道有没朋友这样用过。希望能教教我,谢谢~!~~                                       
</p>                                       
                                       
<input type="reset" id="upreset"name="Submit" value="重置" />   
<input type="submit" id="sbutton" value="确定" />
</form>

顶部
kylingood
版主
Rank: 7Rank: 7Rank: 7



UID 104
精华 1
积分 10
帖子 31
翻译 0
原创 0
阅读权限 100
注册 2007-6-22
状态 离线
发表于 2007-7-5 18:57  资料  短消息  加为好友 
搞定了。希望以后我能帮助别人。

顶部
wps2000
新手上路
Rank: 1



UID 34
精华 0
积分 0
帖子 73
翻译 0
原创 0
阅读权限 10
注册 2007-5-20
状态 离线
发表于 2007-7-10 13:44  资料  短消息  加为好友 
应该是CreateHtml()吧!
然后assign啊什么的都没问题了





顶部
Haohappy
超级版主
Rank: 8Rank: 8
PHPEye站长


UID 2
精华 11
积分 110
帖子 260
翻译 6
原创 1
阅读权限 150
注册 2007-5-2
状态 离线
发表于 2007-7-14 18:24  资料  短消息  加为好友  添加 haohappy 为MSN好友 通过MSN和 haohappy 交谈
这没什么特别的,这一部分应该是加在模板里的。





互助共享,共同成长。
顶部
yangxiao42
新手上路
Rank: 1



UID 953
精华 0
积分 0
帖子 2
翻译 0
原创 0
阅读权限 10
注册 2008-4-2
状态 离线
发表于 2008-4-2 15:05  资料  短消息  加为好友 
写一个class
class Editor
{
        /*
          *函数:show
          *作用:显示图文编辑器
          *输入:$FormName(表单的名称),$FieldName(图文混排的字段),$Value(图文混排的值), $Where(在哪个部分使用的编辑框?),$Fid(论坛ID), $CommID(社区ID), $ClubID(俱乐部ID), $Type(使用哪个编辑器)
          *输出:返回图文编辑器
          **
          ******************************************
          *--制作--日期--
          *KuaiYigang@xingmo.com  2004-12-12 19:26
          ******************************************
          *--修改--日期--目的--
          *
          */
        function show($FieldName, $Value)
        {
                global $INC;
                require_once $INC.'/FCKeditor/fckeditor.php';
                $oFCKeditor = new FCKeditor($FieldName) ;
                $oFCKeditor->BasePath = '/inc/FCKeditor/';
                $oFCKeditor->Value = $Value;
                $oFCKeditor->Height = '500';
                $str = $oFCKeditor->Create() ;
                return $str;               
        }

}
?>
只要在你php 里调用这个class
在html直接就可以传过来就是了

[ 本帖最后由 yangxiao42 于 2008-4-2 15:06 编辑 ]

顶部
stewen
新手上路
Rank: 1



UID 1081
精华 0
积分 0
帖子 5
翻译 0
原创 0
阅读权限 10
注册 2008-4-27
状态 离线
发表于 2008-4-27 06:36  资料  短消息  加为好友 
版主怎么不把你的解决方法贴出来呢?共享一下嘛

顶部
stewen
新手上路
Rank: 1



UID 1081
精华 0
积分 0
帖子 5
翻译 0
原创 0
阅读权限 10
注册 2008-4-27
状态 离线
发表于 2008-4-27 06:37  资料  短消息  加为好友 
{php}
$editor=new FCKEditor();
......
{php}
是否是这样呢?

顶部
 


PHPEye社区--LAMP开源技术社区


当前时区 GMT+8, 现在时间是 2008-8-30 18:35

    Powered by Discuz! 5.5.0  © 2001-2007 Comsenz Inc.
Processed in 0.010905 second(s), 6 queries , Gzip enabled

清除 Cookies - 联系我们 - PHPEye开源社区 - Archiver