WordPress.org

Plugin Directory

Changeset 532055


Ignore:
Timestamp:
04/16/12 22:11:30 (2 years ago)
Author:
ldebrouwer
Message:

Version 0.3.4. Added a first version of the dashboard.

Location:
affiliate-press
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • affiliate-press/tags/0.3.4/affiliate-press.php

    r530018 r532055  
    22/** 
    33 * @package Affiliate_Press 
    4  * @version 0.3.3 
     4 * @version 0.3.4 
    55 */ 
    66/* 
     
    99Description: Affiliate Press allows you to set up an affiliate website based on product feeds as easy as 1-2-3. 
    1010Author: ldebrouwer 
    11 Version: 0.3.3 
     11Version: 0.3.4 
    1212Author URI: http://lucdebrouwer.nl/ 
    1313*/ 
     
    3131function AP_activation() { 
    3232    include( LDB_AP_PATH . 'affiliate-press-upgrade.php' ); 
    33     update_option( 'LDB_Affiliate_Press_Version', '0.3.3' ); 
     33    update_option( 'LDB_Affiliate_Press_Version', '0.3.4' ); 
    3434    wp_schedule_event( time(), 'hourly', 'AP_cronjob' ); 
    3535} 
  • affiliate-press/tags/0.3.4/includes/class-affiliate-press.php

    r530018 r532055  
    274274        /* Function that shows the dashboard. */ 
    275275        function AP_dashboard() { 
     276            global $wpdb; 
     277            $dashboard['products'] = count( get_posts( array( 'post_type' => 'product', 'post_status' => array( 'publish', 'draft' ) ) ) ); 
     278            $dashboard['feeds'] = count( $wpdb->get_results( 'SELECT ID FROM ' . $wpdb->prefix . 'apfeeds', ARRAY_A ) ); 
     279            $dashboard['multipleprices'] = count( $wpdb->get_results( 'SELECT * FROM ' . $wpdb->prefix . 'posts AS products WHERE (SELECT COUNT(*) FROM ' . $wpdb->prefix . 'apprices WHERE ' . $wpdb->prefix . 'apprices.productID = products.ID) > 1 AND post_type="product"', ARRAY_A ) ); 
     280            $dashboard['oneprice'] = count( $wpdb->get_results( 'SELECT * FROM ' . $wpdb->prefix . 'posts AS products WHERE (SELECT COUNT(*) FROM ' . $wpdb->prefix . 'apprices WHERE ' . $wpdb->prefix . 'apprices.productID = products.ID) = 1 AND post_type="product"', ARRAY_A ) ); 
     281            $dashboard['noprices'] = count( $wpdb->get_results( 'SELECT * FROM ' . $wpdb->prefix . 'posts AS products WHERE (SELECT COUNT(*) FROM ' . $wpdb->prefix . 'apprices WHERE ' . $wpdb->prefix . 'apprices.productID = products.ID) = 0 AND post_type="product"', ARRAY_A ) ); 
    276282            include( LDB_AP_VIEW_PATH . 'dashboard.php' ); 
    277283        } 
  • affiliate-press/tags/0.3.4/readme.txt

    r530018 r532055  
    55Requires at least: 3.3 
    66Tested up to: 3.4 
    7 Stable tag: 0.3.3 
     7Stable tag: 0.3.4 
    88 
    99Affiliate Press allows you to set up an affiliate website based on product feeds as easy as 1-2-3. 
     
    5757== Changelog == 
    5858 
     59= 0.3.4 = 
     60* Added a first version of the dashboard. 
     61 
    5962= 0.3.3 = 
    6063* Added the 'Add New Feed Wizard'. It's still rudimentary and feedback would be highly appreciated. Should work like a charm with Daisycon feeds. 
  • affiliate-press/tags/0.3.4/styles.css

    r529401 r532055  
    6161    font-size: 0; 
    6262    line-height: 0; 
     63    display: block; 
    6364} 
    6465 
     
    8586    text-indent: -9999px; 
    8687} 
     88 
     89#ap_dashboard .table { 
     90    width: 48%; 
     91    float: left; 
     92    margin-right: 4%; 
     93} 
     94 
     95#ap_dashboard .last { 
     96    margin-right: 0; 
     97} 
     98 
     99#ap_dashboard p { 
     100    color: #8f8f8f; 
     101    font-size: 14px; 
     102    left: 15px; 
     103    padding: 5px 0; 
     104    border-bottom: 1px solid #dfdfdf; 
     105    margin: -5px 0 5px 0; 
     106} 
     107 
     108#ap_dashboard td { 
     109    color: #777777; 
     110    font-size: 12px; 
     111    padding: 6px 12px 0 0; 
     112    white-space: nowrap; 
     113} 
     114 
     115#ap_dashboard td.first { 
     116    font-family: Georgia, "Times New Roman", "Bitstream Charter", Times,serif; 
     117    font-size: 18px; 
     118    padding: 0 12px 0 0; 
     119    text-align: right; 
     120} 
     121 
     122#ap_dashboard a { 
     123    text-decoration: none; 
     124} 
     125 
     126#ap_dashboard .green { 
     127    color: green; 
     128} 
     129 
     130#ap_dashboard .yellow { 
     131    color: #e66f00; 
     132} 
     133 
     134#ap_dashboard .red { 
     135    color: red; 
     136} 
  • affiliate-press/tags/0.3.4/views/dashboard.php

    r528107 r532055  
    44    <div id="ap_body"> 
    55        <div id="ap_main"> 
     6            <div class="metabox-holder"> 
     7                <div id="ap_dashboard" class="postbox"> 
     8                    <div class="handlediv" title="Click to toggle"><br /></div> 
     9                    <h3 class="hndle"><span>Dashboard</span></h3> 
     10                    <div class="inside"> 
     11                        <div class="table"> 
     12                            <p><?php echo __( 'General', 'LDB_AP' ); ?></p> 
     13                            <table> 
     14                                <tr> 
     15                                    <td class="first"><a href="edit.php"><?php echo $dashboard['products']; ?></a></td> 
     16                                    <td><a href="edit.php?post_type=product"><?php echo _n( 'Product', 'Products', $dashboard['products'], 'LDB_AP' ); ?></a></td> 
     17                                </tr> 
     18                                <tr> 
     19                                    <td class="first"><a href="edit.php?post_type=page"><?php echo $dashboard['feeds']; ?></a></td> 
     20                                    <td><a href="admin.php?page=affiliate_press_feeds"><?php echo _n( 'Feed', 'Feeds', $dashboard['feeds'], 'LDB_AP' ); ?></a></td> 
     21                                </tr> 
     22                            </table> 
     23                        </div> 
     24                        <div class="table last"> 
     25                            <p><?php echo __( 'Prices', 'LDB_AP' ); ?></p> 
     26                            <table> 
     27                                <tr> 
     28                                    <td class="first"><a href="edit.php"><?php echo $dashboard['multipleprices']; ?></a></td> 
     29                                    <td><a href="edit.php?post_type=product" class="green"><?php echo _n( 'Product with multiple prices', 'Products with multiple prices', $dashboard['multipleprices'], 'LDB_AP' ); ?></a></td> 
     30                                </tr> 
     31                                <tr> 
     32                                    <td class="first"><a href="edit.php?post_type=page"><?php echo $dashboard['oneprice']; ?></a></td> 
     33                                    <td><a href="edit.php?post_type=product" class="yellow"><?php echo _n( 'Product with one price', 'Products with one price', $dashboard['oneprice'], 'LDB_AP' ); ?></a></td> 
     34                                </tr> 
     35                                <tr> 
     36                                    <td class="first"><a href="edit.php?post_type=page"><?php echo $dashboard['noprices']; ?></a></td> 
     37                                    <td><a href="edit.php?post_type=product" class="red"><?php echo _n( 'Product with zero prices', 'Products with zero prices', $dashboard['noprices'], 'LDB_AP' ); ?></a></td> 
     38                                </tr> 
     39                            </table> 
     40                        </div> 
     41                        <span class="clr">&nbsp;</span> 
     42                    </div> 
     43                </div> 
     44            </div> 
    645            <p><?php echo __( 'Still thinking about the dashboard layout. :)' ); ?></p> 
    746            <p><?php echo __( 'A help and support section is also in the works.' ); ?></p> 
  • affiliate-press/trunk/affiliate-press.php

    r530018 r532055  
    22/** 
    33 * @package Affiliate_Press 
    4  * @version 0.3.3 
     4 * @version 0.3.4 
    55 */ 
    66/* 
     
    99Description: Affiliate Press allows you to set up an affiliate website based on product feeds as easy as 1-2-3. 
    1010Author: ldebrouwer 
    11 Version: 0.3.3 
     11Version: 0.3.4 
    1212Author URI: http://lucdebrouwer.nl/ 
    1313*/ 
     
    3131function AP_activation() { 
    3232    include( LDB_AP_PATH . 'affiliate-press-upgrade.php' ); 
    33     update_option( 'LDB_Affiliate_Press_Version', '0.3.3' ); 
     33    update_option( 'LDB_Affiliate_Press_Version', '0.3.4' ); 
    3434    wp_schedule_event( time(), 'hourly', 'AP_cronjob' ); 
    3535} 
  • affiliate-press/trunk/includes/class-affiliate-press.php

    r530018 r532055  
    274274        /* Function that shows the dashboard. */ 
    275275        function AP_dashboard() { 
     276            global $wpdb; 
     277            $dashboard['products'] = count( get_posts( array( 'post_type' => 'product', 'post_status' => array( 'publish', 'draft' ) ) ) ); 
     278            $dashboard['feeds'] = count( $wpdb->get_results( 'SELECT ID FROM ' . $wpdb->prefix . 'apfeeds', ARRAY_A ) ); 
     279            $dashboard['multipleprices'] = count( $wpdb->get_results( 'SELECT * FROM ' . $wpdb->prefix . 'posts AS products WHERE (SELECT COUNT(*) FROM ' . $wpdb->prefix . 'apprices WHERE ' . $wpdb->prefix . 'apprices.productID = products.ID) > 1 AND post_type="product"', ARRAY_A ) ); 
     280            $dashboard['oneprice'] = count( $wpdb->get_results( 'SELECT * FROM ' . $wpdb->prefix . 'posts AS products WHERE (SELECT COUNT(*) FROM ' . $wpdb->prefix . 'apprices WHERE ' . $wpdb->prefix . 'apprices.productID = products.ID) = 1 AND post_type="product"', ARRAY_A ) ); 
     281            $dashboard['noprices'] = count( $wpdb->get_results( 'SELECT * FROM ' . $wpdb->prefix . 'posts AS products WHERE (SELECT COUNT(*) FROM ' . $wpdb->prefix . 'apprices WHERE ' . $wpdb->prefix . 'apprices.productID = products.ID) = 0 AND post_type="product"', ARRAY_A ) ); 
    276282            include( LDB_AP_VIEW_PATH . 'dashboard.php' ); 
    277283        } 
  • affiliate-press/trunk/readme.txt

    r530018 r532055  
    55Requires at least: 3.3 
    66Tested up to: 3.4 
    7 Stable tag: 0.3.3 
     7Stable tag: 0.3.4 
    88 
    99Affiliate Press allows you to set up an affiliate website based on product feeds as easy as 1-2-3. 
     
    5757== Changelog == 
    5858 
     59= 0.3.4 = 
     60* Added a first version of the dashboard. 
     61 
    5962= 0.3.3 = 
    6063* Added the 'Add New Feed Wizard'. It's still rudimentary and feedback would be highly appreciated. Should work like a charm with Daisycon feeds. 
  • affiliate-press/trunk/styles.css

    r529401 r532055  
    6161    font-size: 0; 
    6262    line-height: 0; 
     63    display: block; 
    6364} 
    6465 
     
    8586    text-indent: -9999px; 
    8687} 
     88 
     89#ap_dashboard .table { 
     90    width: 48%; 
     91    float: left; 
     92    margin-right: 4%; 
     93} 
     94 
     95#ap_dashboard .last { 
     96    margin-right: 0; 
     97} 
     98 
     99#ap_dashboard p { 
     100    color: #8f8f8f; 
     101    font-size: 14px; 
     102    left: 15px; 
     103    padding: 5px 0; 
     104    border-bottom: 1px solid #dfdfdf; 
     105    margin: -5px 0 5px 0; 
     106} 
     107 
     108#ap_dashboard td { 
     109    color: #777777; 
     110    font-size: 12px; 
     111    padding: 6px 12px 0 0; 
     112    white-space: nowrap; 
     113} 
     114 
     115#ap_dashboard td.first { 
     116    font-family: Georgia, "Times New Roman", "Bitstream Charter", Times,serif; 
     117    font-size: 18px; 
     118    padding: 0 12px 0 0; 
     119    text-align: right; 
     120} 
     121 
     122#ap_dashboard a { 
     123    text-decoration: none; 
     124} 
     125 
     126#ap_dashboard .green { 
     127    color: green; 
     128} 
     129 
     130#ap_dashboard .yellow { 
     131    color: #e66f00; 
     132} 
     133 
     134#ap_dashboard .red { 
     135    color: red; 
     136} 
  • affiliate-press/trunk/views/dashboard.php

    r528107 r532055  
    44    <div id="ap_body"> 
    55        <div id="ap_main"> 
     6            <div class="metabox-holder"> 
     7                <div id="ap_dashboard" class="postbox"> 
     8                    <div class="handlediv" title="Click to toggle"><br /></div> 
     9                    <h3 class="hndle"><span>Dashboard</span></h3> 
     10                    <div class="inside"> 
     11                        <div class="table"> 
     12                            <p><?php echo __( 'General', 'LDB_AP' ); ?></p> 
     13                            <table> 
     14                                <tr> 
     15                                    <td class="first"><a href="edit.php"><?php echo $dashboard['products']; ?></a></td> 
     16                                    <td><a href="edit.php?post_type=product"><?php echo _n( 'Product', 'Products', $dashboard['products'], 'LDB_AP' ); ?></a></td> 
     17                                </tr> 
     18                                <tr> 
     19                                    <td class="first"><a href="edit.php?post_type=page"><?php echo $dashboard['feeds']; ?></a></td> 
     20                                    <td><a href="admin.php?page=affiliate_press_feeds"><?php echo _n( 'Feed', 'Feeds', $dashboard['feeds'], 'LDB_AP' ); ?></a></td> 
     21                                </tr> 
     22                            </table> 
     23                        </div> 
     24                        <div class="table last"> 
     25                            <p><?php echo __( 'Prices', 'LDB_AP' ); ?></p> 
     26                            <table> 
     27                                <tr> 
     28                                    <td class="first"><a href="edit.php"><?php echo $dashboard['multipleprices']; ?></a></td> 
     29                                    <td><a href="edit.php?post_type=product" class="green"><?php echo _n( 'Product with multiple prices', 'Products with multiple prices', $dashboard['multipleprices'], 'LDB_AP' ); ?></a></td> 
     30                                </tr> 
     31                                <tr> 
     32                                    <td class="first"><a href="edit.php?post_type=page"><?php echo $dashboard['oneprice']; ?></a></td> 
     33                                    <td><a href="edit.php?post_type=product" class="yellow"><?php echo _n( 'Product with one price', 'Products with one price', $dashboard['oneprice'], 'LDB_AP' ); ?></a></td> 
     34                                </tr> 
     35                                <tr> 
     36                                    <td class="first"><a href="edit.php?post_type=page"><?php echo $dashboard['noprices']; ?></a></td> 
     37                                    <td><a href="edit.php?post_type=product" class="red"><?php echo _n( 'Product with zero prices', 'Products with zero prices', $dashboard['noprices'], 'LDB_AP' ); ?></a></td> 
     38                                </tr> 
     39                            </table> 
     40                        </div> 
     41                        <span class="clr">&nbsp;</span> 
     42                    </div> 
     43                </div> 
     44            </div> 
    645            <p><?php echo __( 'Still thinking about the dashboard layout. :)' ); ?></p> 
    746            <p><?php echo __( 'A help and support section is also in the works.' ); ?></p> 
Note: See TracChangeset for help on using the changeset viewer.