From: <du...@us...> - 2012-12-11 11:53:19
|
Revision: 10356 http://sourceforge.net/p/xoops/svn/10356 Author: dugris Date: 2012-12-11 11:53:17 +0000 (Tue, 11 Dec 2012) Log Message: ----------- Fix : search Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_search.html XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_search.html =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_search.html 2012-12-11 03:01:22 UTC (rev 10355) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/system/templates/system_search.html 2012-12-11 11:53:17 UTC (rev 10356) @@ -49,7 +49,9 @@ <{if $result.uid}> <a href="<{$xoops_url}>/userinfo.php?uid=<{$result.uid}>" title="<{$result.uname}>"><{$result.uname}></a> <{/if}> - ( <{$result.time}> ) + <{if $result.time}> + (<{$result.time}>) + <{/if}> </span> </div> <{/foreach}> Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php 2012-12-11 03:01:22 UTC (rev 10355) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/search.php 2012-12-11 11:53:17 UTC (rev 10356) @@ -187,9 +187,11 @@ } $res[$i]['title'] = $myts->htmlspecialchars($results[$i]['title']); $res[$i]['title_highligh'] = preg_replace( $queries_pattern, "<span class='searchHighlight'>$1</span>", $myts->htmlspecialchars($results[$i]['title'])); - $res[$i]['uid'] = @intval($results[$i]['uid']); - $res[$i]['uname'] = XoopsUser::getUnameFromId($results[$i]['uid'], true); - $res[$i]['time'] = !empty($results[$i]['time']) ? " (" . XoopsLocal::formatTimestamp(intval($results[$i]['time'])) . ")" : ""; + if ( !empty($results[$i]['uid']) ) { + $res[$i]['uid'] = intval($results[$i]['uid']); + $res[$i]['uname'] = XoopsUser::getUnameFromId($results[$i]['uid'], true); + } + $res[$i]['time'] = !empty($results[$i]['time']) ? XoopsLocal::formatTimestamp(intval($results[$i]['time'])) : ""; $res[$i]['content'] = empty($results[$i]['content']) ? "" : preg_replace( $queries_pattern, "<span class='searchHighlight'>$1</span>", $results[$i]['content']); } if ($count >= 5) { |