開啟 viewthread.php
找$query = $db->query("SELECT tagname FROM {$tablepre}threadtags WHERE tid='$tid'");
$thread['tags'] = '';
while($tags = $db->fetch_array($query)) {[/php]
改為
[php]$thread['tagslist'] = array();
$query = $db->query("SELECT tagname FROM {$tablepre}threadtags WHERE tid='$tid'");
$thread['tags'] = '';
while($tags = $db->fetch_array($query)) {
$thread['tagslist'][] = $tags['tagname'];[/php]
找
[php]function viewthread_parsetags() {
global $tagstatus, $_DCACHE, $firstpid, $postlist;
global $thread;
if($firstpid && $tagstatus && !sprintf('%01b', $postlist[$firstpid]['htmlon']) && !empty($_DCACHE['tags'])) {
..這中間略過..
}[/php]
底下加上
[php] if($firstpid && $tagstatus && !sprintf('%01b', $postlist[$firstpid]['htmlon']) && $thread['tagslist']) {
foreach($thread['tagslist'] as $tags) {
$postlist[$firstpid]['message'] = preg_replace("/(^|>)([^><'\"]*?)(".preg_quote($tags, '/').")([^><'\"]*?)(<|$)/eiU", "'\\1\\2<span href=\"tag.php?name='.rawurlencode('\\3').'\" onclick=\"tagshow(event)\" class=\"t_tag\">\\3</span>\\4\\5'", $postlist[$firstpid]['message'], 1);
}
}完成 |