$sourceData){ foreach($sourceData['rx_cogs'] as $cogId => $cog){ $cog['id'] = strtolower($cogId); $cog['source'] = $source; $cog['source_name'] = $sourceData['name']; $cog['rx_category'] = $sourceData['rx_category']; if(!empty($cog['max_bot_version'])){ array_unshift($cog['requirements'], 'Bot<=' . $cog['min_bot_version']); } if(!empty($cog['min_bot_version'])){ array_unshift($cog['requirements'], 'Bot>=' . $cog['min_bot_version']); } if(!empty($cog['min_python_version'])){ array_unshift($cog['requirements'], 'Python>=' . implode('.', $cog['min_python_version'])); } if($cog['hidden'] || $cog['disabled']){ continue; } if($cog['rx_category'] == 'unapproved' && $show_ua !== "1"){ continue; } 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'])){ continue; } } array_push($cogs, $cog); } } function byName($a,$b){ return ($a['id'] <= $b['id']) ? -1 : 1;} usort($cogs, "byName"); $cog_chunks = array_chunk($cogs, $per_page); ?>