PHP Classes

File: apps/newswall/showresults.php

Recommend this page to a friend!
  Classes of Mark Richards   CliqonV4   apps/newswall/showresults.php   Download  
File: apps/newswall/showresults.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: CliqonV4
Framework with modules to build Web applications
Author: By
Last change:
Date: 5 years ago
Size: 755 bytes
 

Contents

Class file image Download
<?php
  error_reporting
(0);
 
session_start();
 
$results=array();
  if(!empty(
$_POST["q"])) {
   
$qparts=explode(" ",$_POST["q"]);
    foreach(
$_SESSION["bid"] as $key=>$value) {
     
$found=false;
      foreach(
$qparts as $onepart) {
        if(!empty(
$onepart)) {
          if(
eregi($onepart,$value)) $found=true;
          if(
$onepart[0]=="+" && strlen($onepart)>1 && eregi(substr($onepart,1),$value)) $found=true; else
          if(
$onepart[0]=="+" && strlen($onepart)>1 && !eregi(substr($onepart,1),$value)) {$found=false;break;}
          if(
$onepart[0]=="-" && strlen($onepart)>1 && eregi(substr($onepart,1),$value)) {$found=false;break;}
        }
      }
      if(
$found==true) $results[]="#".$key;
    }
    echo
json_encode($results);
  }
?>