PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Mod Submissions

Reply
 
Thread Tools
Old 03-01-2004, 04:26 AM   #1
laurentxav
Green Mole
 
Join Date: Jan 2004
Location: Belgium
Posts: 11
Bug in the "refine" feature

Hello,

I've found a little bug in the "refine" feature in the last version (1.8.0).

When you want to search a specific path of your site, you've to add some hidden fields in the search form:
Code:
<input type="hidden" name="site" value="YourSiteIDHere">
<input type="hidden" name="path" value="YourPathHere">
<input type="hidden" name="refine" value="1">
Then, in the result page, PhpDig show the results found in "YourPathHere" folder.
But if you do a new search now, PhpDig'll ignore the "YourPathHere" because de refine value is lost.

To correct this, you've to modify the following files :
1) /libs/search_function.php
modify line ~577
PHP Code:
$t_fstrings phpdigMakeForm($query_string,$option,$limite,SEARCH_PAGE,$site,$path,'template',$template); 
replace by :
PHP Code:
$t_fstrings phpdigMakeForm($query_string,$option,$limite,SEARCH_PAGE,$site,$path,'template',$template,$refine); 
modify line ~605
PHP Code:
phpdigMakeForm($query_string,$option,$limite,SEARCH_PAGE,$site,$path); 
replace by :
PHP Code:
phpdigMakeForm($query_string,$option,$limite,SEARCH_PAGE,$site,$path,$refine); 
modify line ~632
PHP Code:
phpdigMakeForm($query_string,$option,$limite,SEARCH_PAGE,$site,$path); 
replace by :
PHP Code:
phpdigMakeForm($query_string,$option,$limite,SEARCH_PAGE,$site,$path,$refine); 
2) /libs/function_phpdig_form.php
modifiy the first line code (~line 20)
PHP Code:
function phpdigMakeForm($query_string="",$option="start",$limite=10,$result_page="index.php",
$site="",$path="",$mode='classic',$template=""
replace by :
PHP Code:
function phpdigMakeForm($query_string="",$option="start",$limite=10,$result_page="index.php",
$site="",$path="",$mode='classic',$template="",$refine=0
in the block line ~39
PHP Code:
$result['form_head'] = "<form action='$result_page' method='get'>
<input type='hidden' name='site' value='$site'/>
<input type='hidden' name='path' value='$path'/>
<input type='hidden' name='result_page' value='$result_page'/>
"

add a line :
PHP Code:
$result['form_head'] = "<form action='$result_page' method='get'>
<input type='hidden' name='site' value='$site'/>
<input type='hidden' name='path' value='$path'/>
<input type='hidden' name='result_page' value='$result_page'/>
<input type='hidden' name='refine' value='$refine'/>
"

Now, PhpDig consider de refine feature and show result in the specified path.
It works for me but if I'm wrong, Charter, please correct me !

Laurent
laurentxav is offline   Reply With Quote
Old 03-01-2004, 09:32 AM   #2
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. Moved to Mod Submissions as it's a mod of a mod but not part of the original code.

Once $refine is set to one, do you have an option to set it back to zero, or to reset $path to start a new search of the same site?

The code in this thread may be of interest.
__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter 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
search.php suddenly stops parsing during "extract vars" jackmoring Troubleshooting 1 08-25-2006 12:27 PM
PDF/X-PDF "Bug" in 1.8.9 and below c4x Bug Tracker 0 07-07-2006 02:08 AM
shows blank page if "Search All" and "exact phrase", timeout? alokjain9 Troubleshooting 2 03-07-2006 08:08 AM
"search depth" and "links per" features laurentxav How-to Forum 1 01-12-2005 08:27 PM
What is "refine" used for? AllKnightAccess How-to Forum 0 09-26-2004 01:46 PM


All times are GMT -8. The time now is 11:53 AM.


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