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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[发布] HOME帖子标题过长截取后后面如何去掉省略号

[复制链接]
sdwfmyl 发表于 2012-7-20 10:45:55 | 显示全部楼层 |阅读模式
下面是INDEX。PHP里面的一段代码,不知道是不是从这里改,有高人知道怎么把标题中的省略号去掉吗。
//论坛新贴
$hack_cut_num = 9; //标题条数
$hack_cut_str = 48; //标题字数
$hack_cut_strauthor = 9;
$new_post_top_threadlist = array();
$nthread = array();
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fid AND f.fid not in (0) AND t.displayorder not in (-1,-2) ORDER BY t.dateline DESC LIMIT 0, $hack_cut_num");
while($nthread = $db->fetch_array($query)) {
        $nthread['forumname'] = ereg_replace('<[^>]*>','',$nthread['name']);
        $nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
        $nthread['view_author'] = cutstr($nthread['author'],$hack_cut_strauthor);
        $nthread['date']= gmdate("H:i:s", $nthread['dateline'] + $timeoffset * 3600);
        $nthread['lastreplytime']= gmdate("$dateformat $timeformat", $nthread[lastpost] + ($timeoffset * 3600));
        if($nthread['highlight']) {
                $string = sprintf('%02d', $nthread['highlight']);
                $stylestr = sprintf('%03b', $string[0]);
                $nthread['highlight'] = 'style="';
                $nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $nthread['highlight'] .= '"';
        } else {
                $nthread['highlight'] = '';
        }
        $new_post_top_threadlist[] = $nthread;
}
//结束//

zhuohjj 发表于 2012-7-20 17:10:07 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

 楼主| sdwfmyl 发表于 2012-7-20 17:22:44 | 显示全部楼层
zhuohjj 发表于 2012-7-20 17:10
路过,顶一下吧。00000

回复

使用道具 举报

zhaowenwen 发表于 2012-7-20 17:54:41 | 显示全部楼层
这个不错,省略号的确麻烦
回复

使用道具 举报

 楼主| sdwfmyl 发表于 2012-7-23 00:45:31 | 显示全部楼层
zhaowenwen 发表于 2012-7-20 17:54
这个不错,省略号的确麻烦

回复

使用道具 举报

shchint 发表于 2012-7-23 01:06:50 | 显示全部楼层
不错,支持一下!~
回复

使用道具 举报

 楼主| sdwfmyl 发表于 2012-7-25 01:31:55 | 显示全部楼层
shchint 发表于 2012-7-23 01:06
不错,支持一下!~

回复

使用道具 举报

寻针 发表于 2012-7-25 09:12:21 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

wwwuxp 发表于 2012-8-11 17:30:37 | 显示全部楼层
一段代码
回复

使用道具 举报

金龙网 发表于 2012-8-27 18:41:08 | 显示全部楼层
怎么搞的这么复杂呢
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-10-2 10:36 , Processed in 0.174365 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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