|
11-16-2004, 02:03 PM | #1 |
Green Mole
Join Date: Oct 2004
Posts: 11
|
Display Document Icon in Result-page
Hi,
for those who may wont to display an icon if the search-result links to a binary document like word, pdf or anything else, I am adding here a small mod I inserted into "search_function.php" right after the line Code:
$timer->stop('Extracts'); Code:
//binaries should display an image and be opened in a new window $suffix_array = array('doc','pdf','xls','zip','ppt','pps'); $suffix = substr($url,-3); if (in_array($suffix, $suffix_array)) { $mytarget = '_blank'; $myimage = '<img src="icons/'.$suffix.'.gif" hspace="4">'; } else { $mytarget = LINK_TARGET; $myimage = ''; } And I had to alter the code for the table_results array (just underneath). The value for "page_link" looks now Code:
'page_link' => $myimage."<a class=\"phpdig\" href=\"".$url."\" onmousedown=\"return clickit(".$n.",'".$js_url."')\" target=\"".$mytarget."\" >".ereg_replace('%20*',' ',$title)."</a>", Topaz |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Search Result Page Question | b-online | How-to Forum | 2 | 03-28-2005 12:03 PM |
How to display results on an existing page ? | alexuslesours | How-to Forum | 1 | 12-08-2004 10:59 AM |
display result by | lolodev | Mod Requests | 1 | 05-19-2004 03:27 AM |
web page thumbnails in result page | JWSmythe | How-to Forum | 2 | 05-15-2004 01:11 PM |
phpdigHighlight on result page | 123av | Troubleshooting | 3 | 11-16-2003 06:46 PM |