Changeset 2754142
- Timestamp:
- 07/10/2022 02:28:19 AM (4 years ago)
- Location:
- custom-post-donations/trunk
- Files:
-
- 2 edited
-
custom-post-donations.php (modified) (14 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
custom-post-donations/trunk/custom-post-donations.php
r2313839 r2754142 5 5 Description: 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. 6 6 Author: HahnCreativeGroup 7 Version: 4. 2.77 Version: 4.3 8 8 Author URI: https://plugingarden.com/ 9 9 */ … … 13 13 class WP_Donations { 14 14 public function __construct() { 15 16 } 17 15 16 } 17 18 18 //DB Functions 19 19 public function define_db_tables() { 20 20 21 21 } 22 22 } … … 42 42 43 43 if ( $wpdb->get_var( "show tables like '$cpDonations_table'" ) != $cpDonations_table ) { 44 44 45 45 $sql = "CREATE TABLE $cpDonations_table (". 46 46 "Id INT NOT NULL AUTO_INCREMENT, ". … … 53 53 "PRIMARY KEY Id (Id) ". 54 54 ")"; 55 55 56 56 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 57 57 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 ); 60 60 } 61 61 add_option("cpDonations_Business_Name", "Enter Email Address"); … … 64 64 function cpDonations_options() { 65 65 if (!get_option('cpDonations_returnUrl')) { 66 add_option('cpDonations_returnUrl', ""); 66 add_option('cpDonations_returnUrl', ""); 67 67 } 68 68 if (!get_option('cpDonations_buttonStyle')) { 69 add_option('cpDonations_buttonStyle', "default"); 69 add_option('cpDonations_buttonStyle', "default"); 70 70 } 71 71 if (!get_option('cpDonations_restrictToPagePost')) { 72 add_option('cpDonations_restrictToPagePost', "true"); 72 add_option('cpDonations_restrictToPagePost', "true"); 73 73 } 74 74 } … … 85 85 { 86 86 add_menu_page(__('WP Donations','menu-cpDonations'), __('WP Donations','menu-cpDonations'), 'manage_options', 'cpDonations-admin', 'showCpDonationsMenu' ); 87 87 88 88 // Add a submenu to the custom top-level menu: 89 89 add_submenu_page('cpDonations-admin', __('WP Donations >> Add Page','menu-cpDonations'), __('Add Donation','menu-cpDonations'), 'manage_options', 'add-cpDonation', 'add_cpDonation'); … … 128 128 // 2) Fixed + additional - one fixed donation amount with an additional editable donation amount field 129 129 // 3) Per Item - Fixed donation amount per item witn an additional editable donation amount field 130 */ 130 */ 131 131 global $wpdb; 132 132 global $cpDonations_table; 133 133 134 134 if ($id != "-1") { 135 135 $cpDonation = $wpdb->get_row( "SELECT * FROM $cpDonations_table WHERE Id = '$id'" ); … … 138 138 $cpDonation = $wpdb->get_row( "SELECT * FROM $cpDonations_table WHERE slug = '$cpDonationName'" ); 139 139 } 140 140 141 141 if($cpDonation != null) { 142 142 143 143 $buttonStyle = "https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif"; 144 144 145 145 switch(get_option('cpDonations_buttonStyle')) { 146 146 case "small": … … 154 154 break; 155 155 } 156 156 157 157 $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")."' />"; 159 159 $defaultDonation = $cpDonation->defaultdonation; 160 160 $donationType = $cpDonation->donationtype; … … 162 162 $options = ""; 163 163 for($i=1;$i<=$maxItems;$i++) { 164 $options .= "<option>".$i."</option>"; 164 $options .= "<option>".$i."</option>"; 165 165 } 166 166 $quantity = "<select name='quantity' class='cp-donation quantity'>".$options."</select>"; 167 167 168 168 $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 170 170 switch($donationType) { 171 171 case 2: … … 182 182 break; 183 183 } 184 184 185 185 $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'>". 186 186 "<input type='hidden' class='cmd' name='cmd' value='_donations'>". … … 198 198 "<p class='submit'>".$buttonStyle."". 199 199 "<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 202 202 $restrict = get_option('cpDonations_restrictToPagePost'); 203 203 if(($restrict == "true") && (is_single() || is_page())) { 204 return $form; 204 return $form; 205 205 } 206 206 else if($restrict == "false") { … … 212 212 } 213 213 else { 214 return ""; 215 } 214 return ""; 215 } 216 216 } 217 217 … … 244 244 245 245 // 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>'; 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>'; 249 249 } 250 250 return $links; 251 251 } 252 252 253 253 //Add the extra links on the plugin page 254 254 add_filter('plugin_row_meta', 'add_cpDonations_plugin_links', 10, 2); -
custom-post-donations/trunk/readme.txt
r2754141 r2754142 6 6 Tested up to: 6.0 7 7 Requires PHP: 5.6 8 Stable tag: 4. 2.78 Stable tag: 4.3 9 9 10 10 WP 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.