From f9fd11035c04e01d6a71a3da7f4bf02dee77210e Mon Sep 17 00:00:00 2001 From: Ciaran Gultnieks Date: Sat, 3 Mar 2012 10:56:28 +0000 Subject: [PATCH] Show categories on web site from data, not hard-coded --- wp-fdroid/wp-fdroid.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/wp-fdroid/wp-fdroid.php b/wp-fdroid/wp-fdroid.php index 96d6827d..cba67e64 100644 --- a/wp-fdroid/wp-fdroid.php +++ b/wp-fdroid/wp-fdroid.php @@ -464,8 +464,16 @@ class FDroid if(($query_vars['fdfilter']===null || $query_vars['fdfilter']!='') && $numpages>0) { $out.='
'; - if($query_vars['fdfilter']===null) { - $categories = array('All applications','Games','Internet','Multimedia','Navigation','Office','System'); + if($query_vars['fdfilter']===null) { + + $categories = array('All categories'); + $handle = fopen(getenv('DOCUMENT_ROOT').'/repo/categories.txt', 'r'); + if ($handle) { + while (($buffer = fgets($handle, 4096)) !== false) { + $categories[] = $buffer; + } + fclose($handle); + } $out.='
'; $out.=$this->makeformdata($query_vars); -- 2.30.2