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_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 appstore_defaults_array() { $defaults = array( 'id'=> '', 'screenshots'=>false); return $defaults; } function appstore_process($atts, $content=null, $code="" ) { $a = shortcode_atts(appstore_defaults_array(), $atts ); extract($a); $showScreenshots = 0; if ($screenshots==true) { $showScreenshots = 1; } if ($id<>"") { return AppStoreLinks_getContent($id,$showScreenshots); } } 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; } // Alternative if ($obj->results[0]->genreIds[0]>=12000) { $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) { $price = __("Kostenlos","appstore"); } else { $price .= getCurrency($AppStore_country); } $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'); $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 = ''; } // Language Options if ($language == "de_de") { $langDeveloper = "Hersteller:"; $langPrice = "Preis:"; $langAgeRating = "Freigabe:"; $langRating = "Bewertung:"; } else { $langDeveloper = "Developer:"; $langPrice = "Price:"; $langAgeRating = "Rated:"; $langRating = "Rating:"; } // Get Rating if (get_option("AppStore_showRatings")=='checked'){ $averageUserRatingForCurrentVersion = $obj->results[0]->averageUserRatingForCurrentVersion; $userRatingCountForCurrentVersion = $obj->results[0]->userRatingCountForCurrentVersion; $averageUserRating = $obj->results[0]->averageUserRating; $userRatingCount = $obj->results[0]->userRatingCount; // not enough ratings if (is_null($averageUserRatingForCurrentVersion)==true){ $averageUserRatingForCurrentVersion = 0; $userRatingCountForCurrentVersion = "not enough"; } // not enough ratings if (is_null($averageUserRating)==true){ $averageUserRating = 0; $userRatingCount = "not enough"; } if ($averageUserRatingForCurrentVersion>0){ $ratingHTML = ''.$averageUserRatingForCurrentVersion.''; } else { $ratingHTML = '';//nicht genügend Bewertungen'; } } else { $ratingHTML = ""; } // Create Output $output .= ''.$spanOverlay; $output .= ''; $output .= ''.$trackName.' (AppStore Link) '; $output .= ''.$trackName.'
'; $output .= ''.$langDeveloper.' '.$sellerName.'
'; $output .= ''.$langAgeRating.' '.$contentAdvisoryRating.$ratingHTML.'
'; $output .= ''.$langPrice.' '.$price.' '; //$output .= ''.$langRating.' '.$ratingHTML; $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","appsstore"); } else { //$price .= getCurrency($AppStore_country); if( $AppStore_country == "US") { $price .= " USD"; }elseif ($AppStore_country == "CH") { $price .= " CHF"; }elseif ($AppStore_country == "GB") { $price .= " GBP"; } 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;}"); add_option("AppStore_showRatings", "0"); add_option("AppStore_enableStats", "checked"); // 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 ); } // 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_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'); if (get_option("AppStore_enableStats")=="checked") { 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'])); update_option("AppStore_showRatings",attribute_escape($_POST['AppStore_showRatings'])); update_option("AppStore_enableStats",attribute_escape($_POST['AppStore_enableStats'])); } /*$Countries = array( "DE" => __("Deutschland", 'appstore'), "AT" => __("Österreich", 'appstore'), "CH" => __("Schweiz", 'appstore'), "FI" => __("Finland", 'appstore'), "GB" => __("Großbritannien", 'appstore'), "US" => __("USA", 'appstore'));*/ $Countries = getCountries(); asort($Countries); // "US" => "USA" $language = array( "de_de" => __("Deutsch", 'appstore'), "en_us" => __("Englisch", 'appstore') ); asort($language); $AdminPage .= "
    Donate

    If you like the Appstore Plugin, you can support its development by a donation:



    \"\"

    My Amazon.de wishlist

    News

    ".__("Einstellungen für das AppStore-Plugin", 'appstore')."

    ".__("Dieses Plugin lässt sich ganz einfach mit [app 123456] integrieren.", 'appstore')."

    ".__("iTunes-Store Land:", 'appstore')."
    ".__("Sprache:", 'appstore')."
    ".__("Cachingzeit Bilder (in h):", 'appstore')."
    ".__("Cachingzeit Daten (in h):", 'appstore')."
    ".__("Downl.Link Bezeichung:", 'appstore')."
    ".__("Tradedoubler ID:", 'appstore')." ".__("Noch kein", 'appstore')." Tradedoubler Partner?
    ".__("Bewertungen Aktivieren:", 'appstore')."
    ".__("Statistiken Aktivieren:", 'appstore')."
    ".__("Style (CSS):", 'appstore')."

    ".__("Verwendung und Beispiel", 'appstore')."

    ".__("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: ", 'appstore')."
    ".__("Alternativ kannst du auch unter http://appsuche.touchtalk.at die gewünschte App suchen. Die ID steht dann 'versteckt' in wei/szlig; hinter 'Beschreibung'.", 'appstore')."

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

    ".__("Info", 'appstore')."

    ".__("Land", 'appstore')."

    ".__("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.", 'appstore')."

    ".__("Cachingzeiten", 'appstore')."

    ".__("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.", 'appstore')."

    ".__("Tradedoubler ID", 'appstore')."

    ".__("Damit Ihr auch ein wenig Geld damit verdienen könnt ;-)", 'appstore')."

    ".__("Sprache", 'appstore')."

    ".__("Wenn die Sprache oder das iTunes Land umgestellt wird, sollte ggf. auch der Cache gelöscht werden, da sonst die Preise nicht korrekt sind.", 'appstore')."

    ".__("Unterstützung", 'appstore')."

    ".__("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.", 'appstore'); echo $AdminPage; } function AppStoreLinks_SetSyle() { echo ''; $individualStyle = get_option("AppStore_style"); if ($individualStyle <> "") { echo ""; } } function admin_register_head() { $siteurl = get_option('siteurl'); $url = $siteurl . '/wp-content/plugins/' . basename(dirname(__FILE__)) . '/css/AppStore.css'; echo "\n"; } function appstore_add_button($buttons) { array_push($buttons, "separator", "appstoreButton"); return $buttons; } function appstore_register($plugin_array) { $siteurl = get_option('siteurl'); $url = $siteurl . '/wp-content/plugins/' . basename(dirname(__FILE__)) . '/button/editor_plugin.js'; $plugin_array['appstoreButton'] = $url; return $plugin_array; } add_filter('mce_external_plugins', "appstore_register"); add_filter('mce_buttons', 'appstore_add_button', 0); 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'); add_action('admin_head', 'admin_register_head'); add_shortcode('appstore', 'appstore_process'); load_plugin_textdomain('appstore',null, dirname(plugin_basename(__FILE__))."/languages/"); register_activation_hook(__FILE__, 'AppStoreLinks_activate'); ?>