Plugin Directory

Changeset 616341


Ignore:
Timestamp:
10/23/2012 03:37:29 PM (13 years ago)
Author:
Plugrush
Message:
 
Location:
plugrush/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • plugrush/trunk/plugrush.php

    r616073 r616341  
    44Plugin URI: http://wordpress.org/extend/plugins/plugrush/
    55Description: 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.02
     6Version: 1.03
    77Author: PlugRush.com
    88Author URI: http://www.plugrush.com
     
    5252    add_action( 'add_meta_boxes', 'plugrush_add_box' );
    5353    #add_filter('post_updated_messages', 'plugrush_messages');
     54    add_action('wp_dashboard_setup', 'plugrush_dashboard_widgets' );
     55}
     56
     57/* EARNINGS WIDGET ON FRONTPAGE */
     58function 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}
     82function plugrush_dashboard_widgets() {
     83    wp_add_dashboard_widget('plugrush_earnings', 'PlugRush earnings', 'plugrush_earnings');
    5484}
    5585
     
    335365        $info = curl_getinfo($curl);
    336366        if($info['content_type'] == 'application/json'){
    337             $response = json_decode($response,true);
     367            $response = (array) json_decode($response,true);
    338368            $response['status'] = $info['http_code'];
    339369        }else{
     
    612642            if(!empty($new_instance['widget_id'])){
    613643                $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);
    615645                if(!empty($w)){
    616646                    $instance['widget_id'] = $w['data']['id']; 
  • plugrush/trunk/readme.txt

    r616073 r616341  
    44Requires at least: 2.8
    55Tested up to: 3.4.1
    6 Stable tag: 1.02
     6Stable tag: 1.03
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4747* Removed need for CURLOPT_FOLLOWLOCATION which caused problems on servers with safe_mode enabled.
    4848
     49= 1.03 =
     50* Added PlugRush earnings on the wordpress dashboard, and made changes for plugin to work with PHP 5.1.x
    4951
    5052
    5153
     54
Note: See TracChangeset for help on using the changeset viewer.