一、当公告标题太长时,公告的开始时间会被截取,导致会员看不到时间。
二、解决方法
1、打开论坛根目录下的 index.php,找到:
if(!$gid) {
$announcements = '';
if($_DCACHE['announcements']) {
$readapmids = !empty($_DCOOKIE['readapmid']) ? explode('D', $_DCOOKIE['readapmid']) : array();
foreach($_DCACHE['announcements'] as $announcement) {
if(empty($announcement['groups']) || in_array($groupid, $announcement['groups'])) {
if(empty($announcement['type'])) {
$announcements .= '
'.$announcement['subject'].
'('.gmdate($dateformat, $announcement['starttime'] + $timeoffset * 3600).')';
} elseif($announcement['type'] == 1) {
$announcements .= '
'.$announcement['subject'].
'('.gmdate($dateformat, $announcement['starttime'] + $timeoffset * 3600).')';
}
}
}
}
修改为:
if(!$gid) {
$announcements = '';
if($_DCACHE['announcements']) {
$readapmids = !empty($_DCOOKIE['readapmid']) ? explode('D', $_DCOOKIE['readapmid']) : array();
foreach($_DCACHE['announcements'] as $announcement) {
if(empty($announcement['groups']) || in_array($groupid, $announcement['groups'])) {
if(empty($announcement['type'])) {
$announcements .= '
'.''.$announcement['subject'].''.
'('.gmdate($dateformat, $announcement['starttime'] + $timeoffset * 3600).')';
} elseif($announcement['type'] == 1) {
$announcements .= '
'.''.$announcement['subject'].''.
'('.gmdate($dateformat, $announcement['starttime'] + $timeoffset * 3600).')';
}
}
}
}
修改完毕,保存文件。
2、打开模板文件 css_common.htm,找到:#ann li { overflow: hidden; padding-left: 10px; white-space: nowrap; }
在其下面添加如下css代码:
#ann a:hover { text-decoration: none; }
#ann span { display: block; float: left; width: 100px; height: 30px; overflow: hidden; }
其中span属性 width: 100px; 中的100 为标题的长度,请根据自己的需要修改大小。
修改完毕,保存文件。
3、到后台更新模板缓存。
三、修改长度后,显示如下: