No lowercase for urls and cog names

This commit is contained in:
Twentysix 2020-09-27 00:23:15 +02:00
parent 0691c08e9e
commit 67bb5f7c4c

View File

@ -22,7 +22,7 @@ $json = json_decode(implode(" ", file('https://raw.githubusercontent.com/Cog-Cre
$cogs = array();
foreach($json as $source => $sourceData){
foreach($sourceData['rx_cogs'] as $cogId => $cog){
$cog['id'] = strtolower($cogId);
$cog['id'] = $cogId;
$cog['source'] = $source;
$cog['source_name'] = $sourceData['name'];
@ -43,8 +43,8 @@ foreach($json as $source => $sourceData){
if(count($cog['author']) == 0){ continue; } # ghost entries
foreach($cog['tags'] as $index => $this_tag){$cog['tags'][$index] = strtolower($this_tag);}
if($filter && !in_array(strtolower($filter), $cog['tags'])){ continue; }
if($search && strpos(strtolower($cog['id']), strtolower($search)) === false){
if(strpos(strtolower($cog['description'] ?: $cog['short']), strtolower($search)) === false && !in_array(strtolower($search), $cog['tags'])){
if($search && stripos(strtolower($cog['id']), strtolower($search)) === false){
if(stripos(strtolower($cog['description'] ?: $cog['short']), strtolower($search)) === false && !in_array(strtolower($search), $cog['tags'])){
continue;
}
}
@ -129,7 +129,7 @@ $cog_chunks = array_chunk($cogs, $per_page);
<t><svg class="icon" viewBox="0 0 16 19">
<path fill-rule="evenodd" d="M0 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6zm13 .25a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25v-.5zM2.25 8a.25.25 0 0 0-.25.25v.5c0 .138.112.25.25.25h.5A.25.25 0 0 0 3 8.75v-.5A.25.25 0 0 0 2.75 8h-.5zM4 8.25A.25.25 0 0 1 4.25 8h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 4 8.75v-.5zM6.25 8a.25.25 0 0 0-.25.25v.5c0 .138.112.25.25.25h.5A.25.25 0 0 0 7 8.75v-.5A.25.25 0 0 0 6.75 8h-.5zM8 8.25A.25.25 0 0 1 8.25 8h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 8 8.75v-.5zM13.25 8a.25.25 0 0 0-.25.25v.5c0 .138.112.25.25.25h.5a.25.25 0 0 0 .25-.25v-.5a.25.25 0 0 0-.25-.25h-.5zm0 2a.25.25 0 0 0-.25.25v.5c0 .138.112.25.25.25h.5a.25.25 0 0 0 .25-.25v-.5a.25.25 0 0 0-.25-.25h-.5zm-3-2a.25.25 0 0 0-.25.25v.5c0 .138.112.25.25.25h1.5a.25.25 0 0 0 .25-.25v-.5a.25.25 0 0 0-.25-.25h-1.5zm.75 2.25a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25v-.5zM11.25 6a.25.25 0 0 0-.25.25v.5c0 .138.112.25.25.25h.5a.25.25 0 0 0 .25-.25v-.5a.25.25 0 0 0-.25-.25h-.5zM9 6.25A.25.25 0 0 1 9.25 6h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 9 6.75v-.5zM7.25 6a.25.25 0 0 0-.25.25v.5c0 .138.112.25.25.25h.5A.25.25 0 0 0 8 6.75v-.5A.25.25 0 0 0 7.75 6h-.5zM5 6.25A.25.25 0 0 1 5.25 6h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 5 6.75v-.5zM2.25 6a.25.25 0 0 0-.25.25v.5c0 .138.112.25.25.25h1.5A.25.25 0 0 0 4 6.75v-.5A.25.25 0 0 0 3.75 6h-1.5zM2 10.25a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25v-.5zM4.25 10a.25.25 0 0 0-.25.25v.5c0 .138.112.25.25.25h5.5a.25.25 0 0 0 .25-.25v-.5a.25.25 0 0 0-.25-.25h-5.5z"></path>
</svg><b>Installation commands</b><l>repo add <?php print(strtolower($cog['source_name'])); ?> <?php print(strtolower($cog['source']));?></l><l>cog install <?php print(strtolower($cog['source_name'])); ?> <?php print($cog['id']); ?></l></t>
</svg><b>Installation commands</b><l>repo add <?php print(strtolower($cog['source_name'])); ?> <?php print($cog['source']);?></l><l>cog install <?php print(strtolower($cog['source_name'])); ?> <?php print($cog['id']); ?></l></t>
<f><?php sort($cog['tags']);foreach($cog['tags'] as $tag){?><tag href="?filter=<?php print($tag); ?>"><?php print($tag); ?></tag><?php }?><src href="<?php print($cog['source']);?>">View Repository</src></f>
</div>
<?php }} ?>