diff --git a/wp-fdroid/wp-fdroid.php b/wp-fdroid/wp-fdroid.php index 2aaba2e8..4de4cdea 100644 --- a/wp-fdroid/wp-fdroid.php +++ b/wp-fdroid/wp-fdroid.php @@ -68,7 +68,8 @@ class FDroid // Handler for the 'fdroidrepo' shortcode. // $attribs - shortcode attributes - // $content - optional content enclosed between the starting and ending shortcode + // $content - optional content enclosed between the starting and + // ending shortcode // Returns the generated content. function do_shortcode($attribs,$content=null) { global $wp_query,$wp_rewrite; @@ -100,6 +101,7 @@ class FDroid $attrs=$app->attributes(); if($attrs['id']==$id) { + $apks=array();; foreach($app->children() as $el) { switch($el->getName()) { case "name": @@ -111,24 +113,78 @@ class FDroid case "summary": $summary=$el; break; + case "description": + $desc=$el; + break; case "license": $license=$el; break; case "source": $source=$el; break; - case "issues": + case "tracker": $issues=$el; break; case "web": $web=$el; break; + case "package": + $thisapk=array(); + foreach($el->children() as $pel) { + switch($pel->getName()) { + case "version": + $thisapk['version']=$pel; + break; + case "vercode": + $thisapk['vercode']=$pel; + break; + case "apkname": + $thisapk['apkname']=$pel; + break; + case "hash": + $thisapk['hash']=$pel; + break; + case "size": + $thisapk['size']=$pel; + break; + case "sdkver": + $thisapk['sdkver']=$pel; + break; + case "permissions": + $thisapk['permissions']=$pel; + break; + } + } + $apks[]=$thisapk; + } } $out="

".$name."

"; $out.='

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

"; + + $out.="

".$desc."

"; + + $out.="

License: ".$license."

"; + + $out.="

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

"; + + $out.="

Packages

"; + foreach($apks as $apk) { + $out.="

Version ".$apk['version']." - "; + $out.='download '; + $out.=$apk['size']." bytes"; + $out.="

"; + } + return $out; } }