4 && ($number % 100) < 20) ? 2 : $cases[min($number % 10, 5)]]; } // Init config $config = json_decode( file_get_contents( __DIR__ . '/../../config.json' ) ); // Init $client = new \Manticoresearch\Client( [ 'host' => $config->manticore->server->host, 'port' => $config->manticore->server->port, ] ); // Init index $index = $client->index( $config->manticore->index->document ); // Get totals $total = $index->search('') ->option('cutoff', 0) ->limit(0) ->get() ->getTotal(); $placeholder = plural( $total, [ sprintf( _('Over %s page or enter the new one...'), number_format( $total ) ), sprintf( _('Over %s pages or enter the new one...'), number_format( $total ) ), sprintf( _('Over %s pages or enter the new one...'), number_format( $total ) ), ] ); // Request $q = !empty($_GET['q']) ? $_GET['q'] : ''; $p = !empty($_GET['p']) ? (int) $_GET['p'] : 1; // Check URL for exist $results = $index->search($q) ->offset($p * $config->webui->pagination->limit - $config->webui->pagination->limit) ->limit($config->webui->pagination->limit) ->get(); ?> <?php echo sprintf(_('%s - YGGo!'), htmlentities($q)) ?>

getTotal()) { ?>
url)) { ?>

title ?>

description)) { ?> description ?> keywords)) { ?> keywords ?> setValue( parse_url( $result->url, PHP_URL_HOST ) ); $identicon->setSize(16); $identicon->setStyle( [ 'backgroundColor' => 'rgba(255, 255, 255, 0)', 'padding' => 0 ] ); ?> identicon url)) ?>
webui->pagination->limit <= $results->getTotal()) { ?>