<form id="search-form"> <input name="q" <?php echo !empty($_GET['q']) ? " value='" . CoreUtils::aposEncode($_GET['q']) . "'" : ''; ?> title='Search'> <button type='submit' class='blue'>Search</button> <button type='button' class='green typcn typcn-flash sanic-button' title="I'm feeling lucky"></button> <button type='reset' class='red typcn typcn-times' title='Clear'<?php echo empty($_GET['q']) ? ' disabled' : ''; ?> ></button> </form> <? } else echo CoreUtils::notice('warn','<span class="typcn typcn-warning"></span> <strong>ElasticSearch server is down!</strong> Please <a class="send-feedback">let us know</a>, and in the meantime, use the <a class="btn darkblue typcn typcn-th-menu" href="/cg'.($EQG?'/eqg':'').'/full">Full List</a> to find appearances faster. Sorry for the inconvenience.',true); ?> <?php echo $Pagination->HTML . Appearances::getHTML($Ponies) . $Pagination->HTML; ?> </div> <? $export = array( 'Color' => $Color, 'color' => $color, 'EQG' => $EQG, 'AppearancePage' => false, ); if (Permission::sufficient('staff')) $export = array_merge($export, array( 'TAG_TYPES_ASSOC' => Tags::$TAG_TYPES_ASSOC, 'MAX_SIZE' => CoreUtils::getMaxUploadSize(), 'HEX_COLOR_PATTERN' => $HEX_COLOR_REGEX, ));
if (!empty($search['hits']['hits'])) { $ids = []; foreach ($search['hits']['hits'] as $hit) { $ids[] = $hit['_id']; } $Ponies = $CGDb->where('id IN (' . implode(',', $ids) . ')')->orderBy('order', 'ASC')->get('appearances'); } } if (!$elasticAvail) { $_EntryCount = $CGDb->where('ishuman', $EQG)->where('id != 0')->count('appearances'); $Pagination = new Pagination('cg', $AppearancesPerPage, $_EntryCount); $Ponies = Appearances::get($EQG, $Pagination->getLimit()); } if (isset($_REQUEST['GOFAST'])) { if (empty($Ponies[0]['id'])) { Response::fail('The search returned no results.'); } Response::done(array('goto' => "{$CGPath}/v/{$Ponies[0]['id']}-" . Appearances::getSafeLabel($Ponies[0]))); } CoreUtils::fixPath("{$CGPath}/{$Pagination->page}" . (!empty($Restrictions) ? "?q={$SearchQuery}" : '')); $heading = ($EQG ? 'EQG ' : '') . "{$Color} Guide"; $title .= "Page {$Pagination->page} - {$heading}"; if (isset($_GET['js'])) { $Pagination->respond(Appearances::getHTML($Ponies, NOWRAP), '#list'); } $settings = array('title' => $title, 'heading' => $heading, 'css' => array($do), 'js' => array('jquery.qtip', 'jquery.ctxmenu', $do, 'paginate')); if (Permission::sufficient('staff')) { $settings['css'] = array_merge($settings['css'], $GUIDE_MANAGE_CSS); $settings['js'] = array_merge($settings['js'], $GUIDE_MANAGE_JS); } CoreUtils::loadPage($settings);