| 1 |
<?php |
| 2 |
/** |
| 3 |
* CSS/JS loading handlers for s2Member ( inner processing routines ). |
| 4 |
* |
| 5 |
* Copyright: © 2009-2011 |
| 6 |
* {@link http://www.websharks-inc.com/ WebSharks, Inc.} |
| 7 |
* ( coded in the USA ) |
| 8 |
* |
| 9 |
* Released under the terms of the GNU General Public License. |
| 10 |
* You should have received a copy of the GNU General Public License, |
| 11 |
* along with this software. In the main directory, see: /licensing/ |
| 12 |
* If not, see: {@link http://www.gnu.org/licenses/}. |
| 13 |
* |
| 14 |
* @package s2Member\CSS_JS |
| 15 |
* @since 3.5 |
| 16 |
*/ |
| 17 |
if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"])) |
| 18 |
exit("Do not access this file directly."); |
| 19 |
/**/ |
| 20 |
if (!class_exists ("c_ws_plugin__s2member_css_js_in")) |
| 21 |
{ |
| 22 |
/** |
| 23 |
* CSS/JS loading handlers for s2Member ( inner processing routines ). |
| 24 |
* |
| 25 |
* @package s2Member\CSS_JS |
| 26 |
* @since 3.5 |
| 27 |
*/ |
| 28 |
class c_ws_plugin__s2member_css_js_in |
| 29 |
{ |
| 30 |
/** |
| 31 |
* Outputs CSS for theme integration. |
| 32 |
* |
| 33 |
* @package s2Member\CSS_JS |
| 34 |
* @since 3.5 |
| 35 |
* |
| 36 |
* @attaches-to: ``add_action("init");`` |
| 37 |
* |
| 38 |
* @return null Or exits script execution after loading CSS. |
| 39 |
*/ |
| 40 |
public static function css () |
| 41 |
{ |
| 42 |
do_action ("ws_plugin__s2member_before_css", get_defined_vars ()); |
| 43 |
/**/ |
| 44 |
if (!empty ($_GET["ws_plugin__s2member_css"])) |
| 45 |
{ |
| 46 |
header("Content-Type: text/css; charset=utf-8"); |
| 47 |
header("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("+1 week")) . " GMT"); |
| 48 |
header("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT"); |
| 49 |
header("Cache-Control: max-age=604800"); |
| 50 |
header("Pragma: public"); |
| 51 |
/**/ |
| 52 |
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]; |
| 53 |
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images"; |
| 54 |
/**/ |
| 55 |
ob_start("c_ws_plugin__s2member_utils_css::compress_css"); |
| 56 |
/**/ |
| 57 |
include_once dirname (dirname (__FILE__)) . "/s2member.css"; |
| 58 |
/**/ |
| 59 |
do_action ("ws_plugin__s2member_during_css", get_defined_vars ()); |
| 60 |
/**/ |
| 61 |
exit (); /* Clean exit. */ |
| 62 |
} |
| 63 |
/**/ |
| 64 |
do_action ("ws_plugin__s2member_after_css", get_defined_vars ()); |
| 65 |
} |
| 66 |
/** |
| 67 |
* Outputs JS for theme integration. |
| 68 |
* |
| 69 |
* Be sure s2Member's API Constants are already defined before firing this. |
| 70 |
* |
| 71 |
* @package s2Member\CSS_JS |
| 72 |
* @since 3.5 |
| 73 |
* |
| 74 |
* @attaches-to: ``add_action("init");`` |
| 75 |
* |
| 76 |
* @return null Or exits script execution after loading JS w/Globals. |
| 77 |
*/ |
| 78 |
public static function js_w_globals () |
| 79 |
{ |
| 80 |
do_action ("ws_plugin__s2member_before_js_w_globals", get_defined_vars ()); |
| 81 |
/**/ |
| 82 |
if (!empty ($_GET["ws_plugin__s2member_js_w_globals"])) |
| 83 |
{ |
| 84 |
header("Content-Type: text/javascript; charset=utf-8"); |
| 85 |
header("Expires: " . gmdate ("D, d M Y H:i:s", strtotime ("+1 week")) . " GMT"); |
| 86 |
header("Last-Modified: " . gmdate ("D, d M Y H:i:s") . " GMT"); |
| 87 |
header("Cache-Control: max-age=604800"); |
| 88 |
header("Pragma: public"); |
| 89 |
/**/ |
| 90 |
echo "var S2MEMBER_VERSION = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_VERSION) . "',"; |
| 91 |
/**/ |
| 92 |
echo "S2MEMBER_CURRENT_USER_LOGIN_COUNTER = " . S2MEMBER_CURRENT_USER_LOGIN_COUNTER . ","; |
| 93 |
/**/ |
| 94 |
echo "S2MEMBER_CURRENT_USER_IS_LOGGED_IN = " . ((S2MEMBER_CURRENT_USER_IS_LOGGED_IN) ? "true" : "false") . ","; |
| 95 |
echo "S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER = " . ((S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER) ? "true" : "false") . ","; |
| 96 |
/**/ |
| 97 |
echo "S2MEMBER_CURRENT_USER_ACCESS_LEVEL = " . S2MEMBER_CURRENT_USER_ACCESS_LEVEL . ","; |
| 98 |
echo "S2MEMBER_CURRENT_USER_ACCESS_LABEL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_ACCESS_LABEL) . "',"; |
| 99 |
/**/ |
| 100 |
echo "S2MEMBER_CURRENT_USER_SUBSCR_ID = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_SUBSCR_ID) . "',"; |
| 101 |
echo "S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID) . "',"; |
| 102 |
echo "S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY) . "',"; |
| 103 |
echo "S2MEMBER_CURRENT_USER_CUSTOM = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_CUSTOM) . "',"; |
| 104 |
/**/ |
| 105 |
echo "S2MEMBER_CURRENT_USER_REGISTRATION_TIME = " . S2MEMBER_CURRENT_USER_REGISTRATION_TIME . ","; |
| 106 |
echo "S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME = " . S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME . ","; |
| 107 |
/**/ |
| 108 |
echo "S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS = " . S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS . ","; |
| 109 |
echo "S2MEMBER_CURRENT_USER_REGISTRATION_DAYS = " . S2MEMBER_CURRENT_USER_REGISTRATION_DAYS . ","; |
| 110 |
/**/ |
| 111 |
echo "S2MEMBER_CURRENT_USER_DISPLAY_NAME = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_DISPLAY_NAME) . "',"; |
| 112 |
echo "S2MEMBER_CURRENT_USER_FIRST_NAME = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_FIRST_NAME) . "',"; |
| 113 |
echo "S2MEMBER_CURRENT_USER_LAST_NAME = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_LAST_NAME) . "',"; |
| 114 |
/**/ |
| 115 |
echo "S2MEMBER_CURRENT_USER_LOGIN = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_LOGIN) . "',"; |
| 116 |
echo "S2MEMBER_CURRENT_USER_EMAIL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_EMAIL) . "',"; |
| 117 |
echo "S2MEMBER_CURRENT_USER_IP = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_IP) . "',"; |
| 118 |
echo "S2MEMBER_CURRENT_USER_REGISTRATION_IP = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_REGISTRATION_IP) . "',"; |
| 119 |
/**/ |
| 120 |
echo "S2MEMBER_CURRENT_USER_ID = " . S2MEMBER_CURRENT_USER_ID . ","; |
| 121 |
echo "S2MEMBER_CURRENT_USER_FIELDS = " . S2MEMBER_CURRENT_USER_FIELDS . ","; |
| 122 |
/**/ |
| 123 |
echo "S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED = " . S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED . ","; |
| 124 |
echo "S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED = " . ((S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED) ? "true" : "false") . ","; |
| 125 |
echo "S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY = " . S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY . ","; |
| 126 |
echo "S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS = " . S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS . ","; |
| 127 |
/**/ |
| 128 |
echo "S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID = " . S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID . ","; |
| 129 |
echo "S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID = " . S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID . ","; |
| 130 |
echo "S2MEMBER_LOGIN_WELCOME_PAGE_ID = " . S2MEMBER_LOGIN_WELCOME_PAGE_ID . ","; |
| 131 |
/**/ |
| 132 |
echo "S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL) . "',"; |
| 133 |
echo "S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL) . "',"; |
| 134 |
echo "S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL) . "',"; |
| 135 |
echo "S2MEMBER_LOGIN_WELCOME_PAGE_URL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_LOGIN_WELCOME_PAGE_URL) . "',"; |
| 136 |
echo "S2MEMBER_LOGOUT_PAGE_URL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_LOGOUT_PAGE_URL) . "',"; |
| 137 |
echo "S2MEMBER_LOGIN_PAGE_URL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_LOGIN_PAGE_URL) . "',"; |
| 138 |
/**/ |
| 139 |
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++) |
| 140 |
{ |
| 141 |
if (defined (($S2MEMBER_LEVELn_LABEL = "S2MEMBER_LEVEL" . $n . "_LABEL"))) |
| 142 |
echo $S2MEMBER_LEVELn_LABEL . " = '" . c_ws_plugin__s2member_utils_strings::esc_sq (constant ($S2MEMBER_LEVELn_LABEL)) . "',"; |
| 143 |
} |
| 144 |
/**/ |
| 145 |
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++) |
| 146 |
{ |
| 147 |
if (defined (($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED = "S2MEMBER_LEVEL" . $n . "_FILE_DOWNLOADS_ALLOWED"))) |
| 148 |
echo $S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED . " = " . constant ($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED) . ","; |
| 149 |
} |
| 150 |
/**/ |
| 151 |
for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++) |
| 152 |
{ |
| 153 |
if (defined (($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS = "S2MEMBER_LEVEL" . $n . "_FILE_DOWNLOADS_ALLOWED_DAYS"))) |
| 154 |
echo $S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS . " = " . constant ($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS) . ","; |
| 155 |
} |
| 156 |
/**/ |
| 157 |
echo "S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS) . "',"; |
| 158 |
/**/ |
| 159 |
echo "S2MEMBER_REG_EMAIL_FROM_NAME = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_REG_EMAIL_FROM_NAME) . "',"; |
| 160 |
echo "S2MEMBER_REG_EMAIL_FROM_EMAIL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_REG_EMAIL_FROM_EMAIL) . "',"; |
| 161 |
/**/ |
| 162 |
echo "S2MEMBER_PAYPAL_NOTIFY_URL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_PAYPAL_NOTIFY_URL) . "',"; |
| 163 |
echo "S2MEMBER_PAYPAL_RETURN_URL = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_PAYPAL_RETURN_URL) . "',"; |
| 164 |
/**/ |
| 165 |
echo "S2MEMBER_PAYPAL_BUSINESS = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_PAYPAL_BUSINESS) . "',"; |
| 166 |
echo "S2MEMBER_PAYPAL_ENDPOINT = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_PAYPAL_ENDPOINT) . "',"; |
| 167 |
echo "S2MEMBER_PAYPAL_API_ENDPOINT = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_PAYPAL_API_ENDPOINT) . "',"; |
| 168 |
/**/ |
| 169 |
echo "S2MEMBER_VALUE_FOR_PP_INV = Math.round (new Date ().getTime ()) + '~" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_IP) . "',"; |
| 170 |
echo "S2MEMBER_VALUE_FOR_PP_INV_GEN = function(){ var invoice = '', formatSeed = function(seed, reqWidth) { seed = parseInt(seed, 10).toString (16); if (reqWidth < seed.length) return seed.slice (seed.length - reqWidth); else if (reqWidth > seed.length) return Array(1 + (reqWidth - seed.length)).join ('0') + seed; return seed; }; if (typeof S2MEMBER_VALUE_FOR_PP_INV_GEN_UNIQUE_SEED === 'undefined') S2MEMBER_VALUE_FOR_PP_INV_GEN_UNIQUE_SEED = Math.floor (Math.random () * 0x75bcd15); S2MEMBER_VALUE_FOR_PP_INV_GEN_UNIQUE_SEED++; invoice = formatSeed(parseInt(new Date ().getTime () / 1000, 10), 8); invoice += formatSeed(S2MEMBER_VALUE_FOR_PP_INV_GEN_UNIQUE_SEED, 5); invoice += '~' + S2MEMBER_CURRENT_USER_IP; return invoice; },"; |
| 171 |
/**/ |
| 172 |
echo "S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0 = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0) . "',"; |
| 173 |
echo "S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0 = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0) . "',"; |
| 174 |
/**/ |
| 175 |
echo "S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1 = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1) . "',"; |
| 176 |
echo "S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1 = '" . c_ws_plugin__s2member_utils_strings::esc_sq (S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1) . "';"; |
| 177 |
/**/ |
| 178 |
$u = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"]; |
| 179 |
$i = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["dir_url"] . "/images"; |
| 180 |
/**/ |
| 181 |
include_once dirname (dirname (__FILE__)) . "/s2member-min.js"; |
| 182 |
/**/ |
| 183 |
do_action ("ws_plugin__s2member_during_js_w_globals", get_defined_vars ()); |
| 184 |
/**/ |
| 185 |
exit (); /* Clean exit. */ |
| 186 |
} |
| 187 |
/**/ |
| 188 |
do_action ("ws_plugin__s2member_after_js_w_globals", get_defined_vars ()); |
| 189 |
} |
| 190 |
} |
| 191 |
} |
| 192 |
?> |