Source Code Documentation


s2member-pro\includes\functions\api-functions.inc.php


  1. <?php
  2. /**
  3. * Core API Functions *( for site owners )*.
  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\API_Functions
  31. * @since 1.0
  32. */
  33. if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
  34. exit ("Do not access this file directly.");
  35. /**
  36. * Allows for the inclusion of the Pro Login Widget directly into a theme/plugin file.
  37. *
  38. * This function will return the HTML output from the widget function call.
  39. * Example usage: ``<!php echo s2member_pro_login_widget(); !>``
  40. *
  41. * The ``$options`` parameter (array) is completely optional *( i.e. NOT required )*.
  42. * It can be passed in as an array of options; overriding some or all of these defaults:
  43. *
  44. * o ``"title" => "Membership Login"``
  45. * Title when NOT logged in, or leave this blank if you'd prefer not to show a title.
  46. *
  47. * o ``"signup_url" => "%%automatic%%"``
  48. * Full Signup URL, or use `%%automatic%%` for the Membership Options Page. If you leave this blank, it will not be shown.
  49. *
  50. * o ``"login_redirect" => ""``
  51. * Empty ( i.e. `""` ) = Login Welcome Page, `%%previous%%` = Previous Page, `%%home%%` = Home Page, or use a full URL of your own.
  52. *
  53. * o ``"logged_out_code" => ""``
  54. * HTML/PHP code to display when logged out. May also contain WP Shortcodes if you like.
  55. *
  56. * o ``"profile_title" => "My Profile Summary"``
  57. * Title when a User is logged in. Or you can leave this blank if you'd prefer not to show a title.
  58. *
  59. * o ``"display_gravatar" => "1"``
  60. * Display Gravatar image when logged in? `1` = yes, `0` = no. Gravatars are based on email address.
  61. *
  62. * o ``"link_gravatar" => "1"``
  63. * Link Gravatar image to Gravatar.com? `1` = yes, `0` = no. Allows Users to setup a Gravatar.
  64. *
  65. * o ``"display_name" => "1"``
  66. * Display the current User's WordPress® "Display Name" when logged in? `1` = yes, `0` = no.
  67. *
  68. * o ``"logged_in_code" => ""``
  69. * HTML/PHP code to display when logged in. May also contain WP Shortcodes if you like.
  70. *
  71. * o ``"logout_redirect" => "%%home%%"``
  72. * Empty ( i.e. `""` ) = Login Screen, `%%previous%%` = Previous Page, `%%home%%` = Home Page, or use a full URL of your own.
  73. *
  74. * o ``"my_account_url" => "%%automatic%%"``
  75. * Full URL of your own, or use `%%automatic%%` for the Login Welcome Page. Leave empty to not show this at all.
  76. *
  77. * o ``"my_profile_url" => "%%automatic%%"``
  78. * Full URL of your own, or use `%%automatic%%` for a JavaScript popup. Leave empty to not show this at all.
  79. *
  80. * The ``$args`` parameter (array) is also completely optional *( i.e. NOT required )*.
  81. * It can be passed in as an array of options: overriding some or all of these defaults:
  82. *
  83. * o ``"before_widget" => ""``
  84. * HTML code to display before the widget.
  85. *
  86. * o ``"before_title" => "<h3>"``
  87. * HTML code to display before the title.
  88. *
  89. * o ``"after_title" => "</h3>"``
  90. * HTML code to display after the title.
  91. *
  92. * o ``"after_widget" => ""``
  93. * HTML code to display after the widget.
  94. *
  95. * @package s2Member\API_Functions
  96. * @since 1.5
  97. *
  98. * @param array $options Optional. See function description for details.
  99. * @param array $args Optional. See function description for details.
  100. * @return str The Pro Login Widget, HTML markup.
  101. */
  102. if (!function_exists ("s2member_pro_login_widget"))
  103. {
  104. function s2member_pro_login_widget ($options = FALSE, $args = FALSE)
  105. {
  106. $args = (is_array ($args)) ? $args : array ("before_widget" => "", "before_title" => "<h3>", "after_title" => "</h3>", "after_widget" => "");
  107. /**/
  108. return eval ('ob_start(); c_ws_plugin__s2member_pro_login_widget::widget($args, $options); $ob = ob_get_clean(); return $ob;');
  109. }
  110. }
  111. ?>

s2member-pro\includes\functions\api-functions.inc.php

Source Code Documentation