Source Code Documentation


pro\s2member-pro\includes\menu-pages\gen-ops-lwp-otos.inc.php


  1. <?php
  2. /**
  3. * Menu page for s2Member Pro (Login Welcome Page / One-Time-Offers).
  4. *
  5. * Copyright: © 2009-2011
  6. * {@link http://www.websharks-inc.com/ WebSharks, Inc.}
  7. * (coded in the USA)
  8. *
  9. * This WordPress® plugin (s2Member Pro) is comprised of two parts:
  10. *
  11. * o (1) Its PHP code is licensed under the GPL license, as is WordPress®.
  12. * You should have received a copy of the GNU General Public License,
  13. * along with this software. In the main directory, see: /licensing/
  14. * If not, see: {@link http://www.gnu.org/licenses/}.
  15. *
  16. * o (2) All other parts of (s2Member Pro); including, but not limited to:
  17. * the CSS code, some JavaScript code, images, and design;
  18. * are licensed according to the license purchased.
  19. * See: {@link http://www.s2member.com/prices/}
  20. *
  21. * Unless you have our prior written consent, you must NOT directly or indirectly license,
  22. * sub-license, sell, resell, or provide for free; part (2) of the s2Member Pro Module;
  23. * or make an offer to do any of these things. All of these things are strictly
  24. * prohibited with part (2) of the s2Member Pro Module.
  25. *
  26. * Your purchase of s2Member Pro includes free lifetime upgrades via s2Member.com
  27. * (i.e. new features, bug fixes, updates, improvements); along with full access
  28. * to our video tutorial library: {@link http://www.s2member.com/videos/}
  29. *
  30. * @package s2Member\Menu_Pages
  31. * @since 110720
  32. */
  33. if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
  34. exit ("Do not access this file directly.");
  35.  
  36. if (!class_exists ("c_ws_plugin__s2member_pro_menu_page_gen_ops_lwp_otos"))
  37. {
  38. /**
  39. * Menu page for s2Member Pro (Login Welcome Page / One-Time-Offers).
  40. *
  41. * @package s2Member\Menu_Pages
  42. * @since 110720
  43. */
  44. class c_ws_plugin__s2member_pro_menu_page_gen_ops_lwp_otos
  45. {
  46. public function __construct ()
  47. {
  48. echo '<div class="ws-menu-page-group" title="One-Time-Offers (Upon Login)">' . "\n";
  49.  
  50. echo '<div class="ws-menu-page-section ws-plugin--s2member-pro-one-time-offers-section">' . "\n";
  51. echo '<h3>Optional One-Time-Offers (Upon Login)</h3>' . "\n";
  52. echo '<p>This is enabled by s2Member Pro. One-Time-Offers allow you to override your default Login Welcome Page, based on the number of times a User/Member has logged in previously. s2Member Pro gives you the ability to write your own configuration file for One-Time-Offers. Please follow the instructions below. It is also possible for advanced site owners to use these <a href="#" onclick="alert(\'Replacement Codes:\\n\\n%%current_user_login%% = The current User\\\'s Username, lowercase.\\n%%current_user_id%% = The current User\\\'s ID.\\n%%current_user_level%% = The current User\\\'s s2Member Level.\\n%%current_user_role%% = The current User\\\'s WordPress® Role.' . ((!is_multisite () || !c_ws_plugin__s2member_utils_conds::is_multisite_farm () || is_main_site ()) ? '\\n%%current_user_ccaps%% = The current User\\\'s Custom Capabilities.' : '') . '\\n%%current_user_logins%% = Number of times the current User has logged in.\\n\\nFor example, if you\\\'re using BuddyPress, and you want to redirect Members to their BuddyPress Profile page after logging in, you would use: ' . site_url ("/members/%%current_user_login%%/profile/") . '\\n\\nOr, using %%current_user_level%%, you could have a separate One-Time-Offer page for each Membership Level that you plan to offer.\'); return false;">Replacement Codes</a> in their One-Time-Offer URLs.</p>' . "\n";
  53. echo (c_ws_plugin__s2member_utils_conds::bp_is_installed ()) ? '<p><em><strong>BuddyPress:</strong> s2Member integrates with BuddyPress. This configuration affects BuddyPress too.</em></p>' . "\n" : '';
  54.  
  55. echo '<table class="form-table">' . "\n";
  56. echo '<tbody>' . "\n";
  57. echo '<tr>' . "\n";
  58.  
  59. echo '<th>' . "\n";
  60. echo '<label for="ws-plugin--s2member-pro-login-welcome-page-otos">' . "\n";
  61. echo 'One-Time-Offer Configuration File:' . "\n";
  62. echo '</label>' . "\n";
  63. echo '</th>' . "\n";
  64.  
  65. echo '</tr>' . "\n";
  66. echo '<tr>' . "\n";
  67.  
  68. echo '<td>' . "\n";
  69. echo '<textarea name="ws_plugin__s2member_pro_login_welcome_page_otos" id="ws-plugin--s2member-pro-login-welcome-page-otos" rows="8" wrap="off" spellcheck="false">' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_login_welcome_page_otos"]) . '</textarea><br />' . "\n";
  70. echo 'This is a line-delimited list of URLs <em>(in a special format, as seen below)</em>.<br /><br />' . "\n";
  71. echo 'Special format (explained):<br />' . "\n";
  72. echo '<code>[Logins]</code>:<code>[Access Level]</code>:<code>[One-Time-Offer URL]</code><br /><br />' . "\n";
  73. echo '<em><code>[Logins]</code> (this triggers your One-Time-Offer page, upon X number of logins)</em><br />' . "\n";
  74. echo '<em><code>[Access Level]</code> (optional, this triggers your One-Time-Offer, based on Level# as well)</em><br />' . "\n";
  75. echo '<em><code>[One-Time-Offer URL]</code> (where User is redirected, upon login)</em><br /><br />' . "\n";
  76. echo '<strong>Example Configuration File:</strong><br />' . "\n";
  77. echo '<code>1:http://example.com/your-first-login/</code> <em>(displayed on 1st login, to all Users/Members)</em><br />' . "\n";
  78. echo '<code>25:http://example.com/customer-loyalty-reward/</code> <em>(displayed on 25th login, to all Users/Members)</em><br />' . "\n";
  79. echo '<code>3:1:http://example.com/upgrade-to-level-2/</code> <em>(displayed on 3rd login, to Level #1 Members only)</em><br />' . "\n";
  80. echo '<code>1:0:http://example.com/upgrade-to-level-1/</code> <em>(displayed on 1st login, to Free Subscribers only)</em>' . "\n";
  81. echo '</td>' . "\n";
  82.  
  83. echo '</tr>' . "\n";
  84. echo '</tbody>' . "\n";
  85. echo '</table>' . "\n";
  86. echo '</div>' . "\n";
  87.  
  88. echo '</div>' . "\n";
  89. }
  90. }
  91. }
  92.  
  93. new c_ws_plugin__s2member_pro_menu_page_gen_ops_lwp_otos ();
  94. ?>

pro\s2member-pro\includes\menu-pages\gen-ops-lwp-otos.inc.php

Source Code Documentation