PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > How-to Forum

Reply
 
Thread Tools
Old 09-30-2006, 11:05 PM   #1
fmehl
Green Mole
 
fmehl's Avatar
 
Join Date: Sep 2006
Posts: 2
Unhappy refine search to two or more urls

Hi, I'm new to Phpdig (and PHP in general), but I was wondering if it's possible to search two or more sites at a time, but not all of the ones included in the spider.

What I'm hoping to do is change the dropdown list to checkboxes, where users can choose whichever sites they want to search. I've been looking at function_phpdig_form but am having trouble with it. I don't know how to pass two or more siteids to the search query.

Any advice is much appreciated. Thanks!
fmehl is offline   Reply With Quote
Old 10-01-2006, 08:50 AM   #2
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
PhpDig is really set to search all sites or one site at a time. The $site varaible is what determines the site to search and can be in a query string, hidden field, or option tag. To get $site set and treated as an array of integers rather than one integer...

Here are the areas in search_functions.php that may have to be changed:
  • Code:
    if (mb_eregi("^[0-9]+[,]",$site)) {
        $tempbust = explode(",",$site);
        $site = $tempbust[0];
        $path = $tempbust[1];
    }
    settype($site,'integer'); // now set to integer
  • Code:
         $wheresite = "AND spider.site_id = $site ";
  • Code:
         $refine_url = "&refine=1&site=$site&path=".urlencode($path);
And here are the areas in function_phpdig_form.php that may have to be changed:
  • Code:
        if (isset($site) && is_numeric($site) && ($site > 0)) {
            $site = (int) $site;
  • Code:
                'WHERE '.PHPDIG_DB_PREFIX.'sites.site_id = '.$site.' '.
  • Code:
                $dd_query = mysql_query('SELECT DISTINCT path FROM '.PHPDIG_DB_PREFIX.'spider WHERE site_id = '.$site.' AND path != ""',$id_connect);
  • Code:
                <input type='hidden' name='site' value='$site'/>
  • Code:
              $result['form_dropdown'] .= "<option value='".$dd_data['site_id'].",".$dd_data['path']."'>".$dd_data['site_url'].$dd_data['path']."</option>";
  • Code:
      <input type='hidden' name='site' value='$site'/>
There may be other areas also, and of course the search form would need to be altered to allow for muli-selects. Also, the areas above don't take into account the changes that might be needed for selected or checked remembrance after a search.
__________________
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
Old 10-01-2006, 01:52 PM   #3
fmehl
Green Mole
 
fmehl's Avatar
 
Join Date: Sep 2006
Posts: 2
Thanks!!! I'll give it a try.
fmehl 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
how can I modify the search urls worldwealth How-to Forum 0 12-11-2005 12:27 AM
Refine search, but not based on path kristian Mod Submissions 0 01-28-2005 07:10 AM
refine search but not based on path... zevince How-to Forum 3 07-08-2004 09:30 AM
refine problem Killersushi Troubleshooting 2 01-25-2004 11:48 PM
$refine $refine_url $site jedi_diah How-to Forum 1 11-18-2003 03:42 PM


All times are GMT -8. The time now is 02:08 AM.


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