Changeset 698522
- Timestamp:
- 04/16/2013 01:35:22 PM (13 years ago)
- Location:
- olimometer
- Files:
-
- 65 added
- 3 edited
-
tags/2.45 (added)
-
tags/2.45/LiberationSans-Regular.ttf (added)
-
tags/2.45/jscolor (added)
-
tags/2.45/jscolor/arrow.gif (added)
-
tags/2.45/jscolor/cross.gif (added)
-
tags/2.45/jscolor/demo.html (added)
-
tags/2.45/jscolor/hs.png (added)
-
tags/2.45/jscolor/hv.png (added)
-
tags/2.45/jscolor/jscolor.js (added)
-
tags/2.45/my-script.js (added)
-
tags/2.45/olimometer-class.php (added)
-
tags/2.45/olimometer.php (added)
-
tags/2.45/readme.txt (added)
-
tags/2.45/screenshot-1.jpg (added)
-
tags/2.45/screenshot-2.jpg (added)
-
tags/2.45/screenshot-3.jpg (added)
-
tags/2.45/screenshot-4.jpg (added)
-
tags/2.45/skins (added)
-
tags/2.45/skins.php (added)
-
tags/2.45/skins.xml (added)
-
tags/2.45/skins/oli-bold-chunky (added)
-
tags/2.45/skins/oli-bold-chunky/bold-chunky-bar.png (added)
-
tags/2.45/skins/oli-bold-chunky/bold-chunky-bottom.png (added)
-
tags/2.45/skins/oli-bold-chunky/bold-chunky-top.png (added)
-
tags/2.45/skins/oli-default (added)
-
tags/2.45/skins/oli-default/therm_bar_empty.png (added)
-
tags/2.45/skins/oli-default/therm_bulb.png (added)
-
tags/2.45/skins/oli-default/therm_top.png (added)
-
tags/2.45/skins/oli-ourprogress-blue (added)
-
tags/2.45/skins/oli-ourprogress-blue/therm_bar_empty.png (added)
-
tags/2.45/skins/oli-ourprogress-blue/therm_bulb.png (added)
-
tags/2.45/skins/oli-ourprogress-blue/therm_top.png (added)
-
tags/2.45/skins/oli-ourprogress-green (added)
-
tags/2.45/skins/oli-ourprogress-green/therm_bar_empty.png (added)
-
tags/2.45/skins/oli-ourprogress-green/therm_bulb.png (added)
-
tags/2.45/skins/oli-ourprogress-green/therm_top.png (added)
-
tags/2.45/skins/oli-ourprogress-red (added)
-
tags/2.45/skins/oli-ourprogress-red/therm_bar_empty.png (added)
-
tags/2.45/skins/oli-ourprogress-red/therm_bulb.png (added)
-
tags/2.45/skins/oli-ourprogress-red/therm_top.png (added)
-
tags/2.45/skins/oli-progpress-black (added)
-
tags/2.45/skins/oli-progpress-black/left.png (added)
-
tags/2.45/skins/oli-progpress-black/middle.png (added)
-
tags/2.45/skins/oli-progpress-black/right.png (added)
-
tags/2.45/skins/oli-rounded (added)
-
tags/2.45/skins/oli-rounded/rounded_bar.png (added)
-
tags/2.45/skins/oli-rounded/rounded_bottom.png (added)
-
tags/2.45/skins/oli-rounded/rounded_top.png (added)
-
tags/2.45/skins/oli-thinblackhorizontal (added)
-
tags/2.45/skins/oli-thinblackhorizontal/left.png (added)
-
tags/2.45/skins/oli-thinblackhorizontal/middle.png (added)
-
tags/2.45/skins/oli-thinblackhorizontal/right.png (added)
-
tags/2.45/skins/oli-thinbluehorizontal (added)
-
tags/2.45/skins/oli-thinbluehorizontal/left.png (added)
-
tags/2.45/skins/oli-thinbluehorizontal/middle.png (added)
-
tags/2.45/skins/oli-thinbluehorizontal/right.png (added)
-
tags/2.45/skins/oli-thinredhorizontal (added)
-
tags/2.45/skins/oli-thinredhorizontal/left.png (added)
-
tags/2.45/skins/oli-thinredhorizontal/middle.png (added)
-
tags/2.45/skins/oli-thinredhorizontal/right.png (added)
-
tags/2.45/skins/oli-watermaster (added)
-
tags/2.45/skins/oli-watermaster/watermaster-bar.png (added)
-
tags/2.45/skins/oli-watermaster/watermaster-bottom.png (added)
-
tags/2.45/skins/oli-watermaster/watermaster-top.png (added)
-
tags/2.45/thermometer.php (added)
-
trunk/olimometer-class.php (modified) (8 diffs)
-
trunk/olimometer.php (modified) (13 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
olimometer/trunk/olimometer-class.php
r675314 r698522 38 38 public $olimometer_overlay_y = 0; 39 39 public $olimometer_stayclassypid = 0; 40 public $olimometer_stayclassyeid = 0; 40 41 41 42 private $olimometer_default_link = "http://www.olivershingler.co.uk/oliblog/olimometer/"; … … 78 79 $this->olimometer_overlay_y = $query_results['olimometer_overlay_y']; 79 80 $this->olimometer_stayclassypid = $query_results['olimometer_stayclassypid']; 81 $this->olimometer_stayclassyeid = $query_results['olimometer_stayclassyeid']; 80 82 81 83 if($query_results['olimometer_link'] == "" || $query_results['olimometer_link'] == null) { … … 164 166 'olimometer_overlay_x' => $this->olimometer_overlay_x, 165 167 'olimometer_overlay_y' => $this->olimometer_overlay_y, 166 'olimometer_stayclassypid' => $this->olimometer_stayclassypid 168 'olimometer_stayclassypid' => $this->olimometer_stayclassypid, 169 'olimometer_stayclassyeid' => $this->olimometer_stayclassyeid 167 170 ) ); 168 171 … … 199 202 'olimometer_overlay_x' => $this->olimometer_overlay_x, 200 203 'olimometer_overlay_y' => $this->olimometer_overlay_y, 201 'olimometer_stayclassypid' => $this->olimometer_stayclassypid 204 'olimometer_stayclassypid' => $this->olimometer_stayclassypid, 205 'olimometer_stayclassyeid' => $this->olimometer_stayclassyeid 202 206 ), 203 207 array( 'olimometer_id' => $this->olimometer_id ) … … 260 264 } 261 265 262 // If StayClassy integration is configured, get the current balance and save it266 // If StayClassy PROJECT ID integration is configured, get the current balance and save it 263 267 if($this->olimometer_use_paypal == 2) { 264 268 $olimometer_stayclassy_balance = $this->getStayClassy($this->olimometer_stayclassypid); … … 278 282 } 279 283 } 284 285 // If StayClassy EVENT ID integration is configured, get the current balance and save it 286 if($this->olimometer_use_paypal == 3) { 287 $olimometer_stayclassy_balance = $this->getStayClassyEvent($this->olimometer_stayclassyeid); 288 if($olimometer_stayclassy_balance == false) { 289 // If PayPal link is broken, set balance to 0 290 $olimometer_stayclassy_balance = 0; 291 } 292 else { 293 if($this->olimometer_progress_value == ($olimometer_stayclassy_balance) ) { 294 // PayPal balance hasn't changed since we last checked so don't do anything 295 } 296 else { 297 // It has changed, so save it 298 $this->olimometer_progress_value = $olimometer_stayclassy_balance; 299 $this->save(); 300 } 301 } 302 } 280 303 281 304 … … 289 312 $the_olimometer_text = $the_olimometer_text." class='".$css_class."'"; 290 313 } 291 $the_olimometer_text = $the_olimometer_text." alt='Olimometer 2.4 5'></a>";314 $the_olimometer_text = $the_olimometer_text." alt='Olimometer 2.46'></a>"; 292 315 293 316 return $the_olimometer_text; … … 319 342 } 320 343 344 // Gets the total_raised value from StayClassy.org for a given EID. 345 function getStayClassyEvent($EID) { 346 $json = file_get_contents("http://www.stayclassy.org/api/event-info?eid=$EID"); 347 348 $jsonIterator = new RecursiveIteratorIterator( 349 new RecursiveArrayIterator(json_decode($json, TRUE)), 350 RecursiveIteratorIterator::SELF_FIRST); 351 352 $return_value = 0; 353 354 foreach ($jsonIterator as $key => $val) { 355 if(is_array($val)) { 356 //$return_text = $return_text . "$key:\n"; 357 } else { 358 if($key == "total_raised") { 359 $return_value = $val; 360 } 361 //$return_text = $return_text . "$key => $val\n"; 362 } 363 } 364 365 return $return_value; 366 } 367 321 368 // The following function is for PayPal balance retrieval 322 369 function PPHttpPost($methodName_, $nvpStr_) { -
olimometer/trunk/olimometer.php
r675314 r698522 6 6 Author: Oliver Shingler 7 7 Author URI: http://www.olivershingler.co.uk 8 Version: 2.4 58 Version: 2.46 9 9 */ 10 10 … … 151 151 $an_olimometer->olimometer_overlay_y = $_REQUEST['olimometer_overlay_y']; 152 152 $an_olimometer->olimometer_stayclassypid = $_REQUEST['olimometer_stayclassypid']; 153 $an_olimometer->olimometer_stayclassyeid = $_REQUEST['olimometer_stayclassyeid']; 153 154 154 155 // Save it … … 219 220 <script language="javascript"> 220 221 221 /*222 function olimometer_progress_disable() {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;228 }229 230 function olimometer_progress_enable() {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 222 238 223 function olimometer_progress($progress_type) { 239 224 // 0 = Manual 240 225 // 1 = PayPal 241 // 2 = StayClassy 226 // 2 = StayClassy Project 227 // 3 = StayClassy Event 242 228 if ($progress_type == 0) { 243 229 // Enable manual … … 247 233 // Disable StayClassy 248 234 olimometer_disable_stayclassy(true); 235 // Disable StayClassy Event 236 olimometer_disable_stayclassyevent(true); 249 237 } 250 238 if ($progress_type == 1) { … … 255 243 // Disable StayClassy 256 244 olimometer_disable_stayclassy(true); 245 // Disable StayClassy Event 246 olimometer_disable_stayclassyevent(true); 257 247 } 258 248 if ($progress_type == 2) { … … 263 253 // Disable Manual 264 254 olimometer_disable_manual(true); 255 // Disable StayClassy Event 256 olimometer_disable_stayclassyevent(true); 257 } 258 if ($progress_type == 3) { 259 // Disable StayClassy 260 olimometer_disable_stayclassy(true); 261 // Disable PayPal 262 olimometer_disable_paypal(true); 263 // Disable Manual 264 olimometer_disable_manual(true); 265 // Enable StayClassy Event 266 olimometer_disable_stayclassyevent(false); 265 267 } 266 268 } … … 279 281 function olimometer_disable_stayclassy($tof) { 280 282 document.olimometer_form1.olimometer_stayclassypid.readOnly = $tof; 283 } 284 285 function olimometer_disable_stayclassyevent($tof) { 286 document.olimometer_form1.olimometer_stayclassyeid.readOnly = $tof; 281 287 } 282 288 … … 473 479 } 474 480 475 ?> onClick="olimometer_progress(2);"> StayClassy 481 ?> onClick="olimometer_progress(2);"> StayClassy Project<br /> 482 <input name="olimometer_use_paypal" id="olimometer_use_paypal" type="radio" value="3"<?php 483 if($current_olimometer->olimometer_use_paypal == 3) { 484 echo " checked"; 485 } 486 487 ?> onClick="olimometer_progress(3);"> StayClassy Event 476 488 477 489 <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> … … 553 565 </tr> 554 566 567 <tr class="form-field form-required"> 568 <th scope="row" valign="top"><label for="name">StayClassy EID</label></th> 569 <td><input name="olimometer_stayclassyeid" id="olimometer_stayclassyeid" type="text" value="<?php 570 echo $current_olimometer->olimometer_stayclassyeid; 571 572 ?>" size="40" aria-required="true" /> 573 <p><span class="description">Please enter your unique StayClassy.org event ID for which you would like to track the total.</span></p></td> 574 </tr> 555 575 556 576 </table> … … 847 867 848 868 <p><strong>Want to say thank you?</strong></p> 849 <p>You can visit themy site for more information or to make a donation: <a href='http://www.olivershingler.co.uk/oliblog/olimometer'>http://www.olivershingler.co.uk/oliblog/olimometer</a>.</p>869 <p>You can visit my site for more information or to make a donation: <a href='http://www.olivershingler.co.uk/oliblog/olimometer'>http://www.olivershingler.co.uk/oliblog/olimometer</a>.</p> 850 870 851 871 … … 892 912 { 893 913 olimometer_progress(2); 914 } 915 if(document.olimometer_form1.olimometer_use_paypal[3].checked) 916 { 917 olimometer_progress(3); 894 918 } 895 919 … … 1223 1247 ************************/ 1224 1248 global $olimometer_db_version; 1225 $olimometer_db_version = "2.4 1";1249 $olimometer_db_version = "2.46"; 1226 1250 1227 1251 function olimometer_install() { … … 1260 1284 olimometer_overlay_y int, 1261 1285 olimometer_stayclassypid int, 1286 olimometer_stayclassyeid int, 1262 1287 UNIQUE KEY olimometer_id (olimometer_id) 1263 1288 );"; -
olimometer/trunk/readme.txt
r675314 r698522 109 109 == Changelog == 110 110 111 = 2.46 = 112 * Added support for StayClassy Events in addition to Projects 113 111 114 = 2.45 = 112 115 * Added Swiss Francs (CHF) as a currency option … … 245 248 == Upgrade Notice == 246 249 250 = 2.46 = 251 * Added support for StayClassy Events in addition to Projects 252 247 253 = 2.45 = 248 254 * Added Swiss Francs (CHF) as a currency option
Note: See TracChangeset
for help on using the changeset viewer.