Plugins, it should be in the list. Activtate it and avery occurence of the expression [app itemId] (case sensitive) will 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 ("searchwidget.php"); wp_enqueue_style('thickbox'); wp_enqueue_script('jquery'); wp_enqueue_script('thickbox'); 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; } // old System if ($id=="") { $id = $atts[0]; } if ($content<>null){ return appstore_getCustom($id, $content); } if ($id<>"") { return AppStoreLinks_getContent($id,$showScreenshots); } } function appstore_process_ext($atts, $content=null, $code="" ) { $showScreenshots = 1; $id = $atts[0]; if ($id<>"") { return AppStoreLinks_getContent($id,$showScreenshots); } } function appstore_process_img($atts, $content=null, $code="" ) { $showScreenshots = 2; $id = $atts[0]; if ($id<>"") { return AppStoreLinks_getContent($id,$showScreenshots); } } function appstore_getCustom($searchid, $content) { list( $obj , $spanOverlay ) = getContent($searchid); if ($obj==false) { return "Artikel wurde nicht gefunden"; } // Variablen $AppStore_country = get_option("AppStore_country"); $trackName = $obj->results[0]->trackName; $price = $obj->results[0]->price; if ($price == 0.00000) { $price = __("Kostenlos","appstore"); } else { $price = str_replace("{0}",$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); $AffLink = WP_PLUGIN_URL."/".PLUGIN_BASE_DIRECTORY."/AppStore.php?appid=".$searchid; $DLLink = ''.APPSTORE_DL_LINKNAME.''; $ratingHTML = ''.getRatingStars($obj).''; $artwork100 = $obj->results[0]->artworkUrl100; $artwork60 = $obj->results[0]->artworkUrl60; // {trackname}, {sellername}, {dllink}, {price}, {stars}, {description}, {artwork100}, {artwork60} $content = str_replace("{id}",$id,$content); $content = str_replace("{trackname}",$trackName,$content); $content = str_replace("{sellername}",$sellerName,$content); $content = str_replace("{dllink}",$DLLink,$content); $content = str_replace("{price}",$price,$content); $content = str_replace("{stars}",$ratingHTML,$content); $content = str_replace("{description}",$description,$content); $content = str_replace("{artwork100}",$artwork100,$content); $content = str_replace("{artwork60}",$artwork60,$content); return $content; } function getRatingStars($obj,$class="") { // Get Rating $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"; } //'#container li {background: url(stars.png) no-repeat top left;}' if ($averageUserRatingForCurrentVersion>0){ if ($class<>"") { $class = 'class="'.$class.'"'; } $ratingHTML = ''.$averageUserRatingForCurrentVersion.
						''; /*$ratingClass = 'sprite-stars'.str_replace('.','',$averageUserRatingForCurrentVersion ) ; $ratingHTML = '
';*/ } else { $ratingHTML = '';//nicht genügend Bewertungen'; } return $ratingHTML; } 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 if ($isMacSoftware == 1) { $artworkUrl60 = $obj->results[0]->artworkUrl100; } else { $artworkUrl60 = $obj->results[0]->artworkUrl60; } $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 = str_replace("{0}",$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:","appstore"); $langPrice = __("Price:","appstore"); $langAgeRating = __("Rated:","appstore"); $langRating = __("Rating:","appstore"); } if (get_option("AppStore_showRatings")=='checked'){ $ratingHTML = getRatingStars($obj,'ratingStarsImg'); } else { $ratingHTML = ""; } // Create Output $output .= ''.$spanOverlay; $output .= ''; $output .= ''.$trackName.' (AppStore Link) '; $output .= ''.$trackName.'
'; $output .= ''.$langDeveloper.' '.$sellerName.'
'; $output .= '
'.$langAgeRating.' '.$contentAdvisoryRating.$ratingHTML.'
'; $output .= ''.$langPrice.' '.$price.' '; $output .= ''.$ThickBoxLink.APPSTORE_DL_LINKNAME.''; $output .= '
'; } $screenshots = ""; if ($type >= 1 && $obj->results[0]->screenshotUrls[0] <> '' ) { $screenshots .= "
'; } if ($type == 1 && $isMacSoftware == 0 ) { 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; $AppStore_country = get_option("AppStore_country"); if ($price == 0.00000) { $price = __("Kostenlos","appstore"); } else { $price = str_replace("{0}",$price,getCurrency($AppStore_country)); } $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_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"); add_option("AppStore_customAffURL",""); // 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', WP_PLUGIN_URL."/".PLUGIN_BASE_DIRECTORY.'/button/mcebutton.png'); 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'])); update_option("AppStore_customAffURL",attribute_escape($_POST['AppStore_customAffURL'])); } $Countries = getCountries(); asort($Countries); $language = array( "de_de" => __("Deutsch", 'appstore'), "it_it" => __("Italienisch", 'appstore'), "pl_pl" => __("Polnisch", 'appstore'), "zh_cn" => __("Chinesisch", 'appstore'), "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?
    ".__("Custom Affiliate URL:", 'appstore')."(?)
    ".__("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')."

    ".__('Ein Video zur Konfiguration von Tradedoubler gibts ','appstore')." ".__('hier (Youtube-Video)','appstore').". ". __('Vielen Dank an Zettt von ','appstore')."www.macosxscreencasts.com

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

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

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

    ".__("Custom Affiliate URL:", 'appstore')."

    ".__("Wenn du bereits einen alternativen Affiliate Partner hast oder Tradedoubler nicht verwenden willst, kannst du hier eine Affiliate-URL deines Werbepartners eingeben. Setzte einfach {URL} dort ein, wo der AppStore-Link eingesetzt werden soll.
    zB: http://click.linksynergy.com/fs-bin/stat?id=AAAAAAAA&offerid=100000&type=3&subid=0&tmpid=0006&RD_PARM1={URL}&partnerId=99 ", '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_action('wp_print_scripts', 'WPWall_ScriptsAction'); add_action('wp_head', 'AppStoreLinks_SetSyle'); add_action('admin_head', 'admin_register_head'); add_shortcode('app', 'appstore_process'); add_shortcode('appext', 'appstore_process_ext'); add_shortcode('appimg', 'appstore_process_img'); add_filter('comment_text', 'do_shortcode'); add_filter('the_content_rss', 'do_shortcode'); load_plugin_textdomain('appstore',null, dirname(plugin_basename(__FILE__))."/languages/"); register_activation_hook(__FILE__, 'AppStoreLinks_activate'); ?>