-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
100 lines (78 loc) · 3.45 KB
/
index.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
<?php
/**
* Plugin Name: User Role Subscriptions
* Plugin URI: http://www.jonathonbyrd.com
* Description: This simple wordpress plugin is designed to manage user role subscriptions. You may charge differently for all roles and manage their subscription periods.
* Version: 2.0.2
* Date: December 24th, 2009
* Author: Jonathon Byrd
* Author URI: http://www.jonathonbyrd.com
*
* @subpackage : Wordpress
* @author : Jonathon Byrd
* @copyright : All Rights Reserved, Byrd Inc. 2009
* @link : http://www.jonathonbyrd.com
*
* Jonathon Byrd is a freelance developer for hire. Jonathon has owned many companies and
* understands the importance of website credibility. Contact Jonathon Today.
*
*/
require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR.'framework.php';
// Check to ensure this file is within the rest of the framework
defined('_EXEC') or die();
if ( class_exists('byrdSiteRoles') ){
global $byrdRoles;
$byrdRoles = new byrdSiteRoles();
//adding admin menu options
if ( function_exists('add_action') ) add_action('admin_menu', 'plugin_config_Roles');
function plugin_config_Roles(){
if ( function_exists('add_submenu_page') ){
add_submenu_page('users.php',__('Membership Role Subscriptions'),__('Role Subscriptions'),'manage_options','byrd_rolessubscriptions'.DS.'config_index_subscriptions.php','');
add_submenu_page('users.php',__('Membership Role Subscriptions'),__('Role Management'),'manage_options','byrd_rolessubscriptions'.DS.'config_index_roles.php','');
add_submenu_page('users.php',__('Membership Role Subscriptions'),__('Role Reports'),'manage_options','byrd_rolessubscriptions'.DS.'config_index_reports.php','');
add_submenu_page('users.php',__('Membership Role Subscriptions'),__('Role Configurations'),'manage_options','byrd_rolessubscriptions'.DS.'config_index_configurations.php','');
}
}
// This will create the database tables
require_once dirname(__FILE__).DS.'activation_install_script.php';
register_activation_hook(__FILE__, 'install_byrd_roles');
function install_byrd_roles(){
$install = new RolesInstallation();
$install->install();
}
//php method of loading the contact form
if (!function_exists('getSubscription')){ function getSubscription( $id = false ){
global $byrdRoles;
if (!$id)
{
$byrdRoles->getSubscriptions();
return false;
}
$byrdRoles->getSubscription($id);
}}
//php method of loading the contact form
if (!function_exists('getSubscriptions')){ function getSubscriptions(){
global $byrdRoles;
$byrdRoles->getSubscriptions();
}}
//filter replace the user input in the posts with the subscriptions
add_filter('the_content', array(&$byrdRoles, 'contentFilters'));
add_filter('manage_users_custom_column', array(&$byrdRoles, 'user_columns'),10,3);
//adding a column header to the users table
$columns = get_column_headers( 'users' );
//display the users expiration data
if ($byrdRoles->displayexpirationdata){
$columns['subscription_expiration'] = 'Sub. Expiration';
$columns['subscription_startdate'] = 'Started Sub.';
$columns['subscription_name'] = 'Item Name';
}
//display the users address information
if ($byrdRoles->displayusersaddress){
$columns['subscription_streetaddress'] = 'Street Address';
$columns['subscription_city'] = 'City';
$columns['subscription_state'] = 'State';
$columns['subscription_zip'] = 'Zip';
$columns['subscription_country'] = 'Country';
}
register_column_headers('users',$columns);
}