PluginProbe
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions / 110815
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions v110815
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 110815, at includes/classes/constants.inc.php

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