PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Mod Submissions

Reply
 
Thread Tools
Old 11-16-2004, 02:03 PM   #1
Topaz
Green Mole
 
Topaz's Avatar
 
Join Date: Oct 2004
Posts: 11
Post 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');
. Also these binaries will be opened in a new browser-window.

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 = '';
}
As you can see, I installed an "icons"-folder in the "search"-directory.

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>",
According to this example the names of the icons should be like "pdf.gif" or "doc.gif".

Topaz
Topaz is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT -8. The time now is 01:12 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.