PDA

View Full Version : Customization of "XML like code"


Canadian
01-05-2004, 04:06 PM
In the results templates I see this "XML like code" described in the documentation and am wondering how can I track down its "source". I mean for example; what determines that <phpdig:complete_path> shows the full URL, because I would like that to show just the main site.

Another customization I am interested in is limiting the results to one page maximum return for each "host" or URL, does anyone know an easy way to do this? Because right now a typical search on my index returns 5 straight pages from one site, followed by 5 or 10 straight pages from another site and so on......

Finally is there a way to add voice to the returns so that each site gets read out to people as they are returned? Like "Site return No. 1 is ABC news, your source for global and......" and so on?..... I thought this would be useful for any blind visitors....

Thanks

Charter
01-06-2004, 12:53 AM
Hi. For question one, using <phpdig:complete_path> as an example, to find where this is defined, search for complete_path in the PHP files. Doing this shows complete_path to be in the search_function.php file.

Now searching on complete_path in the search_function.php file shows the following:

'complete_path' => $url,

This is one of the key value pairs in the $table_results array. The key complete_path gets the vaule $url, so searching the search_function.php file again for $url shows $url defined as follows:

$url = eregi_replace("([a-z0-9])[/]+","\\\\1/",$content['site_url'].$content['path'].$content['file']);

The $url variable is also used in page_link so changing its definition affects both complete_path and page_link.

For question two, from PhpDig 1.6.4+ there is the following option in the config.php file:

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

For question three, it looks like you want to implement a server-side screen reader. While I am not aware of such a program, you might find this (http://www.iso.gmu.edu/~swidmaye/portfolio/edit797assistivetech.htm) article on client-side screen readers useful.

Canadian
01-06-2004, 09:18 AM
Much obliged !