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

2,402 lines 103.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/Profile 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/Profile 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_Functions\s2member_user_downloads()
1039 * @see s2Member\API_Functions\s2member_total_downloads_of()
1040 * @see s2Member\API_Functions\s2member_total_unique_downloads_of()
1041 *
1042 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED
1043 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS
1044 *
1045 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY
1046 *
1047 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1048 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1049 *
1050 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED
1051 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS
1052 *
1053 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS
1054 *
1055 * @see `Dashboard -> s2Member -> Download Options`
1056 */
1057 if (!defined ("S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED"))
1058 define ("S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED", ($c[] = (int)$file_downloads["allowed"]));
1059 /**
1060 * Does the current User have access to unlimited File Downloads.
1061 *
1062 * A value of true means the current User's allowed downloads are >= `999999999`, and false means it is not.
1063 * This is useful if you are allowing unlimited ( i.e. `999999999+` ) Downloads on some Membership Levels.
1064 * You can display `Unlimited` instead of a numerical value.
1065 *
1066 * This will be false if NOT logged-in.
1067 *
1068 * ———— Quick PHP Code Sample ————
1069 * ```
1070 * <!php
1071 * if(S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED)
1072 * echo 'You have access to unlimited downloads.';
1073 * !>
1074 * ```
1075 * ———— Shortcode & JavaScript Equivalents ————
1076 * ```
1077 * [s2If constant(S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED)]
1078 * You have access to unlimited downloads.
1079 * [/s2If]
1080 *
1081 * <script type="text/javascript">
1082 * if(S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED)
1083 * document.write('You have access to unlimited downloads.');
1084 * </script>
1085 * ```
1086 *
1087 * @package s2Member\API_Constants
1088 * @since 3.5
1089 *
1090 * @var bool
1091 *
1092 * @see s2Member\API_Functions\s2member_user_downloads()
1093 * @see s2Member\API_Functions\s2member_total_downloads_of()
1094 * @see s2Member\API_Functions\s2member_total_unique_downloads_of()
1095 *
1096 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED
1097 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS
1098 *
1099 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY
1100 *
1101 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1102 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1103 *
1104 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED
1105 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS
1106 *
1107 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS
1108 *
1109 * @see `Dashboard -> s2Member -> Download Options`
1110 */
1111 if (!defined ("S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED"))
1112 define ("S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED", ($c[] = (($file_downloads["allowed"] >= 999999999) ? true : false)));
1113 /**
1114 * Indicates the number of unique Files the current User has downloaded in the last X days.
1115 *
1116 * This will be equal to `0` if NOT logged-in.
1117 *
1118 * ———— Quick PHP Code Sample ————
1119 * ```
1120 * <!php echo S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY; !>
1121 * ```
1122 * ———— Shortcode & JavaScript Equivalents ————
1123 * ```
1124 * [s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY" /]
1125 *
1126 * <script type="text/javascript">
1127 * document.write(S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY);
1128 * </script>
1129 * ```
1130 *
1131 * @package s2Member\API_Constants
1132 * @since 3.5
1133 *
1134 * @var int
1135 *
1136 * @note This does NOT include File Downloads accessed with an Advanced File Download Key.
1137 *
1138 * @see s2Member\API_Functions\s2member_user_downloads()
1139 * @see s2Member\API_Functions\s2member_total_downloads_of()
1140 * @see s2Member\API_Functions\s2member_total_unique_downloads_of()
1141 *
1142 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED
1143 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED
1144 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS
1145 *
1146 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1147 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1148 *
1149 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED
1150 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS
1151 *
1152 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS
1153 *
1154 * @see `Dashboard -> s2Member -> Download Options`
1155 */
1156 if (!defined ("S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY"))
1157 define ("S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY", ($c[] = (int)$file_downloads["currently"]));
1158 /**
1159 * Indicates the X number of days, configured by the site owner; for the current User.
1160 *
1161 * This will be equal to `0` if NOT logged-in.
1162 *
1163 * ———— Quick PHP Code Sample ————
1164 * ```
1165 * You are allowed to download <!php echo S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED; !> files, every <!php echo S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS; !> days.
1166 * You've downloaded <!php echo S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY; !> files in the last <!php echo S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS; !> days.
1167 * ```
1168 * ———— Shortcode & JavaScript Equivalents ————
1169 * ```
1170 * You are allowed to download [s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED" /] files, every [s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS" /] days.
1171 * You've downloaded [s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY" /] files in the last [s2Get constant="S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS" /] days.
1172 *
1173 * 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.
1174 * 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.
1175 * ```
1176 *
1177 * @package s2Member\API_Constants
1178 * @since 3.5
1179 *
1180 * @var int
1181 *
1182 * @see s2Member\API_Functions\s2member_user_downloads()
1183 * @see s2Member\API_Functions\s2member_total_downloads_of()
1184 * @see s2Member\API_Functions\s2member_total_unique_downloads_of()
1185 *
1186 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED
1187 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED
1188 *
1189 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY
1190 *
1191 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1192 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1193 *
1194 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED
1195 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS
1196 *
1197 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS
1198 *
1199 * @see `Dashboard -> s2Member -> Download Options`
1200 */
1201 if (!defined ("S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS"))
1202 define ("S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS", ($c[] = (int)$file_downloads["allowed_days"]));
1203 /**
1204 * The configured Page ID, for the Download Limit Exceeded Page.
1205 *
1206 * This will be equal to `0` if NOT yet configured.
1207 *
1208 * ———— Quick PHP Code Sample ————
1209 * ```
1210 * <!php echo S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID; !>
1211 * ```
1212 * ———— Shortcode & JavaScript Equivalents ————
1213 * ```
1214 * [s2Get constant="S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID" /]
1215 *
1216 * <script type="text/javascript">
1217 * document.write(S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID);
1218 * </script>
1219 * ```
1220 *
1221 * @package s2Member\API_Constants
1222 * @since 3.5
1223 *
1224 * @var int
1225 *
1226 * @see s2Member\API_Functions\s2member_user_downloads()
1227 * @see s2Member\API_Functions\s2member_total_downloads_of()
1228 * @see s2Member\API_Functions\s2member_total_unique_downloads_of()
1229 *
1230 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED
1231 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED
1232 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS
1233 *
1234 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY
1235 *
1236 * @see s2Member\API_Constants\S2MEMBER_LOGIN_PAGE_URL
1237 * @see s2Member\API_Constants\S2MEMBER_LOGOUT_PAGE_URL
1238 *
1239 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID
1240 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL
1241 *
1242 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_ID
1243 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_URL
1244 *
1245 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1246 *
1247 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL
1248 *
1249 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED
1250 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS
1251 *
1252 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS
1253 *
1254 * @see `Dashboard -> s2Member -> Download Options`
1255 */
1256 if (!defined ("S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID"))
1257 define ("S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_limit_exceeded_page"]));
1258 /**
1259 * The configured Page ID, for the Membership Options Page.
1260 *
1261 * This will be equal to `0` if NOT yet configured.
1262 *
1263 * ———— Quick PHP Code Sample ————
1264 * ```
1265 * <!php echo S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID; !>
1266 * ```
1267 * ———— Shortcode & JavaScript Equivalents ————
1268 * ```
1269 * [s2Get constant="S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID" /]
1270 *
1271 * <script type="text/javascript">
1272 * document.write(S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID);
1273 * </script>
1274 * ```
1275 *
1276 * @package s2Member\API_Constants
1277 * @since 3.5
1278 *
1279 * @var int
1280 *
1281 * @see s2Member\API_Constants\S2MEMBER_LOGIN_PAGE_URL
1282 * @see s2Member\API_Constants\S2MEMBER_LOGOUT_PAGE_URL
1283 *
1284 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL
1285 *
1286 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_ID
1287 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_URL
1288 *
1289 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1290 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1291 *
1292 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL
1293 *
1294 * @see `Dashboard -> s2Member -> General Options -> Membership Options Page`
1295 */
1296 if (!defined ("S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID"))
1297 define ("S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["membership_options_page"]));
1298 /**
1299 * The configured Page ID, for the Login Welcome Page.
1300 *
1301 * This will be equal to `0` if NOT yet configured.
1302 *
1303 * ———— Quick PHP Code Sample ————
1304 * ```
1305 * <!php echo S2MEMBER_LOGIN_WELCOME_PAGE_ID; !>
1306 * ```
1307 * ———— Shortcode & JavaScript Equivalents ————
1308 * ```
1309 * [s2Get constant="S2MEMBER_LOGIN_WELCOME_PAGE_ID" /]
1310 *
1311 * <script type="text/javascript">
1312 * document.write(S2MEMBER_LOGIN_WELCOME_PAGE_ID);
1313 * </script>
1314 * ```
1315 *
1316 * @package s2Member\API_Constants
1317 * @since 3.5
1318 *
1319 * @var int
1320 *
1321 * @see s2Member\API_Constants\S2MEMBER_LOGIN_PAGE_URL
1322 * @see s2Member\API_Constants\S2MEMBER_LOGOUT_PAGE_URL
1323 *
1324 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID
1325 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL
1326 *
1327 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_URL
1328 *
1329 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1330 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1331 *
1332 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL
1333 *
1334 * @see `Dashboard -> s2Member -> General Options -> Login Welcome Page`
1335 */
1336 if (!defined ("S2MEMBER_LOGIN_WELCOME_PAGE_ID"))
1337 define ("S2MEMBER_LOGIN_WELCOME_PAGE_ID", ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]));
1338 /**
1339 * A URL, which leads to the Stand-Alone Profile Modification Page.
1340 *
1341 * This is always a reference to `/?s2member_profile=1` *( i.e. the Stand-Alone version )*.
1342 *
1343 * ———— Quick PHP Code Sample ————
1344 * ```
1345 * <!php echo S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL; !>
1346 * ```
1347 * ———— Shortcode & JavaScript Equivalents ————
1348 * ```
1349 * [s2Get constant="S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL" /]
1350 *
1351 * <script type="text/javascript">
1352 * document.write(S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL);
1353 * </script>
1354 * ```
1355 *
1356 * @package s2Member\API_Constants
1357 * @since 3.5
1358 *
1359 * @var str
1360 *
1361 * @see s2Member\API_Constants\S2MEMBER_LOGIN_PAGE_URL
1362 * @see s2Member\API_Constants\S2MEMBER_LOGOUT_PAGE_URL
1363 *
1364 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID
1365 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL
1366 *
1367 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_ID
1368 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_URL
1369 *
1370 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1371 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1372 *
1373 * @see `Dashboard -> s2Member -> General Options -> Profile Modifications`
1374 */
1375 if (!defined ("S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL"))
1376 define ("S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL", ($c[] = (string)site_url ("/?s2member_profile=1")));
1377 /**
1378 * A URL, which leads to the Download Limit Exceeded Page; as configured by the site owner.
1379 *
1380 * If the site owner has not yet configured a Download Limit Exceeded Page, this defaults to the Home Page.
1381 *
1382 * ———— Quick PHP Code Sample ————
1383 * ```
1384 * <!php echo S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL; !>
1385 * ```
1386 * ———— Shortcode & JavaScript Equivalents ————
1387 * ```
1388 * [s2Get constant="S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL" /]
1389 *
1390 * <script type="text/javascript">
1391 * document.write(S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL);
1392 * </script>
1393 * ```
1394 *
1395 * @package s2Member\API_Constants
1396 * @since 3.5
1397 *
1398 * @var str
1399 *
1400 * @see s2Member\API_Functions\s2member_user_downloads()
1401 * @see s2Member\API_Functions\s2member_total_downloads_of()
1402 * @see s2Member\API_Functions\s2member_total_unique_downloads_of()
1403 *
1404 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED
1405 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED
1406 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS
1407 *
1408 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY
1409 *
1410 * @see s2Member\API_Constants\S2MEMBER_LOGIN_PAGE_URL
1411 * @see s2Member\API_Constants\S2MEMBER_LOGOUT_PAGE_URL
1412 *
1413 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID
1414 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL
1415 *
1416 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_ID
1417 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_URL
1418 *
1419 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1420 *
1421 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL
1422 *
1423 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED
1424 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS
1425 *
1426 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS
1427 *
1428 * @see `Dashboard -> s2Member -> Download Options`
1429 */
1430 if (!defined ("S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL"))
1431 define ("S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL", ($c[] = (string)$links["file_download_limit_exceeded_page"]));
1432 /**
1433 * A URL, which leads to the Membership Options Page; as configured by the site owner.
1434 *
1435 * If the site owner has not yet configured a Membership Options Page, this defaults to the Home Page.
1436 *
1437 * ———— Quick PHP Code Sample ————
1438 * ```
1439 * <!php echo S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL; !>
1440 * ```
1441 * ———— Shortcode & JavaScript Equivalents ————
1442 * ```
1443 * [s2Get constant="S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL" /]
1444 *
1445 * <script type="text/javascript">
1446 * document.write(S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
1447 * </script>
1448 * ```
1449 *
1450 * @package s2Member\API_Constants
1451 * @since 3.5
1452 *
1453 * @var str
1454 *
1455 * @see s2Member\API_Constants\S2MEMBER_LOGIN_PAGE_URL
1456 * @see s2Member\API_Constants\S2MEMBER_LOGOUT_PAGE_URL
1457 *
1458 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID
1459 *
1460 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_ID
1461 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_URL
1462 *
1463 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1464 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1465 *
1466 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL
1467 *
1468 * @see `Dashboard -> s2Member -> General Options -> Membership Options Page`
1469 */
1470 if (!defined ("S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL"))
1471 define ("S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL", ($c[] = (string)$links["membership_options_page"])); /* Signup page. */
1472 /**
1473 * The URL, which leads to the Login Welcome Page; as configured by the site owner.
1474 *
1475 * If the site owner has not yet configured a Login Welcome Page, this defaults to the Home Page.
1476 *
1477 * ———— Quick PHP Code Sample ————
1478 * ```
1479 * <!php echo S2MEMBER_LOGIN_WELCOME_PAGE_URL; !>
1480 * ```
1481 * ———— Shortcode & JavaScript Equivalents ————
1482 * ```
1483 * [s2Get constant="S2MEMBER_LOGIN_WELCOME_PAGE_URL" /]
1484 *
1485 * <script type="text/javascript">
1486 * document.write(S2MEMBER_LOGIN_WELCOME_PAGE_URL);
1487 * </script>
1488 * ```
1489 *
1490 * @package s2Member\API_Constants
1491 * @since 3.5
1492 *
1493 * @var str
1494 *
1495 * @see s2Member\API_Constants\S2MEMBER_LOGIN_PAGE_URL
1496 * @see s2Member\API_Constants\S2MEMBER_LOGOUT_PAGE_URL
1497 *
1498 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID
1499 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL
1500 *
1501 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_ID
1502 *
1503 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1504 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1505 *
1506 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL
1507 *
1508 * @see `Dashboard -> s2Member -> General Options -> Login Welcome Page`
1509 */
1510 if (!defined ("S2MEMBER_LOGIN_WELCOME_PAGE_URL"))
1511 define ("S2MEMBER_LOGIN_WELCOME_PAGE_URL", ($c[] = (($login_redirection_url) ? (string)$login_redirection_url : (string)$links["login_welcome_page"])));
1512 /**
1513 * The URL, which logs the current User out of their account.
1514 *
1515 * This is the value provided by WordPress®. It's the same as using ``wp_logout_url()``.
1516 *
1517 * ———— Quick PHP Code Sample ————
1518 * ```
1519 * <!php echo S2MEMBER_LOGOUT_PAGE_URL; !>
1520 * ```
1521 * ———— Shortcode & JavaScript Equivalents ————
1522 * ```
1523 * [s2Get constant="S2MEMBER_LOGOUT_PAGE_URL" /]
1524 *
1525 * <script type="text/javascript">
1526 * document.write(S2MEMBER_LOGOUT_PAGE_URL);
1527 * </script>
1528 * ```
1529 *
1530 * @package s2Member\API_Constants
1531 * @since 3.5
1532 *
1533 * @var str
1534 *
1535 * @see s2Member\API_Constants\S2MEMBER_LOGIN_PAGE_URL
1536 *
1537 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID
1538 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL
1539 *
1540 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_ID
1541 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_URL
1542 *
1543 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1544 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1545 *
1546 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL
1547 *
1548 * @see http://codex.wordpress.org/Function_Reference/wp_logout_url wp_logout_url()
1549 */
1550 if (!defined ("S2MEMBER_LOGOUT_PAGE_URL"))
1551 define ("S2MEMBER_LOGOUT_PAGE_URL", ($c[] = (string)wp_logout_url ())); /* This triggers `wp_nonce_tick()`; watch out for dynamic changes. */
1552 /**
1553 * The URL, where a User can log into their account.
1554 *
1555 * This is the value provided by WordPress®. It's the same as using ``wp_login_url()``.
1556 *
1557 * ———— Quick PHP Code Sample ————
1558 * ```
1559 * <!php echo S2MEMBER_LOGIN_PAGE_URL; !>
1560 * ```
1561 * ———— Shortcode & JavaScript Equivalents ————
1562 * ```
1563 * [s2Get constant="S2MEMBER_LOGIN_PAGE_URL" /]
1564 *
1565 * <script type="text/javascript">
1566 * document.write(S2MEMBER_LOGIN_PAGE_URL);
1567 * </script>
1568 * ```
1569 *
1570 * @package s2Member\API_Constants
1571 * @since 3.5
1572 *
1573 * @var str
1574 *
1575 * @see s2Member\API_Constants\S2MEMBER_LOGOUT_PAGE_URL
1576 *
1577 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_ID
1578 * @see s2Member\API_Constants\S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL
1579 *
1580 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_ID
1581 * @see s2Member\API_Constants\S2MEMBER_LOGIN_WELCOME_PAGE_URL
1582 *
1583 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1584 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1585 *
1586 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_PROFILE_MODIFICATION_PAGE_URL
1587 *
1588 * @see http://codex.wordpress.org/Function_Reference/wp_login_url wp_login_url()
1589 */
1590 if (!defined ("S2MEMBER_LOGIN_PAGE_URL"))
1591 define ("S2MEMBER_LOGIN_PAGE_URL", ($c[] = (string)wp_login_url ())); /* Will not trigger `wp_nonce_tick()`, no worries in this case. */
1592 /**
1593 * Each Membership Level ( Label ); as configured by the site owner.
1594 *
1595 * The defaults are as follows:
1596 * o Level #0 ``S2MEMBER_LEVEL0_LABEL`` = Free Subscriber
1597 * o Level #1 ``S2MEMBER_LEVEL1_LABEL`` = Bronze Member
1598 * o Level #2 ``S2MEMBER_LEVEL2_LABEL`` = Silver Member
1599 * o Level #3 ``S2MEMBER_LEVEL3_LABEL`` = Gold Member
1600 * o Level #4 ``S2MEMBER_LEVEL4_LABEL`` = Platinum Member
1601 *
1602 * ———— Quick PHP Code Sample ————
1603 * ```
1604 * <!php echo S2MEMBER_LEVEL0_LABEL; !>
1605 * ```
1606 * ———— Shortcode & JavaScript Equivalents ————
1607 * ```
1608 * [s2Get constant="S2MEMBER_LEVEL0_LABEL" /]
1609 *
1610 * <script type="text/javascript">
1611 * document.write(S2MEMBER_LEVEL0_LABEL);
1612 * </script>
1613 * ```
1614 *
1615 * @package s2Member\API_Constants
1616 * @since 3.5
1617 *
1618 * @var str
1619 *
1620 * @see s2Member\API_Functions\get_user_field()
1621 * @see `get_user_field("s2member_access_role")`
1622 * @see `get_user_field("s2member_access_level")`
1623 * @see `get_user_field("s2member_access_label")`
1624 *
1625 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_ACCESS_LEVEL
1626 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_ACCESS_LABEL
1627 *
1628 * @see http://codex.wordpress.org/Function_Reference/wp_get_current_user wp_get_current_user()
1629 *
1630 * @see `Dashboard -> s2Member -> General Options -> Membership Level ( Labels )`
1631 */
1632 for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
1633 {
1634 if (!defined (($S2MEMBER_LEVELn_LABEL = "S2MEMBER_LEVEL" . $n . "_LABEL")))
1635 define ($S2MEMBER_LEVELn_LABEL, ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_label"]));
1636 }
1637 /**
1638 * File Downloads allowed at each Membership Level; as configured by the site owner.
1639 *
1640 * The defaults are as follows:
1641 * o Level #0 ``S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED`` = `0`
1642 * o Level #1 ``S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED`` = `0`
1643 * o Level #2 ``S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED`` = `0`
1644 * o Level #3 ``S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED`` = `0`
1645 * o Level #4 ``S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED`` = `0`
1646 *
1647 * ———— Quick PHP Code Sample ————
1648 * ```
1649 * <!php echo S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED; !>
1650 * ```
1651 * ———— Shortcode & JavaScript Equivalents ————
1652 * ```
1653 * [s2Get constant="S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED" /]
1654 *
1655 * <script type="text/javascript">
1656 * document.write(S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED);
1657 * </script>
1658 * ```
1659 *
1660 * @package s2Member\API_Constants
1661 * @since 3.5
1662 *
1663 * @var int
1664 *
1665 * @see s2Member\API_Functions\s2member_user_downloads()
1666 * @see s2Member\API_Functions\s2member_total_downloads_of()
1667 * @see s2Member\API_Functions\s2member_total_unique_downloads_of()
1668 *
1669 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED
1670 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED
1671 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS
1672 *
1673 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY
1674 *
1675 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1676 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1677 *
1678 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS
1679 *
1680 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS
1681 *
1682 * @see `Dashboard -> s2Member -> Download Options`
1683 */
1684 for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
1685 {
1686 if (!defined (($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED = "S2MEMBER_LEVEL" . $n . "_FILE_DOWNLOADS_ALLOWED")))
1687 define ($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED, ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_file_downloads_allowed"]));
1688 }
1689 /**
1690 * File Download days, at each Membership Level; as configured by the site owner.
1691 *
1692 * The defaults are as follows:
1693 * o Level #0 ``S2MEMBER_LEVEL0_FILE_DOWNLOADS_ALLOWED_DAYS`` = `0`
1694 * o Level #1 ``S2MEMBER_LEVEL1_FILE_DOWNLOADS_ALLOWED_DAYS`` = `0`
1695 * o Level #2 ``S2MEMBER_LEVEL2_FILE_DOWNLOADS_ALLOWED_DAYS`` = `0`
1696 * o Level #3 ``S2MEMBER_LEVEL3_FILE_DOWNLOADS_ALLOWED_DAYS`` = `0`
1697 * o Level #4 ``S2MEMBER_LEVEL4_FILE_DOWNLOADS_ALLOWED_DAYS`` = `0`
1698 *
1699 * ———— Quick PHP Code Sample ————
1700 * ```
1701 * 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.
1702 * 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.
1703 * ```
1704 * ———— Shortcode & JavaScript Equivalents ————
1705 * ```
1706 * 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.
1707 * 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.
1708 *
1709 * 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.
1710 * 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.
1711 * ```
1712 *
1713 * @package s2Member\API_Constants
1714 * @since 3.5
1715 *
1716 * @var int
1717 *
1718 * @see s2Member\API_Functions\s2member_user_downloads()
1719 * @see s2Member\API_Functions\s2member_total_downloads_of()
1720 * @see s2Member\API_Functions\s2member_total_unique_downloads_of()
1721 *
1722 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED
1723 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED
1724 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS
1725 *
1726 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY
1727 *
1728 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1729 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1730 *
1731 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED
1732 *
1733 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS
1734 *
1735 * @see `Dashboard -> s2Member -> Download Options`
1736 */
1737 for ($n = 0; $n <= $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["levels"]; $n++)
1738 {
1739 if (!defined (($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS = "S2MEMBER_LEVEL" . $n . "_FILE_DOWNLOADS_ALLOWED_DAYS")))
1740 define ($S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS, ($c[] = (int)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["level" . $n . "_file_downloads_allowed_days"]));
1741 }
1742 /**
1743 * Inline File Download extensions; as configured by the site owner.
1744 *
1745 * ———— Quick PHP Code Sample ————
1746 * ```
1747 * <!php echo S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS; !>
1748 * ```
1749 * ———— Shortcode & JavaScript Equivalents ————
1750 * ```
1751 * [s2Get constant="S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS" /]
1752 *
1753 * <script type="text/javascript">
1754 * document.write(S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS);
1755 * </script>
1756 * ```
1757 *
1758 * @package s2Member\API_Constants
1759 * @since 3.5
1760 *
1761 * @var str
1762 *
1763 * @see s2Member\API_Functions\s2member_user_downloads()
1764 * @see s2Member\API_Functions\s2member_total_downloads_of()
1765 * @see s2Member\API_Functions\s2member_total_unique_downloads_of()
1766 *
1767 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED
1768 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_IS_UNLIMITED
1769 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_ALLOWED_DAYS
1770 *
1771 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_DOWNLOADS_CURRENTLY
1772 *
1773 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_ID
1774 * @see s2Member\API_Constants\S2MEMBER_FILE_DOWNLOAD_LIMIT_EXCEEDED_PAGE_URL
1775 *
1776 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED
1777 * @see s2Member\API_Constants\S2MEMBER_LEVELn_FILE_DOWNLOADS_ALLOWED_DAYS
1778 *
1779 * @see `Dashboard -> s2Member -> Download Options`
1780 */
1781 if (!defined ("S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS"))
1782 define ("S2MEMBER_FILE_DOWNLOAD_INLINE_EXTENSIONS", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["file_download_inline_extensions"]));
1783 /**
1784 * From: Name, for s2Member-specific emails; as configured by the site owner.
1785 *
1786 * ———— Quick PHP Code Sample ————
1787 * ```
1788 * <!php echo S2MEMBER_REG_EMAIL_FROM_NAME; !>
1789 * ```
1790 * ———— Shortcode & JavaScript Equivalents ————
1791 * ```
1792 * [s2Get constant="S2MEMBER_REG_EMAIL_FROM_NAME" /]
1793 *
1794 * <script type="text/javascript">
1795 * document.write(S2MEMBER_REG_EMAIL_FROM_NAME);
1796 * </script>
1797 * ```
1798 *
1799 * @package s2Member\API_Constants
1800 * @since 3.5
1801 *
1802 * @var str
1803 *
1804 * @see s2Member\API_Constants\S2MEMBER_REG_EMAIL_FROM_EMAIL
1805 *
1806 * @see `Dashboard -> s2Member -> General Options`
1807 */
1808 if (!defined ("S2MEMBER_REG_EMAIL_FROM_NAME"))
1809 define ("S2MEMBER_REG_EMAIL_FROM_NAME", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]));
1810 /**
1811 * From: Email Address, for s2Member-specific emails; as configured by the site owner.
1812 *
1813 * ———— Quick PHP Code Sample ————
1814 * ```
1815 * <!php echo S2MEMBER_REG_EMAIL_FROM_EMAIL; !>
1816 * ```
1817 * ———— Shortcode & JavaScript Equivalents ————
1818 * ```
1819 * [s2Get constant="S2MEMBER_REG_EMAIL_FROM_EMAIL" /]
1820 *
1821 * <script type="text/javascript">
1822 * document.write(S2MEMBER_REG_EMAIL_FROM_EMAIL);
1823 * </script>
1824 * ```
1825 *
1826 * @package s2Member\API_Constants
1827 * @since 3.5
1828 *
1829 * @var str
1830 *
1831 * @see s2Member\API_Constants\S2MEMBER_REG_EMAIL_FROM_NAME
1832 *
1833 * @see `Dashboard -> s2Member -> General Options`
1834 */
1835 if (!defined ("S2MEMBER_REG_EMAIL_FROM_EMAIL"))
1836 define ("S2MEMBER_REG_EMAIL_FROM_EMAIL", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"]));
1837 /**
1838 * Full URL to PayPal® IPN handler, provided by s2Member.
1839 *
1840 * ———— Quick PHP Code Sample ————
1841 * ```
1842 * <!php echo S2MEMBER_PAYPAL_NOTIFY_URL; !>
1843 * ```
1844 * ———— Shortcode & JavaScript Equivalents ————
1845 * ```
1846 * [s2Get constant="S2MEMBER_PAYPAL_NOTIFY_URL" /]
1847 *
1848 * <script type="text/javascript">
1849 * document.write(S2MEMBER_PAYPAL_NOTIFY_URL);
1850 * </script>
1851 * ```
1852 *
1853 * @package s2Member\API_Constants
1854 * @since 3.5
1855 *
1856 * @var str
1857 *
1858 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_RETURN_URL
1859 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_PDT_IDENTITY_TOKEN
1860 *
1861 * @see `Dashboard -> s2Member -> PayPal® Options -> IPN Integration`
1862 */
1863 if (!defined ("S2MEMBER_PAYPAL_NOTIFY_URL"))
1864 define ("S2MEMBER_PAYPAL_NOTIFY_URL", ($c[] = (string)site_url ("/?s2member_paypal_notify=1")));
1865 /**
1866 * Full URL to PayPal® Auto-Return/PDT handler, provided by s2Member.
1867 *
1868 * ———— Quick PHP Code Sample ————
1869 * ```
1870 * <!php echo S2MEMBER_PAYPAL_RETURN_URL; !>
1871 * ```
1872 * ———— Shortcode & JavaScript Equivalents ————
1873 * ```
1874 * [s2Get constant="S2MEMBER_PAYPAL_RETURN_URL" /]
1875 *
1876 * <script type="text/javascript">
1877 * document.write(S2MEMBER_PAYPAL_RETURN_URL);
1878 * </script>
1879 * ```
1880 *
1881 * @package s2Member\API_Constants
1882 * @since 3.5
1883 *
1884 * @var str
1885 *
1886 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_NOTIFY_URL
1887 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_PDT_IDENTITY_TOKEN
1888 *
1889 * @see `Dashboard -> s2Member -> PayPal® Options -> Auto-Return/PDT Integration`
1890 */
1891 if (!defined ("S2MEMBER_PAYPAL_RETURN_URL"))
1892 define ("S2MEMBER_PAYPAL_RETURN_URL", ($c[] = (string)site_url ("/?s2member_paypal_return=1")));
1893 /**
1894 * PayPal® Business Email Address; as configured by the site owner.
1895 *
1896 * ———— Quick PHP Code Sample ————
1897 * ```
1898 * <!php echo S2MEMBER_PAYPAL_BUSINESS; !>
1899 * ```
1900 * ———— Shortcode & JavaScript Equivalents ————
1901 * ```
1902 * [s2Get constant="S2MEMBER_PAYPAL_BUSINESS" /]
1903 *
1904 * <script type="text/javascript">
1905 * document.write(S2MEMBER_PAYPAL_BUSINESS);
1906 * </script>
1907 * ```
1908 *
1909 * @package s2Member\API_Constants
1910 * @since 3.5
1911 *
1912 * @var str
1913 *
1914 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_USERNAME
1915 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_PASSWORD
1916 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_SIGNATURE
1917 *
1918 * @see `Dashboard -> s2Member -> PayPal® Options -> Account Details`
1919 */
1920 if (!defined ("S2MEMBER_PAYPAL_BUSINESS"))
1921 define ("S2MEMBER_PAYPAL_BUSINESS", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_business"]));
1922 /**
1923 * PayPal® endpoint domain ( changes when Sandbox Mode is enabled ).
1924 *
1925 * o In Sandbox Mode, this is: `www.sandbox.paypal.com`.
1926 * o In Production Mode, this is: `www.paypal.com`.
1927 *
1928 * ———— Quick PHP Code Sample ————
1929 * ```
1930 * <!php echo S2MEMBER_PAYPAL_ENDPOINT; !>
1931 * ```
1932 * ———— Shortcode & JavaScript Equivalents ————
1933 * ```
1934 * [s2Get constant="S2MEMBER_PAYPAL_ENDPOINT" /]
1935 *
1936 * <script type="text/javascript">
1937 * document.write(S2MEMBER_PAYPAL_ENDPOINT);
1938 * </script>
1939 * ```
1940 *
1941 * @package s2Member\API_Constants
1942 * @since 3.5
1943 *
1944 * @var str
1945 *
1946 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_ENDPOINT
1947 *
1948 * @see `Dashboard -> s2Member -> PayPal® Options -> Account Details`
1949 */
1950 if (!defined ("S2MEMBER_PAYPAL_ENDPOINT"))
1951 define ("S2MEMBER_PAYPAL_ENDPOINT", ($c[] = (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "www.sandbox.paypal.com" : "www.paypal.com")));
1952 /**
1953 * PayPal® API endpoint domain ( changes when Sandbox Mode is enabled ).
1954 *
1955 * o In Sandbox Mode, this is: `api-3t.sandbox.paypal.com`.
1956 * o In Production Mode, this is: `api-3t.paypal.com`.
1957 *
1958 * ———— Quick PHP Code Sample ————
1959 * ```
1960 * <!php echo S2MEMBER_PAYPAL_API_ENDPOINT; !>
1961 * ```
1962 * ———— Shortcode & JavaScript Equivalents ————
1963 * ```
1964 * [s2Get constant="S2MEMBER_PAYPAL_API_ENDPOINT" /]
1965 *
1966 * <script type="text/javascript">
1967 * document.write(S2MEMBER_PAYPAL_API_ENDPOINT);
1968 * </script>
1969 * ```
1970 *
1971 * @package s2Member\API_Constants
1972 * @since 3.5
1973 *
1974 * @var str
1975 *
1976 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_ENDPOINT
1977 *
1978 * @see `Dashboard -> s2Member -> PayPal® Options -> Account Details`
1979 */
1980 if (!defined ("S2MEMBER_PAYPAL_API_ENDPOINT"))
1981 define ("S2MEMBER_PAYPAL_API_ENDPOINT", ($c[] = (($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_sandbox"]) ? "api-3t.sandbox.paypal.com" : "api-3t.paypal.com")));
1982 /**
1983 * PayPal® API Username; as configured by the site owner.
1984 *
1985 * ———— Quick PHP Code Sample ————
1986 * ```
1987 * <!php echo S2MEMBER_PAYPAL_API_USERNAME; !>
1988 * ```
1989 * ———— Shortcode & JavaScript Equivalents ————
1990 * ```
1991 * [s2Get constant="S2MEMBER_PAYPAL_API_USERNAME" /]
1992 *
1993 * NOTE: For security purposes,
1994 * this API Constant is NOT available as a JavaScript Global.
1995 * ```
1996 *
1997 * @package s2Member\API_Constants
1998 * @since 3.5
1999 *
2000 * @var str
2001 *
2002 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_BUSINESS
2003 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_PASSWORD
2004 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_SIGNATURE
2005 *
2006 * @see `Dashboard -> s2Member -> PayPal® Options -> Account Details`
2007 */
2008 if (!defined ("S2MEMBER_PAYPAL_API_USERNAME"))
2009 define ("S2MEMBER_PAYPAL_API_USERNAME", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_username"]));
2010 /**
2011 * PayPal® API Password; as configured by the site owner.
2012 *
2013 * ———— Quick PHP Code Sample ————
2014 * ```
2015 * <!php echo S2MEMBER_PAYPAL_API_PASSWORD; !>
2016 * ```
2017 * ———— Shortcode & JavaScript Equivalents ————
2018 * ```
2019 * [s2Get constant="S2MEMBER_PAYPAL_API_PASSWORD" /]
2020 *
2021 * NOTE: For security purposes,
2022 * this API Constant is NOT available as a JavaScript Global.
2023 * ```
2024 *
2025 * @package s2Member\API_Constants
2026 * @since 3.5
2027 *
2028 * @var str
2029 *
2030 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_BUSINESS
2031 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_USERNAME
2032 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_SIGNATURE
2033 *
2034 * @see `Dashboard -> s2Member -> PayPal® Options -> Account Details`
2035 */
2036 if (!defined ("S2MEMBER_PAYPAL_API_PASSWORD"))
2037 define ("S2MEMBER_PAYPAL_API_PASSWORD", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_password"]));
2038 /**
2039 * PayPal® API Signature; as configured by the site owner.
2040 *
2041 * ———— Quick PHP Code Sample ————
2042 * ```
2043 * <!php echo S2MEMBER_PAYPAL_API_SIGNATURE; !>
2044 * ```
2045 * ———— Shortcode & JavaScript Equivalents ————
2046 * ```
2047 * [s2Get constant="S2MEMBER_PAYPAL_API_SIGNATURE" /]
2048 *
2049 * NOTE: For security purposes,
2050 * this API Constant is NOT available as a JavaScript Global.
2051 * ```
2052 *
2053 * @package s2Member\API_Constants
2054 * @since 3.5
2055 *
2056 * @var str
2057 *
2058 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_BUSINESS
2059 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_USERNAME
2060 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_API_PASSWORD
2061 *
2062 * @see `Dashboard -> s2Member -> PayPal® Options -> Account Details`
2063 */
2064 if (!defined ("S2MEMBER_PAYPAL_API_SIGNATURE"))
2065 define ("S2MEMBER_PAYPAL_API_SIGNATURE", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_api_signature"]));
2066 /**
2067 * PayPal® PDT Identity Token; as configured by the site owner.
2068 *
2069 * ———— Quick PHP Code Sample ————
2070 * ```
2071 * <!php echo S2MEMBER_PAYPAL_PDT_IDENTITY_TOKEN; !>
2072 * ```
2073 * ———— Shortcode & JavaScript Equivalents ————
2074 * ```
2075 * [s2Get constant="S2MEMBER_PAYPAL_PDT_IDENTITY_TOKEN" /]
2076 *
2077 * NOTE: For security purposes,
2078 * this API Constant is NOT available as a JavaScript Global.
2079 * ```
2080 *
2081 * @package s2Member\API_Constants
2082 * @since 3.5
2083 *
2084 * @var str
2085 *
2086 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_RETURN_URL
2087 * @see s2Member\API_Constants\S2MEMBER_PAYPAL_NOTIFY_URL
2088 *
2089 * @see `Dashboard -> s2Member -> PayPal® Options -> Auto-Return/PDT Integration`
2090 */
2091 if (!defined ("S2MEMBER_PAYPAL_PDT_IDENTITY_TOKEN"))
2092 define ("S2MEMBER_PAYPAL_PDT_IDENTITY_TOKEN", ($c[] = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["paypal_identity_token"]));
2093 /**
2094 * PayPal® value for Payment Buttons with input name: `invoice`.
2095 *
2096 * This can be used to auto-fill the `invoice` value in PayPal® Button Codes, with a unique Code~IP combination.
2097 * 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.
2098 *
2099 * 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}.
2100 * It MUST be excluded, because the value of this particular API Constant will change too often *( i.e. it changes, depending on microtime )*.
2101 * So, when including this API Constant in the JavaScript API as a Global, care must be taken to build an Invoice, using JavaScript
2102 * to calculate the unique time-based code, with something like: `Math.round (new Date ().getTime ())`.
2103 *
2104 * These five API Constants are special.
2105 * o {@link s2Member\API_Constants\S2MEMBER_VALUE_FOR_PP_INV}
2106 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0}
2107 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0}
2108 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1}
2109 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1}
2110 *
2111 * They are used by the PayPal® Button Generator for s2Member.
2112 *
2113 * The `INV` value can be used to auto-fill the `invoice` for PayPal® Button Codes, with a unique Code~IP combination.
2114 * 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.
2115 *
2116 * The `ON0/OS0` values, are how s2Member identifies an existing Member *( and/or a Free Subscriber )*, who is already logged-in
2117 * when they click a PayPal® Modification Button that was generated for you by s2Member's Button Generator.
2118 *
2119 * Instead of forcing a Member *( and/or a Free Subscriber )* to re-register for a new account,
2120 * s2Member can identify their existing account, and update it; according to the modified terms in your Button Code.
2121 * These three Button Code parameters: `on0`, `os0`, `modify`, work together in harmony. If you're using the Shortcode Format for PayPal® Buttons,
2122 * you won't even see these, because they're added internally by the Shortcode processor.
2123 *
2124 * The `ON1/OS1` values, are used by s2Member to identify a Customer's IP Address through IPN communications with PayPal®.
2125 *
2126 * Anyway, these five API Constants are just documented here for clarity;
2127 * you probably won't use any of these directly; the Button Generator pops them in.
2128 *
2129 * ———— Quick PHP Code Sample ————
2130 * ```
2131 * <!php echo S2MEMBER_VALUE_FOR_PP_INV; !>
2132 * ```
2133 * ———— Shortcode & JavaScript Equivalents ————
2134 * ```
2135 * [s2Get constant="S2MEMBER_VALUE_FOR_PP_INV" /]
2136 *
2137 * <script type="text/javascript">
2138 * document.write(S2MEMBER_VALUE_FOR_PP_INV);
2139 * </script>
2140 * ```
2141 *
2142 * @package s2Member\API_Constants
2143 * @since 110720
2144 *
2145 * @var str
2146 *
2147 * @see s2Member\API_Functions\s2member_value_for_pp_inv()
2148 *
2149 * @see `Dashboard -> s2Member -> PayPal® Buttons`
2150 */
2151 if (!defined ("S2MEMBER_VALUE_FOR_PP_INV"))
2152 define ("S2MEMBER_VALUE_FOR_PP_INV", uniqid () . "~" . S2MEMBER_CURRENT_USER_IP);
2153 /**
2154 * PayPal® value for Payment Buttons with input name: `on0`.
2155 *
2156 * Used in PayPal® Modification Buttons *( i.e. upgrades/downgrades )*.
2157 *
2158 * This auto-fills the `on0` value in PayPal® Button Codes. If a Button Code is presented to a logged-in Member,
2159 * this will auto-fill the value for the `on0` input variable, with the string: "Referencing Customer ID".
2160 * Otherwise, it will be set to a default value of: "Originating Domain".
2161 *
2162 * These five API Constants are special.
2163 * o {@link s2Member\API_Constants\S2MEMBER_VALUE_FOR_PP_INV}
2164 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0}
2165 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0}
2166 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1}
2167 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1}
2168 *
2169 * They are used by the PayPal® Button Generator for s2Member.
2170 *
2171 * The `INV` value can be used to auto-fill the `invoice` for PayPal® Button Codes, with a unique Code~IP combination.
2172 * 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.
2173 *
2174 * The `ON0/OS0` values, are how s2Member identifies an existing Member *( and/or a Free Subscriber )*, who is already logged-in
2175 * when they click a PayPal® Modification Button that was generated for you by s2Member's Button Generator.
2176 *
2177 * Instead of forcing a Member *( and/or a Free Subscriber )* to re-register for a new account,
2178 * s2Member can identify their existing account, and update it; according to the modified terms in your Button Code.
2179 * These three Button Code parameters: `on0`, `os0`, `modify`, work together in harmony. If you're using the Shortcode Format for PayPal® Buttons,
2180 * you won't even see these, because they're added internally by the Shortcode processor.
2181 *
2182 * The `ON1/OS1` values, are used by s2Member to identify a Customer's IP Address through IPN communications with PayPal®.
2183 *
2184 * Anyway, these five API Constants are just documented here for clarity;
2185 * you probably won't use any of these directly; the Button Generator pops them in.
2186 *
2187 * ———— Quick PHP Code Sample ————
2188 * ```
2189 * <!php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0; !>
2190 * ```
2191 * ———— Shortcode & JavaScript Equivalents ————
2192 * ```
2193 * [s2Get constant="S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0" /]
2194 *
2195 * <script type="text/javascript">
2196 * document.write(S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0);
2197 * </script>
2198 * ```
2199 *
2200 * @package s2Member\API_Constants
2201 * @since 3.5
2202 *
2203 * @var str
2204 *
2205 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0
2206 *
2207 * @see `Dashboard -> s2Member -> PayPal® Buttons`
2208 */
2209 if (!defined ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0"))
2210 define ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0", ($c[] = ((S2MEMBER_CURRENT_USER_SUBSCR_OR_WP_ID) ? "Referencing Customer ID" : "Originating Domain")));
2211 /**
2212 * PayPal® value for Payment Buttons with input name: `os0`.
2213 *
2214 * Used in PayPal® Modification Buttons *( i.e. upgrades/downgrades )*.
2215 *
2216 * This auto-fills the `os0` value in PayPal® Button Codes. If a Button Code is presented to a logged-in Member,
2217 * 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}.
2218 * Otherwise, it will be set to a default value of ``$_SERVER["HTTP_HOST"]`` *( the originating domain name )*.
2219 *
2220 * These five API Constants are special.
2221 * o {@link s2Member\API_Constants\S2MEMBER_VALUE_FOR_PP_INV}
2222 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0}
2223 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0}
2224 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1}
2225 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1}
2226 *
2227 * They are used by the PayPal® Button Generator for s2Member.
2228 *
2229 * The `INV` value can be used to auto-fill the `invoice` for PayPal® Button Codes, with a unique Code~IP combination.
2230 * 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.
2231 *
2232 * The `ON0/OS0` values, are how s2Member identifies an existing Member *( and/or a Free Subscriber )*, who is already logged-in
2233 * when they click a PayPal® Modification Button that was generated for you by s2Member's Button Generator.
2234 *
2235 * Instead of forcing a Member *( and/or a Free Subscriber )* to re-register for a new account,
2236 * s2Member can identify their existing account, and update it; according to the modified terms in your Button Code.
2237 * These three Button Code parameters: `on0`, `os0`, `modify`, work together in harmony. If you're using the Shortcode Format for PayPal® Buttons,
2238 * you won't even see these, because they're added internally by the Shortcode processor.
2239 *
2240 * The `ON1/OS1` values, are used by s2Member to identify a Customer's IP Address through IPN communications with PayPal®.
2241 *
2242 * Anyway, these five API Constants are just documented here for clarity;
2243 * you probably won't use any of these directly; the Button Generator pops them in.
2244 *
2245 * ———— Quick PHP Code Sample ————
2246 * ```
2247 * <!php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0; !>
2248 * ```
2249 * ———— Shortcode & JavaScript Equivalents ————
2250 * ```
2251 * [s2Get constant="S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0" /]
2252 *
2253 * <script type="text/javascript">
2254 * document.write(S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0);
2255 * </script>
2256 * ```
2257 *
2258 * @package s2Member\API_Constants
2259 * @since 3.5
2260 *
2261 * @var str
2262 *
2263 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0
2264 *
2265 * @see `Dashboard -> s2Member -> PayPal® Buttons`
2266 */
2267 if (!defined ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0"))
2268 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"])));
2269 /**
2270 * PayPal® value for Payment Buttons with input name: `on1`.
2271 *
2272 * This auto-fills the `on1` value in PayPal® Button Codes.
2273 * This always contains the string: "Customer IP Address".
2274 *
2275 * These five API Constants are special.
2276 * o {@link s2Member\API_Constants\S2MEMBER_VALUE_FOR_PP_INV}
2277 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0}
2278 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0}
2279 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1}
2280 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1}
2281 *
2282 * They are used by the PayPal® Button Generator for s2Member.
2283 *
2284 * The `INV` value can be used to auto-fill the `invoice` for PayPal® Button Codes, with a unique Code~IP combination.
2285 * 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.
2286 *
2287 * The `ON0/OS0` values, are how s2Member identifies an existing Member *( and/or a Free Subscriber )*, who is already logged-in
2288 * when they click a PayPal® Modification Button that was generated for you by s2Member's Button Generator.
2289 *
2290 * Instead of forcing a Member *( and/or a Free Subscriber )* to re-register for a new account,
2291 * s2Member can identify their existing account, and update it; according to the modified terms in your Button Code.
2292 * These three Button Code parameters: `on0`, `os0`, `modify`, work together in harmony. If you're using the Shortcode Format for PayPal® Buttons,
2293 * you won't even see these, because they're added internally by the Shortcode processor.
2294 *
2295 * The `ON1/OS1` values, are used by s2Member to identify a Customer's IP Address through IPN communications with PayPal®.
2296 *
2297 * Anyway, these five API Constants are just documented here for clarity;
2298 * you probably won't use any of these directly; the Button Generator pops them in.
2299 *
2300 * ———— Quick PHP Code Sample ————
2301 * ```
2302 * <!php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1; !>
2303 * ```
2304 * ———— Shortcode & JavaScript Equivalents ————
2305 * ```
2306 * [s2Get constant="S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1" /]
2307 *
2308 * <script type="text/javascript">
2309 * document.write(S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1);
2310 * </script>
2311 * ```
2312 *
2313 * @package s2Member\API_Constants
2314 * @since 3.5
2315 *
2316 * @var str
2317 *
2318 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1
2319 *
2320 * @see `Dashboard -> s2Member -> PayPal® Buttons`
2321 */
2322 if (!defined ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1"))
2323 define ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1", ($c[] = "Customer IP Address" /* Via $_SERVER["REMOTE_ADDR"] below. */));
2324 /**
2325 * PayPal® value for Payment Buttons with input name: `os1`.
2326 *
2327 * This auto-fills the `os1` value in PayPal® Button Codes,
2328 * with the Customer's IP Address, via ``$_SERVER["REMOTE_ADDR"]``.
2329 *
2330 * These five API Constants are special.
2331 * o {@link s2Member\API_Constants\S2MEMBER_VALUE_FOR_PP_INV}
2332 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON0}
2333 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS0}
2334 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1}
2335 * o {@link s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1}
2336 *
2337 * They are used by the PayPal® Button Generator for s2Member.
2338 *
2339 * The `INV` value can be used to auto-fill the `invoice` for PayPal® Button Codes, with a unique Code~IP combination.
2340 * 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.
2341 *
2342 * The `ON0/OS0` values, are how s2Member identifies an existing Member *( and/or a Free Subscriber )*, who is already logged-in
2343 * when they click a PayPal® Modification Button that was generated for you by s2Member's Button Generator.
2344 *
2345 * Instead of forcing a Member *( and/or a Free Subscriber )* to re-register for a new account,
2346 * s2Member can identify their existing account, and update it; according to the modified terms in your Button Code.
2347 * These three Button Code parameters: `on0`, `os0`, `modify`, work together in harmony. If you're using the Shortcode Format for PayPal® Buttons,
2348 * you won't even see these, because they're added internally by the Shortcode processor.
2349 *
2350 * The `ON1/OS1` values, are used by s2Member to identify a Customer's IP Address through IPN communications with PayPal®.
2351 *
2352 * Anyway, these five API Constants are just documented here for clarity;
2353 * you probably won't use any of these directly; the Button Generator pops them in.
2354 *
2355 * ———— Quick PHP Code Sample ————
2356 * ```
2357 * <!php echo S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1; !>
2358 * ```
2359 * ———— Shortcode & JavaScript Equivalents ————
2360 * ```
2361 * [s2Get constant="S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1" /]
2362 *
2363 * <script type="text/javascript">
2364 * document.write(S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1);
2365 * </script>
2366 * ```
2367 *
2368 * @package s2Member\API_Constants
2369 * @since 3.5
2370 *
2371 * @var str
2372 *
2373 * @see s2Member\API_Constants\S2MEMBER_CURRENT_USER_VALUE_FOR_PP_ON1
2374 *
2375 * @see `Dashboard -> s2Member -> PayPal® Buttons`
2376 */
2377 if (!defined ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1"))
2378 define ("S2MEMBER_CURRENT_USER_VALUE_FOR_PP_OS1", ($c[] = (string)$_SERVER["REMOTE_ADDR"]));
2379 /*
2380 Allows other Constants to be calculated with their checksums included too.
2381 */
2382 $c = apply_filters ("ws_plugin__s2member_during_constants_c", $c, get_defined_vars ());
2383 /**
2384 * Used internally by s2Member to compare the value of all API Constants at once.
2385 *
2386 * @package s2Member\API_Constants
2387 * @since 3.5
2388 *
2389 * @var str
2390 */
2391 if (!defined ("WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5"))
2392 define ("WS_PLUGIN__S2MEMBER_API_CONSTANTS_MD5", md5 (serialize ($c) . c_ws_plugin__s2member_utilities::ver_checksum ()));
2393 /*
2394 Calls the after Hook. Do NOT set Constants here.
2395 */
2396 do_action ("ws_plugin__s2member_after_constants", get_defined_vars ());
2397 /**/
2398 return; /* Return for uniformity. */
2399 }
2400 }
2401 }
2402 ?>