Page 1 of 1
Is there a way to grab a post variable in the url and...
Posted:
July 26th, 2011, 11:13 pm
by rwilki
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.
Re: Is there a way to grab a post variable in the url and...
Posted:
July 27th, 2011, 6:01 pm
by joeboydston
Same problem here, much interested if anyone knows of a solution.
Re: Is there a way to grab a post variable in the url and...
Posted:
July 27th, 2011, 8:21 pm
by candy
not solved here either, still v.much interested in a solution ....
Re: Is there a way to grab a post variable in the url and...
Posted:
July 27th, 2011, 10:46 pm
by Cristián Lávaque
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.
Re: Is there a way to grab a post variable in the url and...
Posted:
July 28th, 2011, 11:53 am
by joeboydston
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?
Re: Is there a way to grab a post variable in the url and...
Posted:
July 28th, 2011, 1:56 pm
by rwilki
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
Re: Is there a way to grab a post variable in the url and...
Posted:
July 28th, 2011, 3:30 pm
by Cristián Lávaque
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#p29101rwilki 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?
Re: Is there a way to grab a post variable in the url and...
Posted:
July 28th, 2011, 4:41 pm
by joeboydston
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.
Re: Is there a way to grab a post variable in the url and...
Posted:
July 28th, 2011, 4:54 pm
by rwilki
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
Re: Is there a way to grab a post variable in the url and...
Posted:
July 29th, 2011, 1:18 pm
by joeboydston
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.
Re: Is there a way to grab a post variable in the url and...
Posted:
August 1st, 2011, 11:19 am
by joeboydston
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
Re: Is there a way to grab a post variable in the url and...
Posted:
August 1st, 2011, 11:26 am
by rwilki
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...