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