Plugin Directory

Changeset 152086


Ignore:
Timestamp:
09/04/2009 08:50:21 PM (17 years ago)
Author:
road2nowhere
Message:

kiva app_id added for better tracking by kiva

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kivaorg-widget/trunk/kiva.php

    r134843 r152086  
    44Plugin URI: http://urpisdream.com/2009/05/kiva-loans-wordpress-widget/
    55Description: Kiva widget, display my investments
    6 Version: 2.5
     6Version: 2.6
    77Author: Marilyn Burgess
    88Author URI: http://urpisdream.com
     
    3434$kiva_cache_path = ( defined('WP_CONTENT_URL') ) ? WP_CONTENT_URL : ABSPATH . 'wp-content';;
    3535$kiva_cache_path = $kiva_cache_path . "/plugins/kivaorg-widget/cache";
     36
     37global $kiva_api_app_id;
     38$kiva_api_app_id = "com.urpidream.wpwidget";
    3639
    3740function widget_kiva_loan_init() {
     
    5659
    5760    function get_kiva_loans(){
    58 
     61        global $kiva_api_app_id;
    5962        $options = get_option('widget_kiva_loan');
    6063        $limit = $options['number_of_loans'];
     
    7881
    7982            if($results == ""){
    80                 $url = "http://api.kivaws.org/v1/lenders/$username/loans.json";
     83                $url = "http://api.kivaws.org/v1/lenders/$username/loans.json?app_id=$kiva_api_app_id";
    8184       
    8285                $ch = curl_init();
     
    120123        $html = "<div id='kiva_loans'>";
    121124        $html .= $content;
    122         $html .= "<center><a href='http://kiva.org/'><img src='" . get_option('siteurl') . "/wp-content/plugins/kivaorg-widget/kiva.gif' alt='Kiva.org' class='kiva_logo' /></a></center>";
     125        $html .= "<center><a href='http://kiva.org/?app_id=$kiva_api_app_id'><img src='" . get_option('siteurl') . "/wp-content/plugins/kivaorg-widget/kiva.gif' alt='Kiva.org' class='kiva_logo' /></a></center>";
    123126        $html .= "</div>";
    124127        return $html;
     
    247250
    248251       
    249 
     252        global $kiva_api_app_id;
    250253        $style = "max-height:".$size."px;max-width:".$size."px;width:expression(this.width > ".$size." ? \"".$size."px\" : this.width); height:expression(this.height > ".$size." ? \"".$size."px\" : this.height);";
    251         $html .= "<a href='http://www.kiva.org/app.php?page=businesses&action=about&id=" . $loan->{id} . "' target='_new'><img src='$image_src' alt='". $loan->{name} . "' style='".$style."' /></a><br />";
     254        $html .= "<a href='http://www.kiva.org/app.php?page=businesses&action=about&app_id=$kiva_api_app_id&id=" . $loan->{id} . "' target='_new'><img src='$image_src' alt='". $loan->{name} . "' style='".$style."' /></a><br />";
    252255        $html .= "<table>";
    253256        $html .= "<tr><td style='vertical-align:top'><b>Location:</b></td><td>". $loan->{location}->{country} . ", " . $loan->{location}->{town} . "</td></tr>";
Note: See TracChangeset for help on using the changeset viewer.