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.

allowing non members to read a bit more ?

Home Forums Community Forum allowing non members to read a bit more ?

Tagged: 

This topic contains 17 replies, has 4 voices. Last updated by  David Welch 4 years, 6 months ago.

Topic Author Topic
Posted: Monday Jun 11th, 2012 at 4:38 am #16125

What I would really like to do is that once readers click on an article on the front page and then move to the post, they are offered slightly more information — ideally as far as the red line in number one – an image and some text … if they want to read more of the article then clicking on a “more” link will take them to the sign up page if they are non members and members will be able to read the complete article number down to red line two

We have a variety of people writing our articles with varying degrees of digital ability so the best way would probably be a short code which they could insert into their articles at the correct point.

Is this possible ?

thanks for your time

ciao
keane

http://www.giornaledibarganews.com

List Of Topic Replies

Viewing 17 replies - 1 through 17 (of 17 total)
Author Replies
Author Replies
Posted: Monday Jun 11th, 2012 at 7:01 pm #16167
Eduan
Username: Eduan
Moderator

Hello Keane,

I believe I know how to achieve this. First, make sure sure that the options under Dashboard -› s2Member® -› Restriction Options -› Alternative View Protection are not enabled.

Then, simply use the more tag when you want it or need it, where the first red line is.

And make sure to have that post protected.

I’m pretty sure this would work, I’m working it out in my head, haven’t done any tests, but it should work.

Hope this helps. :)

Posted: Tuesday Jun 12th, 2012 at 10:09 am #16251

I think there might be a slight problem with communication here and so I will try to be a bit clearer and maybe with the images it might become more obvious as to what I’m trying to do.

okay, this is the front page of my site and as you can see it is the magazine style template with various articles on the front page of various lengths – the main article having more text showing that the others for instance.

when people click on any of those articles they are then taken to a single post page where up until now they can read the complete article

Once s2member is set up what I would like to happen is that for non-members they will be able to see the article down as far as redline one. This will give them a brief description of the event and a single image. That way we fulfil our role as an information service in this area.

There should be a link just before redline one which will point to them the membership options if they wish for more information.

Readers who are already members of the site will be able to see the whole page all the way down to redline two

Probably the simplest way of achieving this is by using the “MORE” tag but it would appear that that will not work on a post or page.

so, is there anybody out there who can give me a hand with this problem

thanks to your time

ciao
keane

http://www.giornaledibarganews.com

Posted: Tuesday Jun 12th, 2012 at 12:35 pm #16265
Eduan
Username: Eduan
Moderator

Hello Keane?

So did you try what I told you? I believe it should work like you say.

Tell me how it goes, and if it doesn’t work, also tell me. ;)

Posted: Tuesday Jun 12th, 2012 at 1:33 pm #16274
Jim Climy
Username: weasel

I think I am doing something similar. Happy to message with you. I think Im even using the same theme. Might be good to compare notes. Email me at bex dot domains at gmail dot com.

Posted: Tuesday Jun 12th, 2012 at 4:55 pm #16285

sorry Eduan – not working – the “MORE” tag would appear to not work on a post or page.

ciao
keane

Posted: Tuesday Jun 12th, 2012 at 5:37 pm #16287
David Welch
Username: dwbiz05

Not sure how “manual” you want this process to be. However, this might work:

Add this to your theme’s functions.php file:

add_shortcode('dw-post-more','dw_post_more');

function dw_post_more($atts,$content){
	explode(shortcode_atts(array("level" => 0),$atts));
	
	if(is_user_logged_in() && S2MEMBER_CURRENT_USER_ACCESS_LEVEL === $level){
		return do_shortcode($content);
	}
	else {
		return '<a href="'.S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL.'">Get Access To More Of This Content</a>';
	}
}

Then wrap your “hidden” part with this shortcode.. like this:

This is the public content.
[dw-post-more level="0"]
This is the private content. You can change the level to match whatever level should have access to the info.
[/dw-post-more]
This is public info after the private info.

This is not fully tested so let me know if something doesn’t work.

Dave

Posted: Thursday Jun 14th, 2012 at 9:19 am #16472

