Search Tutorials
Flash Keyword Search Module for DGS SearchAs I stated before, the reason I liked DGS Search was its modular capabilities. I've included with the attached zip a flash.php This file is to be placed in your ../dgssearch/lib/display/ directory. It is used to send the variables back to Flash.
<?
/*
** flash.php written by James Greenhalgh
** used for keyword search in flash
*/
function flash($retVal, $q, $r, $o, $s, $timer) {
global $config;
$size = ($s <1) ? count($retVal) : $s;
$dispR = ($r == $config["maxResults"]) ? 0 : $r;
if ($size> 0) {
$i = 0;
reset($retVal);
while (list(, $match) = each($retVal)) {
$i++;
if ($i <= $o)
continue;
if ($i> $o + $r)
break;
$question = $match["link"];
$id = $match["url"];
printf("&link$i=$id&word$i=$question");
}
}
printf("&linksLoaded=yes");
return true;
}
?>
This PHP script gets executed when you click on the Ask Button, it is loaded in the ActionScripting of the Ask Button. I'm not going to get into explaining every line step by step, but the most important one is this line: printf("&link$i=$id&word$i=$question");
Note: If you are going to be using PostgreSQL, then you must copy the attached
"db.php" file into the lib/search/ directory. (make sure to rename the old one) PostgreSQL support is
not part of the DGS Search package yet, it's my own personal hack which should work.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|