function __construct($user_query, $type_obj = "article") { $this->type_obj = $type_obj; $this->field_restrict[] = array('field' => 'type', 'values' => $this->type_obj, 'op' => "and", 'not' => false); parent::__construct($user_query); }
echo $_GET['syntax']; ?> </b></font> <div class="c" style="font-family: monospace;"> <Br><Br> <table width="100%" Height="" id="archvie" border="0"> <tr id="archive" bgcolor=""> <td nowrap width="25" id=""><span class="whitetext_md"><B>Name / Title</B><hr></td> <td nowrap width="25"><span class="whitetext_md"><b>Posted</b><Hr></span></td> <td nowrap width="25"><span class="whitetext_md"><b>Total Hits</b><Hr></span></td> <td nowrap width="25"><span class="whitetext_md"><b>Syntax</b><hr></span></td> </tr> <tr> <?php include '../classes/search.class.php'; $search = new searcher(); $search->searchbysyntax(); ?> <?php $error = $search->error; if (isset($error)) { echo $error; } ?> </tr> </div> <!--/row--> </div> <!--/span--> </div> <!--/row-->
public function __construct($user_query, $fields = "") { $this->fields_list_gen = $fields; $this->field_restrict = array(); $tmp = explode(",", $fields); //On récupère la liste des champs if (count($tmp)) { if (!preg_match("/;/", $fields)) { //Si je n'ai pas de ; alors je n'ai qu'une liste de champ if (count($tmp) == 1) { //Je n'ai qu'un champ $this->field_restrict[] = array('field' => "code_champ", 'values' => $fields, 'op' => "and", 'not' => false); } else { $this->field_restrict[] = array('field' => "code_champ", 'values' => $tmp, 'op' => "and", 'not' => false); } } else { foreach ($tmp as $value) { if (preg_match("/^([0-9]+?);([0-9;]+)\$/", $value, $matches)) { //J'ai un ou des sous champs if (preg_match("/;/", $matches[2])) { $list_sub = explode(";", $matches[2]); } else { $list_sub = $matches[2]; } $sub = array(); $sub[] = array('sub_field' => "code_ss_champ", 'values' => $list_sub, 'op' => "and", 'not' => false); $this->field_restrict[] = array('field' => "code_champ", 'values' => $matches[1], 'op' => "or", 'not' => false, 'sub' => $sub); } else { $this->field_restrict[] = array('field' => "code_champ", 'values' => $value, 'op' => "or", 'not' => false); } } } } parent::__construct($user_query); }
</div> <div class="span8"> <div class="base-block"> <img src="img/search.png" height="40" width="40"> <font size="5"> Search Results</font> <div class="c" style="font-family: monospace;"> <table width="1110" Height="" id="archvie" border="0"><Br> <tr id="archive" bgcolor=""> <td nowrap width="35" id=""><span class="whitetext_md"><B>Name / Title</B><hr></td> <td nowrap width="35"><span class="whitetext_md"><b>Posted</b><Hr></span></td> <td nowrap width="25"><span class="whitetext_md"><b>Total Hits</b><Hr></span></td> <td nowrap width="35"><span class="whitetext_md"><b>Syntax</b><hr></span></td> <tr> <?include 'classes/search.class.php'; $search = new searcher(); $search->searchbyname();?> <? $error = $search->error; if (isset($error)) { echo $error; } ?> </tr> </table> </div> <!--/row--> </div> <!--/span--> </div>
public function __construct($user_query) { parent::__construct($user_query); $this->field_restrict[] = array('field' => "code_champ", 'values' => array(36), 'op' => "and", 'not' => false); }