Paid Memberships Pro - Version 1.7.10.2

Version Description

  • Fixed MySQL warning/error that was introduced in 1.7.10.1 and showing for some people who had "hide excerpts" enabled.
Download this release

Release Info

Developer strangerstudios
Plugin Icon 128x128 Paid Memberships Pro
Version 1.7.10.2
Comparing to
See all releases

Code changes from version 1.7.3 to 1.7.10.2

Files changed (146) hide show
  1. adminpages/addons.php +1 -1
  2. adminpages/addons/images/pmpro-bbpress.jpg +0 -0
  3. adminpages/addons/images/pmpro-constant-contact.gif +0 -0
  4. adminpages/addons/images/pmpro-email-templates.gif +0 -0
  5. adminpages/addons/images/pmpro-woocommerce.gif +0 -0
  6. adminpages/addons/pmpro-addon-packages.php +2 -2
  7. adminpages/addons/pmpro-affiliates.php +2 -2
  8. adminpages/addons/pmpro-aweber.php +2 -2
  9. adminpages/addons/pmpro-bbpress.php +8 -5
  10. adminpages/addons/pmpro-constant-contact.php +31 -0
  11. adminpages/addons/pmpro-email-templates.php +31 -0
  12. adminpages/addons/pmpro-expiration.php +9 -7
  13. adminpages/addons/pmpro-freeaddress.php +7 -5
  14. adminpages/addons/pmpro-infusionsoft.php +4 -4
  15. adminpages/addons/pmpro-mailchimp.php +3 -3
  16. adminpages/addons/pmpro-network-subsite.php +31 -0
  17. adminpages/addons/pmpro-post-affiliate-pro.php +1 -1
  18. adminpages/addons/pmpro-register-helper.php +1 -1
  19. adminpages/addons/pmpro-series.php +1 -1
  20. adminpages/addons/pmpro-shipping.php +1 -1
  21. adminpages/addons/pmpro-stripe-lite.php +0 -30
  22. adminpages/addons/pmpro-user-pages.php +1 -1
  23. adminpages/addons/pmpro-woocommerce.php +31 -0
  24. adminpages/addons/pmpro-wp-affiliate.php +5 -3
  25. adminpages/addons/tml.php +1 -1
  26. adminpages/addons/wp-bouncer.php +2 -2
  27. adminpages/admin_header.php +21 -0
  28. adminpages/advancedsettings.php +79 -8
  29. adminpages/dashboard.php +2 -2
  30. adminpages/discountcodes.php +23 -18
  31. adminpages/emailsettings.php +181 -152
  32. adminpages/functions.php +68 -3
  33. adminpages/membershiplevels.php +20 -12
  34. adminpages/memberslist-csv.php +95 -32
  35. adminpages/memberslist.php +58 -30
  36. adminpages/orders-csv.php +127 -19
  37. adminpages/orders.php +311 -6
  38. adminpages/pagesettings.php +51 -9
  39. adminpages/paymentsettings.php +36 -77
  40. adminpages/reports.php +3 -0
  41. adminpages/reports/login.php +6 -6
  42. adminpages/reports/memberships.php +36 -22
  43. adminpages/reports/sales.php +40 -42
  44. classes/class.memberorder.php +62 -12
  45. classes/class.pmproemail.php +76 -11
  46. classes/gateways/class.pmprogateway.php +17 -1
  47. classes/gateways/class.pmprogateway_braintree.php +10 -10
  48. classes/gateways/class.pmprogateway_payflowpro.php +9 -6
  49. classes/gateways/class.pmprogateway_paypal.php +10 -8
  50. classes/gateways/class.pmprogateway_paypalexpress.php +65 -21
  51. classes/gateways/class.pmprogateway_paypalstandard.php +16 -10
  52. classes/gateways/class.pmprogateway_stripe.php +59 -15
  53. classes/gateways/class.pmprogateway_twocheckout.php +49 -27
  54. css/admin-rtl.css +63 -0
  55. css/admin.css +5 -5
  56. css/frontend-rtl.css +111 -0
  57. css/frontend.css +49 -86
  58. email/billing.html +1 -4
  59. email/billing_failure.html +1 -5
  60. email/billing_failure_admin.html +1 -5
  61. email/checkout_check.html +1 -1
  62. email/checkout_freetrial.html +1 -4
  63. email/checkout_freetrial_admin.html +1 -4
  64. email/checkout_paid.html +1 -4
  65. email/checkout_paid_admin.html +1 -4
  66. email/checkout_trial.html +1 -4
  67. email/checkout_trial_admin.html +1 -4
  68. email/credit_card_expiring.html +1 -3
  69. email/invoice.html +2 -6
  70. includes/adminpages.php +146 -65
  71. includes/cleanup.php +1 -12
  72. includes/content.php +61 -33
  73. includes/currencies.php +9 -2
  74. includes/email.php +39 -9
  75. includes/functions.php +1732 -1622
  76. includes/https.php +53 -18
  77. includes/init.php +39 -23
  78. includes/lib/Stripe/Stripe.php +10 -0
  79. includes/lib/Stripe/Stripe/Account.php +5 -6
  80. includes/lib/Stripe/Stripe/ApiRequestor.php +153 -51
  81. includes/lib/Stripe/Stripe/ApiResource.php +51 -17
  82. includes/lib/Stripe/Stripe/ApplicationFee.php +53 -0
  83. includes/lib/Stripe/Stripe/AttachedObject.php +23 -0
  84. includes/lib/Stripe/Stripe/Balance.php +15 -0
  85. includes/lib/Stripe/Stripe/BalanceTransaction.php +39 -0
  86. includes/lib/Stripe/Stripe/Card.php +54 -0
  87. includes/lib/Stripe/Stripe/CardError.php +4 -2
  88. includes/lib/Stripe/Stripe/Charge.php +55 -7
  89. includes/lib/Stripe/Stripe/Coupon.php +24 -7
  90. includes/lib/Stripe/Stripe/Customer.php +61 -6
  91. includes/lib/Stripe/Stripe/Error.php +9 -7
  92. includes/lib/Stripe/Stripe/Event.php +12 -6
  93. includes/lib/Stripe/Stripe/InvalidRequestError.php +4 -2
  94. includes/lib/Stripe/Stripe/Invoice.php +30 -6
  95. includes/lib/Stripe/Stripe/InvoiceItem.php +24 -6
  96. includes/lib/Stripe/Stripe/List.php +25 -5
  97. includes/lib/Stripe/Stripe/Object.php +123 -12
  98. includes/lib/Stripe/Stripe/Plan.php +26 -6
  99. includes/lib/Stripe/Stripe/Recipient.php +75 -0
  100. includes/lib/Stripe/Stripe/SingletonApiResource.php +7 -0
  101. includes/lib/Stripe/Stripe/Stripe.php +49 -3
  102. includes/lib/Stripe/Stripe/Subscription.php +58 -0
  103. includes/lib/Stripe/Stripe/Token.php +12 -6
  104. includes/lib/Stripe/Stripe/Transfer.php +34 -6
  105. includes/lib/Stripe/Stripe/Util.php +42 -14
  106. includes/login.php +13 -5
  107. includes/metaboxes.php +2 -2
  108. includes/upgradecheck.php +12 -3
  109. includes/xmlrpc.php +80 -0
  110. languages/gettext.sh +23 -0
  111. languages/pmpro-cs_CZ.mo +0 -0
  112. languages/pmpro-cs_CZ.po +2889 -0
  113. languages/pmpro-en_GB.mo +0 -0
  114. languages/pmpro-en_GB.po +2661 -0
  115. languages/pmpro-fr_FR.mo +0 -0
  116. languages/pmpro-fr_FR.po +442 -326
  117. languages/pmpro-it_IT.mo +0 -0
  118. languages/pmpro-it_IT.po +3517 -0
  119. languages/pmpro-pt_BR.mo +0 -0
  120. languages/pmpro-pt_BR.po +2661 -0
  121. languages/pmpro-sk_SK.mo +0 -0
  122. languages/pmpro-sk_SK.po +3826 -0
  123. languages/pmpro.mo +0 -0
  124. languages/pmpro.po +2232 -1033
  125. languages/pmpro.pot +2232 -1033
  126. license.txt +10 -11
  127. logs/.gitkeep +0 -0
  128. logs/ipn.txt +0 -2084
  129. pages/account.php +15 -11
  130. pages/billing.php +46 -11
  131. pages/checkout.php +50 -37
  132. pages/confirmation.php +3 -3
  133. pages/invoice.php +3 -3
  134. pages/levels.php +32 -82
  135. paid-memberships-pro.php +54 -8
  136. preheaders/billing.php +36 -5
  137. preheaders/cancel.php +3 -3
  138. preheaders/checkout.php +65 -23
  139. preheaders/levels.php +1 -1
  140. readme.txt +145 -3
  141. scheduled/crons.php +13 -3
  142. services/applydiscountcode.php +141 -134
  143. services/authnet-silent-post.php +5 -0
  144. services/ipnhandler.php +163 -20
  145. services/stripe-webhook.php +101 -18
  146. services/twocheckout-ins.php +84 -41
