Changeset 3348286
- Timestamp:
- 08/21/2025 04:36:41 PM (7 months ago)
- Location:
- groups-for-membermouse
- Files:
-
- 2 edited
- 1 copied
-
tags/2.4.2 (copied) (copied from groups-for-membermouse/trunk)
-
tags/2.4.2/groups-for-membermouse.php (modified) (5 diffs)
-
trunk/groups-for-membermouse.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
groups-for-membermouse/tags/2.4.2/groups-for-membermouse.php
r3153994 r3348286 4 4 * Plugin Name: Groups for MemberMouse 5 5 * Description: Adds group support to MemberMouse. You can define different types of groups allowing a single customer to pay for multiple seats and members to join existing groups for free or for a price based on how you configure the group type. <strong>Requires MemberMouse to activate and use.</strong> 6 * Version: 2.4. 16 * Version: 2.4.2 7 7 * Author: Mintun Media 8 8 * Plugin URI: https://www.mintunmedia.com … … 85 85 const MM_PLUGIN_PATH = 'membermouse/index.php'; 86 86 87 public $plugin_name; 88 87 89 function __construct() { 88 90 $this->plugin_name = basename(dirname(__FILE__)) . '/' . basename(__FILE__); … … 135 137 global $wpdb; 136 138 137 $plugin_data = get_plugin_data(MGROUP_PATH . 'groups-for-membermouse.php'); 138 $plugin_version = explode('.', $plugin_data['Version']); 139 $plugin_version_major = (int) reset($plugin_version); 140 $plugin_version_middle = (int) $plugin_version[1]; 141 $plugin_version_minor = (int) end($plugin_version); 142 143 /** 144 * 2.0.8 DB Update 145 * - Add member_status to wp_group_sets_members 146 * @date 9.28.2021 147 */ 148 if ($plugin_version_major <= 2 && $plugin_version_middle === 0 && $plugin_version_minor <= 9) { 149 $dbname = $wpdb->dbname; 150 $table_name = $wpdb->prefix . "group_sets_members"; 151 $is_status_col = $wpdb->get_results("SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `table_name` = '{$table_name}' AND `TABLE_SCHEMA` = '{$dbname}' AND `COLUMN_NAME` = 'member_status'"); 152 if (empty($is_status_col)) : 153 $add_status_column = "ALTER TABLE `{$table_name}` ADD `member_status` INT(11) DEFAULT 1 AFTER `member_id`; "; 154 $wpdb->query($add_status_column); 155 endif; 156 } 157 } 139 $dbname = $wpdb->dbname; 140 $table_name = $wpdb->prefix . "group_sets_members"; 141 $is_status_col = $wpdb->get_results("SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `table_name` = '{$table_name}' AND `TABLE_SCHEMA` = '{$dbname}' AND `COLUMN_NAME` = 'member_status'"); 142 143 if (empty($is_status_col)) { 144 $add_status_column = "ALTER TABLE `{$table_name}` ADD `member_status` INT(11) DEFAULT 1 AFTER `member_id`; "; 145 $wpdb->query($add_status_column); 146 } 147 } 148 158 149 /** 159 150 * Load Extra Groups Classes … … 617 608 } 618 609 619 public static function MemberMouseGroupPagination($limit = 10, $count, $page, $start, $targetpage, $type = "groups") { 610 public static function MemberMouseGroupPagination($count, $page, $start, $targetpage, $limit = 10, $type = "groups") { 611 $count = (int)$count; 612 $page = (int)$page; 613 $start = (int)$start; 614 $limit = max(1, (int)$limit); 615 620 616 $prev = $page - 1; 621 617 $next = $page + 1; … … 917 913 918 914 // Only update if the new group type is different. Necessary when the callback is fired twice, as in the case of a purchase & membership change. 919 if ($template_id != $original_group_template->id) {915 if ($template_id != $original_group_template->id) { 920 916 // Don't change group name if it's already been changed. 921 917 if ($group->group_name !== $original_group_template->name) { -
groups-for-membermouse/trunk/groups-for-membermouse.php
r3153994 r3348286 4 4 * Plugin Name: Groups for MemberMouse 5 5 * Description: Adds group support to MemberMouse. You can define different types of groups allowing a single customer to pay for multiple seats and members to join existing groups for free or for a price based on how you configure the group type. <strong>Requires MemberMouse to activate and use.</strong> 6 * Version: 2.4. 16 * Version: 2.4.2 7 7 * Author: Mintun Media 8 8 * Plugin URI: https://www.mintunmedia.com … … 85 85 const MM_PLUGIN_PATH = 'membermouse/index.php'; 86 86 87 public $plugin_name; 88 87 89 function __construct() { 88 90 $this->plugin_name = basename(dirname(__FILE__)) . '/' . basename(__FILE__); … … 135 137 global $wpdb; 136 138 137 $plugin_data = get_plugin_data(MGROUP_PATH . 'groups-for-membermouse.php'); 138 $plugin_version = explode('.', $plugin_data['Version']); 139 $plugin_version_major = (int) reset($plugin_version); 140 $plugin_version_middle = (int) $plugin_version[1]; 141 $plugin_version_minor = (int) end($plugin_version); 142 143 /** 144 * 2.0.8 DB Update 145 * - Add member_status to wp_group_sets_members 146 * @date 9.28.2021 147 */ 148 if ($plugin_version_major <= 2 && $plugin_version_middle === 0 && $plugin_version_minor <= 9) { 149 $dbname = $wpdb->dbname; 150 $table_name = $wpdb->prefix . "group_sets_members"; 151 $is_status_col = $wpdb->get_results("SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `table_name` = '{$table_name}' AND `TABLE_SCHEMA` = '{$dbname}' AND `COLUMN_NAME` = 'member_status'"); 152 if (empty($is_status_col)) : 153 $add_status_column = "ALTER TABLE `{$table_name}` ADD `member_status` INT(11) DEFAULT 1 AFTER `member_id`; "; 154 $wpdb->query($add_status_column); 155 endif; 156 } 157 } 139 $dbname = $wpdb->dbname; 140 $table_name = $wpdb->prefix . "group_sets_members"; 141 $is_status_col = $wpdb->get_results("SELECT `COLUMN_NAME` FROM `INFORMATION_SCHEMA`.`COLUMNS` WHERE `table_name` = '{$table_name}' AND `TABLE_SCHEMA` = '{$dbname}' AND `COLUMN_NAME` = 'member_status'"); 142 143 if (empty($is_status_col)) { 144 $add_status_column = "ALTER TABLE `{$table_name}` ADD `member_status` INT(11) DEFAULT 1 AFTER `member_id`; "; 145 $wpdb->query($add_status_column); 146 } 147 } 148 158 149 /** 159 150 * Load Extra Groups Classes … … 617 608 } 618 609 619 public static function MemberMouseGroupPagination($limit = 10, $count, $page, $start, $targetpage, $type = "groups") { 610 public static function MemberMouseGroupPagination($count, $page, $start, $targetpage, $limit = 10, $type = "groups") { 611 $count = (int)$count; 612 $page = (int)$page; 613 $start = (int)$start; 614 $limit = max(1, (int)$limit); 615 620 616 $prev = $page - 1; 621 617 $next = $page + 1; … … 917 913 918 914 // Only update if the new group type is different. Necessary when the callback is fired twice, as in the case of a purchase & membership change. 919 if ($template_id != $original_group_template->id) {915 if ($template_id != $original_group_template->id) { 920 916 // Don't change group name if it's already been changed. 921 917 if ($group->group_name !== $original_group_template->name) {
Note: See TracChangeset
for help on using the changeset viewer.