PDA

View Full Version : custom sites phpdig:form_dropdown


jdell_nv
03-28-2005, 03:34 PM
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

jerrywin5
03-29-2005, 12:38 AM
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.

jdell_nv
03-29-2005, 02:46 PM
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

Charter
04-06-2005, 01:36 PM
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.

jdell_nv
04-07-2005, 01:50 PM
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...

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
04-07-2005, 02:19 PM
Oops! You also need to do the same change for the 'Narrow search results' on about line 140 of same file.