<?php
// $Id: search.inc.php,v 1.1 2003/08/31 12:16:13 half-dead Exp $
// ------------------------------------------------------------------------- //
//               E-Xoops: Content Management for the Masses                  //
//                       < http://www.e-xoops.com >                          //
// ------------------------------------------------------------------------- //
// Original Author: James Knickelbein
// Author Website : http://www.journeymilwaukee.com
// License Type   : GPL: See /manual/LICENSES/GPL.txt
// ------------------------------------------------------------------------- //
function arcade_search($queryarray, $andor, $limit, $offset, $userid) {
global $db;
$sql = "SELECT t1.gid, t1.uid, t1.score, t1.score_date, t2.gname
FROM `".$db->prefix("arcade_scores")."` AS t1, 
 `".$db->prefix("arcade_games")."` AS t2
 WHERE t1.gid = t2.gid " ;
if ( $userid != 0 ) {
	$sql .= " AND uid=".$userid." ";
}
$sql   .= " ORDER BY score_date DESC";
$result = $db->query($sql, $limit, $offset);
$i = 0;
if ($result) {
	while ($myrow = $db->fetchArray($result)) {
		$ret[$i]['image']   = "images/home.png";
		$ret[$i]['link']    = "index.php?act=play_game&gid=".$myrow['gid'];
		$ret[$i]['title']   = $myrow['gname'];
		$ret[$i]['content'] = $myrow['score'];
		$ret[$i]['time']    = $myrow['score_date'];
		$ret[$i]['uid']     = $myrow['uid'];
		$i++;
	}
}
return $ret;
}
?>
