Changeset 613541
- Timestamp:
- 10/17/2012 08:18:52 AM (13 years ago)
- Location:
- olimometer
- Files:
-
- 65 added
- 3 edited
-
tags/2.40 (added)
-
tags/2.40/LiberationSans-Regular.ttf (added)
-
tags/2.40/jscolor (added)
-
tags/2.40/jscolor/arrow.gif (added)
-
tags/2.40/jscolor/cross.gif (added)
-
tags/2.40/jscolor/demo.html (added)
-
tags/2.40/jscolor/hs.png (added)
-
tags/2.40/jscolor/hv.png (added)
-
tags/2.40/jscolor/jscolor.js (added)
-
tags/2.40/my-script.js (added)
-
tags/2.40/olimometer-class.php (added)
-
tags/2.40/olimometer.php (added)
-
tags/2.40/readme.txt (added)
-
tags/2.40/screenshot-1.jpg (added)
-
tags/2.40/screenshot-2.jpg (added)
-
tags/2.40/screenshot-3.jpg (added)
-
tags/2.40/screenshot-4.jpg (added)
-
tags/2.40/skins (added)
-
tags/2.40/skins.php (added)
-
tags/2.40/skins.xml (added)
-
tags/2.40/skins/oli-bold-chunky (added)
-
tags/2.40/skins/oli-bold-chunky/bold-chunky-bar.png (added)
-
tags/2.40/skins/oli-bold-chunky/bold-chunky-bottom.png (added)
-
tags/2.40/skins/oli-bold-chunky/bold-chunky-top.png (added)
-
tags/2.40/skins/oli-default (added)
-
tags/2.40/skins/oli-default/therm_bar_empty.png (added)
-
tags/2.40/skins/oli-default/therm_bulb.png (added)
-
tags/2.40/skins/oli-default/therm_top.png (added)
-
tags/2.40/skins/oli-ourprogress-blue (added)
-
tags/2.40/skins/oli-ourprogress-blue/therm_bar_empty.png (added)
-
tags/2.40/skins/oli-ourprogress-blue/therm_bulb.png (added)
-
tags/2.40/skins/oli-ourprogress-blue/therm_top.png (added)
-
tags/2.40/skins/oli-ourprogress-green (added)
-
tags/2.40/skins/oli-ourprogress-green/therm_bar_empty.png (added)
-
tags/2.40/skins/oli-ourprogress-green/therm_bulb.png (added)
-
tags/2.40/skins/oli-ourprogress-green/therm_top.png (added)
-
tags/2.40/skins/oli-ourprogress-red (added)
-
tags/2.40/skins/oli-ourprogress-red/therm_bar_empty.png (added)
-
tags/2.40/skins/oli-ourprogress-red/therm_bulb.png (added)
-
tags/2.40/skins/oli-ourprogress-red/therm_top.png (added)
-
tags/2.40/skins/oli-progpress-black (added)
-
tags/2.40/skins/oli-progpress-black/left.png (added)
-
tags/2.40/skins/oli-progpress-black/middle.png (added)
-
tags/2.40/skins/oli-progpress-black/right.png (added)
-
tags/2.40/skins/oli-rounded (added)
-
tags/2.40/skins/oli-rounded/rounded_bar.png (added)
-
tags/2.40/skins/oli-rounded/rounded_bottom.png (added)
-
tags/2.40/skins/oli-rounded/rounded_top.png (added)
-
tags/2.40/skins/oli-thinblackhorizontal (added)
-
tags/2.40/skins/oli-thinblackhorizontal/left.png (added)
-
tags/2.40/skins/oli-thinblackhorizontal/middle.png (added)
-
tags/2.40/skins/oli-thinblackhorizontal/right.png (added)
-
tags/2.40/skins/oli-thinbluehorizontal (added)
-
tags/2.40/skins/oli-thinbluehorizontal/left.png (added)
-
tags/2.40/skins/oli-thinbluehorizontal/middle.png (added)
-
tags/2.40/skins/oli-thinbluehorizontal/right.png (added)
-
tags/2.40/skins/oli-thinredhorizontal (added)
-
tags/2.40/skins/oli-thinredhorizontal/left.png (added)
-
tags/2.40/skins/oli-thinredhorizontal/middle.png (added)
-
tags/2.40/skins/oli-thinredhorizontal/right.png (added)
-
tags/2.40/skins/oli-watermaster (added)
-
tags/2.40/skins/oli-watermaster/watermaster-bar.png (added)
-
tags/2.40/skins/oli-watermaster/watermaster-bottom.png (added)
-
tags/2.40/skins/oli-watermaster/watermaster-top.png (added)
-
tags/2.40/thermometer.php (added)
-
trunk/olimometer-class.php (modified) (7 diffs)
-
trunk/olimometer.php (modified) (12 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
olimometer/trunk/olimometer-class.php
r608691 r613541 37 37 public $olimometer_overlay_x = 0; 38 38 public $olimometer_overlay_y = 0; 39 public $olimometer_stayclassypid = 0; 39 40 40 41 private $olimometer_default_link = "http://www.olivershingler.co.uk/oliblog/olimometer/"; … … 76 77 $this->olimometer_overlay_x = $query_results['olimometer_overlay_x']; 77 78 $this->olimometer_overlay_y = $query_results['olimometer_overlay_y']; 79 $this->olimometer_stayclassypid = $query_results['olimometer_stayclassypid']; 78 80 79 81 if($query_results['olimometer_link'] == "" || $query_results['olimometer_link'] == null) { … … 161 163 'olimometer_overlay_image' => $this->olimometer_overlay_image, 162 164 'olimometer_overlay_x' => $this->olimometer_overlay_x, 163 'olimometer_overlay_y' => $this->olimometer_overlay_y 165 'olimometer_overlay_y' => $this->olimometer_overlay_y, 166 'olimometer_stayclassypid' => $this->olimometer_stayclassypid 164 167 ) ); 165 168 … … 195 198 'olimometer_overlay_image' => $this->olimometer_overlay_image, 196 199 'olimometer_overlay_x' => $this->olimometer_overlay_x, 197 'olimometer_overlay_y' => $this->olimometer_overlay_y 200 'olimometer_overlay_y' => $this->olimometer_overlay_y, 201 'olimometer_stayclassypid' => $this->olimometer_stayclassypid 198 202 ), 199 203 array( 'olimometer_id' => $this->olimometer_id ) … … 255 259 } 256 260 } 261 262 // If StayClassy integration is configured, get the current balance and save it 263 if($this->olimometer_use_paypal == 2) { 264 $olimometer_stayclassy_balance = $this->getStayClassy($this->olimometer_stayclassypid); 265 if($olimometer_stayclassy_balance == false) { 266 // If PayPal link is broken, set balance to 0 267 $olimometer_stayclassy_balance = 0; 268 } 269 else { 270 if($this->olimometer_progress_value == ($olimometer_stayclassy_balance) ) { 271 // PayPal balance hasn't changed since we last checked so don't do anything 272 } 273 else { 274 // It has changed, so save it 275 $this->olimometer_progress_value = $olimometer_stayclassy_balance; 276 $this->save(); 277 } 278 } 279 } 257 280 258 281 … … 266 289 $the_olimometer_text = $the_olimometer_text." class='".$css_class."'"; 267 290 } 268 $the_olimometer_text = $the_olimometer_text." alt='Olimometer 2.4 0'></a>";291 $the_olimometer_text = $the_olimometer_text." alt='Olimometer 2.41'></a>"; 269 292 270 293 return $the_olimometer_text; … … 272 295 } 273 296 274 297 // Gets the total_raised value from StayClassy.org for a given PID. 298 function getStayClassy($PID) { 299 $json = file_get_contents("http://www.stayclassy.org/api/project-info?pid=$PID"); 300 301 $jsonIterator = new RecursiveIteratorIterator( 302 new RecursiveArrayIterator(json_decode($json, TRUE)), 303 RecursiveIteratorIterator::SELF_FIRST); 304 305 $return_value = 0; 306 307 foreach ($jsonIterator as $key => $val) { 308 if(is_array($val)) { 309 //$return_text = $return_text . "$key:\n"; 310 } else { 311 if($key == "total_raised") { 312 $return_value = $val; 313 } 314 //$return_text = $return_text . "$key => $val\n"; 315 } 316 } 317 318 return $return_value; 319 } 275 320 276 321 // The following function is for PayPal balance retrieval -
olimometer/trunk/olimometer.php
r608691 r613541 6 6 Author: Oliver Shingler 7 7 Author URI: http://www.olivershingler.co.uk 8 Version: 2.4 08 Version: 2.41 9 9 */ 10 10 … … 150 150 $an_olimometer->olimometer_overlay_x = $_REQUEST['olimometer_overlay_x']; 151 151 $an_olimometer->olimometer_overlay_y = $_REQUEST['olimometer_overlay_y']; 152 $an_olimometer->olimometer_stayclassypid = $_REQUEST['olimometer_stayclassypid']; 152 153 153 154 // Save it … … 217 218 218 219 <script language="javascript"> 220 221 /* 219 222 function olimometer_progress_disable() { 220 document.olimometer_form1.olimometer_progress_value.readOnly = true;221 document.olimometer_form1.olimometer_paypal_username.readOnly = false;222 document.olimometer_form1.olimometer_paypal_password.readOnly = false;223 document.olimometer_form1.olimometer_paypal_signature.readOnly = false;224 document.olimometer_form1.olimometer_paypal_extra_value.readOnly = false;223 document.olimometer_form1.olimometer_progress_value.readOnly = true; 224 document.olimometer_form1.olimometer_paypal_username.readOnly = false; 225 document.olimometer_form1.olimometer_paypal_password.readOnly = false; 226 document.olimometer_form1.olimometer_paypal_signature.readOnly = false; 227 document.olimometer_form1.olimometer_paypal_extra_value.readOnly = false; 225 228 } 226 229 227 230 function olimometer_progress_enable() { 228 document.olimometer_form1.olimometer_progress_value.readOnly = false; 229 document.olimometer_form1.olimometer_paypal_username.readOnly = true; 230 document.olimometer_form1.olimometer_paypal_password.readOnly = true; 231 document.olimometer_form1.olimometer_paypal_signature.readOnly = true; 232 document.olimometer_form1.olimometer_paypal_extra_value.readOnly = true; 233 } 234 231 document.olimometer_form1.olimometer_progress_value.readOnly = false; 232 document.olimometer_form1.olimometer_paypal_username.readOnly = true; 233 document.olimometer_form1.olimometer_paypal_password.readOnly = true; 234 document.olimometer_form1.olimometer_paypal_signature.readOnly = true; 235 document.olimometer_form1.olimometer_paypal_extra_value.readOnly = true; 236 }*/ 237 238 function olimometer_progress($progress_type) { 239 // 0 = Manual 240 // 1 = PayPal 241 // 2 = StayClassy 242 if ($progress_type == 0) { 243 // Enable manual 244 olimometer_disable_manual(false); 245 // Disable PayPal 246 olimometer_disable_paypal(true); 247 // Disable StayClassy 248 olimometer_disable_stayclassy(true); 249 } 250 if ($progress_type == 1) { 251 // Enable PayPal 252 olimometer_disable_paypal(false); 253 // Disable Manual 254 olimometer_disable_manual(true); 255 // Disable StayClassy 256 olimometer_disable_stayclassy(true); 257 } 258 if ($progress_type == 2) { 259 // Enable StayClassy 260 olimometer_disable_stayclassy(false); 261 // Disable PayPal 262 olimometer_disable_paypal(true); 263 // Disable Manual 264 olimometer_disable_manual(true); 265 } 266 } 267 268 function olimometer_disable_manual($tof) { 269 document.olimometer_form1.olimometer_progress_value.readOnly = $tof; 270 } 271 272 function olimometer_disable_paypal($tof) { 273 document.olimometer_form1.olimometer_paypal_username.readOnly = $tof; 274 document.olimometer_form1.olimometer_paypal_password.readOnly = $tof; 275 document.olimometer_form1.olimometer_paypal_signature.readOnly = $tof; 276 document.olimometer_form1.olimometer_paypal_extra_value.readOnly = $tof; 277 } 278 279 function olimometer_disable_stayclassy($tof) { 280 document.olimometer_form1.olimometer_stayclassypid.readOnly = $tof; 281 } 235 282 236 283 function olimometer_overlay_disable() { … … 408 455 <table class="form-table"> 409 456 <tr class="form-required"> 410 <th scope="row" valign="top"><label for="name">Manual or PayPal Link?</label></th>457 <th scope="row" valign="top"><label for="name">Manual or Automatic Progress Tracking?</label></th> 411 458 <td><input name="olimometer_use_paypal" id="olimometer_use_paypal" type="radio" value="0"<?php 412 459 if($current_olimometer->olimometer_use_paypal == 0) { … … 414 461 } 415 462 416 ?> onClick="olimometer_progress _enable();"> Manual<br />463 ?> onClick="olimometer_progress(0);"> Manual<br /> 417 464 <input name="olimometer_use_paypal" id="olimometer_use_paypal" type="radio" value="1"<?php 418 465 if($current_olimometer->olimometer_use_paypal == 1) { … … 420 467 } 421 468 422 ?> onClick="olimometer_progress_disable();"> PayPal 423 424 <p><span class="description">Do you want to update the progress (current amount raised) manually or automatically by linking to a PayPal account?</span></p></td> 469 ?> onClick="olimometer_progress(1);"> PayPal<br /> 470 <input name="olimometer_use_paypal" id="olimometer_use_paypal" type="radio" value="2"<?php 471 if($current_olimometer->olimometer_use_paypal == 2) { 472 echo " checked"; 473 } 474 475 ?> onClick="olimometer_progress(2);"> StayClassy 476 477 <p><span class="description">Do you want to update the progress (current amount raised) manually or automatically by linking to a PayPal or StayClassy account?</span></p></td> 425 478 426 479 </tr> … … 491 544 </tr> 492 545 546 <tr class="form-field form-required"> 547 <th scope="row" valign="top"><label for="name">StayClassy PID</label></th> 548 <td><input name="olimometer_stayclassypid" id="olimometer_stayclassypid" type="text" value="<?php 549 echo $current_olimometer->olimometer_stayclassypid; 550 551 ?>" size="40" aria-required="true" /> 552 <p><span class="description">Please enter your unique StayClassy.org project ID for which you would like to track the total.</span></p></td> 553 </tr> 493 554 494 555 … … 820 881 if(document.olimometer_form1.olimometer_use_paypal[0].checked) 821 882 { 822 olimometer_progress _enable();823 } 824 else 883 olimometer_progress(0); 884 } 885 if(document.olimometer_form1.olimometer_use_paypal[1].checked) 825 886 { 826 olimometer_progress_disable(); 887 olimometer_progress(1); 888 } 889 if(document.olimometer_form1.olimometer_use_paypal[2].checked) 890 { 891 olimometer_progress(2); 827 892 } 828 893 … … 1067 1132 ************************/ 1068 1133 global $olimometer_db_version; 1069 $olimometer_db_version = "2.4 0";1134 $olimometer_db_version = "2.41"; 1070 1135 1071 1136 function olimometer_install() { … … 1103 1168 olimometer_overlay_x int, 1104 1169 olimometer_overlay_y int, 1170 olimometer_stayclassypid int, 1105 1171 UNIQUE KEY olimometer_id (olimometer_id) 1106 1172 );"; … … 1129 1195 // Yes it has! 1130 1196 // If currently installed database version is less than current version required for this plugin, then we need to upgrade 1131 $required_db_version = 2.4 0;1197 $required_db_version = 2.41; 1132 1198 $installed_db_version = get_option("olimometer_db_version"); 1133 1199 if($installed_db_version < $required_db_version) { … … 1283 1349 } 1284 1350 1351 1352 1353 1354 1355 1285 1356 ?> -
olimometer/trunk/readme.txt
r608691 r613541 7 7 Stable tag: trunk 8 8 9 A fully customisable fundraising thermometer with PayPal integration, custom skins and support for multiple vertical and horizontal thermometers.9 A fully customisable fundraising thermometer with PayPal and StayClassy integration, custom skins and support for multiple vertical and horizontal thermometers. 10 10 11 11 == Description == 12 12 13 A fully customisable fundraising thermometer with PayPal integration and custom skin support.13 A fully customisable fundraising thermometer with PayPal and StayClassy integration and custom skin support. 14 14 15 15 Multiple thermometers can be configured and displayed separately on different pages or posts. Each thermometer supports individual customisation, targets, currencies and progress tracking. … … 105 105 == Changelog == 106 106 107 = 2.41 = 108 * Added support for tracking StayClassy.org fundraising totals 109 107 110 = 2.40 = 108 111 * Added the ability to overlay a custom image over the top of the Olimometer. This feature can be found at the bottom of the Appearance and Layout section of the admin page. … … 226 229 == Upgrade Notice == 227 230 231 = 2.41 = 232 * Added support for tracking StayClassy.org fundraising totals 233 228 234 = 2.40 = 229 235 * Added the ability to overlay a custom image over the top of the Olimometer. This feature can be found at the bottom of the Appearance and Layout section of the admin page.
Note: See TracChangeset
for help on using the changeset viewer.