In the code:
function connectForAjax() { $database = ''; $tblPrefix = ''; $dbuser = ''; $dbpass = ''; $dbhost = 'localhost'; $db = mysql_connect($dbhost,$dbuser,$dbpass) or die("cannot connect to database"); $selected = @mysql_select_db($database, $db) or die ("cannot select database"); return $tblPrefix; }
Why would you not use the $modx->dbconfig[’configPieceHere’] stuff so there’s no manual intervention required?
include_once (dirname(__FILE__).'../../../../manager/includes/config.inc.php');
Any progress on search results highlighting?
Also, have you thought about making a switchable configuration parameter to turn it into a live search?

In your absence, we’ve done a lot on this front and will be introducing a new file to facilitate Ajax calls to the DB at the root level of the distribution with the next release (index-ajax.php). Without this file, basedir issues on some PHP5 installs make it a no go. The good news is that we’ve now got it working requiring no manual configuration.
We’re continuing to clean up and comment the code as we go through it, and may add a few configuration params as well.
By livesearch, I mean something along the lines of the demo at gizax.it.
$ajaxSearch = (isset($ajaxSearch))? $ajaxSearch : 0;
I think this should default to 1; after all, we’re talking about an Ajax search. The logic on the search action should then include a test to make sure the scriptaculous/prototype library calls work. If not, it should output an error message stating that the libraries could not be found.
When it’s done, we should also then do a version that works with moo.ajax and moo.fx, as they’re much lighter.
This discussion is closed to further replies. Keep calm and carry on.