### Example One-Time-Offer Configuration File Source: https://s2member.com/kb-article/configuring-s2member-general-options Provides examples of how to structure a One-Time-Offer configuration file. It demonstrates offers for all users on specific logins, and offers for specific access levels. ```plaintext 1:http://example.com/your-first-login/ 25:http://example.com/customer-loyalty-reward/ 3:1:http://example.com/upgrade-to-level-2/ (displayed on 3rd login, to Level #1 Members only) 1:0:http://example.com/upgrade-to-level-1/ ``` -------------------------------- ### Example Coupon Codes for Import Source: https://s2member.com/kb-article/is-it-possible-to-import-coupon-codes This example file demonstrates how to list multiple coupon codes with different configurations, including discounts, date ranges, and usage restrictions. ```text SAVE5PERCENT|5% SAVE10|10 CHRISTMAS2015|25%|2015-12-01~2016-01-01 JULY4TH|40%|2015-07-04~2015-07-05|ta-only|1||1000 SAVE20|20|~2015-10-03|ta-only|||1000 ``` -------------------------------- ### Example User Import Row Source: https://s2member.com/kb-article/importingupdating-users A complete example of a single row in a user import CSV file, demonstrating how to populate all fields, including custom ones. ```csv "","johnsmith22","mY!passwrD","John","Smith","John Smith","john.smith@example.com","http://www.example.com/","2","music,videos","12/31/2000","01/10/2001","12/31/2020","12/31/2021","www.example.com|123.357.125.654","I-2342934SSER243","paypal","fishing,biking,computers","xx-large" ``` -------------------------------- ### New User Import Line Example Source: https://s2member.com/kb-article/importingupdating-users Example of a single line in a CSV file for importing a new user. The 'ID' field is left empty for new user creation. ```csv "","johndoe22","8834ks9903","John","Doe","John Doe","johndoe22@example.com" ``` -------------------------------- ### Example WordPress Pages for Username Redirection Source: https://s2member.com/kb-article/customizing-your-login-welcome-page These are example WordPress page URLs that would be created to match the dynamic redirection URL based on specific usernames. ```text http://www.example.com/johndoe22-account-page http://www.example.com/maryjane-account-page http://www.example.com/billybob-account-page http://www.example.com/acmecorp-account-page ``` -------------------------------- ### CSV Import Example with Specific Custom Fields Source: https://s2member.com/kb-article/importingupdating-users Example demonstrating the CSV structure for importing specific custom fields like 'interests', 't_shirt_size', and 'zipcode'. Values must be in alphabetical order of their IDs. ```csv ...,"fishing,biking,computers","xx-large","30052" ``` -------------------------------- ### Full s2Member Pro-Form Example with Fixed EOT Source: https://s2member.com/kb-article/how-do-you-create-a-subscription-that-ends-on-a-fixed-date This is a complete example combining the PHP logic for calculating days until a fixed EOT with an s2Member Pro-Form shortcode. It ensures that all subscriptions end on '31 October 2025'. This example is for PayPal Pro-Forms but can be adapted for Authorize.Net or Stripe. ```php [php] $now = strtotime('now'); // The time now (in seconds). $fixed_eot_time = strtotime('31 October 2025'); // Future time (in seconds). $days_until_fixed_eot_time = round(($fixed_eot_time - $now) / DAY_IN_SECONDS); // ↑ This is where we calculate the number of days until an EOT should occur. [/php] [s2Member-Pro-PayPal-Form level="1" desc="$0.01 USD / Access Until October 31st, 2025" ra="0.01" rr="BN" rt="D" rp="[php]echo $days_until_fixed_eot_time;[/php]" /] ``` -------------------------------- ### Example s2Member Meta Fields in Export Source: https://s2member.com/kb-article/advanced-importexport-tools This snippet shows example CSV headers and corresponding data for s2Member-related meta fields. It illustrates the 'meta_key__' prefix used to classify these fields. ```csv "meta_key__wp_s2member_custom","meta_key__wp_s2member_subscr_id","meta_key__wp_s2member_subscr_baid","meta_key__wp_s2member_subscr_cid","meta_key__wp_s2member_subscr_gateway","meta_key__wp_s2member_registration_ip","meta_key__wp_s2member_ipn_signup_vars","meta_key__wp_s2member_paid_registration_times","meta_key__wp_s2member_access_cap_times","meta_key__wp_s2member_sp_references","meta_key__wp_s2member_last_status_scan","meta_key__wp_s2member_first_payment_txn_id","meta_key__wp_s2member_last_payment_time","meta_key__wp_s2member_auto_eot_time","meta_key__wp_s2member_file_download_access_arc","meta_key__wp_s2member_file_download_access_log" "www.example.com","9983JKSD03343","2098234DF","980234LSEFJ","stripe","123.456.789.0","{private: JSON object}","{ \"level\":1406275414, \"level1\":1406275414}","{ \"1406275414.0001\":\"level1\"}","{private: JSON object}","1406271660","90823GAUI92323F","1406554660","1406271700","{private: JSON object}","{private: JSON object}" ``` -------------------------------- ### Example WordPress Pages for Membership Level Redirection Source: https://s2member.com/kb-article/customizing-your-login-welcome-page These are example WordPress page URLs that would be created to match the dynamic redirection URL based on specific membership levels. ```text http://www.example.com/0-account-page http://www.example.com/1-account-page http://www.example.com/2-account-page http://www.example.com/3-account-page http://www.example.com/4-account-page ``` -------------------------------- ### Basic Content Dripping Source: https://s2member.com/kb-article/s2drip-shortcode Use this snippet to display content to members at a specific level or higher, starting from a certain day of their membership. The content remains visible indefinitely after the specified start day. ```shortcode [s2Drip access="level1" from_day="4"] Some content for Members at Level 1 (or higher). This content will show only after day 3 of their paid membership. ~ i.e. it starts showing on day 4. It will continue to be shown every day thereafter. [/s2Drip] ``` -------------------------------- ### JW Player Sharing and Logo Example Source: https://s2member.com/kb-article/s2stream-shortcode-documentation Configures both social sharing and adds a logo with a link to the JW Player. The logo will be displayed on the player. ```html [s2Stream player_option_blocks="sharing:{},logo:{file:'/logo.png',link:'http://example.com'}"] ``` -------------------------------- ### s2Member Import Format with Optional Fields Source: https://s2member.com/kb-article/migrating-from-other-software-to-s2member An extended example showing all possible fields for s2Member import, including subscription and custom field data. ```csv "ID","Username","Password","First Name","Last Name","Display Name","Email","Website","Level[0-9]+ or Role ID","Custom Capabilities","Registration Date ( mm/dd/yyyy )","First Payment Date ( mm/dd/yyyy )","Last Payment Date ( mm/dd/yyyy )","Auto-EOT Date ( mm/dd/yyyy )","Custom Value ( starts w/domain )","Paid Subscr. ID","Paid Subscr. Gateway","Custom Field ID #1","Custom Field Value #1","Custom Field ID #2","Custom Field Value #2", ... ``` -------------------------------- ### JW Player v6 Skin Example Source: https://s2member.com/kb-article/s2stream-shortcode-documentation Specify a custom skin for JW Player v6 using the player_skin attribute. ```shortcode player_skin="/jwplayer/my-skin.xml" ``` -------------------------------- ### Using PHP in WordPress Source: https://s2member.com/kb-article/introduction-to-s2member Example of using PHP within WordPress Posts, Pages, or Text Widgets with a plugin like ezPHP. ```php ``` -------------------------------- ### Display Access Expires and Next Payment Source: https://s2member.com/kb-article/s2eot-shortcode-documentation Use these examples to display fixed EOT or NPT based on the mode attribute. The default behavior for each mode is to output only the date. ```shortcode [s2Eot mode="fixed" /] ``` ```shortcode [s2Eot mode="next" /] ``` -------------------------------- ### Basic PHP Conditional Tag Example Source: https://s2member.com/kb-article/s2if-simple-shortcode-conditionals This shows a fundamental example of using PHP's `if` statement for conditional logic, demonstrating how s2Member's shortcodes are built upon standard PHP conditional structures. ```php ``` -------------------------------- ### JW Player Skinning Example Source: https://s2member.com/kb-article/s2stream-shortcode-documentation Use this attribute to apply a custom skin to JW Player v7. Ensure you are using JW Player v7 for this option. ```html [s2Stream player_option_blocks="skin:{name:'myskin'}"] ``` -------------------------------- ### CRON Job URL Example Source: https://s2member.com/kb-article/rolescapabilities-via-php This is the URL to trigger the automated user role change script. Ensure you use a secure, secret key. ```text http://example.com/?my_cron_job=secret-cron-job-key ``` -------------------------------- ### Example s2Member Coupon Import File Format Source: https://s2member.com/kb-article/is-it-possible-to-import-coupon-codes This is the format for the text file used to import coupon codes. Each line represents a coupon with various parameters. ```text code|discount|start(YYYY-MM-DD)~end(YYYY-MM-DD)|directive|singulars|users|max-uses ``` -------------------------------- ### Basic WordPress MU Plugin Webhook Handler Source: https://s2member.com/kb-article/building-an-api-notification-handler-webhook This basic MU plugin checks for specific GET parameters in the URL to identify a payment notification and then exits WordPress execution. It's a starting point for handling webhook requests. ```php Welcome [s2Get constant="S2MEMBER_CURRENT_USER_DISPLAY_NAME" /]!

