Empty commit

This commit is contained in:
Git 2012-09-30 08:00:16 +00:00
parent c52d1a6c9e
commit 07bac85278
3 changed files with 23 additions and 20 deletions

View File

@ -138,16 +138,16 @@ public function register_query($QueryString, $QueryProcessTime) {
class SPHINXQL_QUERY { class SPHINXQL_QUERY {
private $SphinxQL; private $SphinxQL;
private $Expressions = array(); private $Expressions;
private $Filters = array(); private $Filters;
private $GroupBy = ''; private $GroupBy;
private $Indexes = ''; private $Indexes;
private $Limits = array(); private $Limits;
private $Options = array(); private $Options;
private $QueryString = ''; private $QueryString;
private $Select = '*'; private $Select;
private $SortBy = array(); private $SortBy;
private $SortGroupBy = ''; private $SortGroupBy;
/** /**
* Initialize SphinxQL object * Initialize SphinxQL object
@ -158,6 +158,7 @@ class SPHINXQL_QUERY {
*/ */
public function __construct($Server = SPHINXQL_HOST, $Port = SPHINXQL_PORT, $Socket = SPHINXQL_SOCK) { public function __construct($Server = SPHINXQL_HOST, $Port = SPHINXQL_PORT, $Socket = SPHINXQL_SOCK) {
$this->SphinxQL = SPHINXQL::init_connection($Server, $Port, $Socket); $this->SphinxQL = SPHINXQL::init_connection($Server, $Port, $Socket);
$this->reset();
} }
/** /**
@ -167,7 +168,6 @@ public function __construct($Server = SPHINXQL_HOST, $Port = SPHINXQL_PORT, $Soc
* @return current SphinxQL query object * @return current SphinxQL query object
*/ */
public function select($Fields) { public function select($Fields) {
$this->reset_query();
$this->Select = $Fields; $this->Select = $Fields;
return $this; return $this;
} }
@ -316,8 +316,6 @@ private function build_options() {
/** /**
* Combine the query conditions into a valid Sphinx query segment * Combine the query conditions into a valid Sphinx query segment
*
* @return SphinxQL query string
*/ */
private function build_query() { private function build_query() {
if(!$this->Indexes) { if(!$this->Indexes) {
@ -325,7 +323,7 @@ private function build_query() {
} }
$this->QueryString = "SELECT $this->Select FROM $this->Indexes"; $this->QueryString = "SELECT $this->Select FROM $this->Indexes";
if(!empty($this->Expressions)) { if(!empty($this->Expressions)) {
$this->Filters[] = "MATCH('".implode(" ", $this->Expressions)."')"; $this->Filters['expr'] = "MATCH('".implode(" ", $this->Expressions)."')";
} }
if(!empty($this->Filters)) { if(!empty($this->Filters)) {
$this->QueryString .= "\nWHERE ".implode("\n\tAND ", $this->Filters); $this->QueryString .= "\nWHERE ".implode("\n\tAND ", $this->Filters);
@ -401,7 +399,7 @@ private function send_query($GetMeta) {
/** /**
* Reset all query options and conditions * Reset all query options and conditions
*/ */
private function reset_query() { public function reset() {
$this->Expressions = array(); $this->Expressions = array();
$this->Filters = array(); $this->Filters = array();
$this->GroupBy = ''; $this->GroupBy = '';

View File

@ -49,7 +49,7 @@
<td class="label">Tags</td> <td class="label">Tags</td>
<td><input type="text" name="tags" size="60" value="<?=$TagList?>" /></td> <td><input type="text" name="tags" size="60" value="<?=$TagList?>" /></td>
</tr> </tr>
<? if($CategoryID == 0) { ?> // CategoryID==0 is "Personal" collages <? if($CategoryID == 0) { // CategoryID==0 is "Personal" collages ?>
<tr> <tr>
<td class="label"><span title="A &quot;featured&quot; personal collage will be listed first on your profile.">Featured</span></td> <td class="label"><span title="A &quot;featured&quot; personal collage will be listed first on your profile.">Featured</span></td>
<td><input type="checkbox" name="featured" <?=($Featured?'checked':'')?> /></td> <td><input type="checkbox" name="featured" <?=($Featured?'checked':'')?> /></td>

View File

@ -78,10 +78,12 @@
<h3>Search this forum:</h3> <h3>Search this forum:</h3>
<form class="search_form" name="forum" action="forums.php" method="get"> <form class="search_form" name="forum" action="forums.php" method="get">
<table cellpadding="6" cellspacing="1" border="0" class="layout border"> <table cellpadding="6" cellspacing="1" border="0" class="layout border">
<input type="hidden" name="action" value="search" />
<input type="hidden" name="forums[]" value="<?=$ForumID?>" />
<tr> <tr>
<td><strong>Search for:</strong></td><td><input type="text" id="searchbox" name="search" size="70" /></td> <td>
<input type="hidden" name="action" value="search" />
<input type="hidden" name="forums[]" value="<?=$ForumID?>" />
<strong>Search for:</strong></td><td><input type="text" id="searchbox" name="search" size="70" />
</td>
</tr> </tr>
<tr> <tr>
<td><strong>Search in:</strong></td> <td><strong>Search in:</strong></td>
@ -91,10 +93,13 @@
<input type="radio" name="type" id="type_body" value="body" /> <input type="radio" name="type" id="type_body" value="body" />
<label for="type_body">Post bodies</label> <label for="type_body">Post bodies</label>
</td> </td>
</tr>
<tr> <tr>
<td><strong>Username:</strong></td><td><input type="text" id="username" name="user" size="70" /></td> <td><strong>Username:</strong></td><td><input type="text" id="username" name="user" size="70" /></td>
</tr> </tr>
<tr><td colspan="2" style="text-align: center"><input type="submit" name="submit" value="Search" /></td></tr> <tr>
<td colspan="2" style="text-align: center"><input type="submit" name="submit" value="Search" /></td>
</tr>
</table> </table>
</form> </form>
<br /> <br />