$sourceData){ foreach($sourceData['rx_plugins'] as $pluginId => $plugin){ $plugin['id'] = $pluginId; $plugin['source'] = explode('@', $source, 2)[0]; $plugin['source_name'] = $sourceData['name']; $plugin['rx_category'] = $sourceData['rx_category']; if($plugin['min_bot_version'] == '0.0.0'){ $plugin['min_bot_version'] = ''; } if($plugin['max_bot_version'] == '0.0.0'){ $plugin['max_bot_version'] = ''; } if($plugin['min_bot_version'] === $plugin['max_bot_version']){ if(!empty($plugin['max_bot_version'])){ array_unshift($plugin['requirements'], 'Bot==' . $plugin['max_bot_version']); } else if(!empty($plugin['max_bot_version'])){ array_unshift($plugin['requirements'], 'Bot==' . $plugin['max_bot_version']); } } else { if(!empty($plugin['max_bot_version'])){ array_unshift($plugin['requirements'], 'Bot<=' . $plugin['max_bot_version']); } if(!empty($plugin['min_bot_version'])){ array_unshift($plugin['requirements'], 'Bot>=' . $plugin['min_bot_version']); } } if(!empty($plugin['min_python_version'])){ array_unshift($plugin['requirements'], 'Python>=' . implode('.', $plugin['min_python_version'])); } if($plugin['hidden'] || $plugin['disabled']){ continue; } if($plugin['rx_category'] == '未认证' && $show_ua !== "1"){ continue; } if(count($plugin['author']) == 0){ continue; } # ghost entries foreach($plugin['tags'] as $index => $this_tag){$plugin['tags'][$index] = strtolower($this_tag);} if($filter && !in_array(strtolower($filter), $plugin['tags'])){ continue; } if($search){ $matched = FALSE; if(stripos(strtolower($plugin['id']), strtolower($search)) !== false){ $matched = TRUE; } else if(stripos(strtolower($plugin['description']), strtolower($search)) !== false){ $matched = TRUE; } else if(in_array(strtolower($search), $plugin['tags'])){ $matched = TRUE; } else { foreach($plugin['author'] as $author) { if(stripos(strtolower($author), strtolower($search)) !== false){ $matched = TRUE; break; } } foreach($plugin['requirements'] as $req) { if(stripos(strtolower($req), strtolower($search)) !== false){ $matched = TRUE; break; } } } if(!$matched){ continue; } } array_push($plugins, $plugin); } } function byName($a,$b){ return ($a['id'] <= $b['id']) ? -1 : 1;} usort($plugins, "byName"); $plugin_chunks = array_chunk($plugins, $per_page); ?>