latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Pull videos from cloudfront based on usrname?

Home Forums Community Forum Pull videos from cloudfront based on usrname?

This topic contains 3 replies, has 2 voices. Last updated by  Dylan Wilbur 3 years, 9 months ago.

Topic Author Topic
Posted: Monday Mar 18th, 2013 at 10:59 pm #45107

Hey Guys,

I’m wondering if it would be possible to use s2member shortcodes to pull unique content from cloudfront based on a members username (or perhaps some other unique id). For instance, if Jim and Bob log-in and navigate to the “movies” section of the site, they will each see different videos specific to them, and they will not see each others videos.

Or, another way:

Get username
If username has a folder on S3 Then pull video(s) in that folder
Else display error message.

And to do this within the shortcodes that s2member already has setup. For the record I already have s3 and cloudfront working beautifully with my site (thank you for such thorough documentation).

Any help would be appreciated

List Of Topic Replies

Viewing 3 replies - 1 through 3 (of 3 total)
Author Replies
Author Replies
Posted: Tuesday Mar 19th, 2013 at 2:20 pm #45177

I tried inserting the get short code for retrieving the current users display name

[s2Get constant="S2MEMBER_CURRENT_USER_DISPLAY_NAME" /]

So the code would look like this:

[s2Stream player="jwplayer-v6-rtmp-only" player_path="/jwplayer/jwplayer.js" file_download="/[_s2Get constant="S2MEMBER_CURRENT_USER_DISPLAY_NAME"]/video.mp4" /]

But that doesn’t seem to work, any suggestions?

Posted: Thursday Mar 21st, 2013 at 2:27 am #45293
Bruce
Username: Bruce
Staff Member

Thank you for your inquiry.

You can pull the current User’s username with PHP within a Shortcode, but not with another shortcode.
You might do something like this:

To use PHP in Post/Pages, you need a PHP Execution plugin installed.
Try the ezPHP Plugin for WordPress®
[s2Stream player="jwplayer-v6-rtmp-only" player_path="/jwplayer/jwplayer.js" file_download="/"<?php echo S2MEMBER_CURRENT_USER_DISPLAY_NAME ?>/video.mp4"/]
Posted: Thursday Mar 21st, 2013 at 1:13 pm #45362

Hey Bruce,

With a few modifications, that worked great! I ended up using S2MEMBER_CURRENT_USER_LOGIN because it cannot be changed, and there was an extra ” in your code for the file name, but thank you so much for your help!

Cheers,
Dylan

Viewing 3 replies - 1 through 3 (of 3 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.