PhpDig.net

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

Reply
 
Thread Tools
Old 03-28-2005, 03:34 PM   #1
jdell_nv
Green Mole
 
Join Date: Oct 2003
Posts: 8
custom sites phpdig:form_dropdown

Hi All,

I would like to specify which sites are listed on the search page because phpDig finds too many (clutters up list with unneeded info). I wanted to set this manually but it appears phpDig is adding a number to the site as a prefix, so hardcoding in the template wouldn't work, because this number might change.

Is there a way to manually specify (say in config.php) which values should appear in the sites form_dropdown item?

Thanks!
John
jdell_nv is offline   Reply With Quote
Old 03-29-2005, 12:38 AM   #2
jerrywin5
Orange Mole
 
Join Date: Mar 2004
Posts: 48
Hi,

You can set the number of results to display per site. In the config file find

define('NUMBER_OF_RESULTS_PER_SITE',-1); //max number of results per site

and set the value to what you like.
jerrywin5 is offline   Reply With Quote
Old 03-29-2005, 02:46 PM   #3
jdell_nv
Green Mole
 
Join Date: Oct 2003
Posts: 8
Hi jerrywin5,

I guess I wasn't clear what I was requesting. On the search page, there is a drop down list of sites at the top of the page that contains about 100 entries, many of which are useless. The search results are fine as they are. I just want to restrict the list of sites at the top in the drop down.

The only two settings I can find that seem to affect the drop down are these:

define('DISPLAY_DROPDOWN',true);
define('DROPDOWN_URLS',true);

So, I'd like to be able to dictate what appears in the drop-down.

Does that make sense?

Thanks for your kind consideration in replying!

Regards,
John
jdell_nv is offline   Reply With Quote
Old 04-06-2005, 01:36 PM   #4
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
PhpDig dynamically creates the dropdown options based on the database content. If you wish to change the dropdown options rather than turn the dropdown off, you would need to edit the function_phpdig_form.php file.
__________________
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 04-07-2005, 01:50 PM   #5
jdell_nv
Green Mole
 
Join Date: Oct 2003
Posts: 8
Thanks! That was the hint I needed. Here is what I did which I think might be useful for others. I added a simple substr_count so we don't get URL's deeper than the first level of the website. For my site structure, this is perfect. I'm sure YMMV for others.

about line 188 of function_phpdig_form.php...
Code:
      while ($dd_data = mysql_fetch_array($dd_query)) {
++        // limit results to only main URL's - don't get lots of useless stuff
++        if (substr_count($dd_data['path'],"/") <= 1) {
          $result['form_dropdown'] .= "<option value='".$dd_data['site_id'].",".$dd_data['path']."'>".$dd_data['site_url'].$dd_data['path']."</option>";
++        }
      }
jdell_nv is offline   Reply With Quote
Old 04-07-2005, 02:19 PM   #6
jdell_nv
Green Mole
 
Join Date: Oct 2003
Posts: 8
Oops! You also need to do the same change for the 'Narrow search results' on about line 140 of same file.
jdell_nv 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
PHPDig won't index most sites and only go down one level on all confusion Troubleshooting 1 10-14-2005 10:32 AM
"I don't want to index your sites!!!" - said PHPDig #ASH How-to Forum 1 04-06-2005 01:57 PM
Can PhpDig spider only certain sites? jkuzma How-to Forum 1 02-11-2005 02:38 PM
custom install rom Script Installation 16 02-23-2004 10:05 AM


All times are GMT -8. The time now is 10:37 PM.


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