PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Mod Submissions

Reply
 
Thread Tools
Old 10-06-2003, 12:03 AM   #1
bthurlow
Green Mole
 
Join Date: Oct 2003
Location: Mississippi, USA
Posts: 7
Lightbulb a more google approach

Hey all, I have made some modifications to my phpdig search. Some of you will like some will not.

I had some problems with the highlighting of the search terms so i had to make a workaround that i have implemented. Also, I wanted a more google styled look to my search engine. To accomplish this i again did some coding. Granted most of this is a rough version it is throughly tested for stability. Below is the files and the coding changes to them. Maybe this will even make it into the next version. If you all would like to include this functionality just let me know and i'll make a more user friendly configuration.

Code & Files.

Add the following to config.php just before the default values.

//Remove variable to not use functionality
define('HIGHLIGHT','<b><font color="blue">'); //Highlight for non classic mode or if above highlight does not work
define('IMG_NAV_START_NOPREV','<img src="./tpl_img/d-nav.gif"/><img src="./tpl_img/r-nav.gif"/>'); //Image for beggining of Nav Bar w/o previous message
define('IMG_NAV_START_PREV','<img src="./tpl_img/r-nav.gif" border=0 align="right"/><img src="./tpl_img/d-nav.gif" border=0 align="right"/><br><br>'); //Image for beggining of Nav Bar w/ previous message
define('IMG_NAV_PAGE_NOSEL','<img src="./tpl_img/a-nav.gif" border=0><br><br>'); //Image for noncurrent nav bar page
define('IMG_NAV_PAGE_SEL','<img src="./tpl_img/a-nav-sel.gif"><br><br>'); //Image for current nav bar page
define('IMG_NAV_END_NONEXT','<img src="./tpl_img/c-nav.gif" align="left"/><img src="./tpl_img/o-nav.gif" align="left"/>'); //Image for end of nav bar w/o next message
define('IMG_NAV_END_NEXT','<img src="./tpl_img/c-nav.gif" border=0 align="left"/><img src="./tpl_img/o-nav.gif" border=0 align="left"/><br><br>'); //Image for end of nav bar w/ next message

Replace Line 150 in your phpdig_functions.php file with this:
return @eregi_replace($ereg,'\\1<span class=\"phpdigHighlight\">'.HIGHLIGHT.'\\2</b></font></span>\\3',$string);

In search_function.php replace lines 346 - 369 with the following.

if ($lim_start > 0) {
$previous_link = $url_bar.($lim_start-$limite);
$nav_bar .= '<td><a class=\"phpdig\" href="'.$previous_link.'" >'.IMG_NAV_START_PREV.'<center>&lt;&lt;'.phpdigMsg("previous").'</a></td>';
}
else{
$nav_bar .= '<td valign="top">'.IMG_NAV_START_NOPREV.'</td>';
}
$tot_pages = ceil($num_tot/$limite);
$actual_page = $lim_start/$limite + 1;
$page_inf = max(1,$actual_page - 5);
$page_sup = min($tot_pages,max($actual_page+5,10));
for ($page = $page_inf; $page <= $page_sup; $page++) {
if ($page == $actual_page) {

$nav_bar .= ' <td><span class=\"phpdigHighlight\">'.IMG_NAV_PAGE_SEL.HIGHLIGHT.$page.'</font></span></img></td>';
$pages_bar .=' <td><span class=\"phpdigHighlight\">'.HIGHLIGHT.$page.'</font></span></td>';
$link_actual = $url_bar.(($page-1)*$limite);
}
else {
$nav_bar .= '<td><a class=\"phpdig\" href="'.$url_bar.(($page-1)*$limite).'" >'.IMG_NAV_PAGE_NOSEL.$page.'</a></td>';
$pages_bar .= "<td><a class=\"phpdig\" href=\"".$url_bar.(($page-1)*$limite)."\" >$page</a> \n</td>";
}
}

if ($more_results == 1) {
$next_link = $url_bar.($lim_start+$limite);
$nav_bar .= '<td><a class=\"phpdig\" href="'.$next_link.'" >'.IMG_NAV_END_NEXT.'<center>'.phpdigMsg("next").'&gt;&gt;</a></td>';
}
else{
$nav_bar .= '<td valign="top">'.IMG_NAV_END_NONEXT.'</td>';
}

if you would like to comment on these modifications please feel free to do so. Hopefully some of you will find this interesting and usefull.

Sincerely,
Thurlow
bthurlow is offline   Reply With Quote
Old 10-06-2003, 02:34 AM   #2
bthurlow
Green Mole
 
Join Date: Oct 2003
Location: Mississippi, USA
Posts: 7
Talking ignorance is bliss

Just ignore everything above.

If you would like. I have finished the changes because i was bored. The attached file includes all changes that i made including a readme file.

Have fun and let me know what you think.

If you would like to see a working version of the changes click below

Thurlow Designs Search Engine

Have a good day.
Attached Files
File Type: zip phpdigmods.zip (13.1 KB, 79 views)
bthurlow is offline   Reply With Quote
Old 10-08-2003, 12:14 PM   #3
bthurlow
Green Mole
 
Join Date: Oct 2003
Location: Mississippi, USA
Posts: 7
Talking Modified templates for above

The attached file is the current exsisting templates that i have modified to work with the above layout changes of phpdig. If you decide to install the above changes, please feel free to install these templates for plug and play operation.

Have fun with PhpDig everyone.
Attached Files
File Type: zip templates.zip (12.5 KB, 82 views)
bthurlow is offline   Reply With Quote
Old 10-08-2003, 01:34 PM   #4
Rolandks
Purple Mole
 
Rolandks's Avatar
 
Join Date: Sep 2003
Location: Kassel, Germany
Posts: 119
Nice Idea, but i think the Layout is unclearly to read.
The Distance between the results is to small, and big Lines in "limit to...." break or wrap. AND < end of virtual header of page > HTML-Comments are indexed .... see this: bug:http://www.phpdig.net/showthread.php?s=&threadid=85
Rolandks is offline   Reply With Quote
Old 10-08-2003, 08:23 PM   #5
bthurlow
Green Mole
 
Join Date: Oct 2003
Location: Mississippi, USA
Posts: 7
Thanks Roland, i see what you are talking about. All i'll have to do is just work on the html for the formatting of the results and the limit to...... I'll get to work on the format of the templates and check all of them for those errors. Right now I'm just focusing on layout of the results and more flexability of the format of the layout. I'll Contribute here first and then i'll start contributing on some of the hardcore coding. Just trying to contribute in some form or another.
bthurlow is offline   Reply With Quote
Reply


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
Google Suggest implementation mostvaluablenet Mod Requests 4 02-27-2005 06:09 AM
Google IP's mpnet IPs, SEs, & UAs 0 11-17-2004 12:15 AM
Got a Google Toolbar? Charter The Mole Hole 3 08-28-2004 01:20 PM
Google API [Did you mean ***?] gooseman Mod Requests 0 04-24-2004 06:50 AM
google update heiko IPs, SEs, & UAs 4 04-17-2004 05:10 PM


All times are GMT -8. The time now is 10:26 AM.


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