Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[已解决] 仿织梦文章页自动加上“导读”功能

[复制链接]
croho 发表于 2010-10-25 10:05:32 | 显示全部楼层 |阅读模式
使用变量:$description
修改“导读”字数:1、打开根目录下:viewnews.php。查找:
  1. $description = str_replace(array(' ', "\r", "\n", '\'', '"'), '', cutstr(trim(strip_tags($news['message'])), 200));
复制代码

将200修改自己想显示的字数。

代码演示:

  1. <div id="article_summary">
  2.      <strong>【导读】</strong>$description ...
  3.      </div>
复制代码
效果展示:http://www.chuanmeier.com/viewnews-7935.shtml

评分

1

查看全部评分

saleroad 发表于 2010-10-25 12:31:25 | 显示全部楼层
这个功能不错。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-5-18 07:07 , Processed in 0.095836 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表