From 4087807afe3cf1795c63d92202b82b032a4a07b1 Mon Sep 17 00:00:00 2001 From: David Sterry Date: Mon, 20 Dec 2010 16:16:56 -0800 Subject: [PATCH 1/4] create path variables --- wp-fdroid/wp-fdroid.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wp-fdroid/wp-fdroid.php b/wp-fdroid/wp-fdroid.php index 17d5141c..79de6eab 100644 --- a/wp-fdroid/wp-fdroid.php +++ b/wp-fdroid/wp-fdroid.php @@ -18,6 +18,9 @@ class FDroid // Our text domain, for internationalisation var $textdom='wp-fdroid'; + var $site_url = "http://localhost/fdroid"; + var $site_path = "/var/www/fdroid"; + // Constructor function FDroid() { // Add filters etc here! @@ -96,7 +99,7 @@ class FDroid function get_app($id) { - $xml = simplexml_load_file("/home/fdroid/public_html/repo/index.xml"); + $xml = simplexml_load_file($this->site_path."/repo/index.xml"); foreach($xml->children() as $app) { $attrs=$app->attributes(); @@ -209,7 +212,7 @@ class FDroid $got=0; $total=0; - $xml = simplexml_load_file("/home/fdroid/public_html/repo/index.xml"); + $xml = simplexml_load_file($this->site_path."/repo/index.xml"); foreach($xml->children() as $app) { $attrs=$app->attributes(); From 724f65276b3bd857a76ed69bf8ad9e8015bdde9b Mon Sep 17 00:00:00 2001 From: David Sterry Date: Mon, 20 Dec 2010 16:22:57 -0800 Subject: [PATCH 2/4] fix blank first entry (repo), increase items per page, and add line breaks in html --- wp-fdroid/wp-fdroid.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/wp-fdroid/wp-fdroid.php b/wp-fdroid/wp-fdroid.php index 79de6eab..361e6f0b 100644 --- a/wp-fdroid/wp-fdroid.php +++ b/wp-fdroid/wp-fdroid.php @@ -207,7 +207,7 @@ class FDroid $out="

Applications matching ".$filter; $out.="

"; - $perpage=10; + $perpage=30; $skipped=0; $got=0; $total=0; @@ -215,6 +215,7 @@ class FDroid $xml = simplexml_load_file($this->site_path."/repo/index.xml"); foreach($xml->children() as $app) { + if($app->getName() == 'repo') continue; $attrs=$app->attributes(); $id=$attrs['id']; foreach($app->children() as $el) { @@ -239,22 +240,22 @@ class FDroid $skipped++; } else if($got<$perpage) { - $out.="
"; + $out.="
\n"; $out.='
'; - $out.='
'; + $out.='
'; $out.='
'; $out.='

Details...'; $out.="

"; - $out.="
"; + $out.="
\n"; $out.='

'.$name.""; - $out.="
".$summary."

"; + $out.="
".$summary."

\n"; - $out.=""; + $out.="\n"; $got++; } From 385609797c8eb557abae707428a2c04f1556138c Mon Sep 17 00:00:00 2001 From: David Sterry Date: Mon, 20 Dec 2010 16:30:08 -0800 Subject: [PATCH 3/4] show urls for links --- wp-fdroid/wp-fdroid.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-fdroid/wp-fdroid.php b/wp-fdroid/wp-fdroid.php index 361e6f0b..192e4164 100644 --- a/wp-fdroid/wp-fdroid.php +++ b/wp-fdroid/wp-fdroid.php @@ -173,13 +173,13 @@ class FDroid $out.="

License: ".$license."

"; - $out.="

Links: "; + $out.="

"; if(strlen($web)>0) - $out.='Website '; + $out.='Website: '.$web.'
'; if(strlen($issues)>0) - $out.='Issue Tracker '; + $out.='Issue Tracker: '.$issues.'
'; if(strlen($source)>0) - $out.='Source Code'; + $out.='Source Code: '.$source.'
'; $out.="

"; $out.="

Packages

"; From 81a7de2d85f183f46279b370fcb31c411dbfebbe Mon Sep 17 00:00:00 2001 From: David Sterry Date: Tue, 21 Dec 2010 14:38:13 -0800 Subject: [PATCH 4/4] remove site_url path since it's not necessary --- wp-fdroid/wp-fdroid.php | 1 - 1 file changed, 1 deletion(-) diff --git a/wp-fdroid/wp-fdroid.php b/wp-fdroid/wp-fdroid.php index 192e4164..0d27665c 100644 --- a/wp-fdroid/wp-fdroid.php +++ b/wp-fdroid/wp-fdroid.php @@ -18,7 +18,6 @@ class FDroid // Our text domain, for internationalisation var $textdom='wp-fdroid'; - var $site_url = "http://localhost/fdroid"; var $site_path = "/var/www/fdroid"; // Constructor