mandy
10-04-2000, 06:54 PM
I've been trying to configure dgssearch (Digital Genesis Systems http://www.digitalgenesis.com ) on my site.
I wanted to use it because it claims to be able to do file searching as well as database searching--exactly what I need.
At first I thought the problem with it not being able to include files had something to do with the pre-pending, but I don't think so anymore.[nbsp][nbsp]I think there is actually something going on with the script when it[nbsp][nbsp]runs through an array.[nbsp][nbsp]Anyway, without going into too much detail just yet, I wanted to know if anyone out there had tried this one out.
Thanks.
mandy
10-06-2000, 01:30 AM
Okay, then, since no one has responded, I think I've narrowed the problem down to one variable that is not being created properly ($module).[nbsp][nbsp]Anyone out there have any idea why this bit of php might not work properly?
[assume all variables in the required files are set properly]
******************************************
require("config/config.php");
require("libs/utils.php");
function search($q, $r, $o, $s) {
[nbsp][nbsp][nbsp][nbsp][nbsp]global $config;
[nbsp][nbsp][nbsp][nbsp][nbsp]$modules = $config["searchModules"];
[nbsp][nbsp][nbsp][nbsp][nbsp]$installBase = ereg_replace("(^.*)[/\\]$", "\\1", $config["installBase"]);
[nbsp][nbsp][nbsp][nbsp][nbsp]settype($retVal, "array");
[nbsp][nbsp][nbsp][nbsp][nbsp]reset($modules);
[nbsp][nbsp][nbsp][nbsp][nbsp]while (list(, $module) = each($modules)) {
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]$modInclude = $installBase . $config["fileSeparator"] . "libs" . $config["fileSeparator"] . "search" . $config["fileSeparator"] . $module . ".php";
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]if (!function_exists($module)) {
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]if (is_readable($modInclude)) {
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]include($modInclude);
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]} else {
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]printf("Error: Unable to access search module '%s' (%s).
\n", $module, $modInclude);
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]}
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]}
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]if (function_exists($module)) {
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]$retVal = $module($retVal, $q, $r, $o, $s);
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]if (is_string($retVal)) {
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]printf("Error: Module '%s' had a fatal error. Details below:
\n
\n%s
\n", $module, $retVal);
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]exit(1);
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]}
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]} else {
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]printf("Error: Search module '%s' (%s) is not usable.
\nThis module must contain the function '%s(\$retVal, \$q, \$r, \$o, \$s)'.
\n", $module, $modInclude, $module);
[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]}
[nbsp][nbsp][nbsp][nbsp][nbsp]}
[nbsp][nbsp][nbsp][nbsp][nbsp]return $retVal;
}
*************************************
vBulletin® v3.6.8, Copyright ©2000-2009, Jelsoft Enterprises Ltd.