You can edit your profile using the form below.

[s2Member-Profile /] ``` -------------------------------- ### Mass-Update User Line Example Source: https://s2member.com/kb-article/importingupdating-users Example of a single line in a CSV file for mass-updating an existing user. The 'ID' field contains the WordPress User ID of the account to be updated. ```csv "123","johndoe22","8834ks9903","John","Doe","John Doe","johndoe22@example.com" ``` -------------------------------- ### Login Welcome Page Based on User Capabilities Source: https://s2member.com/kb-article/customizing-your-login-welcome-page A template that conditionally displays content based on the current user's capabilities, allowing for granular access control. ```html

Welcome [s2Get constant="S2MEMBER_CURRENT_USER_DISPLAY_NAME" /]!

[s2If current_user_can(access_s2member_level1)] Content for Members who are logged in with an s2Member Level >= 1. [/s2If] [s2If current_user_cannot(access_s2member_level1)] Content for Free Subscribers. [/s2If]

You can edit your profile using the form below.

[s2Member-Profile /] ``` -------------------------------- ### One-Time-Offer Configuration File Format Source: https://s2member.com/kb-article/configuring-s2member-general-options Defines the special format for One-Time-Offer URLs within a configuration file. This format specifies the number of logins, optional access level, and the target URL. ```plaintext [Logins]:[Access Level]:[One-Time-Offer URL] ``` -------------------------------- ### Create New Users Source: https://s2member.com/kb-article/advanced-importexport-tools Import a CSV file to create new users. The minimum required fields are 'user_login' and 'user_email'. If 'user_pass' is omitted, a password will be generated automatically. ```csv "user_login", "user_email", "user_pass" "johndoe", "john@example.com", "pasSw29914943!" "maryjane", "mary@example.com", "uudkO90!!~!" ``` -------------------------------- ### Displaying EOT/NPT with HTML Markup Source: https://s2member.com/kb-article/s2eot-shortcode-documentation This example shows the rich text output with HTML markup and CSS classes for the [s2Eot /] shortcode, allowing for easy customization of the displayed date and label. ```html Access Expires: Jul 16th, 2025, 12:00 am UTC ``` -------------------------------- ### Login Welcome Page with Additional Details Source: https://s2member.com/kb-article/customizing-your-login-welcome-page An advanced template displaying comprehensive account details such as membership level, user ID, login counter, and custom fields. ```html

