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 .= ''.$trackName.' (AppStore Link) '; $output .= ''.$trackName.'
'; $output .= 'Hersteller: '.$sellerName.'
'; $output .= 'Freigabe: '.$contentAdvisoryRating.'
'; $output .= 'Preis: '.$price.' '; $output .= ''.APPSTORE_DL_LINKNAME.''; //$output .= 'Test'; $output .= '


' ; //$output = '
'; /* $output = '
'; $output .= ''; //$output .= ''; $output .= ''.$trackName.' Beschreibung
'; $output .= 'Hersteller: '.$sellerName.'
'; $output .= 'Freigabe: '.$contentAdvisoryRating.'
'; $output .= 'Preis: '.$price.' '; $output .= 'Download (Aff.Link)'; //$output .= '
'.$obj->results[0]->description.'

' ; $output .= '
' ; $output .= '

' ; */ return ($output); } if ( $_REQUEST['id'] != "" ) { header("Location: ".AppStore_getAff($_REQUEST['id'])); } if ( $_REQUEST['search'] != "" ) { $result = file_get_contents(APPSTORESEARCHLINKNAME.urlencode($_REQUEST['search'])); // Decode Content $obj = json_decode($result); $count = $obj->resultCount; $searchresult = "" ; if ($count > 0){ for ( $i = 0; $i < $count; $i++) { $afflink = AppStore_CreateLink($obj->results[$i]->trackViewUrl); $imageUrl = $obj->results[$i]->artworkUrl60; $trackName = $obj->results[$i]->trackName; // Lange Titel kürzen if (strlen($trackName)>=40) { $trackName = left($obj->results[$i]->trackName,37)."..." ; } //$searchresult .= '
  • '; $searchresult .= ''; $searchresult .= ''.$trackName.' (AppStore Link) '; $searchresult .= "".$trackName."

    "; //$searchresult .= } //$searchresult .= ""; echo $searchresult; } //touchtalk.dreamhosters.com/tttest/wp-content/plugins/AppStore/AppStore.php?search=tomtom } if ( $_REQUEST['searchDetail'] != "" ) { $result = file_get_contents(APPSTORESEARCHLINKNAME.urlencode($_REQUEST['searchDetail'])); // Decode Content $obj = json_decode($result); $count = $obj->resultCount; $searchresult = '
    Deine Suche hat '.$count.' Resultate erzielt

    ' ; if ($count > 0){ for ( $i = 0; $i < $count; $i++) { $afflink = AppStore_CreateLink($obj->results[$i]->trackViewUrl); $imageUrl = $obj->results[$i]->artworkUrl60; $trackName = $obj->results[$i]->trackName; $description = left($obj->results[$i]->description,400)."..."; $trackName = $obj->results[$i]->trackName; $contentAdvisoryRating = $obj->results[$i]->contentAdvisoryRating; $sellerName = $obj->results[$i]->sellerName; $sellerUrl = $obj->results[$i]->sellerUrl; $price = $obj->results[$i]->price; if ($price == 0.00000) { $price = "Kostenlos"; } else { if( $AppStore_country == "US") { $price .= " USD"; } else { $price .= " EUR"; } } $searchresult .= ''; //$searchresult .= "".$trackName."
    "; $searchresult .= ''; $searchresult .= ' '; $searchresult .= '
    '; $searchresult .= ''; $searchresult .= ''.$trackName.' (AppStore Link) '.$trackName.'
    '; $searchresult .= 'Hersteller: '.$sellerName.'
    '; $searchresult .= 'Freigabe: '.$contentAdvisoryRating.'
    '; $searchresult .= 'Preis: '.$price.' '; $searchresult .= 'Download via iTunes
    Beschreibung:
    '.$description.'

    '; } } echo $searchresult; //touchtalk.dreamhosters.com/tttest/wp-content/plugins/AppStore/AppStore.php?search=tomtom } function AppStoreLinks_plugin($content) { return (preg_replace_callback(APPSTORELINKS_REGEXP, 'AppStoreLinks_plugin_callback', $content)); } function AppStoreLinks_activate() { // ToDo: Testen ob Jason installiert ist! // http://codex.wordpress.org/Function_Reference/register_activation_hook add_option("AppStore_country","AT"); add_option("AppStore_language","de_de"); add_option("AppStore_picCache","12"); add_option("AppStore_dataCache","6"); add_option("AppStore_dlLinkname","Download (Aff.Link)"); add_option("AppStore_tdlink","1678350"); add_option("AppStore_Loop",0); } function WPWall_ScriptsAction() { // $wp_wall_plugin_url = trailingslashit( get_bloginfo('wpurl') ).PLUGINDIR.'/'. dirname( plugin_basename(__FILE__) ); wp_enqueue_script('thickbox'); } // Nur wenn der User Adminrechte hat ist if(is_admin()){ add_action('admin_menu', 'AppStore_options'); } ///////////////////// // Optionen einbinden ///////////////////// function AppStore_options() { add_options_page('AppStore', 'AppStore', 8, basename(__FILE__), 'AppStore_options_page'); } function AppStore_options_page() { $AdminPage = null; if(isset($_POST['AppStore_save_options'])) { update_option("AppStore_country",attribute_escape($_POST['AppStore_country'])); update_option("AppStore_language",attribute_escape($_POST['AppStore_language'])); update_option("AppStore_picCache",attribute_escape($_POST['AppStore_picCache'])); update_option("AppStore_dataCache",attribute_escape($_POST['AppStore_dataCache'])); update_option("AppStore_dlLinkname",attribute_escape($_POST['AppStore_dlLinkname'])); update_option("AppStore_tdlink",attribute_escape($_POST['AppStore_tdlink'])); } $Countries = array( "DE" => "Deutschland", "AT" => "Österreich" ); asort($Countries); // "US" => "USA" $language = array( "de_de" => "Deutsch", "en_us" => "Englisch", ); asort($language); $AdminPage .= "

    Einstellungen für das AppStore-Plugin

    Dieses Plugin lässt sich ganz einfach mit [app 123456] integrieren.

    iTunes-Store Land:
    Sprache:
    Cachingzeit Bilder (in h):
    Cachingzeit Daten (in h):
    Downl.Link Bezeichung:
    Tradedoubler ID: Noch kein Tradedoubler Partner?

    Verwendung und Beispiel

    Die ID der App bekommst du aus dem iTunes-Store. Eimfach den Link der gewünschten App kopieren und die Nummer (fast) am Ende suchen:

    http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=284417350&mt=8

    [app 284417350] sollte bei richtiger Konfiguration die Apple Remote App anzeigen. (einfach in einer Seite oder in einem Post einbauen).

    Info

    Land

    Das Land gibt an auf welchen Store die Suche durchgeführt wird. So können zB keine Apps angezeigt werden, welche sich nur im US Store befinden aber ein anderer Store eingestellt ist.

    Cachingzeiten

    Die Cachingzeiten geben an, wie oft die Daten aktualisiert vom Server geladen werden - dies erhöht die Performance und sollte eigentlich nicht geändert werden.

    Tradedoubler ID

    Damit Ihr auch ein wenig Geld damit verdienen könnt ;-)

    Sprache

    Die Sprache ist derzeit noch eher irrelevant - es wird aber in einer der nächsten Aktualisierungen benötigt. Wenn die Sprache oder das iTunes Land umgestellt wird, sollte ggf. auch der Cache gelöscht werden, da sonst die Preise nicht korrekt sind.

    Unterstützung

    Du weißt ja, ein Entwickler ist prinzipiell arm. Ja, ja... traurig aber wahr. Aus diesem Grund steht in jedem 10. Tradedoubler-Link unsere ID um die Entwicklung dieses Plugins und weiterer spannender Projekte zu unterstützen. Deshalb bitten wir dich, den betreffenden Code nicht manuell zu entfernen.
    \"\"
    "; echo $AdminPage; } add_filter('the_content', 'AppStoreLinks_plugin'); add_filter('comment_text', 'AppStoreLinks_plugin'); add_action('wp_print_scripts', 'WPWall_ScriptsAction'); register_activation_hook(__FILE__, 'AppStoreLinks_activate' ); ?>