Changeset 1227384
- Timestamp:
- 08/21/2015 04:06:45 PM (11 years ago)
- Location:
- kivaorg-widget/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kivaorg-widget/trunk/kiva.php
r1181464 r1227384 2 2 /* 3 3 Plugin Name: Kiva Widget 4 Plugin URI: http:// brahminacreations.com/kiva-wordpress-widget/4 Plugin URI: http://wp.brahminacreations.com/kiva-wordpress-widget/ 5 5 Description: Kiva widget, display your investments on the sidebar 6 Version: 4. 06 Version: 4.1 7 7 Author: Brahmina Burgess 8 8 Author URI: http://brahminacreations.com … … 39 39 40 40 global $kiva_api_app_id; 41 $kiva_api_app_id = "com. urpidream.wpwidget";41 $kiva_api_app_id = "com.brahminacreations.kivawpwidget"; 42 42 43 43 function widget_kiva_loan_init() { … … 46 46 return; 47 47 } 48 49 wp_register_style( 'kww', plugins_url( 'style.css', __FILE__ ) ); 50 wp_enqueue_style( 'kww' ); 48 51 49 52 // Print the sidebar widget … … 77 80 } 78 81 $size = $options['image_size']; 79 if( $size > 200){80 $size = 200;82 if( preg_match('/^\d+$/', $size) ){ 83 $size = $size . 'px'; 81 84 } 82 85 $username = $options['kiva_username']; … … 102 105 flush(); 103 106 } 104 $ch = curl_init(); 105 curl_setopt($ch, CURLOPT_URL, $url); 106 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 107 curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3); 108 $response = curl_exec ($ch); 109 curl_close ($ch); 110 107 $return = wp_remote_get($url); 108 $response = $return['body']; 111 109 if($response != ""){ 112 110 $results = json_decode($response); … … 289 287 global $kiva_cache_path; 290 288 291 $html = "<link rel='stylesheet' href='". get_option('siteurl') . "/wp-content/plugins/kivaorg-widget/style.css' type='text/css' media='screen' />";292 289 $html .= "<div class='loan'>"; 293 290 $html .= "<h3>" . $loan->{name}. "</h3><br />"; … … 343 340 344 341 global $kiva_api_app_id; 345 $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);";342 $style = "width: $size;"; 346 343 $html .= "<a href='http://www.kiva.org/lend/" . $loan->{id} . "' target='_new'><img src='$image_src' alt='". $loan->{name} . "' style='".$style."' /></a><br />"; 347 344 $html .= "<table>"; … … 361 358 $newoptions['number_of_loans'] = strip_tags(stripslashes($_POST['number_of_loans'])); 362 359 $newoptions['image_size'] = strip_tags(stripslashes($_POST['image_size'])); 360 361 if($newoptions['image_size'] == ''){ 362 $newoptions['image_size'] = '100%'; 363 } 363 364 364 365 if ( $options != $newoptions ) { … … 376 377 ?> 377 378 <div> 378 <label for="kiva_username" style="line-height:35px;display:block;">Kiva Lender Name: <input type="text" id="kiva_username" name="kiva_username" value="<?php echo $username ?>" /></label> 379 <label for="number_of_loans" style="line-height:35px;display:block;">Number of loans (Min. 1): <input type="text" id="number_of_loans" name="number_of_loans" value="<?php echo $number_of_loans; ?>" /></label> 380 <label for="image_size" style="line-height:35px;display:block;">Image size (Max. 200): <br /><input type="text" id="image_size" name="image_size" value="<?php echo $image_size; ?>" /></label> 379 <p id="kiva_username_input"> 380 <label for="kiva_username">Kiva Lender Name:</label> 381 <input id="kiva_username" name="kiva_username" type="text" value="<?php echo $username; ?>"> 382 </p> 383 <p id="number_of_loans_input"> 384 <label for="number_of_loans">Number of loans (Min. 1):</label> 385 <input id="number_of_loans" name="number_of_loans" type="text" value="<?php echo $number_of_loans; ?>"> 386 </p> 387 <p id="number_of_loans_input"> 388 <label for="image_size">Image size (px or %):</label> 389 <input id="image_size" name="image_size" type="text" value="<?php echo $image_size; ?>"> 390 </p> 381 391 <input type="hidden" name="kiva_loan_submit" id="kiva_loan_submit" value="1" /> 382 392 </div> -
kivaorg-widget/trunk/readme.txt
r1181464 r1227384 1 1 === Kiva.org Loans Widget === 2 2 Contributors: brahmina 3 Donate link: http:// brahminacreations.com/kiva-wordpress-widget/3 Donate link: http://wp.brahminacreations.com 4 4 Tags: kiva, widget, microloans 5 5 Requires at least: 2.8 6 6 Tested up to: 4.2.2 7 Stable tag: 4. 07 Stable tag: 4.1 8 8 9 9 Displays rotating entrepreneurs the blogger has invested in publicly, with pictures and links back to Kiva.org. … … 18 18 19 19 The Kiva.org Loans Widget includes caching of the data collected from Kiva.org to prevent a call to Kiva on every page load. This cache clears once a day. 20 21 Version 4.1 includes text updates and aesthetic fixes 20 22 21 23 Version 4.0 includes text updates and testing up to Wordpress 4.2.2. -
kivaorg-widget/trunk/style.css
r1181464 r1227384 1 1 #kiva_loans div{ 2 font-size: 10px;3 2 padding-left:0px; 4 3 } 5 4 #kiva_loans h3{ 6 font-size: 12px; 7 margin: 0; 5 margin: 0; 8 6 } 9 7 #kiva_loans img { 10 border: #272727 3px solid; 8 border: #272727 1px solid; 9 margin: 0 auto; 11 10 } 12 11 13 12 #kiva_loans img.kiva_logo { 14 border: #272727 0px solid;13 border: none; 15 14 width: 120px; 16 15 } … … 23 22 #kiva_loans table td { 24 23 vertical-align: top; 24 border: none; 25 25 } 26 26 #loans {
Note: See TracChangeset
for help on using the changeset viewer.