|
|
<?php
|
|
|
$sample_searches_tags_reserved = ["new", "we're here"];
|
|
|
$sample_searches_plain = ["language", "Australia"];
|
|
|
$sample_searches_tags = ["chat", "official", "privacy", "android", "crypto"];
|
|
|
$sample_searches_languages = [["en", "🇬🇧"], ["zh", "🇨🇳"]];
|
|
|
|
|
|
$sample_searches = [];
|
|
|
|
|
|
foreach ($sample_searches_tags_reserved as $tag) {
|
|
|
$search = str_replace(" ", "-", $tag);
|
|
|
$sample_searches[] = array("type" => "tag-reserved", "text" => "#$tag", "search" => "#$search");
|
|
|
}
|
|
|
foreach ($sample_searches_tags as $tag) {
|
|
|
$search = str_replace(" ", "-", $tag);
|
|
|
$sample_searches[] = array("type" => "tag", "text" => "#$tag", "search" => "#$search");
|
|
|
}
|
|
|
foreach ($sample_searches_plain as $text) {
|
|
|
$sample_searches[] = array("type" => "plain", "text" => $text, "search" => $text);
|
|
|
}
|
|
|
foreach ($sample_searches_languages as $language_array) {
|
|
|
$sample_searches[] = array("type" => "language", "text" => $language_array[1], "search" => "lang:" . $language_array[0]);
|
|
|
}
|
|
|
?>
|
|
|
|
|
|
<div id="search-container" class="collapsed">
|
|
|
<div id="search">
|
|
|
<?php
|
|
|
// Phantom element for alignnment
|
|
|
?>
|
|
|
<span class="btn-clear-search" style="visibility: hidden;" tabindex="-1">×</span>
|
|
|
<input id="search-bar" autocomplete="off" type="text" placeholder="Search for Communities">
|
|
|
<span id="btn-clear-search" class="btn-clear-search anchorstyle clickable enter-clicks" tabindex="0" title="Clear search">×</span>
|
|
|
</div>
|
|
|
<div id="sample-searches">
|
|
|
<?php foreach ($sample_searches as $search): ?>
|
|
|
<span
|
|
|
class="badge clickable enter-clicks sample-search sample-search-<?=$search['type']?>"
|
|
|
title="Try searching for <?=$search['search']?>"
|
|
|
data-search="<?=$search['search']?>"
|
|
|
tabindex=0
|
|
|
><?=
|
|
|
$search['text']
|
|
|
?></span>
|
|
|
<?php endforeach; ?>
|
|
|
</div>
|
|
|
</div>
|