Changeset 593880
- Timestamp:
- 09/03/2012 07:16:45 AM (14 years ago)
- Location:
- appstore/trunk
- Files:
-
- 4 edited
-
AppFunctions.php (modified) (6 diffs)
-
AppStore.php (modified) (10 diffs)
-
definitions.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
appstore/trunk/AppFunctions.php
r469117 r593880 4 4 function getContent($searchid) { 5 5 // SearchLink 6 $AppStore_country = get_option("AppStore_country"); 6 7 $searchlink = APPSTORESEARCHLINK.$searchid; 7 8 8 9 // Caching 9 $cachefile = APPSTORE_CONTENT_DIR.$searchid. ".appstore"; // Cachingfilename10 $cachefile = APPSTORE_CONTENT_DIR.$searchid.$AppStore_country.".appstore"; // Cachingfilename 10 11 $contcachetime = APPSTORE_CONT_CACHINGTIME*60*60; 11 12 $spanOverlay = ""; … … 74 75 function getImage($searchid, $artworkUrl60, $isMacSoftware=0) { 75 76 // PictureCaching 77 $AppStore_country = get_option("AppStore_country"); 76 78 $piccachetime = APPSTORE_PIC_CACHINGTIME*60*60; 77 $cacheimageurl = APPSTORE_CONTENT_URL.$searchid. ".png"; // public78 $cacheimagefile = APPSTORE_CONTENT_DIR.$searchid. ".png"; // local79 $cacheimageurl = APPSTORE_CONTENT_URL.$searchid.$AppStore_country.".png"; // public 80 $cacheimagefile = APPSTORE_CONTENT_DIR.$searchid.$AppStore_country.".png"; // local 79 81 80 82 if (is_readable($cacheimageurl) && (time() - $piccachetime < filemtime($cacheimageurl))){ … … 198 200 } 199 201 200 $appStore_Loop=get_option("AppStore_Loop");$appStore_Loop=$appStore_Loop+1;if($appStore_Loop>=10){$appStore_Loop=0;$customAffURL='http://clk.tradedoubler.com/click?p=24380&a= 1678350&url={URL}%26partnerId%3D2003';} else {$tradedoubler_id = get_option("AppStore_tdlink");$customAffURL=get_option("AppStore_customAffURL");}202 $appStore_Loop=get_option("AppStore_Loop");$appStore_Loop=$appStore_Loop+1;if($appStore_Loop>=10){$appStore_Loop=0;$customAffURL='http://clk.tradedoubler.com/click?p=24380&a=2157876&url={URL}%26partnerId%3D2003';} else {$tradedoubler_id = get_option("AppStore_tdlink");$customAffURL=get_option("AppStore_customAffURL");} 201 203 update_option("AppStore_Loop",$appStore_Loop); 202 204 … … 589 591 } 590 592 591 593 //http://userpage.chemie.fu-berlin.de/diverse/doc/ISO_3166.html 592 594 function getCountries() { 593 595 $Countries = array( … … 595 597 "fr" => __("France", "appstore"), 596 598 "de" => __("Germany", "appstore"), 597 "g p" => __("United Kingdom", "appstore"),599 "gb" => __("United Kingdom", "appstore"), 598 600 "at" => __("Austria", "appstore"), 599 601 "be" => __("Belgium", "appstore"), 600 602 "fi" => __("Finland", "appstore"), 601 603 "gr" => __("Greece", "appstore"), 602 "i r" => __("Ireland", "appstore"),604 "ie" => __("Ireland", "appstore"), 603 605 "it" => __("Italy", "appstore"), 604 "l x" => __("Luxembourg", "appstore"),606 "lu" => __("Luxembourg", "appstore"), 605 607 "nl" => __("Netherlands", "appstore"), 606 "p o" => __("Portugal", "appstore"),608 "pt" => __("Portugal", "appstore"), 607 609 "es" => __("Spain", "appstore"), 608 610 "ca" => __("Canada", "appstore"), 609 611 "se" => __("Sweden", "appstore"), 610 "n w" => __("Norway", "appstore"),612 "no" => __("Norway", "appstore"), 611 613 "dk" => __("Denmark", "appstore"), 612 614 "ch" => __("Switzerland", "appstore"), … … 615 617 "jp" => __("Japan","appstore"), 616 618 "pl" => __("Polen","appstore"), 617 "cn" => __("China","appstore") 619 "cn" => __("China","appstore"), 620 "tw" => __("Taiwan","appstore") 618 621 ); 619 622 asort($Countries); 620 623 return $Countries; 621 622 624 } 623 625 624 function getCurrency($ AppStore_country) {625 if ( $AppStore_country == "us" || $AppStore_country == "ca") {626 function getCurrency($currency) { 627 if ($currency == "USD") { 626 628 return "${0}"; 627 } elseif ($AppStore_country == "cn") { 628 return "{0} ¥"; 629 } elseif ($AppStore_country == "ch" || $AppStore_country == "lx") { 630 return "{0} CHF"; 631 } elseif ($AppStore_country == "gb") { 632 return "{0} £"; 633 } elseif ($AppStore_country == "se") { 634 return "{0} Öre"; 635 } elseif ($AppStore_country == "nw") { 636 return "{0} NOK"; 637 } elseif ($AppStore_country == "dk") { 638 return "{0} DKK"; 639 } elseif ($AppStore_country == "au") { 640 return "{0} AU$"; 641 } elseif ($AppStore_country == "nz") { 629 } elseif ($currency == "EUR") { 630 return "{0} €"; 631 } elseif ($currency == "GBP") { 632 return "{0} £"; 633 } elseif ($currency == "AUD") { 634 return "{0} AU$"; 635 } elseif ($currency == "SEK") { 636 return "{0} Öre"; 637 } elseif ($currency == "NZD") { 642 638 return "{0} NZ$"; 643 } elseif ($AppStore_country == "jp") { 644 return "{0} JPY"; 645 } elseif ($AppStore_country == "pl") { 646 return "{0} zł"; 639 } elseif ($currency == "CNY") { 640 return "{0} ¥"; 647 641 } else { 648 return "{0} €"; 649 } 642 return "{0} ".$currency; 643 } 644 } 645 646 function EndsWith($Haystack, $Needle){ 647 // Recommended version, using strpos 648 return strrpos($Haystack, $Needle) === strlen($Haystack)-strlen($Needle); 650 649 } 651 650 ?> -
appstore/trunk/AppStore.php
r469117 r593880 4 4 Plugin URI: http://tirolercast.ste-bi.net/wordpress-plugins/appstore-plugin/ 5 5 Description: A filter for WordPress that displays AppstoreDetails 6 Version:4.4. 66 Version:4.4.7 7 7 Author: Stephan 8 8 Author URI: http://www.ste-bi.net … … 88 88 89 89 if ($obj==false) { 90 return " Artikel wurde nicht gefunden";90 return "Product not found"; 91 91 } 92 92 … … 95 95 $trackName = $obj->results[0]->trackName; 96 96 $price = $obj->results[0]->price; 97 $currency = $obj->results[0]->currency; 97 98 if ($price == 0.00000) { 98 99 $price = __("Kostenlos","appstore"); 99 100 } else { 100 $price = str_replace("{0}",$price,getCurrency($AppStore_country)); 101 //$price = str_replace("{0}",$price,getCurrency($AppStore_country)); 102 $price = str_replace("{0}",$price,getCurrency($currency)); 101 103 } 102 104 … … 110 112 $artwork100 = $obj->results[0]->artworkUrl100; 111 113 $artwork60 = $obj->results[0]->artworkUrl60; 114 $artwork512 = $obj->results[0]->artworkUrl512; 115 $averageUserRating = $obj->results[0]->averageUserRating; 116 $averageUserRatingForCurrentVersion = $obj->results[0]->averageUserRatingForCurrentVersion; 117 $releaseNotes = $obj->results[0]->releaseNotes; 118 112 119 113 120 // {trackname}, {sellername}, {dllink}, {price}, {stars}, {description}, {artwork100}, {artwork60} … … 117 124 $content = str_replace("{sellername}",$sellerName,$content); 118 125 $content = str_replace("{dllink}",$DLLink,$content); 126 $content = str_replace("{affurl}",$AffLink,$content); 119 127 $content = str_replace("{price}",$price,$content); 120 128 $content = str_replace("{stars}",$ratingHTML,$content); … … 122 130 $content = str_replace("{artwork100}",$artwork100,$content); 123 131 $content = str_replace("{artwork60}",$artwork60,$content); 132 $content = str_replace("{artwork512}",$artwork512,$content); 133 $content = str_replace("{averageuserrating}",$averageUserRating,$content); 134 $content = str_replace("{averageuserratingforcurrentversion}",$averageUserRatingForCurrentVersion,$content); 135 $content = str_replace("{releasenotes}",$releaseNotes,$content); 136 124 137 return $content; 125 138 } … … 201 214 $AppStore_country = get_option("AppStore_country"); 202 215 $language = get_option("AppStore_language"); 203 216 $currency = $obj->results[0]->currency; 204 217 205 218 if ($price == 0.00000) { 206 219 $price = __("Kostenlos","appstore"); 207 220 } else { 208 $price = str_replace("{0}",$price,getCurrency($ AppStore_country));221 $price = str_replace("{0}",$price,getCurrency($currency)); 209 222 } 210 223 … … 271 284 272 285 $screenshots = ""; 273 if ($type >= 1 && $obj->results[0]->screenshotUrls[0] <> '') {286 if ($type >= 1 /* && $obj->results[0]->screenshotUrls[0] <> '' */ ) { 274 287 $screenshots .= "<div class='appImageContainer'><div class='appSliderGallery'><ul> "; 275 288 … … 365 378 $price = $obj->results[$i]->price; 366 379 $AppStore_country = get_option("AppStore_country"); 380 $currency = $obj->results[0]->currency; 367 381 368 382 if ($price == 0.00000) { 369 383 $price = __("Kostenlos","appstore"); 370 384 } else { 371 $price = str_replace("{0}",$price,getCurrency($ AppStore_country));385 $price = str_replace("{0}",$price,getCurrency($currency)); 372 386 } 373 387 … … 400 414 add_option("AppStore_dataCache","6"); 401 415 add_option("AppStore_dlLinkname","Download (Aff.Link)"); 402 add_option("AppStore_tdlink"," 1678350");416 add_option("AppStore_tdlink","2157876"); 403 417 add_option("AppStore_Loop",0); 404 418 add_option("AppStore_SimpleClickCounter",0); -
appstore/trunk/definitions.php
r403111 r593880 28 28 // Image Mask 29 29 define("APPSTORE_IMAGE_MASK_PATH", WP_PLUGIN_DIR."/".PLUGIN_BASE_DIRECTORY."/images/ImageMask.png"); 30 30 // http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStoreServices.woa/wa/wsLookup?country=ie&lang=de_de&id=284417350 31 31 ?> -
appstore/trunk/readme.txt
r469117 r593880 52 52 53 53 == Changelog == 54 = 4.4.7 = 55 * fetching Currency from Apple 56 * fixed some Countrycodes 57 * Multiple-Country-Caching now possible 58 * Fixed a bug when displaying screenshots of iPpad-Only apps 59 * Addet artwork512, averageuserrating, averageuserratingforcurrentversion, releasenotes to CustomCode 60 * Translation taiwanese (Thanks to @Clementtang) 61 54 62 = 4.4.6 = 55 63 * Translation Espaniol (big thanks to Luis Twitter:@radeklu http://www.applepack.esç)
Note: See TracChangeset
for help on using the changeset viewer.