$cats = $_GET['cats']; $catIDs = explode(",", $cats); } $pageNum = 0; if (!empty($_GET['page'])) { $pageNum = 1 * $_GET['page']; } $pageSz = 0; if (!empty($_GET['pageSz'])) { $pageSz = 1 * $_GET['pageSz']; } ?> <HTML> <BODY> <?php $resInfo = queryObjects($catIDs, $kwds, $pageNum, $pageSz, $onlyWithImgs); if (!$resInfo) { echo "<h2>Query Failed</h2>"; } else { if ($resInfo['nObjs'] == 0) { echo "<h2>Query returned no results!</h2>"; } else { echo "<h2>Query:"; if (!empty($cats)) { echo " Cats: <em>" . $cats . "</em>"; } if (!empty($kwds)) { echo " Kwds: <em>" . $kwds . "</em>"; } echo "</h2>"; echo "<h3>Returned " . $resInfo['nObjs'] . " results.</h2>";
// Parse out page isset($_GET['page']) ? $page = $_GET['page'] : ($page = 1); // Parse page size isset($_GET['pageSize']) ? $pageSize = $_GET['pageSize'] : ($pageSize = 36); // Cannot process rawkwds unless we have no cats or refined keywords if (isset($_GET['rawkwds']) && empty($kwds) && empty($catIDs)) { $rawkwds = trim($_GET['rawkwds'], " \t\n\r'"); $values = getCategoryIDsForKwds($rawkwds, $images); $catIDs = $values['cats']; $kwds = implode(",", $values['kwds']); } $t->assign('cats', implode(",", $catIDs)); //if( $kwds ) $t->assign('kwds', $kwds); // Query objects $objResults = queryObjects($catIDs, $kwds, $tag, $user, $page - 1, $pageSize, $images); // Get object thumbs $objects = array(); if (empty($objResults['objects'])) { $t->assign('pager', ""); $t->assign('results_total', 0); $t->assign('results_start', 0); $t->assign('results_end', 0); //if( $images ) $t->assign('toggleImages', $images); } else { foreach ($objResults['objects'] as $obj) { $obj['img_path'] ? $img_path = $obj['img_path'] : ($obj['img_path'] = "noObjectImage"); $imageOptions = array('img_path' => $obj['img_path'], 'size' => 90, 'img_ar' => $obj['aspectRatio'], 'linkURL' => $CFG->shortbase . "/object/" . $obj['id'], 'vAlign' => "center", 'hAlign' => "center"); $obj['thumb'] = outputSimpleImage($imageOptions); $objects[] = $obj;