PluginProbe
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions / 110710
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions v110710
260913 260909 260829 260814 260805 110710 110731 110812 110815 110912 110913 110915 110926 110927 111002 111003 111011 111017 111029 111105 111206 111216 111220 120213 120219 All 188 releases
s2member / includes / classes / constants.inc.php

constants.inc.php in s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions 110710, at includes/classes/constants.inc.php

2,256 lines 95.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * s2Member's API Constants *( for site owners )*.
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\API_Constants
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_constants"))
21 {
22 /**
23 * s2Member's API Constants *( for site owners )*.
24 *
25 * @package s2Member\API_Constants
26 * @since 3.5
27 */
28 class c_ws_plugin__s2member_constants
29 {
30 /**
31 * Defines several API Constants for s2Member.
32 *
33 * These are also duplicated into the JavaScript API for s2Member.
34 * Except for a few that would pose a security issue. Such as the PayPal® API Credentials;
35 * those are NOT included in the JavaScript API.
36 *
37 * @package s2Member\API_Constants
38 * @since 3.5
39 *
40 * @attaches-to ``add_action("init");``
41 *
42 * @return null
43 *
44 * @todo See if it's possible to further optimize this routine?
45 */
46 public static function constants ()
47 {
48 do_action ("ws_plugin__s2member_before_constants", get_defined_vars ());
49 /**/
50 $links = c_ws_plugin__s2member_cache::cached_page_links ();
51 /**/
52 $user = (is_user_logged_in () && is_object ($user = wp_get_current_user ()) && $user->ID) ? $user : false;
53 /**/
54 $level = c_ws_plugin__s2member_user_access::user_access_level ($user);
55 $file_downloads = c_ws_plugin__s2member_files::user_downloads ($user);
56 $login_redirection_url = c_ws_plugin__s2member_login_redirects::login_redirection_url ($user);
57 /**/
58 $custom = ($user) ? get_user_option ("s2member_custom", $user->ID) : "";
59 $subscr_id = ($user) ? get_user_option ("s2member_subscr_id", $user->ID) : "";
60 $subscr_gateway = ($user) ? get_user_option ("s2member_subscr_gateway", $user->ID) : "";
61 $registration_ip = ($user) ? get_user_option ("s2member_registration_ip", $user->ID) : "";
62 $custom_fields = ($user) ? get_user_option ("s2member_custom_fields", $user->ID) : array ();
63 $paid_registration_times = ($user) ? get_user_option ("s2member_paid_registration_times", $user->ID) : array ();
64 /**/
65 eval ('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
66 do_action ("ws_plugin__s2member_during_constants", get_defined_vars ());
67 unset ($__refs, $__v); /* Unset defined __refs, __v. */
68 /**
69 * Current version of s2Member.
70 *
71 * ———— Quick PHP Code Sample ————
72 * ```
73 * <!php echo S2MEMBER_VERSION; !>
74 * ```
75 * ———— Shortcode & JavaScript Equivalents ————
76 * ```
77 * [s2Get constant="S2MEMBER_VERSION" /]
78 *
79 * <script type="text/javascript">
80 * document.write(S2MEMBER_VERSION);
81 * </script>
82 * ```
83 *
84 * @package s2Member\API_Constants
85 * @since 3.5
86 *
87 * @var str
88 *
89 * @see s2Member\WS_PLUGIN__S2MEMBER_VERSION
90 */
91 if (!defined ("S2MEMBER_VERSION"))
92 define ("S2MEMBER_VERSION", ($c[] = (string)WS_PLUGIN__S2MEMBER_VERSION));
93 /**
94 * Is the current User logged-in at all.
95 *
96 * True if the current User IS logged-in, else false.
97 *
98 * ———— Quick PHP Code Sample ————
99 * ```
100 * <!php
101 * if(S2MEMBER_CURRENT_USER_IS_LOGGED_IN)
102 * echo 'You ARE logged in.';
103 * !>
104 * ```
105 * ———— Shortcode & JavaScript Equivalents ————
106 * ```
107 * [s2If constant(S2MEMBER_CURRENT_USER_IS_LOGGED_IN)]
108 * You ARE logged-in.
109 * [/s2If]
110 *
111 * <script type="text/javascript">
112 * if(S2MEMBER_CURRENT_USER_IS_LOGGED_IN)
113 * document.write('You ARE logged-in.');
114 * </script>
115 * ```
116 *
117 * @package s2Member\API_Constants
118 * @since 3.5
119 *
120 * @var bool
121 *
122 * @see s2Member\API_Functions\is_user_not_logged_in()
123 * @see http://codex.wordpress.org/Function_Reference/is_user_logged_in is_user_logged_in()
124 *
125 * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
126 */
127 if (!defined ("S2MEMBER_CURRENT_USER_IS_LOGGED_IN"))
128 define ("S2MEMBER_CURRENT_USER_IS_LOGGED_IN", ($c[] = (($user) ? true : false)));
129 /**
130 * Is the current User logged-in as a Member.
131 *
132 * True if the current User IS logged-in with a Membership Level greater than `0`, else false.
133 *
134 * ———— Quick PHP Code Sample ————
135 * ```
136 * <!php
137 * if(S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER)
138 * echo 'You ARE logged in at Level #1 or higher.';
139 * !>
140 * ```
141 * ———— Shortcode & JavaScript Equivalents ————
142 * ```
143 * [s2If constant(S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER)]
144 * You ARE logged in at Level #1 or higher.
145 * [/s2If]
146 *
147 * <script type="text/javascript">
148 * if(S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER)
149 * document.write('You ARE logged in at Level #1 or higher.');
150 * </script>
151 * ```
152 *
153 * @package s2Member\API_Constants
154 * @since 3.5
155 *
156 * @var bool
157 *
158 * @see s2Member\API_Functions\is_user_not_logged_in()
159 * @see http://codex.wordpress.org/Function_Reference/is_user_logged_in is_user_logged_in()
160 *
161 * @see s2Member\API_Functions\user_is()
162 * @see s2Member\API_Functions\user_is_not()
163 *
164 * @see s2Member\API_Functions\current_user_is()
165 * @see s2Member\API_Functions\current_user_is_not()
166 * @see s2Member\API_Functions\current_user_is_for_blog()
167 * @see s2Member\API_Functions\current_user_is_not_for_blog()
168 *
169 * @see s2Member\API_Functions\current_user_cannot()
170 * @see s2Member\API_Functions\current_user_cannot_for_blog()
171 * @see http://codex.wordpress.org/Function_Reference/user_can user_can()
172 * @see http://codex.wordpress.org/Function_Reference/current_user_can current_user_can()
173 * @see http://codex.wordpress.org/Function_Reference/current_user_can_for_blog current_user_can_for_blog()
174 *
175 * @see s2Member\API_Functions\get_user_field()
176 * @see `get_user_field("s2member_access_role")`
177 * @see `get_user_field("s2member_access_level")`
178 * @see `get_user_field("s2member_access_label")`
179 *
180 * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
181 */
182 if (!defined ("S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER"))
183 define ("S2MEMBER_CURRENT_USER_IS_LOGGED_IN_AS_MEMBER", ($c[] = (($user && $level >= 1) ? true : false)));
184 /**
185 * The current User's Membership Access Level.
186 *
187 * Negative `-1` through max Membership Level number.
188 * Negative `-1` indicates they are NOT logged-in.
189 *
190 * ———— Quick PHP Code Sample ————
191 * ```
192 * <!php echo S2MEMBER_CURRENT_USER_ACCESS_LEVEL; !>
193 * ```
194 * ———— Shortcode & JavaScript Equivalents ————
195 * ```
196 * [s2Get constant="S2MEMBER_CURRENT_USER_ACCESS_LEVEL" /]
197 *
198 * <script type="text/javascript">
199 * document.write(S2MEMBER_CURRENT_USER_ACCESS_LEVEL);
200 * </script>
201 * ```
202 *
203 * @package s2Member\API_Constants
204 * @since 3.5
205 *
206 * @var int
207 *
208 * @see s2Member\API_Functions\get_user_field()
209 * @see `get_user_field("s2member_access_role")`
210 * @see `get_user_field("s2member_access_level")`
211 * @see `get_user_field("s2member_access_label")`
212 *
213 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_ACCESS_LABEL
214 *
215 * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
216 */
217 if (!defined ("S2MEMBER_CURRENT_USER_ACCESS_LEVEL"))
218 define ("S2MEMBER_CURRENT_USER_ACCESS_LEVEL", ($c[] = (int)$level));
219 /**
220 * The current User's Membership Access Label.
221 *
222 * As configured by the site owner. Each Membership Level is associated with a Membership Label
223 * *( i.e. Bronze, Silver, Gold, Platinum )*, or whatever the site owner has configured.
224 *
225 * An empty string if NOT logged-in.
226 *
227 * ———— Quick PHP Code Sample ————
228 * ```
229 * <!php echo S2MEMBER_CURRENT_USER_ACCESS_LABEL; !>
230 * ```
231 * ———— Shortcode & JavaScript Equivalents ————
232 * ```
233 * [s2Get constant="S2MEMBER_CURRENT_USER_ACCESS_LABEL" /]
234 *
235 * <script type="text/javascript">
236 * document.write(S2MEMBER_CURRENT_USER_ACCESS_LABEL);
237 * </script>
238 * ```
239 *
240 * @package s2Member\API_Constants
241 * @since 3.5
242 *
243 * @var str
244 *
245 * @see s2Member\API_Functions\get_user_field()
246 * @see `get_user_field("s2member_access_role")`
247 * @see `get_user_field("s2member_access_level")`
248 * @see `get_user_field("s2member_access_label")`
249 *
250 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_ACCESS_LEVEL
251 *
252 * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
253 */
254 if (!defined ("S2MEMBER_CURRENT_USER_ACCESS_LABEL"))
255 define ("S2MEMBER_CURRENT_USER_ACCESS_LABEL", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $level . "_label"]));
256 /**
257 * The current User's Paid Subscription ID ( when applicable ).
258 *
259 * An empty string if NOT logged-in.
260 *
261 * ———— Quick PHP Code Sample ————
262 * ```
263 * <!php echo S2MEMBER_CURRENT_USER_SUBSCR_ID; !>
264 * ```
265 * ———— Shortcode & JavaScript Equivalents ————
266 * ```
267 * [s2Get constant="S2MEMBER_CURRENT_USER_SUBSCR_ID" /]
268 *
269 * <script type="text/javascript">
270 * document.write(S2MEMBER_CURRENT_USER_SUBSCR_ID);
271 * </script>
272 * ```
273 *
274 * @package s2Member\API_Constants
275 * @since 3.5
276 *
277 * @var str
278 *
279 * @see s2Member\API_Functions\get_user_field()
280 * @see `get_user_field("s2member_subscr_id")`
281 *
282 * @see http://codex.wordpress.org/Function_Reference/get_user_option get_user_option()
283 * @see `get_user_option("s2member_subscr_id")`
284 *
285 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_CUSTOM
286 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID
287 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY
288 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP
289 *
290 * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
291 */
292 if (!defined ("S2MEMBER_CURRENT_USER_SUBSCR_ID"))
293 define ("S2MEMBER_CURRENT_USER_SUBSCR_ID", ($c[] = (($user) ? (string)$subscr_id : "")));
294 /**
295 * The current User's Paid Subscription ID ( when applicable );
296 * otherwise, this will contain their WordPress® User ID.
297 *
298 * An empty string if NOT logged-in.
299 *
300 * ———— Quick PHP Code Sample ————
301 * ```
302 * <!php echo S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID; !>
303 * ```
304 * ———— Shortcode & JavaScript Equivalents ————
305 * ```
306 * [s2Get constant="S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID" /]
307 *
308 * <script type="text/javascript">
309 * document.write(S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID);
310 * </script>
311 * ```
312 *
313 * @package s2Member\API_Constants
314 * @since 3.5
315 *
316 * @var str
317 *
318 * @see s2Member\API_Functions\get_user_field()
319 * @see `get_user_field("s2member_subscr_or_wp_id")`
320 *
321 * @see http://codex.wordpress.org/Function_Reference/get_user_option get_user_option()
322 * @see `get_user_option("s2member_subscr_id")`
323 *
324 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_CUSTOM
325 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_ID
326 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY
327 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP
328 *
329 * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
330 */
331 if (!defined ("S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID"))
332 define ("S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID", ($c[] = (($user) ? (($subscr_id) ? (string)$subscr_id : (string)$user->ID) : "")));
333 /**
334 * The current User's Paid Subscription Gateway Code ( when applicable ).
335 *
336 * Usually one of these values: `paypal`, `authnet`, `clickbank`, `google`, `ccbill`, `alipay`.
337 *
338 * An empty string if NOT logged-in, or if NOT a paying Member.
339 *
340 * ———— Quick PHP Code Sample ————
341 * ```
342 * <!php echo S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY; !>
343 * ```
344 * ———— Shortcode & JavaScript Equivalents ————
345 * ```
346 * [s2Get constant="S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY" /]
347 *
348 * <script type="text/javascript">
349 * document.write(S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY);
350 * </script>
351 * ```
352 *
353 * @package s2Member\API_Constants
354 * @since 3.5
355 *
356 * @var str
357 *
358 * @see s2Member\API_Functions\get_user_field()
359 * @see `get_user_field("s2member_subscr_gateway")`
360 *
361 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_CUSTOM
362 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_ID
363 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID
364 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP
365 *
366 * @see http://codex.wordpress.org/Function_Reference/get_user_option get_user_option()
367 * @see `get_user_option("s2member_subscr_gateway")`
368 */
369 if (!defined ("S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY"))
370 define ("S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY", ($c[] = (($user) ? (string)$subscr_gateway : "")));
371 /**
372 * The current User's Custom String, associated with their Profile.
373 *
374 * For paying Members, this should always start with the installation domain name.
375 * This is taken from the `custom=""` Attribute in your Button/Form Shortcode.
376 *
377 * Other pipe delimited values may follow the installation domain name, if configured by the site owner.
378 * For instance, this might be equal to something like: `www.example.com|cv1|cv2|cv3`.
379 *
380 * An empty string if NOT logged-in, or if NOT a paying Member.
381 *
382 * ———— Quick PHP Code Sample ————
383 * ```
384 * <!php echo S2MEMBER_CURRENT_USER_CUSTOM; !>
385 * ```
386 * ———— Shortcode & JavaScript Equivalents ————
387 * ```
388 * [s2Get constant="S2MEMBER_CURRENT_USER_CUSTOM" /]
389 *
390 * <script type="text/javascript">
391 * document.write(S2MEMBER_CURRENT_USER_CUSTOM);
392 * </script>
393 * ```
394 *
395 * @package s2Member\API_Constants
396 * @since 3.5
397 *
398 * @var str
399 *
400 * @see s2Member\API_Functions\get_user_field()
401 * @see `get_user_field("s2member_custom")`
402 *
403 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_ID
404 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID
405 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY
406 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP
407 *
408 * @see http://codex.wordpress.org/Function_Reference/get_user_option get_user_option()
409 * @see `get_user_option("s2member_custom")`
410 */
411 if (!defined ("S2MEMBER_CURRENT_USER_CUSTOM"))
412 define ("S2MEMBER_CURRENT_USER_CUSTOM", ($c[] = (($user) ? (string)$custom : "")));
413 /**
414 * The current User's Registration Time.
415 *
416 * The Registration Time, is the time at which the Username was created for the account, that's it.
417 * There's nothing special about this. This simply returns a {@link http://en.wikipedia.org/wiki/Unix_time Unix Timestamp}.
418 *
419 * This will be equal to `0` if NOT logged-in.
420 *
421 * ———— Quick PHP Code Sample ————
422 * ```
423 * <!php echo S2MEMBER_CURRENT_USER_REGISTRATION_TIME; !>
424 * ```
425 * ———— Shortcode & JavaScript Equivalents ————
426 * ```
427 * [s2Get constant="S2MEMBER_CURRENT_USER_REGISTRATION_TIME" /]
428 *
429 * <script type="text/javascript">
430 * document.write(S2MEMBER_CURRENT_USER_REGISTRATION_TIME);
431 * </script>
432 * ```
433 *
434 * @package s2Member\API_Constants
435 * @since 3.5
436 *
437 * @var int
438 *
439 * @see s2Member\API_Functions\s2member_registration_time()
440 *
441 * @see s2Member\API_Functions\s2member_paid_registration_time()
442 * @see `s2member_paid_registration_time("level1")`
443 *
444 * @see s2Member\API_Functions\get_user_field()
445 *
446 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_DAYS
447 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME
448 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS
449 *
450 * @see http://codex.wordpress.org/Function_Reference/get_user_option get_user_option()
451 */
452 if (!defined ("S2MEMBER_CURRENT_USER_REGISTRATION_TIME"))
453 define ("S2MEMBER_CURRENT_USER_REGISTRATION_TIME", ($c[] = (($user && $user->user_registered) ? (int)strtotime ($user->user_registered) : 0)));
454 /**
455 * The current User's first Paid Registration Time; regardless of which paid Level they gained access to.
456 *
457 * **NOTE** A Paid Registration Time, is NOT necessarily related specifically to a Payment.
458 * s2Member records a Paid Registration Time, anytime a User acquires paid Membership Level Access.
459 *
460 * In other words, if you create a new User inside your Dashboard at a Membership Level greater than Level #0,
461 * s2Member will record a Paid Registration Time immediately, because Membership Levels > 0, are reserved for paying Members.
462 * s2Member monitors changes to all User accounts, and records the first Paid Registration Time for each Member, at each paid Membership Level.
463 * So, s2Member stores the first Time a Member reaches each Level of paid access; and s2Member does NOT care if they *actually* paid, or not.
464 *
465 * If the current User has never been at a paid Membership Level, this will be equal to `0`.
466 *
467 * This will be equal to `0` if NOT logged-in.
468 *
469 * ———— Quick PHP Code Sample ————
470 * ```
471 * <!php echo S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME; !>
472 * ```
473 * ———— Shortcode & JavaScript Equivalents ————
474 * ```
475 * [s2Get constant="S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME" /]
476 *
477 * <script type="text/javascript">
478 * document.write(S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME);
479 * </script>
480 * ```
481 *
482 * If you need to know the last time an actual payment was received, please use ``get_user_option ("s2member_last_payment_time")``.
483 *
484 * @package s2Member\API_Constants
485 * @since 3.5
486 *
487 * @var int
488 *
489 * @see s2Member\API_Functions\s2member_registration_time()
490 *
491 * @see s2Member\API_Functions\s2member_paid_registration_time()
492 * @see `s2member_paid_registration_time("level1")`
493 *
494 * @see s2Member\API_Functions\get_user_field()
495 *
496 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_TIME
497 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_DAYS
498 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS
499 *
500 * @see http://codex.wordpress.org/Function_Reference/get_user_option get_user_option()
501 */
502 if (!defined ("S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME"))
503 define ("S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME", ($c[] = (($user && (int)$paid_registration_times["level"]) ? (int)$paid_registration_times["level"] : 0)));
504 /**
505 * The number of days the current User has been a paid Member.
506 *
507 * **NOTE** This is calculated using the first Paid Registration Time.
508 * A Paid Registration Time, is NOT necessarily related specifically to a Payment.
509 * s2Member records a Paid Registration Time, anytime a User acquires paid Membership Level Access.
510 *
511 * In other words, if you create a new User inside your Dashboard at a Membership Level greater than Level #0,
512 * s2Member will record a Paid Registration Time immediately, because Membership Levels > 0, are reserved for paying Members.
513 * s2Member monitors changes to all User accounts, and records the first Paid Registration Time for each Member, at each paid Membership Level.
514 * So, s2Member stores the first Time a Member reaches each Level of paid access; and s2Member does NOT care if they *actually* paid, or not.
515 *
516 * If the current User has never been at a paid Membership Level, this will be equal to `0`.
517 *
518 * This will be equal to `0` if NOT logged-in.
519 *
520 * ———— Quick PHP Code Sample ————
521 * ```
522 * <!php echo S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS; !>
523 * ```
524 * ———— Shortcode & JavaScript Equivalents ————
525 * ```
526 * [s2Get constant="S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS" /]
527 *
528 * <script type="text/javascript">
529 * document.write(S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS);
530 * </script>
531 * ```
532 *
533 * If you need to know the last time an actual payment was received, please use ``get_user_option ("s2member_last_payment_time")``.
534 *
535 * @package s2Member\API_Constants
536 * @since 3.5
537 *
538 * @var int
539 *
540 * @see s2Member\API_Functions\s2member_registration_time()
541 *
542 * @see s2Member\API_Functions\s2member_paid_registration_time()
543 * @see `s2member_paid_registration_time("level1")`
544 *
545 * @see s2Member\API_Functions\get_user_field()
546 *
547 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_TIME
548 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_DAYS
549 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME
550 *
551 * @see http://codex.wordpress.org/Function_Reference/get_user_option get_user_option()
552 */
553 if (!defined ("S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS"))
554 define ("S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS", ($c[] = (($user && (int)$paid_registration_times["level"]) ? (int)floor ((strtotime ("now") - (int)$paid_registration_times["level"]) / 86400) : 0)));
555 /**
556 * The number of days the current User has had an account, period.
557 *
558 * **NOTE** This is calculated with Registration Time.
559 * The Registration Time, is the time at which the Username was created for the account, that's it.
560 *
561 * This will be equal to `0` if NOT logged-in.
562 *
563 * ———— Quick PHP Code Sample ————
564 * ```
565 * <!php echo S2MEMBER_CURRENT_USER_REGISTRATION_DAYS; !>
566 * ```
567 * ———— Shortcode & JavaScript Equivalents ————
568 * ```
569 * [s2Get constant="S2MEMBER_CURRENT_USER_REGISTRATION_DAYS" /]
570 *
571 * <script type="text/javascript">
572 * document.write(S2MEMBER_CURRENT_USER_REGISTRATION_DAYS);
573 * </script>
574 * ```
575 *
576 * @package s2Member\API_Constants
577 * @since 3.5
578 *
579 * @var int
580 *
581 * @see s2Member\API_Functions\s2member_registration_time()
582 *
583 * @see s2Member\API_Functions\s2member_paid_registration_time()
584 * @see `s2member_paid_registration_time("level1")`
585 *
586 * @see s2Member\API_Functions\get_user_field()
587 *
588 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_TIME
589 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PAID_REGISTRATION_TIME
590 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS
591 *
592 * @see http://codex.wordpress.org/Function_Reference/get_user_option get_user_option()
593 */
594 if (!defined ("S2MEMBER_CURRENT_USER_REGISTRATION_DAYS"))
595 define ("S2MEMBER_CURRENT_USER_REGISTRATION_DAYS", ($c[] = (($user && $user->user_registered) ? (int)floor ((strtotime ("now") - strtotime ($user->user_registered)) / 86400) : 0)));
596 /**
597 * The current User's Display Name.
598 *
599 * This is usually a name they prefer to be known by publicly.
600 * Some Users/Members prefer to use their First Name as the Display Name, and keep their Last Name private.
601 *
602 * An empty string if NOT logged-in.
603 *
604 * ———— Quick PHP Code Sample ————
605 * ```
606 * <!php echo S2MEMBER_CURRENT_USER_DISPLAY_NAME; !>
607 * ```
608 * ———— Shortcode & JavaScript Equivalents ————
609 * ```
610 * [s2Get constant="S2MEMBER_CURRENT_USER_DISPLAY_NAME" /]
611 *
612 * <script type="text/javascript">
613 * document.write(S2MEMBER_CURRENT_USER_DISPLAY_NAME);
614 * </script>
615 * ```
616 *
617 * @package s2Member\API_Constants
618 * @since 3.5
619 *
620 * @var str
621 *
622 * @see s2Member\API_Functions\get_user_field()
623 * @see `get_user_field("display_name")`
624 *
625 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_ID
626 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_IP
627 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP
628 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LOGIN
629 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_EMAIL
630 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIRST_NAME
631 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LAST_NAME
632 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIELDS
633 *
634 * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
635 */
636 if (!defined ("S2MEMBER_CURRENT_USER_DISPLAY_NAME"))
637 define ("S2MEMBER_CURRENT_USER_DISPLAY_NAME", ($c[] = (($user) ? (string)$user->display_name : "")));
638 /**
639 * The current User's First Name.
640 *
641 * An empty string if NOT logged-in.
642 *
643 * ———— Quick PHP Code Sample ————
644 * ```
645 * <!php echo S2MEMBER_CURRENT_USER_FIRST_NAME; !>
646 * ```
647 * ———— Shortcode & JavaScript Equivalents ————
648 * ```
649 * [s2Get constant="S2MEMBER_CURRENT_USER_FIRST_NAME" /]
650 *
651 * <script type="text/javascript">
652 * document.write(S2MEMBER_CURRENT_USER_FIRST_NAME);
653 * </script>
654 * ```
655 *
656 * @package s2Member\API_Constants
657 * @since 3.5
658 *
659 * @var str
660 *
661 * @see s2Member\API_Functions\get_user_field()
662 * @see `get_user_field("first_name")`
663 *
664 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_ID
665 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_IP
666 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP
667 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LOGIN
668 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_EMAIL
669 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LAST_NAME
670 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DISPLAY_NAME
671 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIELDS
672 *
673 * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
674 */
675 if (!defined ("S2MEMBER_CURRENT_USER_FIRST_NAME"))
676 define ("S2MEMBER_CURRENT_USER_FIRST_NAME", ($c[] = (($user) ? (string)$user->first_name : "")));
677 /**
678 * The current User's Last Name.
679 *
680 * An empty string if NOT logged-in.
681 *
682 * ———— Quick PHP Code Sample ————
683 * ```
684 * <!php echo S2MEMBER_CURRENT_USER_LAST_NAME; !>
685 * ```
686 * ———— Shortcode & JavaScript Equivalents ————
687 * ```
688 * [s2Get constant="S2MEMBER_CURRENT_USER_LAST_NAME" /]
689 *
690 * <script type="text/javascript">
691 * document.write(S2MEMBER_CURRENT_USER_LAST_NAME);
692 * </script>
693 * ```
694 *
695 * @package s2Member\API_Constants
696 * @since 3.5
697 *
698 * @var str
699 *
700 * @see s2Member\API_Functions\get_user_field()
701 * @see `get_user_field("last_name")`
702 *
703 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_ID
704 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_IP
705 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP
706 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LOGIN
707 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_EMAIL
708 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIRST_NAME
709 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DISPLAY_NAME
710 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIELDS
711 *
712 * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
713 */
714 if (!defined ("S2MEMBER_CURRENT_USER_LAST_NAME"))
715 define ("S2MEMBER_CURRENT_USER_LAST_NAME", ($c[] = (($user) ? (string)$user->last_name : "")));
716 /**
717 * The current User's Username.
718 *
719 * An empty string if NOT logged-in.
720 *
721 * ———— Quick PHP Code Sample ————
722 * ```
723 * <!php echo S2MEMBER_CURRENT_USER_LOGIN; !>
724 * ```
725 * ———— Shortcode & JavaScript Equivalents ————
726 * ```
727 * [s2Get constant="S2MEMBER_CURRENT_USER_LOGIN" /]
728 *
729 * <script type="text/javascript">
730 * document.write(S2MEMBER_CURRENT_USER_LOGIN);
731 * </script>
732 * ```
733 *
734 * @package s2Member\API_Constants
735 * @since 3.5
736 *
737 * @var str
738 *
739 * @see s2Member\API_Functions\get_user_field()
740 * @see `get_user_field("user_login")`
741 *
742 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_ID
743 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_IP
744 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP
745 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_EMAIL
746 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIRST_NAME
747 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LAST_NAME
748 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DISPLAY_NAME
749 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIELDS
750 *
751 * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
752 */
753 if (!defined ("S2MEMBER_CURRENT_USER_LOGIN"))
754 define ("S2MEMBER_CURRENT_USER_LOGIN", ($c[] = (($user) ? (string)$user->user_login : "")));
755 /**
756 * The current User's Email Address.
757 *
758 * An empty string if NOT logged-in.
759 *
760 * ———— Quick PHP Code Sample ————
761 * ```
762 * <!php echo S2MEMBER_CURRENT_USER_EMAIL; !>
763 * ```
764 * ———— Shortcode & JavaScript Equivalents ————
765 * ```
766 * [s2Get constant="S2MEMBER_CURRENT_USER_EMAIL" /]
767 *
768 * <script type="text/javascript">
769 * document.write(S2MEMBER_CURRENT_USER_EMAIL);
770 * </script>
771 * ```
772 *
773 * @package s2Member\API_Constants
774 * @since 3.5
775 *
776 * @var str
777 *
778 * @see s2Member\API_Functions\get_user_field()
779 * @see `get_user_field("user_email")`
780 *
781 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_ID
782 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_IP
783 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP
784 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LOGIN
785 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIRST_NAME
786 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LAST_NAME
787 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DISPLAY_NAME
788 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIELDS
789 *
790 * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
791 */
792 if (!defined ("S2MEMBER_CURRENT_USER_EMAIL"))
793 define ("S2MEMBER_CURRENT_USER_EMAIL", ($c[] = (($user) ? (string)$user->user_email : "")));
794 /**
795 * The current User's IP Address ( even if/when NOT logged-in ).
796 *
797 * This is the current IP Address, taken from ``$_SERVER["REMOTE_ADDR"]``.
798 *
799 * ———— Quick PHP Code Sample ————
800 * ```
801 * <!php echo S2MEMBER_CURRENT_USER_IP; !>
802 * ```
803 * ———— Shortcode & JavaScript Equivalents ————
804 * ```
805 * [s2Get constant="S2MEMBER_CURRENT_USER_IP" /]
806 *
807 * <script type="text/javascript">
808 * document.write(S2MEMBER_CURRENT_USER_IP);
809 * </script>
810 * ```
811 *
812 * @package s2Member\API_Constants
813 * @since 3.5
814 *
815 * @var str
816 *
817 * @see s2Member\API_Functions\get_user_field()
818 * @see `get_user_field("s2member_registration_ip")`
819 * @see `get_user_field("ip")`
820 *
821 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP
822 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_ID
823 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LOGIN
824 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_EMAIL
825 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIRST_NAME
826 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LAST_NAME
827 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DISPLAY_NAME
828 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIELDS
829 *
830 * @see http://www.php.net/manual/en/reserved.variables.server.php Superglobal $_SERVER
831 * @see `$_SERVER["REMOTE_ADDR"]`
832 */
833 if (!defined ("S2MEMBER_CURRENT_USER_IP"))
834 define ("S2MEMBER_CURRENT_USER_IP", ($c[] = (string)$_SERVER["REMOTE_ADDR"]));
835 /**
836 * IP Address the current User had during registration.
837 *
838 * This is the IP Address the User had at the time they registered.
839 * It's useful when you need to know the original IP Address they used.
840 * For instance, this is needed by some affiliate tracking systems; such as iDevAffiliate.
841 *
842 * An empty string if NOT logged-in.
843 *
844 * ———— Quick PHP Code Sample ————
845 * ```
846 * <!php echo S2MEMBER_CURRENT_USER_REGISTRATION_IP; !>
847 * ```
848 * ———— Shortcode & JavaScript Equivalents ————
849 * ```
850 * [s2Get constant="S2MEMBER_CURRENT_USER_REGISTRATION_IP" /]
851 *
852 * <script type="text/javascript">
853 * document.write(S2MEMBER_CURRENT_USER_REGISTRATION_IP);
854 * </script>
855 * ```
856 *
857 * @package s2Member\API_Constants
858 * @since 3.5
859 *
860 * @var str
861 *
862 * @see s2Member\API_Functions\get_user_field()
863 * @see `get_user_field("s2member_registration_ip")`
864 * @see `get_user_field("ip")`
865 *
866 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_IP
867 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_ID
868 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LOGIN
869 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_EMAIL
870 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIRST_NAME
871 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LAST_NAME
872 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DISPLAY_NAME
873 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIELDS
874 *
875 * @see http://www.php.net/manual/en/reserved.variables.server.php Superglobal $_SERVER
876 * @see `$_SERVER["REMOTE_ADDR"]`
877 */
878 if (!defined ("S2MEMBER_CURRENT_USER_REGISTRATION_IP"))
879 define ("S2MEMBER_CURRENT_USER_REGISTRATION_IP", ($c[] = (($user) ? (string)$registration_ip : "")));
880 /**
881 * The current User's WordPress® User ID.
882 *
883 * This will be equal to `0` if NOT logged-in.
884 *
885 * ———— Quick PHP Code Sample ————
886 * ```
887 * <!php echo S2MEMBER_CURRENT_USER_ID; !>
888 * ```
889 * ———— Shortcode & JavaScript Equivalents ————
890 * ```
891 * [s2Get constant="S2MEMBER_CURRENT_USER_ID" /]
892 *
893 * <script type="text/javascript">
894 * document.write(S2MEMBER_CURRENT_USER_ID);
895 * </script>
896 * ```
897 *
898 * @package s2Member\API_Constants
899 * @since 3.5
900 *
901 * @var int
902 *
903 * @see s2Member\API_Functions\get_user_field()
904 * @see `get_user_field("id")`
905 *
906 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_IP
907 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP
908 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LOGIN
909 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_EMAIL
910 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIRST_NAME
911 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_LAST_NAME
912 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DISPLAY_NAME
913 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIELDS
914 *
915 * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
916 */
917 if (!defined ("S2MEMBER_CURRENT_USER_ID"))
918 define ("S2MEMBER_CURRENT_USER_ID", ($c[] = (($user) ? (int)$user->ID : 0)));
919 /**
920 * The current User's fields, provided by s2Member.
921 *
922 * This holds a JSON-encoded array, containing these array keys:
923 *
924 * o `id` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_ID}
925 * o `ip` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_IP}
926 * o `reg_ip` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_REGISTRATION_IP}
927 * o `email` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_EMAIL}
928 * o `login` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_LOGIN}
929 * o `first_name` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_FIRST_NAME}
930 * o `last_name` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_LAST_NAME}
931 * o `display_name` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_DISPLAY_NAME}
932 * o `subscr_id` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_ID}
933 * o `subscr_or_wp_id` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID}
934 * o `subscr_gateway` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY}
935 * o `custom` = value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_CUSTOM}
936 * o and any Custom Registration Fields configured by the site owner.
937 *
938 * This will be an empty JSON-encoded array if NOT logged-in.
939 *
940 * ———— Code Sample ( Using ``json_decode(JSON, true)`` ) ————
941 * ```
942 * <!php
943 * $fields = json_decode(S2MEMBER_CURRENT_USER_FIELDS, true);
944 * echo $fields["email"]; # The current User's Email Address.
945 * echo $fields["my_unique_field_id"]; # A Custom Registration Field configured by the site owner.
946 * !>
947 * ```
948 * ———— Shortcode & JavaScript Equivalents ————
949 * ```
950 * [s2Get user_field="id" /]
951 * [s2Get user_field="ip" /]
952 * [s2Get user_field="reg_ip" /]
953 * [s2Get user_field="email" /]
954 * [s2Get user_field="login" /]
955 * [s2Get user_field="first_name" /]
956 * [s2Get user_field="last_name" /]
957 * [s2Get user_field="display_name" /]
958 * [s2Get user_field="s2member_subscr_id" /]
959 * [s2Get user_field="s2member_subscr_wp_id" /]
960 * [s2Get user_field="s2member_subscr_gateway" /]
961 * [s2Get user_field="s2member_custom" /]
962 * [s2Get user_field="my_custom_field_id" /]
963 *
964 * <script type="text/javascript">
965 * document.write(S2MEMBER_CURRENT_USER_FIELDS.id);
966 * document.write(S2MEMBER_CURRENT_USER_FIELDS.display_name);
967 * </script>
968 * ```
969 *
970 * @package s2Member\API_Constants
971 * @since 3.5
972 *
973 * @var str
974 *
975 * @see s2Member\API_Functions\get_user_field()
976 *
977 * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
978 */
979 if (!defined ("S2MEMBER_CURRENT_USER_FIELDS"))
980 define ("S2MEMBER_CURRENT_USER_FIELDS", ($c[] = (($user) ? json_encode (array_merge (array ("id" => S2MEMBER_CURRENT_USER_ID, "ip" => S2MEMBER_CURRENT_USER_IP, "reg_ip" => S2MEMBER_CURRENT_USER_REGISTRATION_IP, "email" => S2MEMBER_CURRENT_USER_EMAIL, "login" => S2MEMBER_CURRENT_USER_LOGIN, "first_name" => S2MEMBER_CURRENT_USER_FIRST_NAME, "last_name" => S2MEMBER_CURRENT_USER_LAST_NAME, "display_name" => S2MEMBER_CURRENT_USER_DISPLAY_NAME, "subscr_id" => S2MEMBER_CURRENT_USER_SUBSCR_ID, "subscr_or_wp_id" => S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID, "subscr_gateway" => S2MEMBER_CURRENT_USER_SUBSCR_GATEWAY, "custom" => S2MEMBER_CURRENT_USER_CUSTOM), (array)$custom_fields)) : json_encode (array ()))));
981 /**
982 * Indicates the number of unique Files the current User is allowed to download every X days.
983 *
984 * `0` means no access to File Downloads has been made available to the User.
985 *
986 * This will be equal to `0` if NOT logged-in.
987 *
988 * ———— Quick PHP Code Sample ————
989 * ```
990 * <!php echo S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED; !>
991 * ```
992 * ———— Shortcode & JavaScript Equivalents ————
993 * ```
994 * [s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED" /]
995 *
996 * <script type="text/javascript">
997 * document.write(S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED);
998 * </script>
999 * ```
1000 *
1001 * @package s2Member\API_Constants
1002 * @since 3.5
1003 *
1004 * @var int
1005 *
1006 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED
1007 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS
1008 *
1009 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY
1010 *
1011 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1012 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1013 *
1014 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED
1015 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS
1016 *
1017 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS
1018 *
1019 * @see `Dashboard -> s2Member -> Download Options`
1020 */
1021 if (!defined ("S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED"))
1022 define ("S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED", ($c[] = (int)$file_downloads["allowed"]));
1023 /**
1024 * Does the current User have access to unlimited File Downloads.
1025 *
1026 * A value of true means the current User's allowed downloads are >= `999999999`, and false means it is not.
1027 * This is useful if you are allowing unlimited ( i.e. `999999999+` ) Downloads on some Membership Levels.
1028 * You can display `Unlimited` instead of a numerical value.
1029 *
1030 * This will be false if NOT logged-in.
1031 *
1032 * ———— Quick PHP Code Sample ————
1033 * ```
1034 * <!php
1035 * if(S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED)
1036 * echo 'You have access to unlimited downloads.';
1037 * !>
1038 * ```
1039 * ———— Shortcode & JavaScript Equivalents ————
1040 * ```
1041 * [s2If constant(S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED)]
1042 * You have access to unlimited downloads.
1043 * [/s2If]
1044 *
1045 * <script type="text/javascript">
1046 * if(S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED)
1047 * document.write('You have access to unlimited downloads.');
1048 * </script>
1049 * ```
1050 *
1051 * @package s2Member\API_Constants
1052 * @since 3.5
1053 *
1054 * @var bool
1055 *
1056 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED
1057 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS
1058 *
1059 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY
1060 *
1061 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1062 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1063 *
1064 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED
1065 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS
1066 *
1067 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS
1068 *
1069 * @see `Dashboard -> s2Member -> Download Options`
1070 */
1071 if (!defined ("S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED"))
1072 define ("S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED", ($c[] = (($file_downloads["allowed"] >= 999999999) ? true : false)));
1073 /**
1074 * Indicates the number of unique Files the current User has downloaded in the last X days.
1075 *
1076 * This will be equal to `0` if NOT logged-in.
1077 *
1078 * ———— Quick PHP Code Sample ————
1079 * ```
1080 * <!php echo S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY; !>
1081 * ```
1082 * ———— Shortcode & JavaScript Equivalents ————
1083 * ```
1084 * [s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY" /]
1085 *
1086 * <script type="text/javascript">
1087 * document.write(S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY);
1088 * </script>
1089 * ```
1090 *
1091 * @package s2Member\API_Constants
1092 * @since 3.5
1093 *
1094 * @var int
1095 *
1096 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED
1097 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED
1098 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS
1099 *
1100 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1101 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1102 *
1103 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED
1104 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS
1105 *
1106 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS
1107 *
1108 * @see `Dashboard -> s2Member -> Download Options`
1109 */
1110 if (!defined ("S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY"))
1111 define ("S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY", ($c[] = (int)$file_downloads["currently"]));
1112 /**
1113 * Indicates the X number of days, configured by the site owner; for the current User.
1114 *
1115 * This will be equal to `0` if NOT logged-in.
1116 *
1117 * ———— Quick PHP Code Sample ————
1118 * ```
1119 * You are allowed to download <!php echo S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED; !> files, every <!php echo S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS; !> days.
1120 * You've downloaded <!php echo S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY; !> files in the last <!php echo S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS; !> days.
1121 * ```
1122 * ———— Shortcode & JavaScript Equivalents ————
1123 * ```
1124 * You are allowed to download [s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED" /] files, every [s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS" /] days.
1125 * You've downloaded [s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY" /] files in the last [s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS" /] days.
1126 *
1127 * You are allowed to download <script type="text/javascript">document.write(S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED);</script> files, every <script type="text/javascript">document.write(S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS);</script> days.
1128 * You've downloaded <script type="text/javascript">document.write(S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY);</script> files in the last <script type="text/javascript">document.write(S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS);</script> days.
1129 * ```
1130 *
1131 * @package s2Member\API_Constants
1132 * @since 3.5
1133 *
1134 * @var int
1135 *
1136 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED
1137 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED
1138 *
1139 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY
1140 *
1141 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1142 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1143 *
1144 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED
1145 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS
1146 *
1147 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS
1148 *
1149 * @see `Dashboard -> s2Member -> Download Options`
1150 */
1151 if (!defined ("S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS"))
1152 define ("S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS", ($c[] = (int)$file_downloads["allowed_days"]));
1153 /**
1154 * The configured Page ID, for the Download Limit Exceeded Page.
1155 *
1156 * This will be equal to `0` if NOT yet configured.
1157 *
1158 * ———— Quick PHP Code Sample ————
1159 * ```
1160 * <!php echo S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID; !>
1161 * ```
1162 * ———— Shortcode & JavaScript Equivalents ————
1163 * ```
1164 * [s2Get constant="S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID" /]
1165 *
1166 * <script type="text/javascript">
1167 * document.write(S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID);
1168 * </script>
1169 * ```
1170 *
1171 * @package s2Member\API_Constants
1172 * @since 3.5
1173 *
1174 * @var int
1175 *
1176 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED
1177 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED
1178 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS
1179 *
1180 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY
1181 *
1182 * @see s2Member\API_Constants\S2MEMBER_LOGIN_PAGE_URL
1183 * @see s2Member\API_Constants\S2MEMBER_LOGOUT_PAGE_URL
1184 *
1185 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID
1186 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL
1187 *
1188 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_ID
1189 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_URL
1190 *
1191 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1192 *
1193 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL
1194 *
1195 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED
1196 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS
1197 *
1198 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS
1199 *
1200 * @see `Dashboard -> s2Member -> Download Options`
1201 */
1202 if (!defined ("S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID"))
1203 define ("S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]));
1204 /**
1205 * The configured Page ID, for the Membership Options Page.
1206 *
1207 * This will be equal to `0` if NOT yet configured.
1208 *
1209 * ———— Quick PHP Code Sample ————
1210 * ```
1211 * <!php echo S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID; !>
1212 * ```
1213 * ———— Shortcode & JavaScript Equivalents ————
1214 * ```
1215 * [s2Get constant="S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID" /]
1216 *
1217 * <script type="text/javascript">
1218 * document.write(S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID);
1219 * </script>
1220 * ```
1221 *
1222 * @package s2Member\API_Constants
1223 * @since 3.5
1224 *
1225 * @var int
1226 *
1227 * @see s2Member\API_Constants\S2MEMBER_LOGIN_PAGE_URL
1228 * @see s2Member\API_Constants\S2MEMBER_LOGOUT_PAGE_URL
1229 *
1230 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL
1231 *
1232 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_ID
1233 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_URL
1234 *
1235 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1236 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1237 *
1238 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL
1239 *
1240 * @see `Dashboard -> s2Member -> General Options -> Membership Options Page`
1241 */
1242 if (!defined ("S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID"))
1243 define ("S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]));
1244 /**
1245 * The configured Page ID, for the Login Welcome Page.
1246 *
1247 * This will be equal to `0` if NOT yet configured.
1248 *
1249 * ———— Quick PHP Code Sample ————
1250 * ```
1251 * <!php echo S2MEMBER_LOGIN_WELCOME_PAGE_ID; !>
1252 * ```
1253 * ———— Shortcode & JavaScript Equivalents ————
1254 * ```
1255 * [s2Get constant="S2MEMBER_LOGIN_WELCOME_PAGE_ID" /]
1256 *
1257 * <script type="text/javascript">
1258 * document.write(S2MEMBER_LOGIN_WELCOME_PAGE_ID);
1259 * </script>
1260 * ```
1261 *
1262 * @package s2Member\API_Constants
1263 * @since 3.5
1264 *
1265 * @var int
1266 *
1267 * @see s2Member\API_Constants\S2MEMBER_LOGIN_PAGE_URL
1268 * @see s2Member\API_Constants\S2MEMBER_LOGOUT_PAGE_URL
1269 *
1270 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID
1271 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL
1272 *
1273 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_URL
1274 *
1275 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1276 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1277 *
1278 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL
1279 *
1280 * @see `Dashboard -> s2Member -> General Options -> Login Welcome Page`
1281 */
1282 if (!defined ("S2MEMBER_LOGIN_WELCOME_PAGE_ID"))
1283 define ("S2MEMBER_LOGIN_WELCOME_PAGE_ID", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]));
1284 /**
1285 * A URL, which leads to the Stand-Alone Profile Modification Page.
1286 *
1287 * This is always a reference to `/?s2member_profile=1` *( i.e. the Stand-Alone version )*.
1288 *
1289 * ———— Quick PHP Code Sample ————
1290 * ```
1291 * <!php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; !>
1292 * ```
1293 * ———— Shortcode & JavaScript Equivalents ————
1294 * ```
1295 * [s2Get constant="S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL" /]
1296 *
1297 * <script type="text/javascript">
1298 * document.write(S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL);
1299 * </script>
1300 * ```
1301 *
1302 * @package s2Member\API_Constants
1303 * @since 3.5
1304 *
1305 * @var str
1306 *
1307 * @see s2Member\API_Constants\S2MEMBER_LOGIN_PAGE_URL
1308 * @see s2Member\API_Constants\S2MEMBER_LOGOUT_PAGE_URL
1309 *
1310 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID
1311 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL
1312 *
1313 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_ID
1314 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_URL
1315 *
1316 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1317 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1318 *
1319 * @see `Dashboard -> s2Member -> General Options -> Profile Modifications`
1320 */
1321 if (!defined ("S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL"))
1322 define ("S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL", ($c[] = (string)site_url ("/?s2member_profile=1")));
1323 /**
1324 * A URL, which leads to the Download Limit Exceeded Page; as configured by the site owner.
1325 *
1326 * If the site owner has not yet configured a Download Limit Exceeded Page, this defaults to the Home Page.
1327 *
1328 * ———— Quick PHP Code Sample ————
1329 * ```
1330 * <!php echo S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL; !>
1331 * ```
1332 * ———— Shortcode & JavaScript Equivalents ————
1333 * ```
1334 * [s2Get constant="S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL" /]
1335 *
1336 * <script type="text/javascript">
1337 * document.write(S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL);
1338 * </script>
1339 * ```
1340 *
1341 * @package s2Member\API_Constants
1342 * @since 3.5
1343 *
1344 * @var str
1345 *
1346 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED
1347 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED
1348 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS
1349 *
1350 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY
1351 *
1352 * @see s2Member\API_Constants\S2MEMBER_LOGIN_PAGE_URL
1353 * @see s2Member\API_Constants\S2MEMBER_LOGOUT_PAGE_URL
1354 *
1355 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID
1356 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL
1357 *
1358 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_ID
1359 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_URL
1360 *
1361 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1362 *
1363 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL
1364 *
1365 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED
1366 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS
1367 *
1368 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS
1369 *
1370 * @see `Dashboard -> s2Member -> Download Options`
1371 */
1372 if (!defined ("S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL"))
1373 define ("S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL", ($c[] = (string)$links["file_download_limit_exceeded_page"]));
1374 /**
1375 * A URL, which leads to the Membership Options Page; as configured by the site owner.
1376 *
1377 * If the site owner has not yet configured a Membership Options Page, this defaults to the Home Page.
1378 *
1379 * ———— Quick PHP Code Sample ————
1380 * ```
1381 * <!php echo S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL; !>
1382 * ```
1383 * ———— Shortcode & JavaScript Equivalents ————
1384 * ```
1385 * [s2Get constant="S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL" /]
1386 *
1387 * <script type="text/javascript">
1388 * document.write(S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
1389 * </script>
1390 * ```
1391 *
1392 * @package s2Member\API_Constants
1393 * @since 3.5
1394 *
1395 * @var str
1396 *
1397 * @see s2Member\API_Constants\S2MEMBER_LOGIN_PAGE_URL
1398 * @see s2Member\API_Constants\S2MEMBER_LOGOUT_PAGE_URL
1399 *
1400 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID
1401 *
1402 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_ID
1403 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_URL
1404 *
1405 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1406 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1407 *
1408 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL
1409 *
1410 * @see `Dashboard -> s2Member -> General Options -> Membership Options Page`
1411 */
1412 if (!defined ("S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL"))
1413 define ("S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL", ($c[] = (string)$links["membership_options_page"])); /* Signup page. */
1414 /**
1415 * The URL, which leads to the Login Welcome Page; as configured by the site owner.
1416 *
1417 * If the site owner has not yet configured a Login Welcome Page, this defaults to the Home Page.
1418 *
1419 * ———— Quick PHP Code Sample ————
1420 * ```
1421 * <!php echo S2MEMBER_LOGIN_WELCOME_PAGE_URL; !>
1422 * ```
1423 * ———— Shortcode & JavaScript Equivalents ————
1424 * ```
1425 * [s2Get constant="S2MEMBER_LOGIN_WELCOME_PAGE_URL" /]
1426 *
1427 * <script type="text/javascript">
1428 * document.write(S2MEMBER_LOGIN_WELCOME_PAGE_URL);
1429 * </script>
1430 * ```
1431 *
1432 * @package s2Member\API_Constants
1433 * @since 3.5
1434 *
1435 * @var str
1436 *
1437 * @see s2Member\API_Constants\S2MEMBER_LOGIN_PAGE_URL
1438 * @see s2Member\API_Constants\S2MEMBER_LOGOUT_PAGE_URL
1439 *
1440 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID
1441 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL
1442 *
1443 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_ID
1444 *
1445 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1446 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1447 *
1448 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL
1449 *
1450 * @see `Dashboard -> s2Member -> General Options -> Login Welcome Page`
1451 */
1452 if (!defined ("S2MEMBER_LOGIN_WELCOME_PAGE_URL"))
1453 define ("S2MEMBER_LOGIN_WELCOME_PAGE_URL", ($c[] = (($login_redirection_url) ? (string)$login_redirection_url : (string)$links["login_welcome_page"])));
1454 /**
1455 * The URL, which logs the current User out of their account.
1456 *
1457 * This is the value provided by WordPress®. It's the same as using ``wp_logout_url()``.
1458 *
1459 * ———— Quick PHP Code Sample ————
1460 * ```
1461 * <!php echo S2MEMBER_LOGOUT_PAGE_URL; !>
1462 * ```
1463 * ———— Shortcode & JavaScript Equivalents ————
1464 * ```
1465 * [s2Get constant="S2MEMBER_LOGOUT_PAGE_URL" /]
1466 *
1467 * <script type="text/javascript">
1468 * document.write(S2MEMBER_LOGOUT_PAGE_URL);
1469 * </script>
1470 * ```
1471 *
1472 * @package s2Member\API_Constants
1473 * @since 3.5
1474 *
1475 * @var str
1476 *
1477 * @see s2Member\API_Constants\S2MEMBER_LOGIN_PAGE_URL
1478 *
1479 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID
1480 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL
1481 *
1482 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_ID
1483 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_URL
1484 *
1485 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1486 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1487 *
1488 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL
1489 *
1490 * @see http://codex.wordpress.org/Function_Reference/wp_logout_url wp_logout_url()
1491 */
1492 if (!defined ("S2MEMBER_LOGOUT_PAGE_URL"))
1493 define ("S2MEMBER_LOGOUT_PAGE_URL", ($c[] = (string)wp_logout_url ())); /* This triggers `wp_nonce_tick()`; watch out for dynamic changes. */
1494 /**
1495 * The URL, where a User can log into their account.
1496 *
1497 * This is the value provided by WordPress®. It's the same as using ``wp_login_url()``.
1498 *
1499 * ———— Quick PHP Code Sample ————
1500 * ```
1501 * <!php echo S2MEMBER_LOGIN_PAGE_URL; !>
1502 * ```
1503 * ———— Shortcode & JavaScript Equivalents ————
1504 * ```
1505 * [s2Get constant="S2MEMBER_LOGIN_PAGE_URL" /]
1506 *
1507 * <script type="text/javascript">
1508 * document.write(S2MEMBER_LOGIN_PAGE_URL);
1509 * </script>
1510 * ```
1511 *
1512 * @package s2Member\API_Constants
1513 * @since 3.5
1514 *
1515 * @var str
1516 *
1517 * @see s2Member\API_Constants\S2MEMBER_LOGOUT_PAGE_URL
1518 *
1519 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID
1520 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL
1521 *
1522 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_ID
1523 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_URL
1524 *
1525 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1526 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1527 *
1528 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL
1529 *
1530 * @see http://codex.wordpress.org/Function_Reference/wp_login_url wp_login_url()
1531 */
1532 if (!defined ("S2MEMBER_LOGIN_PAGE_URL"))
1533 define ("S2MEMBER_LOGIN_PAGE_URL", ($c[] = (string)wp_login_url ())); /* Will not trigger `wp_nonce_tick()`, no worries in this case. */
1534 /**
1535 * Each Membership Level ( Label ); as configured by the site owner.
1536 *
1537 * The defaults are as follows:
1538 * o Level #0 ``S2MEMBER_LEVEL0_LABEL`` = Free Subscriber
1539 * o Level #1 ``S2MEMBER_LEVEL1_LABEL`` = Bronze Member
1540 * o Level #2 ``S2MEMBER_LEVEL2_LABEL`` = Silver Member
1541 * o Level #3 ``S2MEMBER_LEVEL3_LABEL`` = Gold Member
1542 * o Level #4 ``S2MEMBER_LEVEL4_LABEL`` = Platinum Member
1543 *
1544 * ———— Quick PHP Code Sample ————
1545 * ```
1546 * <!php echo S2MEMBER_LEVEL0_LABEL; !>
1547 * ```
1548 * ———— Shortcode & JavaScript Equivalents ————
1549 * ```
1550 * [s2Get constant="S2MEMBER_LEVEL0_LABEL" /]
1551 *
1552 * <script type="text/javascript">
1553 * document.write(S2MEMBER_LEVEL0_LABEL);
1554 * </script>
1555 * ```
1556 *
1557 * @package s2Member\API_Constants
1558 * @since 3.5
1559 *
1560 * @var str
1561 *
1562 * @see s2Member\API_Functions\get_user_field()
1563 * @see `get_user_field("s2member_access_role")`
1564 * @see `get_user_field("s2member_access_level")`
1565 * @see `get_user_field("s2member_access_label")`
1566 *
1567 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_ACCESS_LEVEL
1568 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_ACCESS_LABEL
1569 *
1570 * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
1571 *
1572 * @see `Dashboard -> s2Member -> General Options -> Membership Level ( Labels )`
1573 */
1574 for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
1575 {
1576 if (!defined (($S2MEMBER_LEVELn_LABEL = "S2MEMBER_LEVEL" . $n . "_LABEL")))
1577 define ($S2MEMBER_LEVELn_LABEL, ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_label"]));
1578 }
1579 /**
1580 * File Downloads allowed at each Membership Level; as configured by the site owner.
1581 *
1582 * The defaults are as follows:
1583 * o Level #0 ``S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED`` = `0`
1584 * o Level #1 ``S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED`` = `0`
1585 * o Level #2 ``S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED`` = `0`
1586 * o Level #3 ``S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED`` = `0`
1587 * o Level #4 ``S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED`` = `0`
1588 *
1589 * ———— Quick PHP Code Sample ————
1590 * ```
1591 * <!php echo S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED; !>
1592 * ```
1593 * ———— Shortcode & JavaScript Equivalents ————
1594 * ```
1595 * [s2Get constant="S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED" /]
1596 *
1597 * <script type="text/javascript">
1598 * document.write(S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED);
1599 * </script>
1600 * ```
1601 *
1602 * @package s2Member\API_Constants
1603 * @since 3.5
1604 *
1605 * @var int
1606 *
1607 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED
1608 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED
1609 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS
1610 *
1611 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY
1612 *
1613 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1614 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1615 *
1616 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS
1617 *
1618 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS
1619 *
1620 * @see `Dashboard -> s2Member -> Download Options`
1621 */
1622 for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
1623 {
1624 if (!defined (($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED = "S2MEMBER_LEVEL" . $n . "_FILE_DOWNLOADS_ALLOWED")))
1625 define ($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED, ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_file_downloads_allowed"]));
1626 }
1627 /**
1628 * File Download days, at each Membership Level; as configured by the site owner.
1629 *
1630 * The defaults are as follows:
1631 * o Level #0 ``S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED_DAYS`` = `0`
1632 * o Level #1 ``S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED_DAYS`` = `0`
1633 * o Level #2 ``S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED_DAYS`` = `0`
1634 * o Level #3 ``S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED_DAYS`` = `0`
1635 * o Level #4 ``S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED_DAYS`` = `0`
1636 *
1637 * ———— Quick PHP Code Sample ————
1638 * ```
1639 * At Level #1, Members are allowed to download <!php echo S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED; !> files, every <!php echo S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED_DAYS; !> days.
1640 * You are currently at Membership Level #<!php echo S2MEMBER_CURRENT_USER_ACCESS_LEVEL; !>. You've downloaded <!php echo S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY; !> files in the last <!php echo S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS; !> days.
1641 * ```
1642 * ———— Shortcode & JavaScript Equivalents ————
1643 * ```
1644 * At Level #1, Members are allowed to download [s2Get constant="S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED" /] files, every [s2Get constant="S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED_DAYS" /] days.
1645 * You are currently at Membership Level #[s2Get constant="S2MEMBER_CURRENT_USER_ACCESS_LEVEL" /]. You've downloaded [s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY" /] files in the last [s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS" /] days.
1646 *
1647 * At Level #1, Members are allowed to download <script type="text/javascript">document.write(S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED);</script> files, every <script type="text/javascript">document.write(S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED_DAYS);</script> days.
1648 * You are currently at Membership Level #<script type="text/javascript">document.write(S2MEMBER_CURRENT_USER_ACCESS_LEVEL);</script>. You've downloaded <script type="text/javascript">document.write(S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY);</script> files in the last <script type="text/javascript">document.write(S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS);</script> days.
1649 * ```
1650 *
1651 * @package s2Member\API_Constants
1652 * @since 3.5
1653 *
1654 * @var int
1655 *
1656 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED
1657 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED
1658 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS
1659 *
1660 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY
1661 *
1662 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1663 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1664 *
1665 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED
1666 *
1667 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS
1668 *
1669 * @see `Dashboard -> s2Member -> Download Options`
1670 */
1671 for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
1672 {
1673 if (!defined (($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS = "S2MEMBER_LEVEL" . $n . "_FILE_DOWNLOADS_ALLOWED_DAYS")))
1674 define ($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS, ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_file_downloads_allowed_days"]));
1675 }
1676 /**
1677 * Inline File Download extensions; as configured by the site owner.
1678 *
1679 * ———— Quick PHP Code Sample ————
1680 * ```
1681 * <!php echo S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS; !>
1682 * ```
1683 * ———— Shortcode & JavaScript Equivalents ————
1684 * ```
1685 * [s2Get constant="S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS" /]
1686 *
1687 * <script type="text/javascript">
1688 * document.write(S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS);
1689 * </script>
1690 * ```
1691 *
1692 * @package s2Member\API_Constants
1693 * @since 3.5
1694 *
1695 * @var str
1696 *
1697 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED
1698 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED
1699 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS
1700 *
1701 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY
1702 *
1703 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1704 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1705 *
1706 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED
1707 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS
1708 *
1709 * @see `Dashboard -> s2Member -> Download Options`
1710 */
1711 if (!defined ("S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS"))
1712 define ("S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_inline_extensions"]));
1713 /**
1714 * From: Name, for s2Member-specific emails; as configured by the site owner.
1715 *
1716 * ———— Quick PHP Code Sample ————
1717 * ```
1718 * <!php echo S2MEMBER_REG_EMAIL_FROM_NAME; !>
1719 * ```
1720 * ———— Shortcode & JavaScript Equivalents ————
1721 * ```
1722 * [s2Get constant="S2MEMBER_REG_EMAIL_FROM_NAME" /]
1723 *
1724 * <script type="text/javascript">
1725 * document.write(S2MEMBER_REG_EMAIL_FROM_NAME);
1726 * </script>
1727 * ```
1728 *
1729 * @package s2Member\API_Constants
1730 * @since 3.5
1731 *
1732 * @var str
1733 *
1734 * @see s2Member\API_Constants\S2MEMBER_REG_EMAIL_FROM_EMAIL
1735 *
1736 * @see `Dashboard -> s2Member -> General Options`
1737 */
1738 if (!defined ("S2MEMBER_REG_EMAIL_FROM_NAME"))
1739 define ("S2MEMBER_REG_EMAIL_FROM_NAME", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]));
1740 /**
1741 * From: Email Address, for s2Member-specific emails; as configured by the site owner.
1742 *
1743 * ———— Quick PHP Code Sample ————
1744 * ```
1745 * <!php echo S2MEMBER_REG_EMAIL_FROM_EMAIL; !>
1746 * ```
1747 * ———— Shortcode & JavaScript Equivalents ————
1748 * ```
1749 * [s2Get constant="S2MEMBER_REG_EMAIL_FROM_EMAIL" /]
1750 *
1751 * <script type="text/javascript">
1752 * document.write(S2MEMBER_REG_EMAIL_FROM_EMAIL);
1753 * </script>
1754 * ```
1755 *
1756 * @package s2Member\API_Constants
1757 * @since 3.5
1758 *
1759 * @var str
1760 *
1761 * @see s2Member\API_Constants\S2MEMBER_REG_EMAIL_FROM_NAME
1762 *
1763 * @see `Dashboard -> s2Member -> General Options`
1764 */
1765 if (!defined ("S2MEMBER_REG_EMAIL_FROM_EMAIL"))
1766 define ("S2MEMBER_REG_EMAIL_FROM_EMAIL", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"]));
1767 /**
1768 * Full URL to PayPal® IPN handler, provided by s2Member.
1769 *
1770 * ———— Quick PHP Code Sample ————
1771 * ```
1772 * <!php echo S2MEMBER_PAYPAL_NOTIFY_URL; !>
1773 * ```
1774 * ———— Shortcode & JavaScript Equivalents ————
1775 * ```
1776 * [s2Get constant="S2MEMBER_PAYPAL_NOTIFY_URL" /]
1777 *
1778 * <script type="text/javascript">
1779 * document.write(S2MEMBER_PAYPAL_NOTIFY_URL);
1780 * </script>
1781 * ```
1782 *
1783 * @package s2Member\API_Constants
1784 * @since 3.5
1785 *
1786 * @var str
1787 *
1788 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_RETURN_URL
1789 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_PDT_IDENTITY_TOKEN
1790 *
1791 * @see `Dashboard -> s2Member -> PayPal® Options -> IPN Integration`
1792 */
1793 if (!defined ("S2MEMBER_PAYPAL_NOTIFY_URL"))
1794 define ("S2MEMBER_PAYPAL_NOTIFY_URL", ($c[] = (string)site_url ("/?s2member_paypal_notify=1")));
1795 /**
1796 * Full URL to PayPal® Auto-Return/PDT handler, provided by s2Member.
1797 *
1798 * ———— Quick PHP Code Sample ————
1799 * ```
1800 * <!php echo S2MEMBER_PAYPAL_RETURN_URL; !>
1801 * ```
1802 * ———— Shortcode & JavaScript Equivalents ————
1803 * ```
1804 * [s2Get constant="S2MEMBER_PAYPAL_RETURN_URL" /]
1805 *
1806 * <script type="text/javascript">
1807 * document.write(S2MEMBER_PAYPAL_RETURN_URL);
1808 * </script>
1809 * ```
1810 *
1811 * @package s2Member\API_Constants
1812 * @since 3.5
1813 *
1814 * @var str
1815 *
1816 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_NOTIFY_URL
1817 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_PDT_IDENTITY_TOKEN
1818 *
1819 * @see `Dashboard -> s2Member -> PayPal® Options -> Auto-Return/PDT Integration`
1820 */
1821 if (!defined ("S2MEMBER_PAYPAL_RETURN_URL"))
1822 define ("S2MEMBER_PAYPAL_RETURN_URL", ($c[] = (string)site_url ("/?s2member_paypal_return=1")));
1823 /**
1824 * PayPal® Business Email Address; as configured by the site owner.
1825 *
1826 * ———— Quick PHP Code Sample ————
1827 * ```
1828 * <!php echo S2MEMBER_PAYPAL_BUSINESS; !>
1829 * ```
1830 * ———— Shortcode & JavaScript Equivalents ————
1831 * ```
1832 * [s2Get constant="S2MEMBER_PAYPAL_BUSINESS" /]
1833 *
1834 * <script type="text/javascript">
1835 * document.write(S2MEMBER_PAYPAL_BUSINESS);
1836 * </script>
1837 * ```
1838 *
1839 * @package s2Member\API_Constants
1840 * @since 3.5
1841 *
1842 * @var str
1843 *
1844 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_USERNAME
1845 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_PASSWORD
1846 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_SIGNATURE
1847 *
1848 * @see `Dashboard -> s2Member -> PayPal® Options -> Account Details`
1849 */
1850 if (!defined ("S2MEMBER_PAYPAL_BUSINESS"))
1851 define ("S2MEMBER_PAYPAL_BUSINESS", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"]));
1852 /**
1853 * PayPal® endpoint domain ( changes when Sandbox Mode is enabled ).
1854 *
1855 * o In Sandbox Mode, this is: `www.sandbox.paypal.com`.
1856 * o In Production Mode, this is: `www.paypal.com`.
1857 *
1858 * ———— Quick PHP Code Sample ————
1859 * ```
1860 * <!php echo S2MEMBER_PAYPAL_ENDPOINT; !>
1861 * ```
1862 * ———— Shortcode & JavaScript Equivalents ————
1863 * ```
1864 * [s2Get constant="S2MEMBER_PAYPAL_ENDPOINT" /]
1865 *
1866 * <script type="text/javascript">
1867 * document.write(S2MEMBER_PAYPAL_ENDPOINT);
1868 * </script>
1869 * ```
1870 *
1871 * @package s2Member\API_Constants
1872 * @since 3.5
1873 *
1874 * @var str
1875 *
1876 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_ENDPOINT
1877 *
1878 * @see `Dashboard -> s2Member -> PayPal® Options -> Account Details`
1879 */
1880 if (!defined ("S2MEMBER_PAYPAL_ENDPOINT"))
1881 define ("S2MEMBER_PAYPAL_ENDPOINT", ($c[] = (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")));
1882 /**
1883 * PayPal® API endpoint domain ( changes when Sandbox Mode is enabled ).
1884 *
1885 * o In Sandbox Mode, this is: `api-3t.sandbox.paypal.com`.
1886 * o In Production Mode, this is: `api-3t.paypal.com`.
1887 *
1888 * ———— Quick PHP Code Sample ————
1889 * ```
1890 * <!php echo S2MEMBER_PAYPAL_API_ENDPOINT; !>
1891 * ```
1892 * ———— Shortcode & JavaScript Equivalents ————
1893 * ```
1894 * [s2Get constant="S2MEMBER_PAYPAL_API_ENDPOINT" /]
1895 *
1896 * <script type="text/javascript">
1897 * document.write(S2MEMBER_PAYPAL_API_ENDPOINT);
1898 * </script>
1899 * ```
1900 *
1901 * @package s2Member\API_Constants
1902 * @since 3.5
1903 *
1904 * @var str
1905 *
1906 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_ENDPOINT
1907 *
1908 * @see `Dashboard -> s2Member -> PayPal® Options -> Account Details`
1909 */
1910 if (!defined ("S2MEMBER_PAYPAL_API_ENDPOINT"))
1911 define ("S2MEMBER_PAYPAL_API_ENDPOINT", ($c[] = (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "api-3t.sandbox.paypal.com" : "api-3t.paypal.com")));
1912 /**
1913 * PayPal® API Username; as configured by the site owner.
1914 *
1915 * ———— Quick PHP Code Sample ————
1916 * ```
1917 * <!php echo S2MEMBER_PAYPAL_API_USERNAME; !>
1918 * ```
1919 * ———— Shortcode & JavaScript Equivalents ————
1920 * ```
1921 * [s2Get constant="S2MEMBER_PAYPAL_API_USERNAME" /]
1922 *
1923 * NOTE: For security purposes,
1924 * this API Constant is NOT available as a JavaScript Global.
1925 * ```
1926 *
1927 * @package s2Member\API_Constants
1928 * @since 3.5
1929 *
1930 * @var str
1931 *
1932 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_BUSINESS
1933 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_PASSWORD
1934 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_SIGNATURE
1935 *
1936 * @see `Dashboard -> s2Member -> PayPal® Options -> Account Details`
1937 */
1938 if (!defined ("S2MEMBER_PAYPAL_API_USERNAME"))
1939 define ("S2MEMBER_PAYPAL_API_USERNAME", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_username"]));
1940 /**
1941 * PayPal® API Password; as configured by the site owner.
1942 *
1943 * ———— Quick PHP Code Sample ————
1944 * ```
1945 * <!php echo S2MEMBER_PAYPAL_API_PASSWORD; !>
1946 * ```
1947 * ———— Shortcode & JavaScript Equivalents ————
1948 * ```
1949 * [s2Get constant="S2MEMBER_PAYPAL_API_PASSWORD" /]
1950 *
1951 * NOTE: For security purposes,
1952 * this API Constant is NOT available as a JavaScript Global.
1953 * ```
1954 *
1955 * @package s2Member\API_Constants
1956 * @since 3.5
1957 *
1958 * @var str
1959 *
1960 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_BUSINESS
1961 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_USERNAME
1962 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_SIGNATURE
1963 *
1964 * @see `Dashboard -> s2Member -> PayPal® Options -> Account Details`
1965 */
1966 if (!defined ("S2MEMBER_PAYPAL_API_PASSWORD"))
1967 define ("S2MEMBER_PAYPAL_API_PASSWORD", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_password"]));
1968 /**
1969 * PayPal® API Signature; as configured by the site owner.
1970 *
1971 * ———— Quick PHP Code Sample ————
1972 * ```
1973 * <!php echo S2MEMBER_PAYPAL_API_SIGNATURE; !>
1974 * ```
1975 * ———— Shortcode & JavaScript Equivalents ————
1976 * ```
1977 * [s2Get constant="S2MEMBER_PAYPAL_API_SIGNATURE" /]
1978 *
1979 * NOTE: For security purposes,
1980 * this API Constant is NOT available as a JavaScript Global.
1981 * ```
1982 *
1983 * @package s2Member\API_Constants
1984 * @since 3.5
1985 *
1986 * @var str
1987 *
1988 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_BUSINESS
1989 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_USERNAME
1990 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_PASSWORD
1991 *
1992 * @see `Dashboard -> s2Member -> PayPal® Options -> Account Details`
1993 */
1994 if (!defined ("S2MEMBER_PAYPAL_API_SIGNATURE"))
1995 define ("S2MEMBER_PAYPAL_API_SIGNATURE", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_signature"]));
1996 /**
1997 * PayPal® PDT Identity Token; as configured by the site owner.
1998 *
1999 * ———— Quick PHP Code Sample ————
2000 * ```
2001 * <!php echo S2MEMBER_PAYPAL_PDT_IDENTITY_TOKEN; !>
2002 * ```
2003 * ———— Shortcode & JavaScript Equivalents ————
2004 * ```
2005 * [s2Get constant="S2MEMBER_PAYPAL_PDT_IDENTITY_TOKEN" /]
2006 *
2007 * NOTE: For security purposes,
2008 * this API Constant is NOT available as a JavaScript Global.
2009 * ```
2010 *
2011 * @package s2Member\API_Constants
2012 * @since 3.5
2013 *
2014 * @var str
2015 *
2016 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_RETURN_URL
2017 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_NOTIFY_URL
2018 *
2019 * @see `Dashboard -> s2Member -> PayPal® Options -> Auto-Return/PDT Integration`
2020 */
2021 if (!defined ("S2MEMBER_PAYPAL_PDT_IDENTITY_TOKEN"))
2022 define ("S2MEMBER_PAYPAL_PDT_IDENTITY_TOKEN", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_identity_token"]));
2023 /**
2024 * PayPal® value for Payment Buttons with input name: `on0`.
2025 *
2026 * Used in PayPal® Modification Buttons *( i.e. upgrades/downgrades )*.
2027 *
2028 * This auto-fills the `on0` value in PayPal® Button Codes. If a Button Code is presented to a logged-in Member,
2029 * this will auto-fill the value for the `on0` input variable, with the string: "Referencing Customer ID".
2030 * Otherwise, it will be set to a default value of: "Originating Domain".
2031 *
2032 * These four API Constants are special.
2033 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0}
2034 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0}
2035 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1}
2036 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1}
2037 *
2038 * They are used by the PayPal® Button Generator for s2Member.
2039 *
2040 * The `ON0/OS0` values, are how s2Member identifies an existing Member *( and/or a Free Subscriber )*, who is already logged-in
2041 * when they click a PayPal® Modification Button that was generated for you by s2Member's Button Generator.
2042 *
2043 * Instead of forcing a Member *( and/or a Free Subscriber )* to re-register for a new account,
2044 * s2Member can identify their existing account, and update it; according to the modified terms in your Button Code.
2045 * These three Button Code parameters: `on0`, `os0`, `modify`, work together in harmony. If you're using the Shortcode Format for PayPal® Buttons,
2046 * you won't even see these, because they're added internally by the Shortcode processor.
2047 *
2048 * The `ON1/OS1` values, are used by s2Member to identify a Customer's IP Address through IPN communications with PayPal®.
2049 *
2050 * Anyway, these four API Constants are just documented here for clarity;
2051 * you probably won't use any of these directly; the Button Generator pops them in.
2052 *
2053 * ———— Quick PHP Code Sample ————
2054 * ```
2055 * <!php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0; !>
2056 * ```
2057 * ———— Shortcode & JavaScript Equivalents ————
2058 * ```
2059 * [s2Get constant="S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0" /]
2060 *
2061 * <script type="text/javascript">
2062 * document.write(S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0);
2063 * </script>
2064 * ```
2065 *
2066 * @package s2Member\API_Constants
2067 * @since 3.5
2068 *
2069 * @var str
2070 *
2071 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0
2072 *
2073 * @see `Dashboard -> s2Member -> PayPal® Buttons`
2074 */
2075 if (!defined ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0"))
2076 define ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0", ($c[] = ((S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID) ? "Referencing Customer ID" : "Originating Domain")));
2077 /**
2078 * PayPal® value for Payment Buttons with input name: `os0`.
2079 *
2080 * Used in PayPal® Modification Buttons *( i.e. upgrades/downgrades )*.
2081 *
2082 * This auto-fills the `os0` value in PayPal® Button Codes. If a Button Code is presented to a logged-in Member,
2083 * this will auto-fill the value for the `os0` input variable, with the value of {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID}.
2084 * Otherwise, it will be set to a default value of ``$_SERVER["HTTP_HOST"]`` *( the originating domain name )*.
2085 *
2086 * These four API Constants are special.
2087 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0}
2088 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0}
2089 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1}
2090 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1}
2091 *
2092 * They are used by the PayPal® Button Generator for s2Member.
2093 *
2094 * The `ON0/OS0` values, are how s2Member identifies an existing Member *( and/or a Free Subscriber )*, who is already logged-in
2095 * when they click a PayPal® Modification Button that was generated for you by s2Member's Button Generator.
2096 *
2097 * Instead of forcing a Member *( and/or a Free Subscriber )* to re-register for a new account,
2098 * s2Member can identify their existing account, and update it; according to the modified terms in your Button Code.
2099 * These three Button Code parameters: `on0`, `os0`, `modify`, work together in harmony. If you're using the Shortcode Format for PayPal® Buttons,
2100 * you won't even see these, because they're added internally by the Shortcode processor.
2101 *
2102 * The `ON1/OS1` values, are used by s2Member to identify a Customer's IP Address through IPN communications with PayPal®.
2103 *
2104 * Anyway, these four API Constants are just documented here for clarity;
2105 * you probably won't use any of these directly; the Button Generator pops them in.
2106 *
2107 * ———— Quick PHP Code Sample ————
2108 * ```
2109 * <!php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0; !>
2110 * ```
2111 * ———— Shortcode & JavaScript Equivalents ————
2112 * ```
2113 * [s2Get constant="S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0" /]
2114 *
2115 * <script type="text/javascript">
2116 * document.write(S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0);
2117 * </script>
2118 * ```
2119 *
2120 * @package s2Member\API_Constants
2121 * @since 3.5
2122 *
2123 * @var str
2124 *
2125 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0
2126 *
2127 * @see `Dashboard -> s2Member -> PayPal® Buttons`
2128 */
2129 if (!defined ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0"))
2130 define ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0", ($c[] = ((S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID) ? S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID : (string)$_SERVER["HTTP_HOST"])));
2131 /**
2132 * PayPal® value for Payment Buttons with input name: `on1`.
2133 *
2134 * This auto-fills the `on1` value in PayPal® Button Codes.
2135 * This always contains the string: "Customer IP Address".
2136 *
2137 * These four API Constants are special.
2138 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0}
2139 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0}
2140 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1}
2141 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1}
2142 *
2143 * They are used by the PayPal® Button Generator for s2Member.
2144 *
2145 * The `ON1/OS1` values, are used by s2Member to identify a Customer's IP Address through IPN communications with PayPal®.
2146 *
2147 * The `ON0/OS0` values, are how s2Member identifies an existing Member *( and/or a Free Subscriber )*, who is already logged-in
2148 * when they click a PayPal® Modification Button that was generated for you by s2Member's Button Generator.
2149 *
2150 * Instead of forcing a Member *( and/or a Free Subscriber )* to re-register for a new account,
2151 * s2Member can identify their existing account, and update it; according to the modified terms in your Button Code.
2152 * These three Button Code parameters: `on0`, `os0`, `modify`, work together in harmony. If you're using the Shortcode Format for PayPal® Buttons,
2153 * you won't even see these, because they're added internally by the Shortcode processor.
2154 *
2155 * Anyway, these four API Constants are just documented here for clarity;
2156 * you probably won't use any of these directly; the Button Generator pops them in.
2157 *
2158 * ———— Quick PHP Code Sample ————
2159 * ```
2160 * <!php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1; !>
2161 * ```
2162 * ———— Shortcode & JavaScript Equivalents ————
2163 * ```
2164 * [s2Get constant="S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1" /]
2165 *
2166 * <script type="text/javascript">
2167 * document.write(S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1);
2168 * </script>
2169 * ```
2170 *
2171 * @package s2Member\API_Constants
2172 * @since 3.5
2173 *
2174 * @var str
2175 *
2176 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1
2177 *
2178 * @see `Dashboard -> s2Member -> PayPal® Buttons`
2179 */
2180 if (!defined ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1"))
2181 define ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1", ($c[] = "Customer IP Address" /* Via $_SERVER["REMOTE_ADDR"] below. */));
2182 /**
2183 * PayPal® value for Payment Buttons with input name: `os1`.
2184 *
2185 * This auto-fills the `os1` value in PayPal® Button Codes,
2186 * with the Customer's IP Address, via ``$_SERVER["REMOTE_ADDR"]``.
2187 *
2188 * These four API Constants are special.
2189 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0}
2190 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0}
2191 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1}
2192 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1}
2193 *
2194 * They are used by the PayPal® Button Generator for s2Member.
2195 *
2196 * The `ON1/OS1` values, are used by s2Member to identify a Customer's IP Address through IPN communications with PayPal®.
2197 *
2198 * The `ON0/OS0` values, are how s2Member identifies an existing Member *( and/or a Free Subscriber )*, who is already logged-in
2199 * when they click a PayPal® Modification Button that was generated for you by s2Member's Button Generator.
2200 *
2201 * Instead of forcing a Member *( and/or a Free Subscriber )* to re-register for a new account,
2202 * s2Member can identify their existing account, and update it; according to the modified terms in your Button Code.
2203 * These three Button Code parameters: `on0`, `os0`, `modify`, work together in harmony. If you're using the Shortcode Format for PayPal® Buttons,
2204 * you won't even see these, because they're added internally by the Shortcode processor.
2205 *
2206 * Anyway, these four API Constants are just documented here for clarity;
2207 * you probably won't use any of these directly; the Button Generator pops them in.
2208 *
2209 * ———— Quick PHP Code Sample ————
2210 * ```
2211 * <!php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1; !>
2212 * ```
2213 * ———— Shortcode & JavaScript Equivalents ————
2214 * ```
2215 * [s2Get constant="S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1" /]
2216 *
2217 * <script type="text/javascript">
2218 * document.write(S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1);
2219 * </script>
2220 * ```
2221 *
2222 * @package s2Member\API_Constants
2223 * @since 3.5
2224 *
2225 * @var str
2226 *
2227 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1
2228 *
2229 * @see `Dashboard -> s2Member -> PayPal® Buttons`
2230 */
2231 if (!defined ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1"))
2232 define ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1", ($c[] = (string)$_SERVER["REMOTE_ADDR"]));
2233 /*
2234 Allows other Constants to be calculated with their checksums included too.
2235 */
2236 $c = apply_filters ("ws_plugin__s2member_during_constants_c", $c, get_defined_vars ());
2237 /**
2238 * Used internally by s2Member to compare the value of all API Constants at once.
2239 *
2240 * @package s2Member\API_Constants
2241 * @since 3.5
2242 *
2243 * @var str
2244 */
2245 if (!defined ("WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5"))
2246 define ("WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5", md5 (serialize ($c) . c_ws_plugin__s2member_utilities::ver_checksum ()));
2247 /*
2248 Calls the after Hook. Do NOT set Constants here.
2249 */
2250 do_action ("ws_plugin__s2member_after_constants", get_defined_vars ());
2251 /**/
2252 return; /* Return for uniformity. */
2253 }
2254 }
2255 }
2256 ?>