diff --git a/wp-fdroid/wp-fdroid.php b/wp-fdroid/wp-fdroid.php index 17d5141c..0d27665c 100644 --- a/wp-fdroid/wp-fdroid.php +++ b/wp-fdroid/wp-fdroid.php @@ -18,6 +18,8 @@ class FDroid // Our text domain, for internationalisation var $textdom='wp-fdroid'; + var $site_path = "/var/www/fdroid"; + // Constructor function FDroid() { // Add filters etc here! @@ -96,7 +98,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(); @@ -170,13 +172,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

"; @@ -204,14 +206,15 @@ class FDroid $out="

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

"; - $perpage=10; + $perpage=30; $skipped=0; $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) { + if($app->getName() == 'repo') continue; $attrs=$app->attributes(); $id=$attrs['id']; foreach($app->children() as $el) { @@ -236,22 +239,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++; }