帝国cms 编辑器换成 ueditor 后如何使用取第一张图片为标题图片

帝国cms 编辑器换成 ueditor 后如何使用取第一张图片为标题图片
ueditor 编辑器有个优势,就是复制文章的时候,可以自动保存远程文件到本地
但是帝国cms 换成ueditor 编辑器后 取第一张图片为标题图片的功能无法使用了

我们可以做如下修改
/e/data/html/1.php 文件(用哪个取决于你用的哪个模型了)

修改

<input name="getfirsttitlepic" type="text" id="getfirsttitlepic" value="" size="1">

<input name="getfirsttitlepic" type="text" id="getfirsttitlepic" value="1" size="1">

然后打开/web/e/class/hinfofun.php
修改

$firsttitlepic=GetFpicToTpic($add['classid'],$id,$add['getfirsttitlepic'],$add['getfirsttitlespic'],$add['getfirsttitlespicw'],$add['getfirsttitlespich'],$public_r['filedeftb']);

换成

$firsttitlepic= bodyimg( mystripslashes( $add['newstext'] ) );

这个样就可以实现 自动把第一张图作为标题图了

所用的自定义函数可以添加到 /e/class/userfun.php

function bodyimg( $obj ){    if ( isset( $obj ) )    {        if ( preg_match( "", $obj, $regs ) )        {            return $obj = $regs[1];        }    }    else    {        return FALSE;    }}function mystripslashes( $string ){    if ( !is_array( $string ) )    {        return stripslashes( $string );    }    foreach ( $string as $key => $val )    {        $string[$key] = new_stripslashes( $val );    }    return $string;}

帝国cms 编辑器换成 ueditor 后如何使用取第一张图片为标题图片
帝国cms 编辑器换成 ueditor 后如何使用取第一张图片为标题图片标题图片

延伸阅读:

    无相关信息
标签:

上一篇:phome_enewsmember 帝国CMS会员主表字段

下一篇:帝国cms内容页判断标题图片是否存在的方法

留言与评论(共有 0 条评论)
   
验证码: