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™

Is there a way to grab a post variable in the url and...

s2Member Plugin. A Membership plugin for WordPress®.

Is there a way to grab a post variable in the url and...

Postby rwilki » July 26th, 2011, 11:13 pm

I'm liking the API scripting shortcodes. They're very cool and powerful. The last thing I need to do is to grab the url of a protected post, and after a successful login or registration use that url to continue to that post.

I know that the program is set to redirect to My Login Page, but it would be so much more effective if it would just continue to the content the visitor REALLY wants. Or at the least, if I could put a dynamic link on My Login Page, that would redirect the visitor to the protected post.
User avatar
rwilki
Registered User
Registered User
 
Posts: 61
Joined: July 22, 2011

Re: Is there a way to grab a post variable in the url and...

Postby joeboydston » July 27th, 2011, 6:01 pm

Same problem here, much interested if anyone knows of a solution.
User avatar
joeboydston
Registered User
Registered User
 
Posts: 5
Joined: July 27, 2011

Re: Is there a way to grab a post variable in the url and...

Postby candy » July 27th, 2011, 8:21 pm

not solved here either, still v.much interested in a solution ....
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: Is there a way to grab a post variable in the url and...

Postby Cristián Lávaque » July 27th, 2011, 10:46 pm

This is something that may be possible with s2Member in a future release, but I have no date for it.

That's why in the other threads Bob and Candy posted about this, I mentioned that you'd need to create this customization yourselves, probably storing the Membership Options Page Variables in the session or a cookie to use them after registration.

Now, in my opinion, if the person paid for the access and just registered, it makes sense to give him a good welcome rather than just send them to the page that bounced them. If they got there in the first place, they very probably either have the link at hand to try again, or will get to it again eventually browsing the website.
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

Re: Is there a way to grab a post variable in the url and...

Postby joeboydston » July 28th, 2011, 11:53 am

In my particular case, I'm more interested in the returning visitor, who has already paid.

We bait them with a compelling post title, then ask them to login, then force them to start over again trying to find the post they clicked in the first place.

Cristián, are you suggesting that WP has an "on_login" type of hook that we could use to redirect based on the MOT variables?
User avatar
joeboydston
Registered User
Registered User
 
Posts: 5
Joined: July 27, 2011

Re: Is there a way to grab a post variable in the url and...

Postby rwilki » July 28th, 2011, 1:56 pm

Cristian, I see your point, that a good welcome message with benefits, etc... is a good sales technique and makes good business sense. I think where the application leaves them short, is that like Joeboydston said, we're asking them to click more than necessary with no "continue" link anywhere.

If I'm subscribing to a news based or article/content-based website, I really want the content more than a welcome. I could always put a nice message with welome information in a confirmation email, plus they always have their MY Page to go to.

Your program is so strong with that exception and the lack of filtering a specific level to a specific login or registration. I can't wait for more enhancements!

Thanks,
Bob
User avatar
rwilki
Registered User
Registered User
 
Posts: 61
Joined: July 22, 2011

Re: Is there a way to grab a post variable in the url and...

Postby Cristián Lávaque » July 28th, 2011, 3:30 pm

joeboydston wrote:Cristián, are you suggesting that WP has an "on_login" type of hook that we could use to redirect based on the MOT variables?


For example, you could use something like this hack viewtopic.php?f=4&t=14211#p29101

rwilki wrote:Cristian, I see your point, that a good welcome message with benefits, etc... is a good sales technique and makes good business sense. I think where the application leaves them short, is that like Joeboydston said, we're asking them to click more than necessary with no "continue" link anywhere.

If I'm subscribing to a news based or article/content-based website, I really want the content more than a welcome. I could always put a nice message with welome information in a confirmation email, plus they always have their MY Page to go to.


Yeah, I see your point guys, I guess it makes sense in some models/flows.

What do you mean by My Page? The profile page?

rwilki wrote:Your program is so strong with that exception and the lack of filtering a specific level to a specific login or registration. I can't wait for more enhancements!


What do you mean? Content specific for each user?
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

Re: Is there a way to grab a post variable in the url and...

Postby joeboydston » July 28th, 2011, 4:41 pm

One of my developers discovered a solution that works for us. It requires shortcode-exec-php plugin.

[url]http://wordpress.org/extend/plugins/shortcode-exec-php/
[/url]

Then copy this javascript code into the bottom of the HTML view of your membership options page:

Code: Select all
<script type="text/javascript">
/* <![CDATA[ */
    jQuery.noConflict();
    jQuery(document).ready(function($){
       $(".redirect_to").val("[s2_redirect]");
    });
/* ]]> */
</script>


So far it's working perfectly for us. Hope this helps somebody else out there, it increases S2's value for us tremendously. Much more professional presentation to the reader.
Last edited by joeboydston on August 1st, 2011, 2:20 pm, edited 1 time in total.
User avatar
joeboydston
Registered User
Registered User
 
Posts: 5
Joined: July 27, 2011

Re: Is there a way to grab a post variable in the url and...

Postby rwilki » July 28th, 2011, 4:54 pm

i tried your code, what is it supposed to do? nothing different is happening for me... Do you mean My Welcome Page? This code did nothing different...

Thanks,
Bob
User avatar
rwilki
Registered User
Registered User
 
Posts: 61
Joined: July 22, 2011

Re: Is there a way to grab a post variable in the url and...

Postby joeboydston » July 29th, 2011, 1:18 pm

Insert the code into the page with your login prompt. For example, my membership page includes a login box at the top. (You know you have the right page when the URL has something like this tacked onto the end: ?s2member_seeking=post-86665&s2member_level_req=0)

So when the returning user logs in, the javascript redirects the URL to the S2member variable from the URL. In this example post_id=86665

Feel free to PM me if you'd like to see a live example.
User avatar
joeboydston
Registered User
Registered User
 
Posts: 5
Joined: July 27, 2011

Re: Is there a way to grab a post variable in the url and...

Postby joeboydston » August 1st, 2011, 11:19 am

I forgot a critical part of the instructions above. The s2_redirect shortcode must be created in PHP exec.

Code: Select all
$post = preg_split('/-/', $_GET['s2member_seeking']);
echo "/?p=" . $post[1];               


Image:
http://d.pr/1PWx
User avatar
joeboydston
Registered User
Registered User
 
Posts: 5
Joined: July 27, 2011

Re: Is there a way to grab a post variable in the url and...

Postby rwilki » August 1st, 2011, 11:26 am

Just sent you a message. Am I supposed to add this code to the file exec-php.php or do something else. I've never created a shortcode in anything other than my functions file.

When added within the php tags, I see the /?p= at the top of my page...
User avatar
rwilki
Registered User
Registered User
 
Posts: 61
Joined: July 22, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 1 guest

cron