gweedo767
Forum Replies Created
-
Forum: Plugins
In reply to: A new “gallery” of sortsI thought about doing that with the search box, but just haven’t done it yet. What you are talking about would be similiar to how Google Suggest shows its content.
I will let you know if I add that.
Forum: Plugins
In reply to: A new “gallery” of sortsThey are all closed due to horible spamming at the moment. I plan to turn them back on with required registration. Any other recommendations?
Forum: Plugins
In reply to: New AJAX based search boxIt should be safe, but you could optionally just have the script load the wp-config.php file like this:
require( dirname(__FILE__) . ‘/wp-config.php’ );
Then just use the variables it sets for your MySQL connection.Forum: Plugins
In reply to: New AJAX based search boxForum: Plugins
In reply to: New AJAX based search boxWierd, that posting of search.php is wrong 🙂 Here is a correct version of it:
<?php
mysql_connect(“DBHOST”,”DBUSER,”DBPASS”);
@mysql_select_db(“DATABASE”) or die(“Freaking db seems to have left”);//make sure that string isn’t in use
$search = $_REQUEST[‘val’];
$sql = “SELECT * FROM wp_posts WHERE post_title LIKE ‘%$search%’ OR post_content LIKE ‘%$search%'”;
$result = mysql_query($sql);
$num = mysql_numrows($result);
mysql_close();$i=0;
while($i<$num) {
$id = mysql_result($result,$i,”ID”);
$title = mysql_result($result,$i,”post_title”);
?>
“><? echo $title ?>
<?
$i++;
}
if($num == 0) {
?>
No Results on ‘<? echo $search ?>’
<?
}?>
END OF PHP
Of course, be sure to replace things like HOST and DBUSER and what not with their correct values for you.