PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Protect Links w/ Shortcode?

s2Member Plugin. A Membership plugin for WordPress®.

Protect Links w/ Shortcode?

Postby trentscott1 » December 15th, 2010, 10:40 am

I use another Wordpress plugin that generates dynamic authenticated links on-the-fly. For example, a link to a file might look like: http://s3.killertuts.com/source_files/2 ... 3450299013 where the last part is different on each page view. Is there a way I can set S2Member to only display such a link when a member is Level 2, for example?

Is the best way to do that to create a rule that looks for the string 'source_files' which should be a constant URI in the links I want to protect? Or, is there a way where I can surround the link with short tags to protect it, like [s2member][level2]http://s3.killertuts.com/source_files/23423423423423[/level2][/s2member]
User avatar
trentscott1
Registered User
Registered User
 
Posts: 2
Joined: December 15, 2010

Re: Protect Links w/ Shortcode?

Postby Cristián Lávaque » December 27th, 2010, 1:19 am

Why do you need shortcode instead of PHP for that?

Code: Select all

<?php if (current_user_is("s2member_level2")){ ?>
    http://s3.killertuts.com/source_files/23423423423423
<?php } ?>
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: Exabot [Bot] and 4 guests

cron