Changeset 616341
- Timestamp:
- 10/23/2012 03:37:29 PM (13 years ago)
- Location:
- plugrush/trunk
- Files:
-
- 2 edited
-
plugrush.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
plugrush/trunk/plugrush.php
r616073 r616341 4 4 Plugin URI: http://wordpress.org/extend/plugins/plugrush/ 5 5 Description: This plugin enable you to use PlugRush on your wordpress site. Use it to enable PlugRush popunders, mobile redirect, adblock detection script, or to add PlugRush Widgets to your widget enabled themes or sidebars 6 Version: 1.0 26 Version: 1.03 7 7 Author: PlugRush.com 8 8 Author URI: http://www.plugrush.com … … 52 52 add_action( 'add_meta_boxes', 'plugrush_add_box' ); 53 53 #add_filter('post_updated_messages', 'plugrush_messages'); 54 add_action('wp_dashboard_setup', 'plugrush_dashboard_widgets' ); 55 } 56 57 /* EARNINGS WIDGET ON FRONTPAGE */ 58 function plugrush_earnings() { 59 $plugrush = get_option('plugrush-settings'); 60 $earnings = plugrush_request(array('action'=>'earnings','user'=>$plugrush['user'],'api_key'=>$plugrush['api_key'])); 61 if(!empty($earnings['data'])){ $earnings['data'] = array_reverse($earnings['data']); ?> 62 <table width="100%"> 63 <thead> 64 <tr> 65 <th align="left">Date</th> 66 <th align="right">Amount</th> 67 </tr> 68 </thead> 69 <tbody> 70 <? foreach($earnings['data'] as $row){ ?> 71 <tr> 72 <td align="left"><?=$row['date'];?></td> 73 <td align="right">$<?=$row['amount'];?></td> 74 </tr> 75 <? } ?> 76 </tbody> 77 </table> 78 <? }else{ 79 echo "Nothing to show here yet"; 80 } 81 } 82 function plugrush_dashboard_widgets() { 83 wp_add_dashboard_widget('plugrush_earnings', 'PlugRush earnings', 'plugrush_earnings'); 54 84 } 55 85 … … 335 365 $info = curl_getinfo($curl); 336 366 if($info['content_type'] == 'application/json'){ 337 $response = json_decode($response,true);367 $response = (array) json_decode($response,true); 338 368 $response['status'] = $info['http_code']; 339 369 }else{ … … 612 642 if(!empty($new_instance['widget_id'])){ 613 643 $params = array('action'=>'widget/get','user'=>$plugrush['user'],'api_key'=>$plugrush['api_key'],'id'=>$new_instance['widget_id']); 614 $w = plugrush_request($params);644 $w = (array) plugrush_request($params); 615 645 if(!empty($w)){ 616 646 $instance['widget_id'] = $w['data']['id']; -
plugrush/trunk/readme.txt
r616073 r616341 4 4 Requires at least: 2.8 5 5 Tested up to: 3.4.1 6 Stable tag: 1.0 26 Stable tag: 1.03 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 47 47 * Removed need for CURLOPT_FOLLOWLOCATION which caused problems on servers with safe_mode enabled. 48 48 49 = 1.03 = 50 * Added PlugRush earnings on the wordpress dashboard, and made changes for plugin to work with PHP 5.1.x 49 51 50 52 51 53 54
Note: See TracChangeset
for help on using the changeset viewer.