Welcome [s2Get constant="S2MEMBER_CURRENT_USER_DISPLAY_NAME" /]!

Your Account Details:

Membership Level: [s2Get constant="S2MEMBER_CURRENT_USER_ACCESS_LEVEL" /] Your are a: [s2Get constant="S2MEMBER_CURRENT_USER_ACCESS_LABEL" /] Your User ID is: [s2Get constant="S2MEMBER_CURRENT_USER_ID" /] Your Username is: [s2Get constant="S2MEMBER_CURRENT_USER_LOGIN" /] Your Email Address is: [s2Get constant="S2MEMBER_CURRENT_USER_EMAIL" /] Your First Name is: [s2Get constant="S2MEMBER_CURRENT_USER_FIRST_NAME" /] Your Last Name is: [s2Get constant="S2MEMBER_CURRENT_USER_LAST_NAME" /] You have logged in [s2Get constant="S2MEMBER_CURRENT_USER_LOGIN_COUNTER" /] times. Your IP Address is: [s2Get constant="S2MEMBER_CURRENT_USER_IP" /] Custom Registration/Profile Field: [s2Get user_field="custom_field_id" /] See: s2Member® -> General Options -> Registration/Profile Fields

You can edit your profile using the form below.

[s2Member-Profile /] ``` -------------------------------- ### JW Player Sharing Functionality Example Source: https://s2member.com/kb-article/s2stream-shortcode-documentation Enables social sharing functionality for the JW Player. This is a basic configuration for sharing. ```html [s2Stream player_option_blocks="sharing:{}"] ``` -------------------------------- ### Combine Conditions and Use s2Get Source: https://s2member.com/kb-article/s2if-simple-shortcode-conditionals Demonstrates using 'OR' logic to combine conditions and the [s2Get /] shortcode to display user display names, access labels, and custom field values. ```shortcode [s2If current_user_is(s2member_level1)] Content for Members at exactly Level# 1, on this Blog. [/s2If] [s2If current_user_is(s2member_level2) OR current_user_is_for_blog(24,s2member_level2)] They are either a Level #2 Member on this Blog, OR ... they're at Level# 2 on Blog ID# 24 (i.e. Multisite Networking) * Note the use of `OR` here. True if either condition is met. [/s2If] [s2If current_user_is(s2member_level3) OR current_user_is(s2member_level4)] Content for Level #3 - OR - Level #4 Members. Either/or. Hi there [s2Get constant="S2MEMBER_CURRENT_USER_DISPLAY_NAME" /]. You have [s2Get constant="S2MEMBER_CURRENT_USER_ACCESS_LABEL" /]. ^ This uses the s2Get Shortcode to retrieve the value of s2Member API Constants. These are also documented under: `Dashboard → s2Member → API Scripting`. So, this might come out to something like: `Hi there John. You have Gold Membership.` Here is a Custom Field value: [s2Get user_field="country_code" /] Custom Registration/Profile Field with the ID: `country_code`. [/s2If] ```