$country[name]\n"; } $language_option_list=""; while ($language=mysql_fetch_array($languages)) { $language_option_list.="\n"; } $category_option_list=""; while ($category=mysql_fetch_array($categories)) { $category_option_list.="\n"; } $html=str_replace("%countries%",$country_option_list,$html); $html=str_replace("%languages%",$language_option_list,$html); $html=str_replace("%categories%",$category_option_list,$html); echo($html); } else if ($action=="dosearch") { if ($country && $country!="all") { $andcountry=" AND country='$country'"; } if ($language && $language!="all") { $andlanguage=" AND language='$language'"; } if ($category && $category!="all") { $andcategory=" AND category='$category'"; } //$query="SELECT * FROM sherlock WHERE name LIKE '%$name%'".$andcountry.$andlanguage.$andcategory." ORDER BY name"; $query="SELECT * FROM sherlock,category WHERE sherlock.category=category.id AND sherlock.name LIKE '%$name%'".$andcountry.$andlanguage .$andcategory." ORDER BY category.name,sherlock.name"; $res=mysql_query($query); $numrows=mysql_num_rows($res); if ($numrows>0) { while ($item=mysql_fetch_array($res)) { if ($item[13] != $prevcat) { if ($catfirsttime == "no") { echo(" \n \n"); } else { $thelist = "
    \n"; echo($thelist); $catfirsttime = "no"; } $thiscat = "
  1. \n $item[14]\n \n
  2. \n
\n"); echo("

$numrows plugins found.\n

"); } else { $nothingfound="

Nothing found.

\n"; echo($nothingfound); } } function displayitem($item) { /*0 = id 1 = plugin name 2 = icon type 3 = long url 4 = short url 5 = author 6 = date 7 = category number 8 = country code 9 = language code 10 = beta 11 = public 12 = comment 13 = category number 14 = category name*/ $startlist = "
  • \n"; $address = " ($item[4])\n"; if ($item[5]) { $author = " by $item[5]\n"; } else { $author = ""; } $install = " $item[1] [$item[9]-$item[8]]\n"; $endlist = "
  • \n"; echo($startlist); echo($install); echo($address . $author); echo($endlist); } ?>