adminpages/addons.php CHANGED
@@ -1,6 +1,6 @@
1
<?php
2
//only admins can get this
3
- if(!function_exists("current_user_can") || !current_user_can("manage_options"))
4
{
5
die(__("You do not have permissions to perform this action.", "pmpro"));
6
}
1
<?php
2
//only admins can get this
3
+ if(!function_exists("current_user_can") || (!current_user_can("manage_options") && !current_user_can("pmpro_addons")))
4
{
5
die(__("You do not have permissions to perform this action.", "pmpro"));
6
}
adminpages/addons/images/pmpro-bbpress.jpg ADDED
Binary file
adminpages/addons/images/pmpro-constant-contact.gif ADDED
Binary file
adminpages/addons/images/pmpro-email-templates.gif ADDED
Binary file
adminpages/addons/images/pmpro-woocommerce.gif ADDED
Binary file
adminpages/addons/pmpro-addon-packages.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Addon Packages',
8
- 'version' => '.1.3',
9
'widget' => 'pmpro_addon_pmpro_addon_packages_widget',
10
'enabled' => function_exists('pmproap_post_meta')
11
)
@@ -22,7 +22,7 @@ function pmpro_addon_pmpro_addon_packages_widget($addon)
22
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-addon-packages/pmpro-addon-packages.php")) { ?>
23
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-addon-packages/pmpro-addon-packages.php'), 'activate-plugin_pmpro-addon-packages/pmpro-addon-packages.php')?>" class="button button-primary">Activate</a>
24
<?php } else { ?>
25
- <a href="https://github.com/strangerstudios/pmpro-addon-packages/archive/master.zip" class="button button-primary">Download</a>
26
<?php } ?>
27
</div>
28
</div> <!-- end info -->
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Addon Packages',
8
+ 'version' => '.4.2',
9
'widget' => 'pmpro_addon_pmpro_addon_packages_widget',
10
'enabled' => function_exists('pmproap_post_meta')
11
)
22
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-addon-packages/pmpro-addon-packages.php")) { ?>
23
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-addon-packages/pmpro-addon-packages.php'), 'activate-plugin_pmpro-addon-packages/pmpro-addon-packages.php')?>" class="button button-primary">Activate</a>
24
<?php } else { ?>
25
+ <a href="https://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-addon-packages.zip" class="button button-primary">Download</a>
26
<?php } ?>
27
</div>
28
</div> <!-- end info -->
adminpages/addons/pmpro-affiliates.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Affiliates',
8
- 'version' => '.2.2',
9
'widget' => 'pmpro_addon_pmpro_affiliates_widget',
10
'enabled' => function_exists('pmpro_affiliates_dependencies')
11
)
@@ -22,7 +22,7 @@ function pmpro_addon_pmpro_affiliates_widget($addon)
22
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-affiliates/pmpro-affiliates.php")) { ?>
23
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-affiliates/pmpro-affiliates.php'), 'activate-plugin_pmpro-affiliates/pmpro-affiliates.php')?>" class="button button-primary">Activate</a>
24
<?php } else { ?>
25
- <a href="https://github.com/strangerstudios/pmpro-affiliates/archive/master.zip" class="button button-primary">Download</a>
26
<?php } ?>
27
</div>
28
</div> <!-- end info -->
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Affiliates',
8
+ 'version' => '.2.4',
9
'widget' => 'pmpro_addon_pmpro_affiliates_widget',
10
'enabled' => function_exists('pmpro_affiliates_dependencies')
11
)
22
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-affiliates/pmpro-affiliates.php")) { ?>
23
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-affiliates/pmpro-affiliates.php'), 'activate-plugin_pmpro-affiliates/pmpro-affiliates.php')?>" class="button button-primary">Activate</a>
24
<?php } else { ?>
25
+ <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-affiliates.zip" class="button button-primary">Download</a>
26
<?php } ?>
27
</div>
28
</div> <!-- end info -->
adminpages/addons/pmpro-aweber.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro AWeber Integration',
8
- 'version' => '.2',
9
'widget' => 'pmpro_addon_pmpro_aweber_widget',
10
'enabled' => function_exists('pmproaw_init')
11
)
@@ -19,7 +19,7 @@ function pmpro_addon_pmpro_aweber_widget($addon)
19
<p>Integrate User Registrations with AWeber. Adds members to lists based on their membership level. (Note: works without PMPro as well.)</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
- <a href="https://github.com/strangerstudios/pmpro-aweber/" class="button">Enabled</a>
23
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-aweber/pmpro-aweber.php")) { ?>
24
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-aweber/pmpro-aweber.php'), 'activate-plugin_pmpro-aweber/pmpro-aweber.php')?>" class="button button-primary">Activate</a>
25
<?php } else { ?>
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro AWeber Integration',
8
+ 'version' => '1.0',
9
'widget' => 'pmpro_addon_pmpro_aweber_widget',
10
'enabled' => function_exists('pmproaw_init')
11
)
19
<p>Integrate User Registrations with AWeber. Adds members to lists based on their membership level. (Note: works without PMPro as well.)</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
+ <a href="<?php echo admin_url("plugins.php");?>" class="button">Enabled</a>
23
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-aweber/pmpro-aweber.php")) { ?>
24
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-aweber/pmpro-aweber.php'), 'activate-plugin_pmpro-aweber/pmpro-aweber.php')?>" class="button button-primary">Activate</a>
25
<?php } else { ?>
adminpages/addons/pmpro-bbpress.php CHANGED
@@ -3,9 +3,9 @@
3
Addon: PMPro bbPress
4
Slug: pmpro-bbpress
5
*/
6
- pmpro_add_addon('gists', array(
7
'title' => 'PMPro bbPress',
8
- 'version' => '.1',
9
'widget' => 'pmpro_addon_pmpro_bbpress_widget',
10
'enabled' => function_exists('pmpro_check_forum')
11
)
@@ -14,14 +14,17 @@ pmpro_add_addon('gists', array(
14
function pmpro_addon_pmpro_bbpress_widget($addon)
15
{
16
?>
17
<div class="info">
18
<p>Locking down bbPress Forums by Membership Level and Forum ID.</p>
19
<div class="actions">
20
<?php if($addon['enabled']) { ?>
21
- <a target="_blank" href="https://gist.github.com/strangerstudios/1633637" class="button">Enabled</a>
22
<?php } else { ?>
23
- <a target="_blank" href="https://gist.github.com/strangerstudios/1633637" class="button button-primary">View Gist</a>
24
- <?php } ?>
25
</div>
26
</div> <!-- end info -->
27
<?php
3
Addon: PMPro bbPress
4
Slug: pmpro-bbpress
5
*/
6
+ pmpro_add_addon('repo', array(
7
'title' => 'PMPro bbPress',
8
+ 'version' => '1.0.1',
9
'widget' => 'pmpro_addon_pmpro_bbpress_widget',
10
'enabled' => function_exists('pmpro_check_forum')
11
)
14
function pmpro_addon_pmpro_bbpress_widget($addon)
15
{
16
?>
17
+ <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-bbpress.jpg" />
18
<div class="info">
19
<p>Locking down bbPress Forums by Membership Level and Forum ID.</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
+ <a href="<?php echo admin_url("plugins.php");?>" class="button">Enabled</a>
23
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-bbpress/pmpro-bbpress.php")) { ?>
24
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-bbpress/pmpro-bbpress.php'), 'activate-plugin_pmpro-bbpress/pmpro-bbpress.php')?>" class="button button-primary">Activate</a>
25
<?php } else { ?>
26
+ <a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-bbpress'), 'install-plugin_pmpro-bbpress'); ?>" class="button button-primary">Download</a>
27
+ <?php } ?>
28
</div>
29
</div> <!-- end info -->
30
<?php
adminpages/addons/pmpro-constant-contact.php ADDED
@@ -0,0 +1,31 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro Constant Contact Integration
4
+ Slug: pmpro-constant-contact
5
+ */
6
+ pmpro_add_addon('thirdparty', array(
7
+ 'title' => 'PMPro Constant Contact Integration',
8
+ 'version' => '1.0',
9
+ 'widget' => 'pmpro_addon_pmpro_constant_contact_widget',
10
+ 'enabled' => function_exists('pmprocc_init')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_constant_contact_widget($addon)
15
+ {
16
+ ?>
17
+ <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-constant-contact.gif" />
18
+ <div class="info">
19
+ <p>Integrate User Registrations with Constant Contact . Adds members to lists based on their membership level. (Note: works without PMPro as well.)</p>
20
+ <div class="actions">
21
+ <?php if($addon['enabled']) { ?>
22
+ <a href="<?php echo admin_url("plugins.php");?>" class="button">Enabled</a>
23
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-constant-contact/pmpro-constant-contact.php")) { ?>
24
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-constant-contact/pmpro-constant-contact.php'), 'activate-plugin_pmpro-constant-contact/pmpro-constant-contact.php')?>" class="button button-primary">Activate</a>
25
+ <?php } else { ?>
26
+ <a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-constant-contact'), 'install-plugin_pmpro-constant-contact'); ?>" class="button button-primary">Download</a>
27
+ <?php } ?>
28
+ </div>
29
+ </div> <!-- end info -->
30
+ <?php
31
+ }
adminpages/addons/pmpro-email-templates.php ADDED
@@ -0,0 +1,31 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro Email Templates Editor
4
+ Slug: pmpro-email-templates-addon
5
+ */
6
+ pmpro_add_addon('repo', array(
7
+ 'title' => 'PMPro Email Templates',
8
+ 'version' => '.3',
9
+ 'widget' => 'pmpro_addon_email_templates_widget',
10
+ 'enabled' => function_exists('pmproet_scripts')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_email_templates_widget($addon)
15
+ {
16
+ ?>
17
+ <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-email-templates.gif" />
18
+ <div class="info">
19
+ <p>Easily edit system-generated Email Templates from the WordPress admin.</p>
20
+ <div class="actions">
21
+ <?php if($addon['enabled']) { ?>
22
+ <a href="http://wordpress.org/plugins/pmpro-email-templates-addon/" class="button">Enabled</a>
23
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-email-templates-addon/pmpro-email-templates.php")) { ?>
24
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-email-templates-addon/pmpro-email-templates.php'), 'activate-plugin_pmpro-email-templates-addon/pmpro-email-templates.php')?>" class="button button-primary">Activate</a>
25
+ <?php } else { ?>
26
+ <a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-email-templates-addon'), 'install-plugin_pmpro-email-templates-addon'); ?>" class="button button-primary">Download</a>
27
+ <?php } ?>
28
+ </div>
29
+ </div> <!-- end info -->
30
+ <?php
31
+ }
adminpages/addons/pmpro-expiration.php CHANGED
@@ -3,11 +3,11 @@
3
Addon: PMPro Expiration Date
4
Slug: pmpro-expiration
5
*/
6
- pmpro_add_addon('gists', array(
7
- 'title' => 'PMPro Expiration Date',
8
'version' => '.1',
9
'widget' => 'pmpro_addon_pmpro_expiration_widget',
10
- 'enabled' => function_exists('my_pmpro_checkout_level_specific_expiration')
11
)
12
);
13
@@ -15,13 +15,15 @@ function pmpro_addon_pmpro_expiration_widget($addon)
15
{
16
?>
17
<div class="info">
18
- <p>Set a specific expiration date for a Membership Level.</p>
19
<div class="actions">
20
<?php if($addon['enabled']) { ?>
21
- <a target="_blank" href="https://gist.github.com/strangerstudios/5709300" class="button">Enabled</a>
22
<?php } else { ?>
23
- <a target="_blank" href="https://gist.github.com/strangerstudios/5709300" class="button button-primary">View Gist</a>
24
- <?php } ?>
25
</div>
26
</div> <!-- end info -->
27
<?php
3
Addon: PMPro Expiration Date
4
Slug: pmpro-expiration
5
*/
6
+ pmpro_add_addon('github', array(
7
+ 'title' => 'PMPro Set Expiration Dates',
8
'version' => '.1',
9
'widget' => 'pmpro_addon_pmpro_expiration_widget',
10
+ 'enabled' => function_exists('pmprosed_pmpro_checkout_level')
11
)
12
);
13
15
{
16
?>
17
<div class="info">
18
+ <p>Set a specific expiration date (e.g. 2013-12-31) for a PMPro membership level or discount code.</p>
19
<div class="actions">
20
<?php if($addon['enabled']) { ?>
21
+ <a href="https://github.com/strangerstudios/pmpro-set-expiration-dates/blob/master/readme.txt" class="button">Enabled</a>
22
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-set-expiration-dates/pmpro-set-expiration-dates.php")) { ?>
23
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-set-expiration-dates/pmpro-set-expiration-dates.php'), 'activate-plugin_pmpro-set-expiration-dates/pmpro-set-expiration-dates.php')?>" class="button button-primary">Activate</a>
24
<?php } else { ?>
25
+ <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-set-expiration-dates.zip" class="button button-primary">Download</a>
26
+ <?php } ?>
27
</div>
28
</div> <!-- end info -->
29
<?php
adminpages/addons/pmpro-freeaddress.php CHANGED
@@ -3,9 +3,9 @@
3
Addon: PMPro Require Name and Address for Free Level
4
Slug: pmpro-freerequire
5
*/
6
- pmpro_add_addon('gists', array(
7
'title' => 'PMPro Require Name/Address for Free Level',
8
- 'version' => '.1',
9
'widget' => 'pmpro_addon_pmpro_freerequire_widget',
10
'enabled' => function_exists('my_pmpro_checkout_boxes_require_address')
11
)
@@ -18,10 +18,12 @@ function pmpro_addon_pmpro_freerequire_widget($addon)
18
<p>Require name/address for free Membership Level checkout.</p>
19
<div class="actions">
20
<?php if($addon['enabled']) { ?>
21
- <a target="_blank" href="https://gist.github.com/strangerstudios/5716249" class="button">Enabled</a>
22
<?php } else { ?>
23
- <a target="_blank" href="https://gist.github.com/strangerstudios/5716249" class="button button-primary">View Gist</a>
24
- <?php } ?>
25
</div>
26
</div> <!-- end info -->
27
<?php
3
Addon: PMPro Require Name and Address for Free Level
4
Slug: pmpro-freerequire
5
*/
6
+ pmpro_add_addon('github', array(
7
'title' => 'PMPro Require Name/Address for Free Level',
8
+ 'version' => '.2',
9
'widget' => 'pmpro_addon_pmpro_freerequire_widget',
10
'enabled' => function_exists('my_pmpro_checkout_boxes_require_address')
11
)
18
<p>Require name/address for free Membership Level checkout.</p>
19
<div class="actions">
20
<?php if($addon['enabled']) { ?>
21
+ <a href="https://github.com/strangerstudios/pmpro-address-for-free-levels" class="button">Enabled</a>
22
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-address-for-free-levels/pmpro-address-for-free-levels.php")) { ?>
23
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-address-for-free-levels/pmpro-address-for-free-levels.php'), 'activate-plugin_pmpro-address-for-free-levels/pmpro-address-for-free-levels.php')?>" class="button button-primary">Activate</a>
24
<?php } else { ?>
25
+ <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-address-for-free-levels.zip" class="button button-primary">Download</a>
26
+ <?php } ?>
27
</div>
28
</div> <!-- end info -->
29
<?php
adminpages/addons/pmpro-infusionsoft.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro Infusionsoft Integration',
8
- 'version' => '.2',
9
'widget' => 'pmpro_addon_pmpro_infusionsoft_widget',
10
'enabled' => function_exists('pmprois_init')
11
)
@@ -19,12 +19,12 @@ function pmpro_addon_pmpro_infusionsoft_widget($addon)
19
<p>Integrate with Infusionsoft. Add members to email lists (groups, tags) based on their membership level. (Note: works without PMPro as well.)</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
- <a href="https://github.com/strangerstudios/pmpro-infusionsoft/" class="button">Enabled</a>
23
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-infusionsoft/pmpro-infusionsoft.php")) { ?>
24
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-infusionsoft/pmpro-infusionsoft.php'), 'activate-plugin_pmpro-infusionsoft/pmpro-infusionsoft.php')?>" class="button button-primary">Activate</a>
25
<?php } else { ?>
26
- <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-infusionsoft.zip" class="button button-primary">Download</a>
27
- <?php } ?>
28
</div>
29
</div> <!-- end info -->
30
<?php
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro Infusionsoft Integration',
8
+ 'version' => '1.0',
9
'widget' => 'pmpro_addon_pmpro_infusionsoft_widget',
10
'enabled' => function_exists('pmprois_init')
11
)
19
<p>Integrate with Infusionsoft. Add members to email lists (groups, tags) based on their membership level. (Note: works without PMPro as well.)</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
+ <a href="<?php echo admin_url("plugins.php");?>" class="button">Enabled</a>
23
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-infusionsoft/pmpro-infusionsoft.php")) { ?>
24
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-infusionsoft/pmpro-infusionsoft.php'), 'activate-plugin_pmpro-infusionsoft/pmpro-infusionsoft.php')?>" class="button button-primary">Activate</a>
25
<?php } else { ?>
26
+ <a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-infusionsoft'), 'install-plugin_pmpro-infusionsoft'); ?>" class="button button-primary">Download</a>
27
+ <?php } ?>
28
</div>
29
</div> <!-- end info -->
30
<?php
adminpages/addons/pmpro-mailchimp.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro MailChimp Integration',
8
- 'version' => '.3.2',
9
'widget' => 'pmpro_addon_pmpro_mailchimp_widget',
10
'enabled' => function_exists('pmpromc_init')
11
)
@@ -19,12 +19,12 @@ function pmpro_addon_pmpro_mailchimp_widget($addon)
19
<p>Integrate User Registrations with Mailchimp. Adds members to lists based on their membership level. (Note: works without PMPro as well.)</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
- <a href="https://github.com/strangerstudios/pmpro-mailchimp/" class="button">Enabled</a>
23
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-mailchimp/pmpro-mailchimp.php")) { ?>
24
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-mailchimp/pmpro-mailchimp.php'), 'activate-plugin_pmpro-mailchimp/pmpro-mailchimp.php')?>" class="button button-primary">Activate</a>
25
<?php } else { ?>
26
<a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-mailchimp'), 'install-plugin_pmpro-mailchimp'); ?>" class="button button-primary">Download</a>
27
- <?php } ?>
28
</div>
29
</div> <!-- end info -->
30
<?php
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro MailChimp Integration',
8
+ 'version' => '.3.4',
9
'widget' => 'pmpro_addon_pmpro_mailchimp_widget',
10
'enabled' => function_exists('pmpromc_init')
11
)
19
<p>Integrate User Registrations with Mailchimp. Adds members to lists based on their membership level. (Note: works without PMPro as well.)</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
+ <a href="<?php echo admin_url("plugins.php");?>" class="button">Enabled</a>
23
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-mailchimp/pmpro-mailchimp.php")) { ?>
24
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-mailchimp/pmpro-mailchimp.php'), 'activate-plugin_pmpro-mailchimp/pmpro-mailchimp.php')?>" class="button button-primary">Activate</a>
25
<?php } else { ?>
26
<a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-mailchimp'), 'install-plugin_pmpro-mailchimp'); ?>" class="button button-primary">Download</a>
27
+ <?php } ?>
28
</div>
29
</div> <!-- end info -->
30
<?php
adminpages/addons/pmpro-network-subsite.php ADDED
@@ -0,0 +1,31 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro Network
4
+ Slug: pmpro-network-subsite
5
+ */
6
+ pmpro_add_addon('github', array(
7
+ 'title' => 'PMPro Network Subsite Helper',
8
+ 'version' => '.1',
9
+ 'widget' => 'pmpro_addon_pmpro_network_subsite_widget',
10
+ 'enabled' => function_exists('pmpron_subsite_activated_plugin')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_network_subsite_widget($addon)
15
+ {
16
+ ?>
17
+ <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-network.gif" />
18
+ <div class="info">
19
+ <p>Have network subsites use membership data from a "main" site to handle access restrictions.</p>
20
+ <div class="actions">
21
+ <?php if($addon['enabled']) { ?>
22
+ <a href="https://github.com/strangerstudios/pmpro-network-subsite" class="button">Enabled</a>
23
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-network-subsite/pmpro-network-subsite.php")) { ?>
24
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-network-subsite/pmpro-network-subsite.php'), 'activate-plugin_pmpro-network-subsite/pmpro-network-subsite.php')?>" class="button button-primary">Activate</a>
25
+ <?php } else { ?>
26
+ <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-network-subsite.zip" class="button button-primary">Download</a>
27
+ <?php } ?>
28
+ </div>
29
+ </div> <!-- end info -->
30
+ <?php
31
+ }
adminpages/addons/pmpro-post-affiliate-pro.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro Post Affiliate Pro Integration',
8
- 'version' => '.3',
9
'widget' => 'pmpro_addon_pmpro_post_affiliate_pro_widget',
10
'enabled' => function_exists('pap_pmpro_track_sale')
11
)
5
*/
6
pmpro_add_addon('thirdparty', array(
7
'title' => 'PMPro Post Affiliate Pro Integration',
8
+ 'version' => '.2',
9
'widget' => 'pmpro_addon_pmpro_post_affiliate_pro_widget',
10
'enabled' => function_exists('pap_pmpro_track_sale')
11
)
adminpages/addons/pmpro-register-helper.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Register Helper',
8
- 'version' => '.5.2',
9
'widget' => 'pmpro_addon_pmpro_register_helper_widget',
10
'enabled' => class_exists('PMProRH_Field')
11
)
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Register Helper',
8
+ 'version' => '.5.11',
9
'widget' => 'pmpro_addon_pmpro_register_helper_widget',
10
'enabled' => class_exists('PMProRH_Field')
11
)
adminpages/addons/pmpro-series.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Series',
8
- 'version' => '.2',
9
'widget' => 'pmpro_addon_pmpro_series_widget',
10
'enabled' => class_exists("PMProSeries")
11
)
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Series',
8
+ 'version' => '.2.1',
9
'widget' => 'pmpro_addon_pmpro_series_widget',
10
'enabled' => class_exists("PMProSeries")
11
)
adminpages/addons/pmpro-shipping.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Shipping Add On',
8
- 'version' => '.2.2.1',
9
'widget' => 'pmpro_addon_pmpro_shipping_widget',
10
'enabled' => function_exists('pmproship_pmpro_checkout_boxes')
11
)
5
*/
6
pmpro_add_addon('github', array(
7
'title' => 'PMPro Shipping Add On',
8
+ 'version' => '.2.4',
9
'widget' => 'pmpro_addon_pmpro_shipping_widget',
10
'enabled' => function_exists('pmproship_pmpro_checkout_boxes')
11
)
adminpages/addons/pmpro-stripe-lite.php DELETED
@@ -1,30 +0,0 @@
1
- <?php
2
- /*
3
- Addon: PMPro Stripe Lite
4
- Slug: pmpro-stripe-lite
5
- */
6
- pmpro_add_addon('github', array(
7
- 'title' => 'PMPro Stripe Lite',
8
- 'version' => '.1.1',
9
- 'widget' => 'pmpro_addon_pmpro_stripe_lite_widget',
10
- 'enabled' => function_exists('pmprosl_pmpro_pages_shortcode_checkout')
11
- )
12
- );
13
-
14
- function pmpro_addon_pmpro_stripe_lite_widget($addon)
15
- {
16
- ?>
17
- <div class="info">
18
- <p>Remove billing fields (not required by Stripe) from the checkout page when using the Stripe payment gateway with PMPro.</p>
19
- <div class="actions">
20
- <?php if($addon['enabled']) { ?>
21
- <a href="https://github.com/strangerstudios/pmpro-stripe-lite/blob/master/readme.txt" class="button">Enabled</a>
22
- <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-stripe-lite/pmpro-stripe-lite.php")) { ?>
23
- <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-stripe-lite/pmpro-stripe-lite.php'), 'activate-plugin_pmpro-stripe-lite/pmpro-stripe-lite.php')?>" class="button button-primary">Activate</a>
24
- <?php } else { ?>
25
- <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-stripe-lite.zip" class="button button-primary">Download</a>
26
- <?php } ?>
27
- </div>
28
- </div> <!-- end info -->
29
- <?php
30
- }
adminpages/addons/pmpro-user-pages.php CHANGED
@@ -14,7 +14,7 @@ pmpro_add_addon('github', array(
14
function pmpro_addon_pmpro_user_pages_widget($addon)
15
{
16
?>
17
- <div class="info">
18
<p>Creates a unique page for each Member after checkout, giving the Admin access to write customized content for each specific member.</p>
19
<div class="actions">
20
<?php if($addon['enabled']) { ?>
14
function pmpro_addon_pmpro_user_pages_widget($addon)
15
{
16
?>
17
+ <div class="info">
18
<p>Creates a unique page for each Member after checkout, giving the Admin access to write customized content for each specific member.</p>
19
<div class="actions">
20
<?php if($addon['enabled']) { ?>
adminpages/addons/pmpro-woocommerce.php ADDED
@@ -0,0 +1,31 @@
1
+ <?php
2
+ /*
3
+ Addon: PMPro WooCommerce
4
+ Slug: pmpro-woocommerce
5
+ */
6
+ pmpro_add_addon('thirdparty', array(
7
+ 'title' => 'PMPro WooCommerce',
8
+ 'version' => '1.1',
9
+ 'widget' => 'pmpro_addon_pmpro_woocommerce_widget',
10
+ 'enabled' => function_exists('pmprowoo_add_membership_from_order')
11
+ )
12
+ );
13
+
14
+ function pmpro_addon_pmpro_woocommerce_widget($addon)
15
+ {
16
+ ?>
17
+ <img class="addon-thumb" src="<?php echo PMPRO_URL?>/adminpages/addons/images/pmpro-woocommerce.gif" />
18
+ <div class="info">
19
+ <p>Use WooCommerce to purchase membership or set members-only product pricing.</p>
20
+ <div class="actions">
21
+ <?php if($addon['enabled']) { ?>
22
+ <a href="<?php echo admin_url("plugins.php");?>" class="button">Enabled</a>
23
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-woocommerce/pmpro-woocommerce.php")) { ?>
24
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-woocommerce/pmpro-woocommerce.php'), 'activate-plugin_pmpro-woocommerce/pmpro-woocommerce.php')?>" class="button button-primary">Activate</a>
25
+ <?php } else { ?>
26
+ <a href="<?php echo wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-woocommerce'), 'install-plugin_pmpro-woocommerce'); ?>" class="button button-primary">Download</a>
27
+ <?php } ?>
28
+ </div>
29
+ </div> <!-- end info -->
30
+ <?php
31
+ }
adminpages/addons/pmpro-wp-affiliate.php CHANGED
@@ -19,10 +19,12 @@ function pmpro_addon_pmpro_wp_affiliate_widget($addon)
19
<p>Process an affiliate via WP Affiliate Platform after a PMPro checkout.</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
- <a target="_blank" href="https://gist.github.com/strangerstudios/3137539" class="button">Enabled</a>
23
<?php } else { ?>
24
- <a target="_blank" href="https://gist.github.com/strangerstudios/3137539" class="button button-primary">View Gist</a>
25
- <?php } ?>
26
</div>
27
</div> <!-- end info -->
28
<?php
19
<p>Process an affiliate via WP Affiliate Platform after a PMPro checkout.</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
+ <a href="https://github.com/strangerstudios/pmpro-wp-affiliate-platform/" class="button">Enabled</a>
23
+ <?php } elseif(file_exists(dirname(__FILE__) . "/../../../pmpro-wp-affiliate-platform/pmpro-wp-affiliate-platform.php")) { ?>
24
+ <a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=pmpro-wp-affiliate-platform/pmpro-wp-affiliate-platform.php'), 'activate-plugin_pmpro-wp-affiliate-platform/pmpro-wp-affiliate-platform.php')?>" class="button button-primary">Activate</a>
25
<?php } else { ?>
26
+ <a href="http://www.paidmembershipspro.com/wp-content/uploads/plugins/pmpro-wp-affiliate-platform.zip" class="button button-primary">Download</a>
27
+ <?php } ?>
28
</div>
29
</div> <!-- end info -->
30
<?php
adminpages/addons/tml.php CHANGED
@@ -7,7 +7,7 @@ pmpro_add_addon('recommended', array(
7
'title' => 'Theme My Login',
8
'widget' => 'pmpro_addon_tml_widget',
9
'enabled' => class_exists('Theme_My_Login'),
10
- 'version' => '6.3.8'
11
)
12
);
13
7
'title' => 'Theme My Login',
8
'widget' => 'pmpro_addon_tml_widget',
9
'enabled' => class_exists('Theme_My_Login'),
10
+ 'version' => '6.3.9'
11
)
12
);
13
adminpages/addons/wp-bouncer.php CHANGED
@@ -5,7 +5,7 @@
5
*/
6
pmpro_add_addon('repo', array(
7
'title' => 'WP Bouncer',
8
- 'version' => '1.0.1',
9
'widget' => 'pmpro_addon_wp_bouncer_widget',
10
'enabled' => class_exists('WP_Bouncer')
11
)
@@ -19,7 +19,7 @@ function pmpro_addon_wp_bouncer_widget($addon)
19
<p>Make sure users are only logged in from one computer or device at a time.</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
- <a href="https://github.com/strangerstudios/wp-bouncer/blob/master/readme.txt" class="button">Enabled</a>
23
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../wp-bouncer/wp-bouncer.php")) { ?>
24
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=wp-bouncer/wp-bouncer.php'), 'activate-plugin_wp-bouncer/wp-bouncer.php')?>" class="button button-primary">Activate</a>
25
<?php } else { ?>
5
*/
6
pmpro_add_addon('repo', array(
7
'title' => 'WP Bouncer',
8
+ 'version' => '1.1',
9
'widget' => 'pmpro_addon_wp_bouncer_widget',
10
'enabled' => class_exists('WP_Bouncer')
11
)
19
<p>Make sure users are only logged in from one computer or device at a time.</p>
20
<div class="actions">
21
<?php if($addon['enabled']) { ?>
22
+ <a href="http://wordpress.org/plugins/wp-bouncer/" class="button">Enabled</a>
23
<?php } elseif(file_exists(dirname(__FILE__) . "/../../../wp-bouncer/wp-bouncer.php")) { ?>
24
<a href="<?php echo wp_nonce_url(self_admin_url('plugins.php?action=activate&plugin=wp-bouncer/wp-bouncer.php'), 'activate-plugin_wp-bouncer/wp-bouncer.php')?>" class="button button-primary">Activate</a>
25
<?php } else { ?>
adminpages/admin_header.php CHANGED
@@ -92,6 +92,27 @@
92
$msgt .= " <a href=\"?page=pmpro-membershiplevels\">" . __("Please edit your levels", "pmpro") . "</a>.";
93
}
94
95
if(!empty($msg))
96
{
97
?>
92
$msgt .= " <a href=\"?page=pmpro-membershiplevels\">" . __("Please edit your levels", "pmpro") . "</a>.";
93
}
94
95
+ if(!pmpro_checkLevelForTwoCheckoutCompatibility())
96
+ {
97
+ $msg = -1;
98
+ $msgt = __("The billing details for some of your membership levels is not supported by TwoCheckout.", "pmpro");
99
+ if($view == "pmpro-membershiplevels" && !empty($_REQUEST['edit']) && $_REQUEST['edit'] > 0)
100
+ {
101
+ if(!pmpro_checkLevelForTwoCheckoutCompatibility($_REQUEST['edit']))
102
+ {
103
+ global $pmpro_twocheckout_error;
104
+ $pmpro_twocheckout_error = true;
105
+
106
+ $msg = -1;
107
+ $msgt = __("The billing details for this level are not supported by 2Checkout. Please review the notes in the Billing Details section below.", "pmpro");
108
+ }
109
+ }
110
+ elseif($view == "pmpro-membershiplevels")
111
+ $msgt .= " " . __("The levels with issues are highlighted below.", "pmpro");
112
+ else
113
+ $msgt .= " <a href=\"?page=pmpro-membershiplevels\">" . __("Please edit your levels", "pmpro") . "</a>.";
114
+ }
115
+
116
if(!empty($msg))
117
{
118
?>
adminpages/advancedsettings.php CHANGED
@@ -1,6 +1,6 @@
1
<?php
2
//only admins can get this
3
- if(!function_exists("current_user_can") || !current_user_can("manage_options"))
4
{
5
die(__("You do not have permissions to perform this action.", "pmpro"));
6
}
@@ -29,6 +29,13 @@
29
30
//footer link
31
pmpro_setOption("hide_footer_link");
32
33
//assume success
34
$msg = true;
@@ -56,17 +63,17 @@
56
//default settings
57
if(!$nonmembertext)
58
{
59
- $nonmembertext = "This content is for !!levels!! members only. <a href=\"" . wp_login_url() . "?action=register\">Register here</a>.";
60
pmpro_setOption("nonmembertext", $nonmembertext);
61
}
62
if(!$notloggedintext)
63
{
64
- $notloggedintext = "Please <a href=\"" . wp_login_url( get_permalink() ) . "\">login</a> to view this content. (<a href=\"" . wp_login_url() . "?action=register\">Register here</a>.)";
65
pmpro_setOption("notloggedintext", $notloggedintext);
66
}
67
if(!$rsstext)
68
{
69
- $rsstext = "This content is for members only. Visit the site and log in/register to read.";
70
pmpro_setOption("rsstext", $rsstext);
71
}
72
@@ -237,9 +244,73 @@ if(pmpro_displayAds())
237
<option value="1" <?php if($hide_footer_link == 1) { ?>selected="selected"<?php } ?>>Yes - Hide the link.</option>
238
</select>
239
</td>
240
- </tr>
241
- */ ?>
242
- </tbody>
243
</table>
244
<script>
245
function pmpro_updateHideAdsTRs()
@@ -281,7 +352,7 @@ if(pmpro_displayAds())
281
</script>
282
283
<p class="submit">
284
- <input name="savesettings" type="submit" class="button-primary" value="<?php _e('Save Settings', 'pmpro');?>" />
285
</p>
286
</form>
287
1
<?php
2
//only admins can get this
3
+ if(!function_exists("current_user_can") || (!current_user_can("manage_options") && !current_user_can("pmpro_advancedsettings")))
4
{
5
die(__("You do not have permissions to perform this action.", "pmpro"));
6
}
29
30
//footer link
31
pmpro_setOption("hide_footer_link");
32
+
33
+ // custom settings (added with pmpro_custom_advanced_settings hook)
34
+ foreach($_REQUEST as $key => $value ) {
35
+ if (strpos($key, 'custom_') === 0) {
36
+ pmpro_setOption($key);
37
+ }
38
+ }
39
40
//assume success
41
$msg = true;
63
//default settings
64
if(!$nonmembertext)
65
{
66
+ $nonmembertext = sprintf( __( 'This content is for !!levels!! members only. <a href="%s">Register here</a>.', 'pmpro' ), wp_login_url() . "?action=register" );
67
pmpro_setOption("nonmembertext", $nonmembertext);
68
}
69
if(!$notloggedintext)
70
{
71
+ $notloggedintext = sprintf( __( 'Please <a href="%s">login</a> to view this content. (<a href="%s">Register here</a>.)', 'pmpro' ), wp_login_url( get_permalink() ), wp_login_url() . "?action=register" );
72
pmpro_setOption("notloggedintext", $notloggedintext);
73
}
74
if(!$rsstext)
75
{
76
+ $rsstext = __( 'This content is for members only. Visit the site and log in/register to read.', 'pmpro' );
77
pmpro_setOption("rsstext", $rsstext);
78
}
79
244
<option value="1" <?php if($hide_footer_link == 1) { ?>selected="selected"<?php } ?>>Yes - Hide the link.</option>
245
</select>
246
</td>
247
+ </tr>
248
+ */
249
+
250
+ // Filter to Add More Advanced Settings for Misc Plugin Options, etc.
251
+ if (has_action('pmpro_custom_advanced_settings')) {
252
+ $custom_fields = apply_filters('pmpro_custom_advanced_settings', $custom_fields);
253
+ foreach ($custom_fields as $field) {
254
+ ?>
255
+ <tr>
256
+ <th valign="top" scope="row">
257
+ <label
258
+ for="<?php _e($field['field_name'], 'pmpro'); ?>"><?php _e($field['label'], 'pmpro'); ?></label>
259
+ </th>
260
+ <td>
261
+ <?php
262
+ switch ($field['field_type']) {
263
+ case 'select':
264
+ ?>
265
+ <select id="<?php _e($field['field_name'], 'pmpro'); ?>"
266
+ name="<?php _e($field['field_name'], 'pmpro'); ?>">
267
+ <?php foreach ($field['options'] as $option) {
268
+ ?>
269
+ <option value="<?php _e($option, 'pmpro'); ?>"
270
+ <?php
271
+ if ($option == pmpro_getOption($field['field_name'])) {
272
+ _e('selected', 'pmpro');
273
+ }
274
+ ?>
275
+ ><?php _e($option, 'pmpro'); ?></option>
276
+ <?php
277
+ } ?>
278
+ </select>
279
+ <?php
280
+ break;
281
+ case 'text':
282
+ ?>
283
+ <input id="<?php _e($field['field_name'], 'pmpro'); ?>"
284
+ name="<?php _e($field['field_name'], 'pmpro'); ?>"
285
+ type="<?php _e($field['field_type'], 'pmpro'); ?>"
286
+ value="<?php echo pmpro_getOption($field['field_name']); ?> ">
287
+ <?php
288
+ break;
289
+ case 'textarea':
290
+ ?>
291
+ <textarea id="<?php _e($field['field_name'], 'pmpro'); ?>"
292
+ name="<?php _e($field['field_name'], 'pmpro'); ?>">
293
+ <?php echo pmpro_getOption($field['field_name']); ?>
294
+ </textarea>
295
+ <?php
296
+ break;
297
+ default:
298
+ break;
299
+ }
300
+ if (!empty($field['description'])) {
301
+ ?>
302
+ <br>
303
+ <small><?php _e($field['description'], 'pmpro'); ?></small>
304
+ <?php
305
+ }
306
+ ?>
307
+ </td>
308
+ <?php
309
+ }
310
+ }
311
+ ?>
312
+ </tr>
313
+ </tbody>
314
</table>
315
<script>
316
function pmpro_updateHideAdsTRs()
352
</script>
353
354
<p class="submit">
355
+ <input name="savesettings" type="submit" class="button button-primary" value="<?php _e('Save Settings', 'pmpro');?>" />
356
</p>
357
</form>
358
adminpages/dashboard.php CHANGED
@@ -105,9 +105,9 @@
105
106
echo '</ul>';
107
echo '<br class="clear"/><div style="margin-top:10px;border-top: 1px solid #ddd; padding-top: 10px; text-align:center;">';
108
- echo '<a href="'.$pmpro_feed.'"><img src="'.get_bloginfo('wpurl').'/wp-includes/images/rss.png" alt=""/> Subscribe with RSS</a>';
109
echo ' &nbsp; &nbsp; &nbsp; ';
110
- echo '<a href="http://www.paidmembershipspro.com/"><img src="'.get_bloginfo('wpurl').'/wp-includes/images/wpmini-blue.png" alt=""/> View Online</a>';
111
echo '<form class="alignright" method="post"><input type="hidden" name="pmpro_removedbwidget" value="true"/><input title="Remove this widget from all users dashboards" class="button" type="submit" value="X"/></form>';
112
echo '</div>';
113
}
105
106
echo '</ul>';
107
echo '<br class="clear"/><div style="margin-top:10px;border-top: 1px solid #ddd; padding-top: 10px; text-align:center;">';
108
+ echo '<a target="_blank" href="'.$pmpro_feed.'"><img src="'.get_bloginfo('wpurl').'/wp-includes/images/rss.png" alt=""/> Subscribe with RSS</a>';
109
echo ' &nbsp; &nbsp; &nbsp; ';
110
+ echo '<a target="_blank" href="http://www.paidmembershipspro.com/blog/">View Online</a>';
111
echo '<form class="alignright" method="post"><input type="hidden" name="pmpro_removedbwidget" value="true"/><input title="Remove this widget from all users dashboards" class="button" type="submit" value="X"/></form>';
112
echo '</div>';
113
}
adminpages/discountcodes.php CHANGED
@@ -189,7 +189,7 @@
189
if($wpdb->query($sqlQuery) !== false)
190
{
191
//okay
192
- do_action("pmpro_save_discount_code_level", $saveid, $level_id);
193
}
194
else
195
{
@@ -221,6 +221,9 @@
221
$code = $wpdb->get_var("SELECT code FROM $wpdb->pmpro_discount_codes WHERE id = '" . $delete . "' LIMIT 1");
222
if(!empty($code))
223
{
224
//delete the code levels
225
$r1 = $wpdb->query("DELETE FROM $wpdb->pmpro_discount_codes_levels WHERE code_id = '" . $delete . "'");
226
@@ -434,13 +437,13 @@
434
</tr>
435
436
<tr class="recurring_info" <?php if(!pmpro_isLevelRecurring($level)) {?>style="display: none;"<?php } ?>>
437
- <th scope="row" valign="top"><label for="billing_amount"><?php _e('Billing Ammount', 'pmpro');?>:</label></th>
438
<td>
439
<?php echo $pmpro_currency_symbol?><input name="billing_amount[]" type="text" size="20" value="<?php echo str_replace("\"", "&quot;", stripslashes($level->billing_amount))?>" /> <small>per</small>
440
<input name="cycle_number[]" type="text" size="10" value="<?php echo str_replace("\"", "&quot;", stripslashes($level->cycle_number))?>" />
441
<select name="cycle_period[]" onchange="updateCyclePeriod();">
442
<?php
443
- $cycles = array( 'Day(s)' => 'Day', 'Week(s)' => 'Week', 'Month(s)' => 'Month', 'Year(s)' => 'Year' );
444
foreach ( $cycles as $name => $value ) {
445
echo "<option value='$value'";
446
if ( $level->cycle_period == $value ) echo " selected='selected'";
@@ -477,7 +480,7 @@
477
478
<tr>
479
<th scope="row" valign="top"><label><?php _e('Membership Expiration', 'pmpro');?>:</label></th>
480
- <td><input id="expiration" name="expiration[]" type="checkbox" value="<?php echo $level->id?>" <?php if(pmpro_isLevelExpiring($level)) { echo "checked='checked'"; } ?> onclick="if(jQuery(this).is(':checked')) { jQuery(this).parent().parent().siblings('.expiration_info').show(); } else { jQuery(this).parent().parent().siblings('.expiration_info').hide();}" /> <small><?php _e('Check this to set an expiration date for new sign ups.', 'pmpro');?></small></td>
481
</tr>
482
483
<tr class="expiration_info" <?php if(!pmpro_isLevelExpiring($level)) {?>style="display: none;"<?php } ?>>
@@ -486,7 +489,7 @@
486
<input id="expiration_number" name="expiration_number[]" type="text" size="10" value="<?php echo str_replace("\"", "&quot;", stripslashes($level->expiration_number))?>" />
487
<select id="expiration_period" name="expiration_period[]">
488
<?php
489
- $cycles = array( 'Day(s)' => 'Day', 'Week(s)' => 'Week', 'Month(s)' => 'Month', 'Year(s)' => 'Year' );
490
foreach ( $cycles as $name => $value ) {
491
echo "<option value='$value'";
492
if ( $level->expiration_period == $value ) echo " selected='selected'";
@@ -494,7 +497,7 @@
494
}
495
?>
496
</select>
497
- <br /><small><?php _e('How long before the expiration expires. Note that any future payments will be cancelled when the membership expires.', 'pmpro');?></small>
498
</td>
499
</tr>
500
</tbody>
@@ -513,8 +516,8 @@
513
</div>
514
515
<p class="submit topborder">
516
- <input name="save" type="submit" class="button-primary" value="Save Code" />
517
- <input name="cancel" type="button" value="Cancel" onclick="location.href='<?php echo get_admin_url(NULL, '/admin.php?page=pmpro-discountcodes')?>';" />
518
</p>
519
</form>
520
</div>
@@ -523,7 +526,7 @@
523
524
<h2>
525
<?php _e('Memberships Discount Codes', 'pmpro');?>
526
- <a href="admin.php?page=pmpro-discountcodes&edit=-1" class="button add-new-h2"><?php _e('Add New Discount Code', 'pmpro');?></a>
527
</h2>
528
529
<?php if(!empty($pmpro_msg)) { ?>
@@ -540,7 +543,14 @@
540
</form>
541
542
<br class="clear" />
543
-
544
<table class="widefat">
545
<thead>
546
<tr>
@@ -550,19 +560,13 @@
550
<th><?php _e('Expires', 'pmpro');?></th>
551
<th><?php _e('Uses', 'pmpro');?></th>
552
<th><?php _e('Levels', 'pmpro');?></th>
553
<th></th>
554
<th></th>
555
</tr>
556
</thead>
557
<tbody>
558
<?php
559
- $sqlQuery = "SELECT *, UNIX_TIMESTAMP(starts) as starts, UNIX_TIMESTAMP(expires) as expires FROM $wpdb->pmpro_discount_codes ";
560
- if(!empty($s))
561
- $sqlQuery .= "WHERE code LIKE '%$s%' ";
562
- $sqlQuery .= "ORDER BY id ASC";
563
-
564
- $codes = $wpdb->get_results($sqlQuery, OBJECT);
565
-
566
if(!$codes)
567
{
568
?>
@@ -610,6 +614,7 @@
610
echo "None";
611
?>
612
</td>
613
<td>
614
<a href="?page=pmpro-discountcodes&edit=<?php echo $code->id?>"><?php _e('edit', 'pmpro');?></a>
615
</td>
@@ -628,4 +633,4 @@
628
629
<?php
630
require_once(dirname(__FILE__) . "/admin_footer.php");
631
- ?>
189
if($wpdb->query($sqlQuery) !== false)
190
{
191
//okay
192
+ do_action("pmpro_save_discount_code_level", $edit, $level_id);
193
}
194
else
195
{
221
$code = $wpdb->get_var("SELECT code FROM $wpdb->pmpro_discount_codes WHERE id = '" . $delete . "' LIMIT 1");
222
if(!empty($code))
223
{
224
+ //action
225
+ do_action("pmpro_delete_discount_code", $delete);
226
+
227
//delete the code levels
228
$r1 = $wpdb->query("DELETE FROM $wpdb->pmpro_discount_codes_levels WHERE code_id = '" . $delete . "'");
229
437
</tr>
438
439
<tr class="recurring_info" <?php if(!pmpro_isLevelRecurring($level)) {?>style="display: none;"<?php } ?>>
440
+ <th scope="row" valign="top"><label for="billing_amount"><?php _e('Billing Amount', 'pmpro');?>:</label></th>
441
<td>
442
<?php echo $pmpro_currency_symbol?><input name="billing_amount[]" type="text" size="20" value="<?php echo str_replace("\"", "&quot;", stripslashes($level->billing_amount))?>" /> <small>per</small>
443
<input name="cycle_number[]" type="text" size="10" value="<?php echo str_replace("\"", "&quot;", stripslashes($level->cycle_number))?>" />
444
<select name="cycle_period[]" onchange="updateCyclePeriod();">
445
<?php
446
+ $cycles = array( __('Day(s)', 'pmpro') => 'Day', __('Week(s)', 'pmpro') => 'Week', __('Month(s)', 'pmpro') => 'Month', __('Year(s)', 'pmpro') => 'Year' );
447
foreach ( $cycles as $name => $value ) {
448
echo "<option value='$value'";
449
if ( $level->cycle_period == $value ) echo " selected='selected'";
480
481
<tr>
482
<th scope="row" valign="top"><label><?php _e('Membership Expiration', 'pmpro');?>:</label></th>
483
+ <td><input id="expiration" name="expiration[]" type="checkbox" value="<?php echo $level->id?>" <?php if(pmpro_isLevelExpiring($level)) { echo "checked='checked'"; } ?> onclick="if(jQuery(this).is(':checked')) { jQuery(this).parent().parent().siblings('.expiration_info').show(); } else { jQuery(this).parent().parent().siblings('.expiration_info').hide();}" /> <?php _e('Check this to set when membership access expires.', 'pmpro');?></td>
484
</tr>
485
486
<tr class="expiration_info" <?php if(!pmpro_isLevelExpiring($level)) {?>style="display: none;"<?php } ?>>
489
<input id="expiration_number" name="expiration_number[]" type="text" size="10" value="<?php echo str_replace("\"", "&quot;", stripslashes($level->expiration_number))?>" />
490
<select id="expiration_period" name="expiration_period[]">
491
<?php
492
+ $cycles = array( __('Day(s)', 'pmpro') => 'Day', __('Week(s)', 'pmpro') => 'Week', __('Month(s)', 'pmpro') => 'Month', __('Year(s)', 'pmpro') => 'Year' );
493
foreach ( $cycles as $name => $value ) {
494
echo "<option value='$value'";
495
if ( $level->expiration_period == $value ) echo " selected='selected'";
497
}
498
?>
499
</select>
500
+ <br /><small><?php _e('Set the duration of membership access. Note that the any future payments (recurring subscription, if any) will be cancelled when the membership expires.', 'pmpro');?></small>
501
</td>
502
</tr>
503
</tbody>
516
</div>
517
518
<p class="submit topborder">
519
+ <input name="save" type="submit" class="button button-primary" value="Save Code" />
520
+ <input name="cancel" type="button" class="button button-secondary" value="Cancel" onclick="location.href='<?php echo get_admin_url(NULL, '/admin.php?page=pmpro-discountcodes')?>';" />
521
</p>
522
</form>
523
</div>
526
527
<h2>
528
<?php _e('Memberships Discount Codes', 'pmpro');?>
529
+ <a href="admin.php?page=pmpro-discountcodes&edit=-1" class="add-new-h2"><?php _e('Add New Discount Code', 'pmpro');?></a>
530
</h2>
531
532
<?php if(!empty($pmpro_msg)) { ?>
543
</form>
544
545
<br class="clear" />
546
+ <?php
547
+ $sqlQuery = "SELECT *, UNIX_TIMESTAMP(starts) as starts, UNIX_TIMESTAMP(expires) as expires FROM $wpdb->pmpro_discount_codes ";
548
+ if(!empty($s))
549
+ $sqlQuery .= "WHERE code LIKE '%$s%' ";
550
+ $sqlQuery .= "ORDER BY id ASC";
551
+
552
+ $codes = $wpdb->get_results($sqlQuery, OBJECT);
553
+ ?>
554
<table class="widefat">
555
<thead>
556
<tr>
560
<th><?php _e('Expires', 'pmpro');?></th>
561
<th><?php _e('Uses', 'pmpro');?></th>
562
<th><?php _e('Levels', 'pmpro');?></th>
563
+ <?php do_action("pmpro_discountcodes_extra_cols_header", $codes);?>
564
<th></th>
565
<th></th>
566
</tr>
567
</thead>
568
<tbody>
569
<?php
570
if(!$codes)
571
{
572
?>
614
echo "None";
615
?>
616
</td>
617
+ <?php do_action("pmpro_discountcodes_extra_cols_body", $code);?>
618
<td>
619
<a href="?page=pmpro-discountcodes&edit=<?php echo $code->id?>"><?php _e('edit', 'pmpro');?></a>
620
</td>
633
634
<?php
635
require_once(dirname(__FILE__) . "/admin_footer.php");
636
+ ?>
adminpages/emailsettings.php CHANGED
@@ -1,152 +1,181 @@
1
- <?php
2
- //only admins can get this
3
- if(!function_exists("current_user_can") || (!current_user_can("manage_options") && !current_user_can("pmpro_emailsettings")))
4
- {
5
- die(__("You do not have permissions to perform this action.", "pmpro"));
6
- }
7
-
8
- global $wpdb, $msg, $msgt;
9
-
10
- //get/set settings
11
- global $pmpro_pages;
12
- if(!empty($_REQUEST['savesettings']))
13
- {
14
- //email options
15
- pmpro_setOption("from_email");
16
- pmpro_setOption("from_name");
17
-
18
- pmpro_setOption("email_admin_checkout");
19
- pmpro_setOption("email_admin_changes");
20
- pmpro_setOption("email_admin_cancels");
21
- pmpro_setOption("email_admin_billing");
22
-
23
- pmpro_setOption("email_member_notification");
24
-
25
- //assume success
26
- $msg = true;
27
- $msgt = "Your email settings have been updated.";
28
- }
29
-
30
- $from_email = pmpro_getOption("from_email");
31
- $from_name = pmpro_getOption("from_name");
32
-
33
- $email_admin_checkout = pmpro_getOption("email_admin_checkout");
34
- $email_admin_changes = pmpro_getOption("email_admin_changes");
35
- $email_admin_cancels = pmpro_getOption("email_admin_cancels");
36
- $email_admin_billing = pmpro_getOption("email_admin_billing");
37
-
38
- $email_member_notification = pmpro_getOption("email_member_notification");
39
-
40
- if(empty($from_email))
41
- {
42
- $parsed = parse_url(home_url());
43
- $hostname = $parsed[host];
44
- $hostparts = split("\.", $hostname);
45
- $email_domain = $hostparts[count($hostparts) - 2] . "." . $hostparts[count($hostparts) - 1];
46
- $from_email = "wordpress@" . $email_domain;
47
- pmpro_setOption("from_email", $from_email);
48
- }
49
-
50
- if(empty($from_name))
51
- {
52
- $from_name = "WordPress";
53
- pmpro_setOption("from_name", $from_name);
54
- }
55
-
56
- require_once(dirname(__FILE__) . "/admin_header.php");
57
- ?>
58
-
59
- <form action="" method="post" enctype="multipart/form-data">
60
- <h2><?php _e('Email Settings', 'pmpro');?></h2>
61
- <p><?php _e('By default, system generated emails are sent from <em><strong>wordpress@yourdomain.com</strong></em>. You can update this from address using the fields below.', 'pmpro');?></p>
62
-
63
- <p><?php _e('To modify the appearance of system generated emails, add the files <em>email_header.html</em> and <em>email_footer.html</em> to your theme\'s directory. This will modify both the WordPress default messages as well as messages generated by Paid Memberships Pro. <a title="Paid Memberships Pro - Member Communications" target="_blank" href="http://www.paidmembershipspro.com/documentation/member-communications/">Click here to learn more about Paid Memberships Pro emails</a>.', 'pmpro');?></p>
64
-
65
- <table class="form-table">
66
- <tbody>
67
- <tr>
68
- <th scope="row" valign="top">
69
- <label for="from_email"><?php _e('From Email', 'pmpro');?>:</label>
70
- </th>
71
- <td>
72
- <input type="text" name="from_email" size="60" value="<?php echo $from_email?>" />
73
- </td>
74
- </tr>
75
- <tr>
76
- <th scope="row" valign="top">
77
- <label for="from_name"><?php _e('From Name', 'pmpro');?>:</label>
78
- </th>
79
- <td>
80
- <input type="text" name="from_name" size="60" value="<?php echo $from_name?>" />
81
- </td>
82
- </tr>
83
- </tbody>
84
- </table>
85
-
86
- <h3><?php _e('Send the site admin emails', 'pmpro');?>:</h3>
87
-
88
- <table class="form-table">
89
- <tbody>
90
- <tr>
91
- <th scope="row" valign="top">
92
- <label for="email_admin_checkout"><?php _e('Checkout', 'pmpro');?>:</label>
93
- </th>
94
- <td>
95
- <input type="checkbox" id="email_admin_checkout" name="email_admin_checkout" value="1" <?php if(!empty($email_admin_checkout)) { ?>checked="checked"<?php } ?> />
96
- <?php _e('when a member checks out.', 'pmpro');?>
97
- </td>
98
- </tr>
99
- <tr>
100
- <th scope="row" valign="top">
101
- <label for="email_admin_changes"><?php _e('Admin Changes', 'pmpro');?>:</label>
102
- </th>
103
- <td>
104
- <input type="checkbox" id="email_admin_changes" name="email_admin_changes" value="1" <?php if(!empty($email_admin_changes)) { ?>checked="checked"<?php } ?> />
105
- <?php _e('when an admin changes a user\'s membership level through the dashboard.', 'pmpro');?>
106
- </td>
107
- </tr>
108
- <tr>
109
- <th scope="row" valign="top">
110
- <label for="email_admin_cancels"><?php _e('Cancellation', 'pmpro');?>:</label>
111
- </th>
112
- <td>
113
- <input type="checkbox" id="email_admin_cancels" name="email_admin_cancels" value="1" <?php if(!empty($email_admin_cancels)) { ?>checked="checked"<?php } ?> />
114
- <?php _e('when a user cancels his or her account.', 'pmpro');?>
115
- </td>
116
- </tr>
117
- <tr>
118
- <th scope="row" valign="top">
119
- <label for="email_admin_billing"><?php _e('Bill Updates', 'pmpro');?>:</label>
120
- </th>
121
- <td>
122
- <input type="checkbox" id="email_admin_billing" name="email_admin_billing" value="1" <?php if(!empty($email_admin_billing)) { ?>checked="checked"<?php } ?> />
123
- <?php _e('when a user updates his or her billing information.', 'pmpro');?>
124
- </td>
125
- </tr>
126
- </tbody>
127
- </table>
128
-
129
- <h3><?php _e('Send members emails', 'pmpro');?>:</h3>
130
-
131
- <table class="form-table">
132
- <tbody>
133
- <tr>
134
- <th scope="row" valign="top">
135
- <label for="email_admin_checkout"><?php _e('New Users', 'pmpro');?>:</label>
136
- </th>
137
- <td>
138
- <input type="checkbox" id="email_member_notification" name="email_member_notification" value="1" <?php if(!empty($email_member_notification)) { ?>checked="checked"<?php } ?> />
139
- <?php _e('Default WP notification email. (Recommended: Leave unchecked. Members will still get an email confirmation from PMPro after checkout.)', 'pmpro');?>
140
- </td>
141
- </tr>
142
- </tbody>
143
- </table>
144
-
145
- <p class="submit">
146
- <input name="savesettings" type="submit" class="button-primary" value="Save Settings" />
147
- </p>
148
- </form>
149
-
150
- <?php
151
- require_once(dirname(__FILE__) . "/admin_footer.php");
152
- ?>
1
+ <?php
2
+ //only admins can get this
3
+ if(!function_exists("current_user_can") || (!current_user_can("manage_options") && !current_user_can("pmpro_emailsettings")))
4
+ {
5
+ die(__("You do not have permissions to perform this action.", "pmpro"));
6
+ }
7
+
8
+ global $wpdb, $msg, $msgt;
9
+
10
+ //get/set settings
11
+ global $pmpro_pages;
12
+ if(!empty($_REQUEST['savesettings']))
13
+ {
14
+ //email options
15
+ pmpro_setOption("from_email");
16
+ pmpro_setOption("from_name");
17
+ pmpro_setOption("only_filter_pmpro_emails");
18
+
19
+ pmpro_setOption("email_admin_checkout");
20
+ pmpro_setOption("email_admin_changes");
21
+ pmpro_setOption("email_admin_cancels");
22
+ pmpro_setOption("email_admin_billing");
23
+
24
+ pmpro_setOption("email_member_notification");
25
+
26
+ //assume success
27
+ $msg = true;
28
+ $msgt = "Your email settings have been updated.";
29
+ }
30
+
31
+ $from_email = pmpro_getOption("from_email");
32
+ $from_name = pmpro_getOption("from_name");
33
+ $only_filter_pmpro_emails = pmpro_getOption("only_filter_pmpro_emails");
34
+
35
+ $email_admin_checkout = pmpro_getOption("email_admin_checkout");
36
+ $email_admin_changes = pmpro_getOption("email_admin_changes");
37
+ $email_admin_cancels = pmpro_getOption("email_admin_cancels");
38
+ $email_admin_billing = pmpro_getOption("email_admin_billing");
39
+
40
+ $email_member_notification = pmpro_getOption("email_member_notification");
41
+
42
+ if(empty($from_email))
43
+ {
44
+ $parsed = parse_url(home_url());
45
+ $hostname = $parsed[host];
46
+ $hostparts = split("\.", $hostname);
47
+ $email_domain = $hostparts[count($hostparts) - 2] . "." . $hostparts[count($hostparts) - 1];
48
+ $from_email = "wordpress@" . $email_domain;
49
+ pmpro_setOption("from_email", $from_email);
50
+ }
51
+
52
+ if(empty($from_name))
53
+ {
54
+ $from_name = "WordPress";
55
+ pmpro_setOption("from_name", $from_name);
56
+ }
57
+
58
+ // default from email wordpress@sitename
59
+ $sitename = strtolower( $_SERVER['SERVER_NAME'] );
60
+ if ( substr( $sitename, 0, 4 ) == 'www.' ) {
61
+ $sitename = substr( $sitename, 4 );
62
+ }
63
+ $default_from_email = 'wordpress@' . $sitename;
64
+
65
+ require_once(dirname(__FILE__) . "/admin_header.php");
66
+ ?>
67
+
68
+ <form action="" method="post" enctype="multipart/form-data">
69
+ <h2><?php _e('Email Settings', 'pmpro');?></h2>
70
+ <p><?php _e('By default, system generated emails are sent from <em><strong>wordpress@yourdomain.com</strong></em>. You can update this from address using the fields below.', 'pmpro');?></p>
71
+
72
+ <p><?php _e('To modify the appearance of system generated emails, add the files <em>email_header.html</em> and <em>email_footer.html</em> to your theme\'s directory. This will modify both the WordPress default messages as well as messages generated by Paid Memberships Pro. <a title="Paid Memberships Pro - Member Communications" target="_blank" href="http://www.paidmembershipspro.com/documentation/member-communications/">Click here to learn more about Paid Memberships Pro emails</a>.', 'pmpro');?></p>
73
+
74
+ <table class="form-table">
75
+ <tbody>
76
+ <tr>
77
+ <th scope="row" valign="top">
78
+ <label for="from_email"><?php _e('From Email', 'pmpro');?>:</label>
79
+ </th>
80
+ <td>
81
+ <input type="text" name="from_email" size="60" value="<?php echo $from_email?>" />
82
+ </td>
83
+ </tr>
84
+ <tr>
85
+ <th scope="row" valign="top">
86
+ <label for="from_name"><?php _e('From Name', 'pmpro');?>:</label>
87
+ </th>
88
+ <td>
89
+ <input type="text" name="from_name" size="60" value="<?php echo $from_name?>" />
90
+ </td>
91
+ </tr>
92
+ <tr>
93
+ <th scope="row" valign="top">
94
+ <label for="only_filter_pmpro_emails"><?php _e('Only Filter PMPro Emails?', 'pmpro');?>:</label>
95
+ </th>
96
+ <td>
97
+ <input type="checkbox" id="only_filter_pmpro_emails" name="only_filter_pmpro_emails" value="1" <?php if(!empty($only_filter_pmpro_emails)) { ?>checked="checked"<?php } ?> />
98
+ <?php _e('If unchecked, all emails from "WordPress &lt;' . $default_from_email . '&gt;" will be filtered to use the above settings.', 'pmpro');?>
99
+ </td>
100
+ </tr>
101
+ </tbody>
102
+ </table>
103
+
104
+ <?php /* going to put something like this here in next version
105
+ <h3><?php _e('Modify System-generated Email Templates', 'pmpro');?>:</h3>
106
+ <?php
107
+ if (function_exists('pmproet_scripts'))
108
+ {
109
+ _e('You have installed the PMPro Email Templates add on. <a href="' . admin_url('admin.php?page=pmpro-email-templates') . '">Click here to modify email templates</a>');
110
+ }
111
+ ?>
112
+ <p><?php _e('To modify the subject line and body content of system generated emails, <a title="Paid Memberships Pro - Email Templates Plugin" target="_blank" href="' . wp_nonce_url(self_admin_url('update.php?action=install-plugin&plugin=pmpro-email-templates-addon'), 'install-plugin_pmpro-email-templates-addon') . '">Install and Activate the PMPro Email Templates add on</a>.', 'pmpro'); ?></p>
113
+ */ ?>
114
+
115
+ <h3><?php _e('Send the site admin emails', 'pmpro');?>:</h3>
116
+
117
+ <table class="form-table">
118
+ <tbody>
119
+ <tr>
120
+ <th scope="row" valign="top">
121
+ <label for="email_admin_checkout"><?php _e('Checkout', 'pmpro');?>:</label>
122
+ </th>
123
+ <td>
124
+ <input type="checkbox" id="email_admin_checkout" name="email_admin_checkout" value="1" <?php if(!empty($email_admin_checkout)) { ?>checked="checked"<?php } ?> />
125
+ <?php _e('when a member checks out.', 'pmpro');?>
126
+ </td>
127
+ </tr>
128
+ <tr>
129
+ <th scope="row" valign="top">
130
+ <label for="email_admin_changes"><?php _e('Admin Changes', 'pmpro');?>:</label>
131
+ </th>
132
+ <td>
133
+ <input type="checkbox" id="email_admin_changes" name="email_admin_changes" value="1" <?php if(!empty($email_admin_changes)) { ?>checked="checked"<?php } ?> />
134
+ <?php _e('when an admin changes a user\'s membership level through the dashboard.', 'pmpro');?>
135
+ </td>
136
+ </tr>
137
+ <tr>
138
+ <th scope="row" valign="top">
139
+ <label for="email_admin_cancels"><?php _e('Cancellation', 'pmpro');?>:</label>
140
+ </th>
141
+ <td>
142
+ <input type="checkbox" id="email_admin_cancels" name="email_admin_cancels" value="1" <?php if(!empty($email_admin_cancels)) { ?>checked="checked"<?php } ?> />
143
+ <?php _e('when a user cancels his or her account.', 'pmpro');?>
144
+ </td>
145
+ </tr>
146
+ <tr>
147
+ <th scope="row" valign="top">
148
+ <label for="email_admin_billing"><?php _e('Bill Updates', 'pmpro');?>:</label>
149
+ </th>
150
+ <td>
151
+ <input type="checkbox" id="email_admin_billing" name="email_admin_billing" value="1" <?php if(!empty($email_admin_billing)) { ?>checked="checked"<?php } ?> />
152
+ <?php _e('when a user updates his or her billing information.', 'pmpro');?>
153
+ </td>
154
+ </tr>
155
+ </tbody>
156
+ </table>
157
+
158
+ <h3><?php _e('Send members emails', 'pmpro');?>:</h3>
159
+
160
+ <table class="form-table">
161
+ <tbody>
162
+ <tr>
163
+ <th scope="row" valign="top">
164
+ <label for="email_admin_checkout"><?php _e('New Users', 'pmpro');?>:</label>
165
+ </th>
166
+ <td>
167
+ <input type="checkbox" id="email_member_notification" name="email_member_notification" value="1" <?php if(!empty($email_member_notification)) { ?>checked="checked"<?php } ?> />
168
+ <?php _e('Default WP notification email. (Recommended: Leave unchecked. Members will still get an email confirmation from PMPro after checkout.)', 'pmpro');?>
169
+ </td>
170
+ </tr>
171
+ </tbody>
172
+ </table>
173
+
174
+ <p class="submit">
175
+ <input name="savesettings" type="submit" class="button-primary" value="Save Settings" />
176
+ </p>
177
+ </form>
178
+
179
+ <?php
180
+ require_once(dirname(__FILE__) . "/admin_footer.php");
181
+ ?>
adminpages/functions.php CHANGED
@@ -1,4 +1,23 @@
1
<?php
2
/*
3
Checks if PMPro settings are complete or if there are any errors.
4
*/
@@ -21,11 +40,11 @@ function pmpro_checkLevelForStripeCompatibility($level = NULL)
21
/*
22
Stripe currently does not support:
23
* Trial Amounts > 0.
24
- * Daily or Weekly billing periods.
25
* Billing Limits.
26
*/
27
if($level->trial_amount > 0 ||
28
- ($level->cycle_number > 0 && ($level->cycle_period == "Day" || $level->cycle_period == "Week")) ||
29
$level->billing_limit > 0)
30
{
31
return false;
@@ -41,7 +60,7 @@ function pmpro_checkLevelForStripeCompatibility($level = NULL)
41
42
//check this level
43
if($level->trial_amount > 0 ||
44
- ($level->cycle_number > 0 && ($level->cycle_period == "Day" || $level->cycle_period == "Week")) ||
45
$level->billing_limit > 0)
46
{
47
return false;
@@ -155,3 +174,49 @@ function pmpro_checkLevelForBraintreeCompatibility($level = NULL)
155
return true;
156
}
157
1
<?php
2
+ /****************************************************************
3
+
4
+ IMPORTANT. PLEASE READ.
5
+
6
+ DO NOT EDIT THIS FILE or any other file in the /wp-content/plugins/paid-memberships-pro/ directory.
7
+ Doing so could break the PMPro plugin and/or keep you from upgrading this plugin in the future.
8
+ We regularly release updates to the plugin, including important security fixes and new features.
9
+ You want to be able to upgrade.
10
+
11
+ If you were asked to insert code into "your functions.php file", it was meant that you edit the functions.php
12
+ in the root folder of your active theme. e.g. /wp-content/themes/twentytwelve/functions.php
13
+ You can also create a custom plugin to place customization code into. Instructions are here:
14
+ http://www.paidmembershipspro.com/2012/08/create-a-plugin-for-pmpro-customizations/
15
+
16
+ Further documentation for customizing Paid Memberships Pro can be found here:
17
+ http://www.paidmembershipspro.com/documentation/
18
+
19
+ ****************************************************************/
20
+
21
/*
22
Checks if PMPro settings are complete or if there are any errors.
23
*/
40
/*
41
Stripe currently does not support:
42
* Trial Amounts > 0.
43
+ * Daily billing periods.
44
* Billing Limits.
45
*/
46
if($level->trial_amount > 0 ||
47
+ ($level->cycle_number > 0 && $level->cycle_period == "Day") ||
48
$level->billing_limit > 0)
49
{
50
return false;
60
61
//check this level
62
if($level->trial_amount > 0 ||
63
+ ($level->cycle_number > 0 && $level->cycle_period == "Day") ||
64
$level->billing_limit > 0)
65
{
66
return false;
174
return true;
175
}
176
177
+ /*
178
+ Checks if PMPro settings are complete or if there are any errors.
179
+ */
180
+ function pmpro_checkLevelForTwoCheckoutCompatibility($level = NULL)
181
+ {
182
+ $gateway = pmpro_getOption("gateway");
183
+ if($gateway == "twocheckout")
184
+ {
185
+ global $wpdb;
186
+
187
+ //check ALL the levels
188
+ if(empty($level))
189
+ {
190
+ $sqlQuery = "SELECT * FROM $wpdb->pmpro_membership_levels ORDER BY id ASC";
191
+ $levels = $wpdb->get_results($sqlQuery, OBJECT);
192
+ if(!empty($levels))
193
+ {
194
+ foreach($levels as $level)
195
+ {
196
+ /*
197
+ 2Checkout currently does not support:
198
+ * Trial amounts less than or greater than the absolute value of amonthly recurring amount.
199
+ */
200
+ if(pmpro_isLevelTrial($level))
201
+ {
202
+ return false;
203
+ }
204
+ }
205
+ }
206
+ }
207
+ else
208
+ {
209
+ //need to look it up?
210
+ if(is_numeric($level))
211
+ $level = $wpdb->get_row("SELECT * FROM $wpdb->pmpro_membership_levels WHERE id = '" . esc_sql($level) . "' LIMIT 1");
212
+
213
+ //check this level
214
+ if(pmpro_isLevelTrial($level))
215
+ {
216
+ return false;
217
+ }
218
+ }
219
+ }
220
+
221
+ return true;
222
+ }
adminpages/membershiplevels.php CHANGED
@@ -9,7 +9,7 @@
9
10
//some vars
11
$gateway = pmpro_getOption("gateway");
12
- global $pmpro_stripe_error, $pmpro_braintree_error, $pmpro_payflow_error, $wp_version;
13
14
if(isset($_REQUEST['edit']))
15
$edit = $_REQUEST['edit'];
@@ -157,6 +157,8 @@
157
158
if($ml_id > 0)
159
{
160
//remove any categories from the ml
161
$sqlQuery = "DELETE FROM $wpdb->pmpro_memberships_categories WHERE membership_id = '$ml_id'";
162
$r1 = $wpdb->query($sqlQuery);
@@ -361,7 +363,7 @@
361
<br /><small>
362
<?php _e('The amount to be billed one cycle after the initial payment.', 'pmpro');?>
363
<?php if($gateway == "stripe") { ?>
364
- <br /><strong <?php if(!empty($pmpro_stripe_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Stripe integration currently only supports billing periods of "Month" or "Year".', 'pmpro');?>
365
<?php } elseif($gateway == "braintree") { ?>
366
<br /><strong <?php if(!empty($pmpro_braintree_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Braintree integration currently only supports billing periods of "Month" or "Year".', 'pmpro');?>
367
<?php } elseif($gateway == "payflowpro") { ?>
@@ -391,7 +393,13 @@
391
392
<tr class="recurring_info" <?php if (!pmpro_isLevelRecurring($level)) echo "style='display:none;'";?>>
393
<th scope="row" valign="top"><label><?php _e('Custom Trial', 'pmpro');?>:</label></th>
394
- <td><input id="custom_trial" name="custom_trial" type="checkbox" value="yes" <?php if ( pmpro_isLevelTrial($level) ) { echo "checked='checked'"; } ?> onclick="jQuery('.trial_info').toggle();" /> <?php _e('Check to add a custom trial period.', 'pmpro');?></td>
395
</tr>
396
397
<tr class="trial_info recurring_info" <?php if (!pmpro_isLevelTrial($level)) echo "style='display:none;'";?>>
@@ -412,8 +420,8 @@
412
<?php } elseif($gateway == "payflowpro") { ?>
413
<br /><small>
414
<strong <?php if(!empty($pmpro_payflow_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Payflow integration currently does not support trial amounts greater than $0.', 'pmpro');?></strong>
415
- </small>
416
- <?php } ?>
417
</td>
418
</tr>
419
@@ -438,7 +446,7 @@
438
<input id="expiration_number" name="expiration_number" type="text" size="10" value="<?php echo str_replace("\"", "&quot;", stripslashes($level->expiration_number))?>" />
439
<select id="expiration_period" name="expiration_period">
440
<?php
441
- $cycles = array( 'Day(s)' => 'Day', 'Week(s)' => 'Week', 'Month(s)' => 'Month', 'Year(s)' => 'Year' );
442
foreach ( $cycles as $name => $value ) {
443
echo "<option value='$value'";
444
if ( $level->expiration_period == $value ) echo " selected='selected'";
@@ -487,7 +495,7 @@
487
{
488
?>
489
490
- <h2><?php _e('Membership Levels', 'pmpro');?> <a href="admin.php?page=pmpro-membershiplevels&edit=-1" class="button add-new-h2"><?php _e('Add New Level', 'pmpro');?></a></h2>
491
<form id="posts-filter" method="get" action="">
492
<p class="search-box">
493
<label class="screen-reader-text" for="post-search-input"><?php _e('Search Levels', 'pmpro');?>:</label>
@@ -526,7 +534,7 @@
526
foreach($levels as $level)
527
{
528
?>
529
- <tr class="<?php if(!$level->allow_signups) { ?>pmpro_gray<?php } ?> <?php if(!pmpro_checkLevelForStripeCompatibility($level) || !pmpro_checkLevelForBraintreeCompatibility($level) || !pmpro_checkLevelForPayflowCompatibility($level)) { ?>pmpro_error<?php } ?>">
530
<td><?php echo $level->id?></td>
531
<td><?php echo $level->name?></td>
532
<td>
@@ -540,7 +548,7 @@
540
<?php if(!pmpro_isLevelRecurring($level)) { ?>
541
--
542
<?php } else { ?>
543
- <?php echo $pmpro_currency_symbol?><?php echo $level->billing_amount?> <?php _e('every', 'pmpro');?> <?php echo $level->cycle_number.' '.sornot($level->cycle_period,$level->cycle_number)?>
544
545
<?php if($level->billing_limit) { ?>(<?php _e('for', 'pmpro');?> <?php echo $level->billing_limit?> <?php echo sornot($level->cycle_period,$level->billing_limit)?>)<?php } ?>
546
@@ -561,9 +569,9 @@
561
<?php } ?>
562
</td>
563
<td><?php if($level->allow_signups) { ?><?php _e('Yes', 'pmpro');?><?php } else { ?><?php _e('No', 'pmpro');?><?php } ?></td>
564
- <td align="center"><a href="admin.php?page=pmpro-membershiplevels&edit=<?php echo $level->id?>" class="edit"><?php _e('edit', 'pmpro');?></a></td>
565
- <td align="center"><a href="admin.php?page=pmpro-membershiplevels&copy=<?php echo $level->id?>&edit=-1" class="edit"><?php _e('copy', 'pmpro');?></a></td>
566
- <td align="center"><a href="javascript: askfirst('<?php printf(__("Are you sure you want to delete membership level %s? All subscriptions will be cancelled.", "pmpro"), $level->name);?>','admin.php?page=pmpro-membershiplevels&action=delete_membership_level&deleteid=<?php echo $level->id?>'); void(0);" class="delete"><?php _e('delete', 'pmpro');?></a></td>
567
</tr>
568
<?php
569
}
9
10
//some vars
11
$gateway = pmpro_getOption("gateway");
12
+ global $pmpro_stripe_error, $pmpro_braintree_error, $pmpro_payflow_error, $pmpro_twocheckout_error, $wp_version;
13
14
if(isset($_REQUEST['edit']))
15
$edit = $_REQUEST['edit'];
157
158
if($ml_id > 0)
159
{
160
+ do_action("pmpro_delete_membership_level", $ml_id);
161
+
162
//remove any categories from the ml
163
$sqlQuery = "DELETE FROM $wpdb->pmpro_memberships_categories WHERE membership_id = '$ml_id'";
164
$r1 = $wpdb->query($sqlQuery);
363
<br /><small>
364
<?php _e('The amount to be billed one cycle after the initial payment.', 'pmpro');?>
365
<?php if($gateway == "stripe") { ?>
366
+ <br /><strong <?php if(!empty($pmpro_stripe_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Stripe integration currently only supports billing periods of "Week", "Month" or "Year".', 'pmpro');?>
367
<?php } elseif($gateway == "braintree") { ?>
368
<br /><strong <?php if(!empty($pmpro_braintree_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Braintree integration currently only supports billing periods of "Month" or "Year".', 'pmpro');?>
369
<?php } elseif($gateway == "payflowpro") { ?>
393
394
<tr class="recurring_info" <?php if (!pmpro_isLevelRecurring($level)) echo "style='display:none;'";?>>
395
<th scope="row" valign="top"><label><?php _e('Custom Trial', 'pmpro');?>:</label></th>
396
+ <td>
397
+ <input id="custom_trial" name="custom_trial" type="checkbox" value="yes" <?php if ( pmpro_isLevelTrial($level) ) { echo "checked='checked'"; } ?> onclick="jQuery('.trial_info').toggle();" /> <?php _e('Check to add a custom trial period.', 'pmpro');?>
398
+
399
+ <?php if($gateway == "twocheckout") { ?>
400
+ <br /><small><strong <?php if(!empty($pmpro_twocheckout_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('2Checkout integration does not support custom trials. You can do one period trials by setting an initial payment different from the billing amount.', 'pmpro');?></strong></small>
401
+ <?php } ?>
402
+ </td>
403
</tr>
404
405
<tr class="trial_info recurring_info" <?php if (!pmpro_isLevelTrial($level)) echo "style='display:none;'";?>>
420
<?php } elseif($gateway == "payflowpro") { ?>
421
<br /><small>
422
<strong <?php if(!empty($pmpro_payflow_error)) { ?>class="pmpro_red"<?php } ?>><?php _e('Payflow integration currently does not support trial amounts greater than $0.', 'pmpro');?></strong>
423
+ </small>
424
+ <?php } ?>
425
</td>
426
</tr>
427
446
<input id="expiration_number" name="expiration_number" type="text" size="10" value="<?php echo str_replace("\"", "&quot;", stripslashes($level->expiration_number))?>" />
447
<select id="expiration_period" name="expiration_period">
448
<?php
449
+ $cycles = array( __('Day(s)', 'pmpro') => 'Day', __('Week(s)', 'pmpro') => 'Week', __('Month(s)', 'pmpro') => 'Month', __('Year(s)', 'pmpro') => 'Year' );
450
foreach ( $cycles as $name => $value ) {
451
echo "<option value='$value'";
452
if ( $level->expiration_period == $value ) echo " selected='selected'";
495
{
496
?>
497
498
+ <h2><?php _e('Membership Levels', 'pmpro');?> <a href="admin.php?page=pmpro-membershiplevels&edit=-1" class="add-new-h2"><?php _e('Add New Level', 'pmpro');?></a></h2>
499
<form id="posts-filter" method="get" action="">
500
<p class="search-box">
501
<label class="screen-reader-text" for="post-search-input"><?php _e('Search Levels', 'pmpro');?>:</label>
534
foreach($levels as $level)
535
{
536
?>
537
+ <tr class="<?php if(!$level->allow_signups) { ?>pmpro_gray<?php } ?> <?php if(!pmpro_checkLevelForStripeCompatibility($level) || !pmpro_checkLevelForBraintreeCompatibility($level) || !pmpro_checkLevelForPayflowCompatibility($level) || !pmpro_checkLevelForTwoCheckoutCompatibility($level)) { ?>pmpro_error<?php } ?>">
538
<td><?php echo $level->id?></td>
539
<td><?php echo $level->name?></td>
540
<td>
548
<?php if(!pmpro_isLevelRecurring($level)) { ?>
549
--
550
<?php } else { ?>
551
+ <?php echo $pmpro_currency_symbol?><?php echo $level->billing_amount?> <?php _e('every', 'pmpro');?> <?php echo $level->cycle_number.' '.pmpro_translate_billing_period($level->cycle_period,$level->cycle_number)?>
552
553
<?php if($level->billing_limit) { ?>(<?php _e('for', 'pmpro');?> <?php echo $level->billing_limit?> <?php echo sornot($level->cycle_period,$level->billing_limit)?>)<?php } ?>
554
569
<?php } ?>
570
</td>
571
<td><?php if($level->allow_signups) { ?><?php _e('Yes', 'pmpro');?><?php } else { ?><?php _e('No', 'pmpro');?><?php } ?></td>
572
+ <td align="center"><a href="admin.php?page=pmpro-membershiplevels&amp;edit=<?php echo $level->id?>" class="edit"><?php _e('edit', 'pmpro');?></a></td>
573
+ <td align="center"><a href="admin.php?page=pmpro-membershiplevels&amp;copy=<?php echo $level->id?>&amp;edit=-1" class="edit"><?php _e('copy', 'pmpro');?></a></td>
574
+ <td align="center"><a href="javascript: askfirst('<?php printf(__("Are you sure you want to delete membership level %s? All subscriptions will be cancelled.", "pmpro"), $level->name);?>','admin.php?page=pmpro-membershiplevels&amp;action=delete_membership_level&amp;deleteid=<?php echo $level->id?>'); void(0);" class="delete"><?php _e('delete', 'pmpro');?></a></td>
575
</tr>
576
<?php
577
}
adminpages/memberslist-csv.php CHANGED
@@ -42,32 +42,83 @@
42
43
if($s)
44
{
45
- $sqlQuery = "SELECT SQL_CALC_FOUND_ROWS u.ID, u.user_login, u.user_email, UNIX_TIMESTAMP(u.user_registered) as joindate, u.user_login, u.user_nicename, u.user_url, u.user_registered, u.user_status, u.display_name, mu.membership_id, mu.initial_payment, mu.billing_amount, mu.cycle_period, UNIX_TIMESTAMP(mu.enddate) as enddate, m.name as membership FROM $wpdb->users u LEFT JOIN $wpdb->usermeta um ON u.ID = um.user_id LEFT JOIN $wpdb->pmpro_memberships_users mu ON u.ID = mu.user_id LEFT JOIN $wpdb->pmpro_membership_levels m ON mu.membership_id = m.id WHERE mu.status = 'active' AND mu.membership_id > 0 AND (u.user_login LIKE '%" . esc_sql($s) . "%' OR u.user_email LIKE '%" . esc_sql($s) . "%' OR um.meta_value LIKE '%" . esc_sql($s) . "%') ";
46
47
- if($l)
48
- $sqlQuery .= " AND mu.membership_id = '" . esc_sql($l) . "' ";
49
50
- $sqlQuery .= "GROUP BY u.ID ORDER BY user_registered DESC ";
51
52
if($limit)
53
$sqlQuery .= "LIMIT $start, $limit";
54
}
55
else
56
{
57
- $sqlQuery = "SELECT SQL_CALC_FOUND_ROWS u.ID, u.user_login, u.user_email, UNIX_TIMESTAMP(u.user_registered) as joindate, u.user_login, u.user_nicename, u.user_url, u.user_registered, u.user_status, u.display_name, mu.membership_id, mu.initial_payment, mu.billing_amount, mu.cycle_period, UNIX_TIMESTAMP(mu.enddate) as enddate, m.name as membership FROM $wpdb->users u LEFT JOIN $wpdb->pmpro_memberships_users mu ON u.ID = mu.user_id LEFT JOIN $wpdb->pmpro_membership_levels m ON mu.membership_id = m.id";
58
- $sqlQuery .= " WHERE mu.membership_id > 0 AND mu.status = 'active' ";
59
- if($l)
60
- $sqlQuery .= " AND mu.membership_id = '" . $l . "' ";
61
- $sqlQuery .= "ORDER BY user_registered DESC ";
62
if($limit)
63
$sqlQuery .= "LIMIT $start, $limit";
64
}
65
66
$sqlQuery = apply_filters("pmpro_members_list_sql", $sqlQuery);
67
68
- $theusers = $wpdb->get_results($sqlQuery);
69
-
70
- $heading = "id,username,firstname,lastname,email,billing firstname,billing lastname,address1,address2,city,state,zipcode,country,phone,membership,initial payment,fee,term,discount_code_id,discount_code,joined,expires";
71
$heading = apply_filters("pmpro_members_list_csv_heading", $heading);
72
$csvoutput = $heading;
73
@@ -111,12 +162,23 @@
111
112
$csvoutput .= "\n";
113
114
if($theusers)
115
{
116
- foreach($theusers as $theuser)
117
{
118
//get meta
119
- $sqlQuery = "SELECT meta_key as `key`, meta_value as `value` FROM $wpdb->usermeta WHERE $wpdb->usermeta.user_id = '" . $theuser->ID . "'";
120
$metavalues = pmpro_getMetavalues($sqlQuery);
121
$theuser->metavalues = $metavalues;
122
$sqlQuery = "SELECT c.id, c.code FROM $wpdb->pmpro_discount_codes_uses cu LEFT JOIN $wpdb->pmpro_discount_codes c ON cu.code_id = c.id WHERE cu.user_id = '" . $theuser->ID . "' ORDER BY c.id DESC LIMIT 1";
@@ -141,37 +203,38 @@
141
142
//joindate and enddate
143
$csvoutput .= "," . pmpro_enclose(date("Y-m-d", $theuser->joindate)) . ",";
144
- if($theuser->enddate)
145
$csvoutput .= pmpro_enclose(date("Y-m-d", $theuser->enddate));
146
else
147
- $csvoutput .= pmpro_enclose("Never");
148
-
149
//any extra columns
150
if(!empty($extra_columns))
151
{
152
foreach($extra_columns as $heading => $callback)
153
{
154
- $csvoutput .= "," . pmpro_enclose(call_user_func($callback, $theuser));
155
}
156
}
157
158
$csvoutput .= "\n";
159
-
160
}
161
}
162
-
163
- $size_in_bytes = strlen($csvoutput);
164
- header("Content-type: text/csv");
165
- //header("Content-type: application/vnd.ms-excel");
166
- if($s && $l)
167
- header("Content-Disposition: attachment; filename=members_list_" . intval($l) . "_level" . sanitize_file_name($s) . ".csv; size=$size_in_bytes");
168
- elseif($s)
169
- header("Content-Disposition: attachment; filename=members_list_" . sanitize_file_name($s) . ".csv; size=$size_in_bytes");
170
- elseif($l)
171
- header("Content-Disposition: attachment; filename=members_list_level" . intval($l) . ".csv; size=$size_in_bytes");
172
- else
173
- header("Content-Disposition: attachment; filename=members_list.csv; size=$size_in_bytes");
174
-
175
print $csvoutput;
176
177
function pmpro_enclose($s)
42
43
if($s)
44
{
45
+ $sqlQuery = "SELECT SQL_CALC_FOUND_ROWS u.ID, u.user_login, u.user_email, UNIX_TIMESTAMP(u.user_registered) as joindate, u.user_login, u.user_nicename, u.user_url, u.user_registered, u.user_status, u.display_name, mu.membership_id, mu.initial_payment, mu.billing_amount, mu.cycle_period, UNIX_TIMESTAMP(mu.enddate) as enddate, m.name as membership FROM $wpdb->users u LEFT JOIN $wpdb->usermeta um ON u.ID = um.user_id LEFT JOIN $wpdb->pmpro_memberships_users mu ON u.ID = mu.user_id LEFT JOIN $wpdb->pmpro_membership_levels m ON mu.membership_id = m.id ";
46
+
47
+ if($l == "oldmembers")
48
+ $sqlQuery .= " LEFT JOIN $wpdb->pmpro_memberships_users mu2 ON u.ID = mu2.user_id AND mu2.status = 'active' ";
49
+
50
+ $sqlQuery .= " WHERE mu.membership_id > 0 AND (u.user_login LIKE '%" . esc_sql($s) . "%' OR u.user_email LIKE '%" . esc_sql($s) . "%' OR um.meta_value LIKE '%" . esc_sql($s) . "%') ";
51
52
+ if($l == "oldmembers")
53
+ $sqlQuery .= " AND mu.status = 'inactive' AND mu2.status IS NULL ";
54
+ elseif($l)
55
+ $sqlQuery .= " AND mu.status = 'active' AND mu.membership_id = '" . esc_sql($l) . "' ";
56
+ else
57
+ $sqlQuery .= " AND mu.status = 'active' ";
58
59
+ $sqlQuery .= "GROUP BY u.ID ";
60
+
61
+ if($l == "oldmembers")
62
+ $sqlQuery .= "ORDER BY enddate DESC ";
63
+ else
64
+ $sqlQuery .= "ORDER BY u.user_registered DESC ";
65
66
if($limit)
67
$sqlQuery .= "LIMIT $start, $limit";
68
}
69
else
70
{
71
+ $sqlQuery = "SELECT SQL_CALC_FOUND_ROWS u.ID, UNIX_TIMESTAMP(mu.enddate) as enddate FROM $wpdb->users u LEFT JOIN $wpdb->pmpro_memberships_users mu ON u.ID = mu.user_id LEFT JOIN $wpdb->pmpro_membership_levels m ON mu.membership_id = m.id ";
72
+
73
+ if($l == "oldmembers")
74
+ $sqlQuery .= " LEFT JOIN $wpdb->pmpro_memberships_users mu2 ON u.ID = mu2.user_id AND mu2.status = 'active' ";
75
+
76
+ $sqlQuery .= " WHERE mu.membership_id > 0 ";
77
+
78
+ if($l == "oldmembers")
79
+ $sqlQuery .= " AND mu.status = 'inactive' AND mu2.status IS NULL ";
80
+ elseif($l)
81
+ $sqlQuery .= " AND mu.status = 'active' AND mu.membership_id = '" . $l . "' ";
82
+ else
83
+ $sqlQuery .= " AND mu.status = 'active' ";
84
+
85
+ $sqlQuery .= "GROUP BY u.ID ";
86
+
87
+ if($l == "oldmembers")
88
+ $sqlQuery .= "ORDER BY enddate DESC ";
89
+ else
90
+ $sqlQuery .= "ORDER BY u.user_registered DESC ";
91
+
92
if($limit)
93
$sqlQuery .= "LIMIT $start, $limit";
94
}
95
96
+ //filter
97
$sqlQuery = apply_filters("pmpro_members_list_sql", $sqlQuery);
98
+
99
+ //get users
100
+ $theusers = $wpdb->get_col($sqlQuery);
101
+
102
+ //begin output
103
+ header("Content-type: text/csv");
104
+ if($s && $l == "oldmembers")
105
+ header("Content-Disposition: attachment; filename=members_list_expired_" . sanitize_file_name($s) . ".csv");
106
+ elseif($s && $l)
107
+ header("Content-Disposition: attachment; filename=members_list_" . intval($l) . "_level_" . sanitize_file_name($s) . ".csv");
108
+ elseif($s)
109
+ header("Content-Disposition: attachment; filename=members_list_" . sanitize_file_name($s) . ".csv");
110
+ elseif($l == "oldmembers")
111
+ header("Content-Disposition: attachment; filename=members_list_expired.csv");
112
+ else
113
+ header("Content-Disposition: attachment; filename=members_list.csv");
114
+
115
+ $heading = "id,username,firstname,lastname,email,billing firstname,billing lastname,address1,address2,city,state,zipcode,country,phone,membership,initial payment,fee,term,discount_code_id,discount_code,joined";
116
+
117
+ if($l == "oldmembers")
118
+ $heading .= ",ended";
119
+ else
120
+ $heading .= ",expires";
121
122
$heading = apply_filters("pmpro_members_list_csv_heading", $heading);
123
$csvoutput = $heading;
124
162
163
$csvoutput .= "\n";
164
165
+ //output
166
+ echo $csvoutput;
167
+ $csvoutput = "";
168
+
169
if($theusers)
170
{
171
+ foreach($theusers as $user_id)
172
{
173
+ //MULTI: This query will need to be updated to support multiple levels per user. Should probably just dump multiple rows for each membership.
174
//get meta
175
+
176
+ if($l == "oldmembers")
177
+ $theuser = $wpdb->get_row("SELECT u.ID, u.user_login, u.user_email, UNIX_TIMESTAMP(u.user_registered) as joindate, u.user_login, u.user_nicename, u.user_url, u.user_registered, u.user_status, u.display_name, mu.membership_id, mu.initial_payment, mu.billing_amount, mu.cycle_period, UNIX_TIMESTAMP(mu.enddate) as enddate, m.name as membership FROM $wpdb->users u LEFT JOIN $wpdb->usermeta um ON u.ID = um.user_id LEFT JOIN $wpdb->pmpro_memberships_users mu ON u.ID = mu.user_id LEFT JOIN $wpdb->pmpro_membership_levels m ON mu.membership_id = m.id WHERE u.ID = '" . $user_id . "' ORDER BY mu.id DESC LIMIT 1");
178
+ else
179
+ $theuser = $wpdb->get_row("SELECT u.ID, u.user_login, u.user_email, UNIX_TIMESTAMP(u.user_registered) as joindate, u.user_login, u.user_nicename, u.user_url, u.user_registered, u.user_status, u.display_name, mu.membership_id, mu.initial_payment, mu.billing_amount, mu.cycle_period, UNIX_TIMESTAMP(mu.enddate) as enddate, m.name as membership FROM $wpdb->users u LEFT JOIN $wpdb->usermeta um ON u.ID = um.user_id LEFT JOIN $wpdb->pmpro_memberships_users mu ON u.ID = mu.user_id AND mu.status = 'active' LEFT JOIN $wpdb->pmpro_membership_levels m ON mu.membership_id = m.id WHERE u.ID = '" . $user_id . "' LIMIT 1");
180
+
181
+ $sqlQuery = "SELECT meta_key as `key`, meta_value as `value` FROM $wpdb->usermeta WHERE $wpdb->usermeta.user_id = '" . $user_id . "'";
182
$metavalues = pmpro_getMetavalues($sqlQuery);
183
$theuser->metavalues = $metavalues;
184
$sqlQuery = "SELECT c.id, c.code FROM $wpdb->pmpro_discount_codes_uses cu LEFT JOIN $wpdb->pmpro_discount_codes c ON cu.code_id = c.id WHERE cu.user_id = '" . $theuser->ID . "' ORDER BY c.id DESC LIMIT 1";
203
204
//joindate and enddate
205
$csvoutput .= "," . pmpro_enclose(date("Y-m-d", $theuser->joindate)) . ",";
206
+
207
+ if($theuser->membership_id)
208
+ {
209
+ if($theuser->enddate)
210
+ $csvoutput .= pmpro_enclose(apply_filters("pmpro_memberslist_expires_column", date("Y-m-d", $theuser->enddate), $theuser));
211
+ else
212
+ $csvoutput .= pmpro_enclose(apply_filters("pmpro_memberslist_expires_column", "Never", $theuser));
213
+ }
214
+ elseif($l == "oldmembers" && $theuser->enddate)
215
+ {
216
$csvoutput .= pmpro_enclose(date("Y-m-d", $theuser->enddate));
217
+ }
218
else
219
+ $csvoutput .= "N/A";
220
+
221
//any extra columns
222
if(!empty($extra_columns))
223
{
224
foreach($extra_columns as $heading => $callback)
225
{
226
+ $csvoutput .= "," . pmpro_enclose(call_user_func($callback, $theuser, $heading));
227
}
228
}
229
230
$csvoutput .= "\n";
231
+
232
+ //output
233
+ echo $csvoutput;
234
+ $csvoutput = "";
235
}
236
}
237
+
238
print $csvoutput;
239
240
function pmpro_enclose($s)
adminpages/memberslist.php CHANGED
@@ -23,7 +23,7 @@
23
<form id="posts-filter" method="get" action="">
24
<h2>
25
<?php _e('Members List', 'pmpro');?>
26
- <a target="_blank" href="<?php echo admin_url('admin-ajax.php');?>?action=memberslist_csv&s=<?php echo $s?>&l=<?php echo $l?>" class="button add-new-h2"><?php _e('Export to CSV', 'pmpro');?></a>
27
</h2>
28
<ul class="subsubsub">
29
<li>
@@ -39,6 +39,7 @@
39
<?php
40
}
41
?>
42
</select>
43
</li>
44
</ul>
@@ -65,24 +66,56 @@
65
66
if($s)
67
{
68
- $sqlQuery = "SELECT SQL_CALC_FOUND_ROWS u.ID, u.user_login, u.user_email, UNIX_TIMESTAMP(u.user_registered) as joindate, mu.membership_id, mu.initial_payment, mu.billing_amount, mu.cycle_period, mu.cycle_number, mu.billing_limit, mu.trial_amount, mu.trial_limit, UNIX_TIMESTAMP(mu.startdate) as startdate, UNIX_TIMESTAMP(mu.enddate) as enddate, m.name as membership FROM $wpdb->users u LEFT JOIN $wpdb->usermeta um ON u.ID = um.user_id LEFT JOIN $wpdb->pmpro_memberships_users mu ON u.ID = mu.user_id LEFT JOIN $wpdb->pmpro_membership_levels m ON mu.membership_id = m.id WHERE mu.status = 'active' AND mu.membership_id > 0 AND (u.user_login LIKE '%$s%' OR u.user_email LIKE '%$s%' OR um.meta_value LIKE '%$s%') ";
69
70
- if($l)
71
- $sqlQuery .= " AND mu.membership_id = '" . $l . "' ";
72
-
73
- $sqlQuery .= "GROUP BY u.ID ORDER BY user_registered DESC LIMIT $start, $limit";
74
}
75
else
76
{
77
$sqlQuery = "SELECT SQL_CALC_FOUND_ROWS u.ID, u.user_login, u.user_email, UNIX_TIMESTAMP(u.user_registered) as joindate, mu.membership_id, mu.initial_payment, mu.billing_amount, mu.cycle_period, mu.cycle_number, mu.billing_limit, mu.trial_amount, mu.trial_limit, UNIX_TIMESTAMP(mu.startdate) as startdate, UNIX_TIMESTAMP(mu.enddate) as enddate, m.name as membership FROM $wpdb->users u LEFT JOIN $wpdb->pmpro_memberships_users mu ON u.ID = mu.user_id LEFT JOIN $wpdb->pmpro_membership_levels m ON mu.membership_id = m.id";
78
- $sqlQuery .= " WHERE mu.membership_id > 0 AND mu.status = 'active' ";
79
- if($l)
80
- $sqlQuery .= " AND mu.membership_id = '" . $l . "' ";
81
- $sqlQuery .= "GROUP BY u.ID ORDER BY user_registered DESC LIMIT $start, $limit";
82
}
83
84
$sqlQuery = apply_filters("pmpro_members_list_sql", $sqlQuery);
85
-
86
$theusers = $wpdb->get_results($sqlQuery);
87
$totalrows = $wpdb->get_var("SELECT FOUND_ROWS() as found_rows");
88
@@ -118,7 +151,14 @@
118
<th><?php _e('Membership', 'pmpro');?></th>
119
<th><?php _e('Fee', 'pmpro');?></th>
120
<th><?php _e('Joined', 'pmpro');?></th>
121
- <th><?php _e('Expires', 'pmpro');?></th>
122
</tr>
123
</thead>
124
<tbody id="users" class="list:user user-list">
@@ -146,21 +186,9 @@
146
<td><a href="mailto:<?php echo $theuser->user_email?>"><?php echo $theuser->user_email?></a></td>
147
<?php do_action("pmpro_memberslist_extra_cols_body", $theuser);?>
148
<td>
149
- <?php
150
- if(empty($theuser->pmpro_bfirstname))
151
- $theuser->pmpro_bfirstname = "";
152
- if(empty($theuser->pmpro_blastname))
153
- $theuser->pmpro_blastname = "";
154
- echo trim($theuser->pmpro_bfirstname . " " . $theuser->pmpro_blastname);
155
- ?><br />
156
- <?php if(!empty($theuser->pmpro_baddress1)) { ?>
157
- <?php echo $theuser->pmpro_baddress1; ?><br />
158
- <?php if(!empty($theuser->pmpro_baddress2)) echo $theuser->pmpro_baddress2 . "<br />"; ?>
159
- <?php if($theuser->pmpro_bcity && $theuser->pmpro_bstate) { ?>
160
- <?php echo $theuser->pmpro_bcity?>, <?php echo $theuser->pmpro_bstate?> <?php echo $theuser->pmpro_bzipcode?> <?php if(!empty($theuser->pmpro_bcountry)) echo $theuser->pmpro_bcountry?><br />
161
- <?php } ?>
162
- <?php } ?>
163
- <?php if(!empty($theuser->pmpro_bphone)) echo formatPhone($theuser->pmpro_bphone);?>
164
</td>
165
<td><?php echo $auser->membership?></td>
166
<td>
@@ -175,13 +203,13 @@
175
-
176
<?php } ?>
177
</td>
178
- <td><?php echo date("m/d/Y", strtotime($theuser->user_registered))?></td>
179
<td>
180
<?php
181
if($auser->enddate)
182
- echo date(get_option('date_format'), $auser->enddate);
183
else
184
- echo __("Never", "pmpro");
185
?>
186
</td>
187
</tr>
23
<form id="posts-filter" method="get" action="">
24
<h2>
25
<?php _e('Members List', 'pmpro');?>
26
+ <a target="_blank" href="<?php echo admin_url('admin-ajax.php');?>?action=memberslist_csv&s=<?php echo $s?>&l=<?php echo $l?>" class="add-new-h2"><?php _e('Export to CSV', 'pmpro');?></a>
27
</h2>
28
<ul class="subsubsub">
29
<li>
39
<?php
40
}
41
?>
42
+ <option value="oldmembers" <?php if($l == "oldmembers") { ?>selected="selected"<?php } ?>><?php _e('Old Members', 'pmpro');?></option>
43
</select>
44
</li>
45
</ul>
66
67
if($s)
68
{
69
+ $sqlQuery = "SELECT SQL_CALC_FOUND_ROWS u.ID, u.user_login, u.user_email, UNIX_TIMESTAMP(u.user_registered) as joindate, mu.membership_id, mu.initial_payment, mu.billing_amount, mu.cycle_period, mu.cycle_number, mu.billing_limit, mu.trial_amount, mu.trial_limit, UNIX_TIMESTAMP(mu.startdate) as startdate, UNIX_TIMESTAMP(mu.enddate) as enddate, m.name as membership FROM $wpdb->users u LEFT JOIN $wpdb->usermeta um ON u.ID = um.user_id LEFT JOIN $wpdb->pmpro_memberships_users mu ON u.ID = mu.user_id LEFT JOIN $wpdb->pmpro_membership_levels m ON mu.membership_id = m.id ";
70
+
71
+ if($l == "oldmembers")
72
+ $sqlQuery .= " LEFT JOIN $wpdb->pmpro_memberships_users mu2 ON u.ID = mu2.user_id AND mu2.status = 'active' ";
73
+
74
+ $sqlQuery .= " WHERE mu.membership_id > 0 AND (u.user_login LIKE '%$s%' OR u.user_email LIKE '%$s%' OR um.meta_value LIKE '%$s%') ";
75
76
+ if($l == "oldmembers")
77
+ $sqlQuery .= " AND mu.status = 'inactive' AND mu2.status IS NULL ";
78
+ elseif($l)
79
+ $sqlQuery .= " AND mu.status = 'active' AND mu.membership_id = '" . $l . "' ";
80
+ else
81
+ $sqlQuery .= " AND mu.status = 'active' ";
82
+
83
+ $sqlQuery .= "GROUP BY u.ID ";
84
+
85
+ if($l == "oldmembers")
86
+ $sqlQuery .= "ORDER BY enddate DESC ";
87
+ else
88
+ $sqlQuery .= "ORDER BY u.user_registered DESC ";
89
+
90
+ $sqlQuery .= "LIMIT $start, $limit";
91
}
92
else
93
{
94
$sqlQuery = "SELECT SQL_CALC_FOUND_ROWS u.ID, u.user_login, u.user_email, UNIX_TIMESTAMP(u.user_registered) as joindate, mu.membership_id, mu.initial_payment, mu.billing_amount, mu.cycle_period, mu.cycle_number, mu.billing_limit, mu.trial_amount, mu.trial_limit, UNIX_TIMESTAMP(mu.startdate) as startdate, UNIX_TIMESTAMP(mu.enddate) as enddate, m.name as membership FROM $wpdb->users u LEFT JOIN $wpdb->pmpro_memberships_users mu ON u.ID = mu.user_id LEFT JOIN $wpdb->pmpro_membership_levels m ON mu.membership_id = m.id";
95
+
96
+ if($l == "oldmembers")
97
+ $sqlQuery .= " LEFT JOIN $wpdb->pmpro_memberships_users mu2 ON u.ID = mu2.user_id AND mu2.status = 'active' ";
98
+
99
+ $sqlQuery .= " WHERE mu.membership_id > 0 ";
100
+
101
+ if($l == "oldmembers")
102
+ $sqlQuery .= " AND mu.status = 'inactive' AND mu2.status IS NULL ";
103
+ elseif($l)
104
+ $sqlQuery .= " AND mu.status = 'active' AND mu.membership_id = '" . $l . "' ";
105
+ else
106
+ $sqlQuery .= " AND mu.status = 'active' ";
107
+ $sqlQuery .= "GROUP BY u.ID ";
108
+
109
+ if($l == "oldmembers")
110
+ $sqlQuery .= "ORDER BY enddate DESC ";
111
+ else
112
+ $sqlQuery .= "ORDER BY u.user_registered DESC ";
113
+
114
+ $sqlQuery .= "LIMIT $start, $limit";
115
}
116
117
$sqlQuery = apply_filters("pmpro_members_list_sql", $sqlQuery);
118
+
119
$theusers = $wpdb->get_results($sqlQuery);
120
$totalrows = $wpdb->get_var("SELECT FOUND_ROWS() as found_rows");
121
151
<th><?php _e('Membership', 'pmpro');?></th>
152
<th><?php _e('Fee', 'pmpro');?></th>
153
<th><?php _e('Joined', 'pmpro');?></th>
154
+ <th>
155
+ <?php
156
+ if($l == "oldmembers")
157
+ _e('Ended', 'pmpro');
158
+ else
159
+ _e('Expires', 'pmpro');
160
+ ?>
161
+ </th>
162
</tr>
163
</thead>
164
<tbody id="users" class="list:user user-list">
186
<td><a href="mailto:<?php echo $theuser->user_email?>"><?php echo $theuser->user_email?></a></td>
187
<?php do_action("pmpro_memberslist_extra_cols_body", $theuser);?>
188
<td>
189
+ <?php
190
+ echo pmpro_formatAddress(trim($theuser->pmpro_bfirstname . " " . $theuser->pmpro_blastname), $theuser->pmpro_baddress1, $theuser->pmpro_baddress2, $theuser->pmpro_bcity, $theuser->pmpro_bstate, $theuser->pmpro_bzipcode, $theuser->pmpro_bcountry, $theuser->pmpro_bphone);
191
+ ?>
192
</td>
193
<td><?php echo $auser->membership?></td>
194
<td>
203
-
204
<?php } ?>
205
</td>
206
+ <td><?php echo date(get_option("date_format"), strtotime($theuser->user_registered))?></td>
207
<td>
208
<?php
209
if($auser->enddate)
210
+ echo apply_filters("pmpro_memberslist_expires_column", date(get_option('date_format'), $auser->enddate), $auser);
211
else
212
+ echo __(apply_filters("pmpro_memberslist_expires_column", "Never", $auser), "pmpro");
213
?>
214
</td>
215
</tr>
adminpages/orders-csv.php CHANGED
@@ -17,6 +17,51 @@
17
$l = $_REQUEST['l'];
18
else
19
$l = false;
20
21
//some vars for the search
22
if(!empty($_REQUEST['pn']))
@@ -40,6 +85,62 @@
40
$start = NULL;
41
}
42