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"); //include ("rewrite.php"); //wp_enqueue_script('jquery'); wp_enqueue_style('thickbox'); wp_enqueue_script('jquery'); wp_enqueue_script('thickbox'); // Just the default output function AppStoreLinks_plugin_callback($match) { $searchid = $match[1]; return AppStoreLinks_getContent($searchid,0); } // Extended (with Images) function AppStoreLinks_plugin_callback_ext($match) { $searchid = $match[1]; return AppStoreLinks_getContent($searchid,1); } // Extended (just Images) function AppStoreLinks_plugin_callback_img($match) { $searchid = $match[1]; return AppStoreLinks_getContent($searchid,2); } function AppStoreLinks_getContent($searchid,$type) { list( $obj , $spanOverlay ) = getContent($searchid); if ($obj==false) { return "Artikel wurde nicht gefunden"; } // Keine Maske bei App-Software if ($obj->results[0]->kind=="mac-software") { $isMacSoftware = 1; } else { $isMacSoftware = 0; } $output = ""; if ($type < 2) { // Read Content $artworkUrl60 = $obj->results[0]->artworkUrl60; $trackName = $obj->results[0]->trackName; $price = $obj->results[0]->price; $AppStore_country = get_option("AppStore_country"); $language = get_option("AppStore_language"); if ($price == 0.00000) { if ($language == "de_de") { $price = "Kostenlos"; } else { $price = "Free"; } } else { if( $AppStore_country == "US") { $price .= " USD"; } elseif ($AppStore_country == "CH") { $price .= " CHF"; } else { $price .= " EUR"; } } $sellerName = $obj->results[0]->sellerName; $sellerUrl = $obj->results[0]->sellerUrl; $contentAdvisoryRating = $obj->results[0]->contentAdvisoryRating; $description = str_replace("\n", "
", $obj->results[0]->description); $cacheimageurl = getImage($searchid, $artworkUrl60, $isMacSoftware); $AffLink = WP_PLUGIN_URL."/".PLUGIN_BASE_DIRECTORY."/AppStore.php?appid=".$searchid; // ToDo: Checken ob Thickbox installiert ist if (1==2) { $ThickURL = esc_url($AffLink.'&#'.$searchid.';TB_iframe=true&#'.$searchid.';width=800&#'.$searchid.';height=800'); //$ThickURL = esc_url($AffLink.'&'.$searchid.';TB_iframe=true&'.$searchid.';width=800&'.$searchid.';height=800&inlineId=myOnPageContent'); $ThickBoxLink = ''; } else { $ThickBoxLink = ''; } // 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 = ''; } //$output .= ''; //$output .= ''.$trackName.' (AppStore Link) '; // Language Options if ($language == "de_de") { $langDeveloper = "Hersteller:"; $langPrice = "Preis:"; $langAgeRating = "Freigabe:"; } else { $langDeveloper = "Developer:"; $langPrice = "Price:"; $langAgeRating = "Rated:"; } // Create Output $output .= ''.$spanOverlay; $output .= ''; $output .= ''.$trackName.' (AppStore Link) '; $output .= ''.$trackName.'
'; $output .= ''.$langDeveloper.' '.$sellerName.'
'; $output .= ''.$langAgeRating.' '.$contentAdvisoryRating.'
'; $output .= ''.$langPrice.' '.$price.' '; //$output .= ''.APPSTORE_DL_LINKNAME.''; $output .= ''.$ThickBoxLink.APPSTORE_DL_LINKNAME.''; $output .= '
'; } $screenshots = ""; if ($type >= 1) { $screenshots .= "
'; } if ($type == 1) { return ('
'.$output.$screenshots."
"); } else { return ($output.$screenshots); } } if ( $_REQUEST['appid'] != "" ) { header("Location: ".AppStore_getAff($_REQUEST['appid'])); } if ( $_REQUEST['appsearch'] != "" ) { $result = file_get_contents(APPSTORESEARCHLINKNAME.urlencode($_REQUEST['appsearch'])); // 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; } } 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"; }elseif ($AppStore_country == "CH") { $price .= " CHF"; } 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; } function AppStoreLinks_plugin($content) { return (preg_replace_callback(APPSTORELINKS_REGEXP, 'AppStoreLinks_plugin_callback', $content)); } function AppStoreLinks_plugin_ext($content) { return (preg_replace_callback(APPSTORELINKS_REGEXP_EXT, 'AppStoreLinks_plugin_callback_ext', $content)); } function AppStoreLinks_plugin_img($content) { return (preg_replace_callback(APPSTORELINKS_REGEXP_IMG, 'AppStoreLinks_plugin_callback_img', $content)); } function AppStoreLinks_activate() { // ToDo: Testen ob Jason installiert ist! 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); add_option("AppStore_SimpleClickCounter",0); add_option("appStore_db_version", "0"); add_option("AppStore_style","#appImageContainer {width: auto;margin: 0px;}"); // Datenbank installieren global $appStore_db_version; $appStore_db_version = "0.6"; global $wpdb; $tablename = $wpdb->prefix.APPSTORE_TABLENAME; if(($wpdb->get_var("show tables like '$tablename'") != $tablename) || ($appStore_db_version <> get_option("appStore_db_version"))) { //price NUMERIC(5,2), //currency char(3) DEFAULT '' NOT NULL, $sql = "CREATE TABLE " . $tablename . " ( id mediumint(9) NOT NULL AUTO_INCREMENT, appid bigint(11) DEFAULT '0' NOT NULL, country char(5) DEFAULT '' NOT NULL, user_agent char(150) DEFAULT '' NOT NULL, ip char(15) DEFAULT '' NOT NULL, createdWhen TIMESTAMP NOT NULL, UNIQUE KEY id (id) );"; require_once(ABSPATH.'wp-admin/includes/upgrade.php'); dbDelta($sql); update_option("appStore_db_version", $appStore_db_version ); } //$rows_affected = $wpdb->insert( $tablename, array( 'time' => current_time('mysql'), 'name' => $welcome_name, 'text' => $welcome_text) ); // //addThickbox(); // check cache Directory if (!file_exists(APPSTORE_CONTENT_DIR)){ mkdir(APPSTORE_CONTENT_DIR) or error_message('Das Cache Verzeichnis konnte nicht angelegt werden'); // Legt das Cache Verzeichnis an. Sollte dies nicht möglich sein, so wird ein Fehler ausgegeben } chmod(APPSTORE_CONTENT_DIR, 0777); // Gibt dem Cache Verzeichniss die nötigen Schreib- und Lese Rechte // Check allow_url_fopen if(allow_url_fopen=='off') { echo'"allow_url_fopen" ist auf diesem Server deaktiviert, wird aber benötigt.
    '; echo'Bitte aktivieren sie diese Funktion (setzten sie sich ggf. mit ihrem Hoster in verbindung. '; } } 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_menu_page('Settings', 'AppStore', 3, basename(__FILE__), 'AppStore_options_page'); add_submenu_page( basename(__FILE__), 'Statistik', 'Statistik', 3, 'AppStoreStatistik', 'AppStoreshowStatistik'); } 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'])); update_option("AppStore_style",attribute_escape($_POST['AppStore_style'])); } $Countries = array( "DE" => "Deutschland", "AT" => "Österreich", "CH" => "Schweiz", "FI" => "Finland" ); 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?
    Style (CSS):

    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).
    [appimg 284417350] zeigt die Screenshots an.
    [appext 284417350] zeigt die Infos und die Screenshots in einem Rahmen an.

    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; } function AppStoreLinks_SetSyle() { echo ''; $individualStyle = get_option("AppStore_style"); if ($individualStyle <> "") { echo ""; } } add_filter('the_content', 'AppStoreLinks_plugin'); add_filter('comment_text', 'AppStoreLinks_plugin'); add_filter('the_content_rss', 'AppStoreLinks_plugin'); add_filter('the_content', 'AppStoreLinks_plugin_ext'); add_filter('comment_text', 'AppStoreLinks_plugin_ext'); add_filter('the_content_rss', 'AppStoreLinks_plugin_ext'); add_filter('the_content', 'AppStoreLinks_plugin_img'); add_filter('comment_text', 'AppStoreLinks_plugin_img'); add_filter('the_content_rss', 'AppStoreLinks_plugin_img'); add_action('wp_print_scripts', 'WPWall_ScriptsAction'); add_action('wp_head', 'AppStoreLinks_SetSyle'); register_activation_hook(__FILE__, 'AppStoreLinks_activate'); ?>