almost there David …. even got a quick tag plugin to wrap the private text with the code …small problem in that I can see the public text but not the private

ciao
keane

Posted: Thursday Jun 14th, 2012 at 9:36 am #16474
David Welch
Username: dwbiz05

Try changing this:

add_shortcode('dw-post-more','dw_post_more');

function dw_post_more($atts,$content){
	explode(shortcode_atts(array("level" => 0),$atts));
	
	if(is_user_logged_in() && S2MEMBER_CURRENT_USER_ACCESS_LEVEL === $level){
		return do_shortcode($content);
	}
	else {
		return '<a href="'.S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL.'">Get Access To More Of This Content</a>';
	}
}

To this:

add_shortcode('dw-post-more','dw_post_more');

function dw_post_more($atts,$content){
	explode(shortcode_atts(array("level" => 0),$atts));
	
	if(is_user_logged_in() && current_user_can("access_s2member_level".$level)){
		return do_shortcode($content);
	}
	else {
		return '<a href="'.S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL.'">Get Access To More Of This Content</a>';
	}
}

Basically just changing

S2MEMBER_CURRENT_USER_ACCESS_LEVEL === $level

to

current_user_can("access_s2member_level".$level)

but I gave the whole code so you don’t have to sift through it if you don’t want to.. lol
Hope that helps,

Dave

  • This reply was modified 4 years, 6 months ago by  David Welch.
Posted: Thursday Jun 14th, 2012 at 10:21 am #16481

still nothing doing … I am starting to think that maybe I have missed out some important step on the way

could it be that I have a problem with the role of my members being just contributors and not s2member level 1 ?

I have set up a new member with s2member level 1 access but if I log in as him, still I cannot see the private text.

I have also disabled buddypress as that too might have been causing problems?

ciao
keane

Posted: Thursday Jun 14th, 2012 at 10:29 am #16482
David Welch
Username: dwbiz05

hm… maybe…

But a paying member would be added as s2member Level 1 right?

can I see how you are using the shortcode?

Dave

Posted: Thursday Jun 14th, 2012 at 10:34 am #16483
David Welch
Username: dwbiz05

Also, can you post a link to your test post?

Dave

Posted: Thursday Jun 14th, 2012 at 11:01 am #16484

test page is here

I automatically assumed that as admin I would be able to see the private text ..and yes, a paying member would be added as s2member Level 1

ciao
keane

Posted: Thursday Jun 14th, 2012 at 11:38 am #16485
David Welch
Username: dwbiz05

try this…

add_shortcode('dw-post-more','dw_post_more');

function dw_post_more($atts,$content){
	explode(shortcode_atts(array("level" => 0),$atts));
	
	if(current_user_can("access_s2member_level".$level)){
		return do_shortcode($content);
	}
	else {
		return '<a href="'.S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL.'">Get Access To More Of This Content</a>';
	}
}

You are correct, the admin should be able to see it since he/she has access to everything s2member_level1 users do.
Dave

Posted: Thursday Jun 14th, 2012 at 2:51 pm #16500

nothing doing David, still not seeing the private stuff

ciao
keane

P.S thank you for all your time on this

Posted: Thursday Jun 14th, 2012 at 3:04 pm #16501
David Welch
Username: dwbiz05

I found the issue. It helps when you type the correct words in your code!

Try This:

add_shortcode('dw-post-more','dw_post_more');

function dw_post_more($atts,$content){
	extract(shortcode_atts(array("level" => 0),$atts));
	
	if(current_user_can("access_s2member_level".$level)){
		return do_shortcode($content);
	}
	else {
		return '<a href="'.S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL.'">Get Access To More Of This Content</a>';
	}
}

explode should be extract…. argh…

Hope that helps,

Dave

Posted: Thursday Jun 14th, 2012 at 4:04 pm #16504

WELL DONE THAT MAN !!!

YES! now it works …. can’t thank you enough

ciao
keane

Posted: Thursday Jun 14th, 2012 at 4:22 pm #16507
David Welch
Username: dwbiz05

No problem, wish I would have caught that error the first time… lol!

Dave

Viewing 17 replies - 1 through 17 (of 17 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.