<?php
// ------------------------------------------------------------------------- //
// E-Xoops: Content Management for the Masses //
// < http://www.e-xoops.com > //
// ------------------------------------------------------------------------- //
// Original Author: James Knickelbein
// Author Website : http://www.journeymilwaukee.com
// Licence Type : GPL
// ------------------------------------------------------------------------- //
function
xtremeguestbook_search
($queryarray, $andor, $limit, $offset, $userid){
global $db;
$ret = array();
if ( $userid != 0 ) {
return $ret;
}
$sql = "SELECT id, nom, definition FROM ".$db->prefix("
xtremguestbook
")." WHERE affiche='O'";
// because count() returns 1 even if a supplied variable
// is not an array, we must check if $querryarray is really an array
$count = count($queryarray);
if ( $count > 0 && is_array($queryarray) ) {
$sql .= " AND ((nom LIKE '%$queryarray[0]%' OR definition LIKE '%$queryarray[0]%')";
for($i=1;$i<$count;$i++){
$sql .= " $andor ";
$sql .= "(nom LIKE '%$queryarray[$i]%' OR definition LIKE '%$queryarray[$i]%')";
}
$sql .= ") ";
}
$result = $db->query($sql,$limit,$offset);
$ret = array();
$i = 0;
while($myrow = $db->fetch_array($result)){
$ret[$i]['image'] = "images/comm-glo.gif
(das Verzeichnis und die Datei habe ich erstellt)
";
$ret[$i]['link'] = "
admin/index.php?op=Messageedit&idmsg=
".$myrow['
idmsg
']."";
$ret[$i]['title'] = $myrow['
message
'];
$i++;
}
return $ret;
}
?>