Plugin Directory

Changeset 2754142


Ignore:
Timestamp:
07/10/2022 02:28:19 AM (4 years ago)
Author:
hahncgdev
Message:

Updated version number, missed in first commit

Location:
custom-post-donations/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • custom-post-donations/trunk/custom-post-donations.php

    r2313839 r2754142  
    55Description: This WordPress plugin will allow you to create unique customized PayPal donation widgets on WordPress posts or pages and accept donations. Creates custom PayPal donation widgets.
    66Author: HahnCreativeGroup
    7 Version: 4.2.7
     7Version: 4.3
    88Author URI: https://plugingarden.com/
    99*/
     
    1313    class WP_Donations {
    1414        public function __construct() {
    15        
    16         }
    17        
     15
     16        }
     17
    1818        //DB Functions
    1919        public function define_db_tables() {
    20            
     20
    2121        }
    2222    }
     
    4242
    4343  if ( $wpdb->get_var( "show tables like '$cpDonations_table'" ) != $cpDonations_table ) {
    44            
     44
    4545    $sql = "CREATE TABLE $cpDonations_table (".
    4646        "Id INT NOT NULL AUTO_INCREMENT, ".
     
    5353        "PRIMARY KEY Id (Id) ".
    5454        ")";
    55    
     55
    5656    require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    5757    dbDelta( $sql );
    58    
    59     add_option( "cpDonations_plugin_db_version", $cpDonations_plugin_db_version ); 
     58
     59    add_option( "cpDonations_plugin_db_version", $cpDonations_plugin_db_version );
    6060  }
    6161  add_option("cpDonations_Business_Name", "Enter Email Address");
     
    6464function cpDonations_options() {
    6565    if (!get_option('cpDonations_returnUrl')) {
    66         add_option('cpDonations_returnUrl', "");   
     66        add_option('cpDonations_returnUrl', "");
    6767    }
    6868    if (!get_option('cpDonations_buttonStyle')) {
    69         add_option('cpDonations_buttonStyle', "default");   
     69        add_option('cpDonations_buttonStyle', "default");
    7070    }
    7171    if (!get_option('cpDonations_restrictToPagePost')) {
    72         add_option('cpDonations_restrictToPagePost', "true");   
     72        add_option('cpDonations_restrictToPagePost', "true");
    7373    }
    7474}
     
    8585{
    8686    add_menu_page(__('WP Donations','menu-cpDonations'), __('WP Donations','menu-cpDonations'), 'manage_options', 'cpDonations-admin', 'showCpDonationsMenu' );
    87    
     87
    8888    // Add a submenu to the custom top-level menu:
    8989    add_submenu_page('cpDonations-admin', __('WP Donations >> Add Page','menu-cpDonations'), __('Add Donation','menu-cpDonations'), 'manage_options', 'add-cpDonation', 'add_cpDonation');
     
    128128    // 2) Fixed + additional - one fixed donation amount with an additional editable donation amount field
    129129    // 3) Per Item - Fixed donation amount per item witn an additional editable donation amount field
    130     */ 
     130    */
    131131    global $wpdb;
    132132    global $cpDonations_table;
    133    
     133
    134134    if ($id != "-1") {
    135135        $cpDonation = $wpdb->get_row( "SELECT * FROM $cpDonations_table WHERE Id = '$id'" );
     
    138138        $cpDonation = $wpdb->get_row( "SELECT * FROM $cpDonations_table WHERE slug = '$cpDonationName'" );
    139139    }
    140    
     140
    141141    if($cpDonation != null) {
    142    
     142
    143143    $buttonStyle = "https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif";
    144    
     144
    145145    switch(get_option('cpDonations_buttonStyle')) {
    146146        case "small":
     
    154154            break;
    155155    }
    156    
     156
    157157    $businessName = get_option("cpDonations_Business_Name");
    158     $returnURLMarkup = (get_option("cpDonations_returnUrl") == "") ? "" : "<input type='hidden' name='return' value='".get_option("cpDonations_returnUrl")."' />"; 
     158    $returnURLMarkup = (get_option("cpDonations_returnUrl") == "") ? "" : "<input type='hidden' name='return' value='".get_option("cpDonations_returnUrl")."' />";
    159159    $defaultDonation = $cpDonation->defaultdonation;
    160160    $donationType = $cpDonation->donationtype;
     
    162162    $options = "";
    163163    for($i=1;$i<=$maxItems;$i++) {
    164         $options .= "<option>".$i."</option>"; 
     164        $options .= "<option>".$i."</option>";
    165165    }
    166166    $quantity = "<select name='quantity' class='cp-donation quantity'>".$options."</select>";
    167    
     167
    168168    $customForm = "<p class='donate_amount'><label class='cp-donation' for='amount'>Your Donation Amount:</label><br /><input type='text' name='amount' class='cp-donation amount' value='".$defaultDonation."' /></p>";
    169    
     169
    170170    switch($donationType) {
    171171        case 2:
     
    182182            break;
    183183    }
    184    
     184
    185185    $form = "<style>input {width: 100%;}</style><!-- Custom Post Donations - http://labs.hahncreativegroup.com/wordpress-paypal-plugin/ --><div><form class='cpDonation' action='https://www.paypal.com/cgi-bin/webscr' method='post'>".
    186186        "<input type='hidden' class='cmd' name='cmd' value='_donations'>".
     
    198198        "<p class='submit'>".$buttonStyle."".
    199199        "<img alt='' border='0' src='https://www.paypal.com/en_US/i/scr/pixel.gif' width='1' height='1'></p>".
    200         "</form></div><!-- Custom Post Donations -->";     
    201                        
     200        "</form></div><!-- Custom Post Donations -->";
     201
    202202        $restrict = get_option('cpDonations_restrictToPagePost');
    203203        if(($restrict == "true") && (is_single() || is_page())) {
    204             return $form;   
     204            return $form;
    205205        }
    206206        else if($restrict == "false") {
     
    212212    }
    213213    else {
    214         return ""; 
    215     }   
     214        return "";
     215    }
    216216}
    217217
     
    244244
    245245// Taken from Google XML Sitemaps from Arne Brachhold
    246 function add_cpDonations_plugin_links($links, $file) { 
    247     if ( $file == plugin_basename(__FILE__) ) {         
    248         $links[] = '<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AZLPGKSCJBPKS">' . __('Donate', 'cpDonations') . '</a>';         
     246function add_cpDonations_plugin_links($links, $file) {
     247    if ( $file == plugin_basename(__FILE__) ) {
     248        $links[] = '<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AZLPGKSCJBPKS">' . __('Donate', 'cpDonations') . '</a>';
    249249    }
    250250    return $links;
    251251}
    252    
     252
    253253//Add the extra links on the plugin page
    254254add_filter('plugin_row_meta', 'add_cpDonations_plugin_links', 10, 2);
  • custom-post-donations/trunk/readme.txt

    r2754141 r2754142  
    66Tested up to: 6.0
    77Requires PHP: 5.6
    8 Stable tag: 4.2.7
     8Stable tag: 4.3
    99
    1010WP Plugin to easily accept payment in WordPress by adding a PayPal button to your website.  Add PayPal 'Buy Now' and integrated forms for selling products and accepting donations.
Note: See TracChangeset for help on using the changeset viewer.