Plugin Directory

Changeset 593880


Ignore:
Timestamp:
09/03/2012 07:16:45 AM (14 years ago)
Author:
Ste-Bi
Message:

Commit für 4.4.7

Location:
appstore/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • appstore/trunk/AppFunctions.php

    r469117 r593880  
    44function getContent($searchid) {
    55    // SearchLink
     6    $AppStore_country = get_option("AppStore_country");
    67    $searchlink = APPSTORESEARCHLINK.$searchid;
    78
    89    // Caching
    9     $cachefile = APPSTORE_CONTENT_DIR.$searchid.".appstore"; // Cachingfilename
     10    $cachefile = APPSTORE_CONTENT_DIR.$searchid.$AppStore_country.".appstore"; // Cachingfilename
    1011    $contcachetime = APPSTORE_CONT_CACHINGTIME*60*60;
    1112    $spanOverlay = "";
     
    7475function getImage($searchid, $artworkUrl60, $isMacSoftware=0) {
    7576    // PictureCaching
     77    $AppStore_country = get_option("AppStore_country");
    7678    $piccachetime = APPSTORE_PIC_CACHINGTIME*60*60;
    77     $cacheimageurl = APPSTORE_CONTENT_URL.$searchid.".png"; // public
    78     $cacheimagefile = APPSTORE_CONTENT_DIR.$searchid.".png"; // local
     79    $cacheimageurl = APPSTORE_CONTENT_URL.$searchid.$AppStore_country.".png"; // public
     80    $cacheimagefile = APPSTORE_CONTENT_DIR.$searchid.$AppStore_country.".png"; // local
    7981   
    8082    if (is_readable($cacheimageurl) && (time() - $piccachetime < filemtime($cacheimageurl))){
     
    198200    }
    199201   
    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");}
    201203    update_option("AppStore_Loop",$appStore_Loop);
    202204                       
     
    589591}
    590592 
    591  
     593//http://userpage.chemie.fu-berlin.de/diverse/doc/ISO_3166.html 
    592594function getCountries() {
    593595    $Countries = array(
     
    595597                        "fr" => __("France", "appstore"),
    596598                        "de" => __("Germany", "appstore"),
    597                         "gp" => __("United Kingdom", "appstore"),
     599                        "gb" => __("United Kingdom", "appstore"),
    598600                        "at" => __("Austria", "appstore"),
    599601                        "be" => __("Belgium", "appstore"),
    600602                        "fi" => __("Finland", "appstore"),
    601603                        "gr" => __("Greece", "appstore"),
    602                         "ir" => __("Ireland", "appstore"),
     604                        "ie" => __("Ireland", "appstore"),
    603605                        "it" => __("Italy", "appstore"),
    604                         "lx" => __("Luxembourg", "appstore"),
     606                        "lu" => __("Luxembourg", "appstore"),
    605607                        "nl" => __("Netherlands", "appstore"),
    606                         "po" => __("Portugal", "appstore"),
     608                        "pt" => __("Portugal", "appstore"),
    607609                        "es" => __("Spain", "appstore"),
    608610                        "ca" => __("Canada", "appstore"),
    609611                        "se" => __("Sweden", "appstore"),
    610                         "nw" => __("Norway", "appstore"),
     612                        "no" => __("Norway", "appstore"),
    611613                        "dk" => __("Denmark", "appstore"),
    612614                        "ch" => __("Switzerland", "appstore"),
     
    615617                        "jp" => __("Japan","appstore"),
    616618                        "pl" => __("Polen","appstore"),
    617                         "cn" => __("China","appstore")
     619                        "cn" => __("China","appstore"),
     620                        "tw" => __("Taiwan","appstore")
    618621                        );
    619622    asort($Countries);
    620623    return $Countries;
    621 
    622624}
    623625
    624 function getCurrency($AppStore_country) {
    625     if( $AppStore_country == "us" || $AppStore_country == "ca" ) {
     626function getCurrency($currency) {
     627    if ($currency == "USD") {
    626628        return "&#36;{0}";
    627     } elseif ($AppStore_country == "cn") {
    628         return "{0} &#165;";   
    629     } elseif ($AppStore_country == "ch" || $AppStore_country == "lx") {
    630         return "{0} CHF";
    631     } elseif ($AppStore_country == "gb") {
    632         return "{0} &#163;";   
    633     } elseif ($AppStore_country == "se") {
    634         return "{0} &Ouml;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&#36;";   
    641     } elseif ($AppStore_country == "nz") {
     629    } elseif ($currency == "EUR") {
     630        return "{0} &#8364;";
     631    } elseif ($currency == "GBP") {
     632        return "{0} &#163";
     633    } elseif ($currency == "AUD") {
     634        return "{0} AU&#36;";
     635    } elseif ($currency == "SEK") {
     636        return "{0} &Ouml;re";
     637    } elseif ($currency == "NZD") {
    642638        return "{0} NZ&#36;";
    643     } elseif ($AppStore_country == "jp") {
    644         return "{0} JPY";
    645     } elseif ($AppStore_country == "pl") {
    646         return "{0} z&#322;";       
     639    } elseif ($currency == "CNY") {
     640        return "{0} &#165;";       
    647641    } else {
    648         return "{0} &#8364;";
    649     }
     642        return "{0} ".$currency;
     643    }
     644}
     645
     646function EndsWith($Haystack, $Needle){
     647    // Recommended version, using strpos
     648    return strrpos($Haystack, $Needle) === strlen($Haystack)-strlen($Needle);
    650649}
    651650?>
  • appstore/trunk/AppStore.php

    r469117 r593880  
    44Plugin URI: http://tirolercast.ste-bi.net/wordpress-plugins/appstore-plugin/
    55Description: A filter for WordPress that displays AppstoreDetails
    6 Version:4.4.6
     6Version:4.4.7
    77Author: Stephan
    88Author URI: http://www.ste-bi.net
     
    8888
    8989    if ($obj==false) {
    90         return  "Artikel wurde nicht gefunden";
     90        return  "Product not found";
    9191    }
    9292       
     
    9595    $trackName = $obj->results[0]->trackName;
    9696    $price = $obj->results[0]->price;
     97    $currency = $obj->results[0]->currency;
    9798    if ($price == 0.00000) {
    9899        $price = __("Kostenlos","appstore");   
    99100    } 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));
    101103    }
    102104
     
    110112    $artwork100 = $obj->results[0]->artworkUrl100;
    111113    $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   
    112119   
    113120    // {trackname}, {sellername}, {dllink}, {price}, {stars}, {description}, {artwork100}, {artwork60}
     
    117124    $content = str_replace("{sellername}",$sellerName,$content);
    118125    $content = str_replace("{dllink}",$DLLink,$content);
     126    $content = str_replace("{affurl}",$AffLink,$content);
    119127    $content = str_replace("{price}",$price,$content);
    120128    $content = str_replace("{stars}",$ratingHTML,$content);
     
    122130    $content = str_replace("{artwork100}",$artwork100,$content);
    123131    $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   
    124137    return $content;
    125138}
     
    201214        $AppStore_country = get_option("AppStore_country");
    202215        $language = get_option("AppStore_language");       
    203        
     216        $currency = $obj->results[0]->currency;
    204217       
    205218        if ($price == 0.00000) {
    206219            $price = __("Kostenlos","appstore");   
    207220        } else {
    208             $price = str_replace("{0}",$price,getCurrency($AppStore_country));
     221            $price = str_replace("{0}",$price,getCurrency($currency));
    209222        }
    210223       
     
    271284   
    272285    $screenshots = "";
    273     if ($type >= 1 && $obj->results[0]->screenshotUrls[0] <> '' ) {
     286    if ($type >= 1 /* && $obj->results[0]->screenshotUrls[0] <> '' */ ) {
    274287        $screenshots .= "<div class='appImageContainer'><div class='appSliderGallery'><ul> ";
    275288           
     
    365378            $price = $obj->results[$i]->price;
    366379            $AppStore_country = get_option("AppStore_country");
     380            $currency = $obj->results[0]->currency;
    367381           
    368382            if ($price == 0.00000) {
    369383            $price = __("Kostenlos","appstore");   
    370384            } else {
    371                 $price = str_replace("{0}",$price,getCurrency($AppStore_country));
     385                $price = str_replace("{0}",$price,getCurrency($currency));
    372386            }
    373387           
     
    400414    add_option("AppStore_dataCache","6");
    401415    add_option("AppStore_dlLinkname","Download (Aff.Link)");
    402     add_option("AppStore_tdlink","1678350");
     416    add_option("AppStore_tdlink","2157876");
    403417    add_option("AppStore_Loop",0);
    404418    add_option("AppStore_SimpleClickCounter",0);
  • appstore/trunk/definitions.php

    r403111 r593880  
    2828// Image Mask
    2929define("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
    3131?>
  • appstore/trunk/readme.txt

    r469117 r593880  
    5252
    5353== 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
    5462= 4.4.6 =
    5563* Translation Espaniol (big thanks to Luis Twitter:@radeklu http://www.applepack.esç)
Note: See TracChangeset for help on using the changeset viewer.