-
Notifications
You must be signed in to change notification settings - Fork 0
/
makesf-members.php
103 lines (72 loc) · 7.99 KB
/
makesf-members.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?php
/**
* Plugin Name: Make Santa Fe Membership Awesomeness
* Plugin URI:https://mind.sh/are
* Description: A plugin that drastically improves the Make Santa Fe membership experience
* Version: 1.2.0
* Author: Mindshare Labs, Inc
* Author URI: https://mind.sh/are
*/
class makeMember {
private $userID = '';
public function __construct() {
$this->userId = get_current_user_id();
global $wpdb;
if ( !defined( 'MAKESF_PLUGIN_FILE' ) ) {
define( 'MAKESF_PLUGIN_FILE', __FILE__ );
}
//Define all the constants
$this->define( 'MAKESF_ABSPATH', dirname( MAKESF_PLUGIN_FILE ) . '/' );
$this->define( 'MAKESF_URL', plugin_dir_url( __FILE__ ));
$this->define( 'MAKESF_PLUGIN_VERSION', '1.4.0');
$this->define( 'PLUGIN_DIR', plugin_dir_url( __FILE__ ));
$this->define( 'SIGNIN_TABLENAME', $wpdb->prefix . 'makesignin');
$this->define( 'MAKE_AJAX_PREPEND', 'makesantafe_');
$this->define( 'MAKE_LOGO', '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 508 329.3"><defs><style>.cls-1{fill:#000;stroke-width:0px;}</style></defs><path class="cls-1" d="M126,0H0v98.6h49.4v-49.2h76.6V0Z"/><path class="cls-1" d="M382,329.3h126v-98.6h-49.4v49.2h-76.6v49.4Z"/><path class="cls-1" d="M105.4,79.1c1.5,2.7,3.2,6.1,5.1,10.1s4,8.3,6.1,13,4.2,9.4,6.3,14.3c2.1,4.9,4,9.4,5.8,13.7,1.8-4.3,3.8-8.9,5.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c-.6-.3-1.5-.6-2.6-.9-1.1-.3-2.5-.4-4.2-.4-3.3,0-5.7.9-7,2.7s-2,4.3-2,7.3v3.5h15.4v6h-15.4v34h-7.2v-43.6c0-5.1,1.3-9.1,3.8-11.9,2.5-2.7,6.5-4.1,11.8-4.1Z"/><path class="cls-1" d="M355.5,231.3c0-3.5.5-6.6,1.5-9.3,1-2.6,2.4-4.8,4.1-6.6,1.7-1.7,3.6-3,5.8-3.9,2.2-.9,4.5-1.3,6.8-1.3,5.4,0,9.5,1.7,12.4,5,2.9,3.4,4.3,8.5,4.3,15.3v1.2c0,.5,0,.9-.1,1.3h-27.4c.3,4.2,1.5,7.3,3.6,9.5s5.4,3.2,9.8,3.2c2.5,0,4.6-.2,6.3-.7,1.7-.4,3-.9,3.9-1.3l1,6c-.9.5-2.4.9-4.6,1.5-2.2.5-4.7.8-7.4.8-3.5,0-6.5-.5-9-1.6s-4.6-2.5-6.3-4.3-2.9-4-3.7-6.6c-.6-2.4-1-5.1-1-8.2ZM382.9,227.4c0-3.2-.8-5.9-2.4-8-1.7-2.1-4-3.1-6.9-3.1-1.6,0-3.1.3-4.3,1-1.3.6-2.3,1.5-3.2,2.5-.9,1-1.6,2.2-2,3.5-.5,1.3-.8,2.7-1,4.1h19.8Z"/></svg>');
$this->includes();
}
public static function get_instance() {
if ( null === self::$instance ) {
self::$instance = new self;
}
return self::$instance;
}
private function define( $name, $value ) {
if ( ! defined( $name ) ) {
define( $name, $value );
}
}
private function includes() {
//General
include_once MAKESF_ABSPATH . 'inc/utilities.php';
include_once MAKESF_ABSPATH . 'inc/options.php';
include_once MAKESF_ABSPATH . 'inc/profile.class.php';
include_once MAKESF_ABSPATH . 'inc/blocks.php';
include_once MAKESF_ABSPATH . 'inc/scripts.php';
include_once MAKESF_ABSPATH . 'inc/tribe-woocommerce.php';
include_once MAKESF_ABSPATH . 'inc/tribe-events.php';
include_once MAKESF_ABSPATH . 'inc/api-endpoints.php';
//Meetup
// include_once MAKESF_ABSPATH . 'inc/meetup/meetupOptions.class.php';
// include_once MAKESF_ABSPATH . 'inc/meetup/meetupAPI.class.php';
//Custom Notification Classes
include_once MAKESF_ABSPATH . 'inc/notifications.class.php';
include_once MAKESF_ABSPATH . 'inc/userBadge.class.php';
include_once MAKESF_ABSPATH . 'inc/newsletter/newsletter-blocks.php';
}
}//end of class
new makeMember();
function make_install() {
global $wpdb;
$charset_collate = $wpdb->get_charset_collate();
$sql = "CREATE TABLE make_signin (
id INT NOT NULL AUTO_INCREMENT,
time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
badges TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
user INT NOT NULL,
PRIMARY KEY (id)
) $charset_collate;";
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
dbDelta( $sql );
}
register_activation_hook( __FILE__, 'make_install' );