Plugins, it should be in the list. Activtate it
and avery occurence of the expression [app itemId] (case sensitive) will
embed an Appstore AppLogo, Name, Price, aso.
Thanks to Manuel, Alexander and Dave who helped me developing this Plugin
*/
if ( !defined('ABSPATH') ) {
require_once ( '../../../wp-blog-header.php');
}
include ("AppFunctions.php");
include ("definitions.php");
//include ("widget.php");
//wp_enqueue_script('jquery');
function AppStoreLinks_plugin_callback($match)
{
$searchid = $match[1];
return AppStoreLinks_getContent($searchid);
}
function AppStoreLinks_getContent($searchid)
{
list( $obj , $spanOverlay ) = getContent($searchid);
if ($obj==false) {
return "Artikel wurde nicht gefunden";
}
// Read Content
$artworkUrl60 = $obj->results[0]->artworkUrl60;
$trackName = $obj->results[0]->trackName;
$price = $obj->results[0]->price;
$AppStore_country = get_option("AppStore_country");
if ($price == 0.00000) {
$price = "Kostenlos";
} else {
if( $AppStore_country == "US") {
$price .= " USD";
} else {
$price .= " EUR";
}
}
$sellerName = $obj->results[0]->sellerName;
$sellerUrl = $obj->results[0]->sellerUrl;
//$trackViewUrl = $obj->results[0]->trackViewUrl;
$contentAdvisoryRating = $obj->results[0]->contentAdvisoryRating;
$description = str_replace("\n", "
", $obj->results[0]->description);
$cacheimageurl = getImage($searchid, $artworkUrl60);
$AffLink = WP_PLUGIN_URL."/AppStore/AppStore.php?id=".$searchid;
// Update Benachrichtigung, aber nur wenn nicht aus Appstore entfernt
$UpdateTimeSpan = time() - (3*24*60*60); // 3Tage
$releaseDate = strtotime($obj->results[0]->releaseDate);
if (($releaseDate >= $UpdateTimeSpan) && ($spanOverlay == "")) {
$spanOverlay = '';
}
// Create Output
// Thickbox einbinden!
// global $wp_version;
// if ($wp_version >= '2.8') {
// wp_enqueue_script('thickbox28','/wp-includes/js/thickbox/thickbox.js', array('jquery'));
// } else {
// wp_enqueue_script('thickbox');
// }
//
// add_thickbox(); // Aus der wp-admin/plugins.php, dort wird Thickbox verwendet.
$output = ''.$spanOverlay;
$output .= '';
//$output .= ' ';
$output .= ''.$trackName.'
';
$output .= 'Hersteller: '.$sellerName.'
';
$output .= 'Freigabe: '.$contentAdvisoryRating.'
';
$output .= 'Preis: '.$price.' ';
$output .= ''.APPSTORE_DL_LINKNAME.'';
//$output .= 'Test';
$output .= '
' ;
//$output = '
| ';
$searchresult .= '';
$searchresult .= ' | ';
//$searchresult .= "".$trackName."'.$trackName.' '; $searchresult .= 'Hersteller: '.$sellerName.' '; $searchresult .= 'Freigabe: '.$contentAdvisoryRating.' '; $searchresult .= 'Preis: '.$price.' '; $searchresult .= 'Download via iTunes | ';
$searchresult .= 'Beschreibung: '.$description.' | ';
$searchresult .= '