Page 2 of 3

Re: Client Portals ~ with video tutorial.

PostPosted: December 26th, 2011, 7:58 pm
by tetrisfoh
Jason,
HA, that fixed it! I just had to add the "www." to my wordpress URL in General settings and now it works fine! Thank you so much, it was getting very frustrating! The login link was using the "www." so it was logging on the wrong variation! Now to go back and figure out how to add a link to navigation bar that directs the client back to "their page"...

-Ted

Re: Client Portals ~ with video tutorial.

PostPosted: January 1st, 2012, 5:00 pm
by hb060992
Great tutorial extremely helpful. :mrgreen:

I have a couple of points to clarify if that's ok?

1) One thing I wasn't clear on (sorry if its a dumb question!) are the username pages (eg. maryjane) set up automatically upon user sign up? I assume it's not a manual input job?

2) The result I would like the achieve is a fairly detailed one and I have attached a screenshot of what I'm trying to replicate. Just wondered what your opinion is of this being achievable with S2 or if I will have to look for a custom solution?

Many thanks for the excellent support!

Re: Client Portals ~ with video tutorial.

PostPosted: January 2nd, 2012, 10:54 pm
by Jason Caldwell
1) One thing I wasn't clear on (sorry if its a dumb question!) are the username pages (eg. maryjane) set up automatically upon user sign up? I assume it's not a manual input job?
No, these pages would need to be created manually. However, a good developer can bypass this with something more automated. For instance, you might do something like this.

1. Login Redirection URL:
http://www.example.com/portal-for/%%current_user_login%%/


2. Create MUST USE plugin, /wp-content/mu-plugins/portal-rewrites.php
Code: Select all
<?php
add_action
("init", "portal_rewrites");
function portal_rewrites()
    {
        add_rewrite_rule("(portal-for)/(.+)$", 'index.php?pagename=$matches[1]&username=$matches[2]', "top");
        add_rewrite_tag("%username%", "(.+?)");
    }
?>
* Go back to Permalink settings in WordPress and click "save" so this propagates.

Reference article: http://codex.wordpress.org/Class_Reference/WP_Rewrite


3. In your theme, create a page that handles the /portal-for/[username] page, and get this query var.
<?php $username = get_query_var("username"); ?>
This way you don't' need to create a page for each user, you just need a template file that reads in the $username value and dynamically displays what it needs to, for the current user.


2) The result I would like the achieve is a fairly detailed one and I have attached a screenshot of what I'm trying to replicate. Just wondered what your opinion is of this being achievable with S2 or if I will have to look for a custom solution?

Many thanks for the excellent support!
This looks good. I think s2Member is a great fit for this. I'd stick with it. You might also seek assistance from a freelancer that is familiar with WordPress and/or s2Member both.

s2Member® / Hot Tip: ( s2Installs.com! )

Recommended by s2Member® Lead Developer (Jason Caldwell). Their rate for a standard installation is $125. They're highly trained. Just request their service!

Need Help? Post A New Job!

It's free. Your Job will appear here, and @ jobs.wordpress.net. It will be displayed for a period of 21 days; or until you take it off, whichever comes first. Good luck!

Re: Client Portals ~ with video tutorial.

PostPosted: January 3rd, 2012, 5:32 am
by Cristián Lávaque
Jason Caldwell wrote:3. In your theme, create a page that handles the /portal-for/[username] page, and get this query var.
<?php $username = get_query_var("username"); ?>
This way you don't' need to create a page for each user, you just need a template file that reads in the $username value and dynamically displays what it needs to, for the current user.


You're suggesting not to create a page for each user then, protected with a custom capability for each page/user. Right?

This same thing can already be done with the Login Welcome page not using hack, just conditionals in the page. WP Admin -> s2Member -> API / Scripting -> Advanced/PHP Conditionals

The URL won't be customized to the user, though. You could add the username in the querystring... not as clean, but would work: http://www.example.com/portal-for/?%%current_user_login%%

That username in the URL would just be for looks, in the page you'd use S2MEMBER_CURRENT_USER_LOGIN. WP Admin -> s2Member -> API / Scripting -> s2Member PHP/API Constants -> S2MEMBER_CURRENT_USER_LOGIN

Re: Client Portals ~ with video tutorial.

PostPosted: January 4th, 2012, 6:28 am
by hb060992
Jason Caldwell wrote:
1) One thing I wasn't clear on (sorry if its a dumb question!) are the username pages (eg. maryjane) set up automatically upon user sign up? I assume it's not a manual input job?
No, these pages would need to be created manually. However, a good developer can bypass this with something more automated. For instance, you might do something like this.

1. Login Redirection URL:
http://www.example.com/portal-for/%%current_user_login%%/


2. Create MUST USE plugin, /wp-content/mu-plugins/portal-rewrites.php
Code: Select all
<?php
add_action
("init""portal_rewrites");
function 
portal_rewrites()
    {
        
add_rewrite_rule("(portal-for)/(.+)$"'index.php?pagename=$matches[1]&username=$matches[2]'"top");
        
add_rewrite_tag("%username%""(.+?)");
    }
?>
* Go back to Permalink settings in WordPress and click "save" so this propagates.

Reference article: http://codex.wordpress.org/Class_Reference/WP_Rewrite


3. In your theme, create a page that handles the /portal-for/[username] page, and get this query var.
<?php $username = get_query_var("username"); ?>
This way you don't' need to create a page for each user, you just need a template file that reads in the $username value and dynamically displays what it needs to, for the current user.


2) The result I would like the achieve is a fairly detailed one and I have attached a screenshot of what I'm trying to replicate. Just wondered what your opinion is of this being achievable with S2 or if I will have to look for a custom solution?

Many thanks for the excellent support!
This looks good. I think s2Member is a great fit for this. I'd stick with it. You might also seek assistance from a freelancer that is familiar with WordPress and/or s2Member both.

s2Member® / Hot Tip: ( s2Installs.com! )

Recommended by s2Member® Lead Developer (Jason Caldwell). Their rate for a standard installation is $125. They're highly trained. Just request their service!

Need Help? Post A New Job!

It's free. Your Job will appear here, and @ jobs.wordpress.net. It will be displayed for a period of 21 days; or until you take it off, whichever comes first. Good luck!
Cristián Lávaque wrote:
Jason Caldwell wrote:3. In your theme, create a page that handles the /portal-for/[username] page, and get this query var.
<?php $username = get_query_var("username"); ?>
This way you don't' need to create a page for each user, you just need a template file that reads in the $username value and dynamically displays what it needs to, for the current user.


You're suggesting not to create a page for each user then, protected with a custom capability for each page/user. Right?

This same thing can already be done with the Login Welcome page not using hack, just conditionals in the page. WP Admin -> s2Member -> API / Scripting -> Advanced/PHP Conditionals

The URL won't be customized to the user, though. You could add the username in the querystring... not as clean, but would work: http://www.example.com/portal-for/?%%current_user_login%%

That username in the URL would just be for looks, in the page you'd use S2MEMBER_CURRENT_USER_LOGIN. WP Admin -> s2Member -> API / Scripting -> s2Member PHP/API Constants -> S2MEMBER_CURRENT_USER_LOGIN


Wow thanks for a solution very helpful :mrgreen: It's rare to see such brilliant support!

Re: Client Portals ~ with video tutorial.

PostPosted: January 4th, 2012, 6:56 pm
by Raam Dev
Thanks for the KUDOS! Jason knows his stuff. :mrgreen:

Re: Client Portals ~ with video tutorial.

PostPosted: January 5th, 2012, 12:24 am
by Jason Caldwell
Cristian wrote:That username in the URL would just be for looks, in the page you'd use S2MEMBER_CURRENT_USER_LOGIN. WP Admin -> s2Member -> API / Scripting -> s2Member PHP/API Constants -> S2MEMBER_CURRENT_USER_LOGIN
Right, just for looks mostly, or organization perhaps. You're right though, there's definitely more than 10 ways to skin this cat. A query string, or even just a "handle-all" Page would do fine, as long as it has internal conditional checks against the current User.

For instance, you could send everyone to:
http://example.com/account/

In the account Page, you might do something like this:
Code: Select all
<?php
$user 
= wp_get_current_user();
if(
$user->has_cap("access_s2member_ccap_maryjane"))
    echo 'This page is for Mary Jane';
?>

Re: Client Portals ~ with video tutorial.

PostPosted: January 5th, 2012, 10:17 pm
by murraystewart
Great plugin and Tutorial.
I am hoping to use this method to create a customer portal with the initial steps involved but want to have a separate category for each client that will be automatically locked as content is added, for just the logged in clients view. I would also like to have these categories not visible unless they log in and invisible to all other users. Hope you can point me in the right direction?

Re: Client Portals ~ with video tutorial.

PostPosted: January 6th, 2012, 6:34 pm
by Eduan
Maybe you can try integrating the Custom Capabilities (a.k.a. CCaps). With ccaps you can offer access to specific features/posts/pages, but without the limit of the amount of ccaps you can have.

So you can have a ccap for posting, another for reading posts, another for receiving private messages etc. It really has no limit.

For more information, check this video:
http://www.s2member.com/custom-capabilities-video/

Hope this helps. :)

Re: Client Portals ~ with video tutorial.

PostPosted: January 15th, 2012, 5:55 pm
by catchacold
I think I am missing something. I followed the video instructions - But, I can still get the the clients page by pasting in the URL in the address bar without logging in.

I set the level restrictions, created the users page, custom capabilities.

What am I missing? WP 3.3.1

Re: Client Portals ~ with video tutorial.

PostPosted: January 17th, 2012, 10:19 am
by tegancat
Hello,

When I have a customer login, all they can see it "welcome user" I cannot get it to come up on their own page. Does anyone have experience with this?

Andrea

Re: Client Portals ~ with video tutorial.

PostPosted: January 24th, 2012, 12:10 pm
by adam1987
Jason Caldwell wrote:Thanks for the follow-up.
Sorry, no. There's no Shortcode for that yet.
Here's a way to achieve what you need via PHP though.

Create this directory and file:
/wp-content/mu-plugins/s2-list-ccap-files.php
( these are MUST USE plugins, see: http://codex.wordpress.org/Must_Use_Plugins )
Code: Select all
<?php
function s2_list_ccap_files 
($ccap)
    {
        if ($ccap && is_string ($ccap) && is_dir ($files_dir = $GLOBALS["WS_PLUGIN__"]["s2member"]["c"]["files_dir"]))
            if (is_dir ($ccap_dir = $files_dir . "/access-s2member-ccap-" . $ccap) && is_readable ($ccap_dir))
                {
                    foreach (scandir ($ccap_dir) as $file)
                        {
                            if (strpos ($file, ".") !== 0)
                                {
                                    $files[] = $file;
                                }
                        }
                }
        return (!empty ($files) && is_array ($files)) ? implode ("<br />", $files) : "";
    }
?>

Now install this PHP Execution plugin, very simple. So you can do this inside a Post/Page.
Code: Select all
<?php echo s2_list_ccap_files("maryjane"); ?>

If you get PHP header errors, you have extra spaces/tabs/line breaks before or after <?php ?>.
Unzip the attached file to get the original, and upload it to:
/wp-content/mu-plugins/s2-list-ccap-files.php
s2-list-ccap-files.zip



Hi, Jason:

First thanks for this great plug in! I am reaching the goal closer and closer :)
But now I am facing a pretty critical issue regarding download of document that related to specific user.
I wonder if you could explain more in detail about how you can do the specific user file download like you expalined above? Becasuse I did exactly what you showed, but seem somethings are missing:
-What will be shown in the page once the php code is injected in the post/page? (I have PHP exec installed, but seem nothing really happening after the code is put in my specific user only C.C. enabled page.)
-What exactly the code does for me?
-How can I secure each file that to be appeared and ready to download for the specific user?

I am facing a deadline, if you could kindly produce a video tutorial about it will be even more great and I think it would expand s2member's capability in another level!

Thank You

Re: Client Portals ~ with video tutorial.

PostPosted: January 26th, 2012, 6:14 pm
by ericc
Quick question from a new user!
In your video you click on a permalink (in the page) and just type/change it. I don't have that functionality - I can't click and retype a page name. Is that a plugin that you're using? How are you doing that? Thanks ahead of time. Great plugin!

- Eric

Re: Client Portals ~ with video tutorial.

PostPosted: January 26th, 2012, 10:23 pm
by Raam Dev
Hi Eric,

That's a feature built into WordPress. If you're running the latest version of WordPress, you should be able to edit the permalink on any post/page when editing it.

Re: Client Portals ~ with video tutorial.

PostPosted: January 26th, 2012, 10:29 pm
by ericc
I've been driving myself crazy clicking on that permalink in the page, but it won't change or let me edit it. What do you have your general permalink structure set at for wordpress? Perhaps this is the cause - there has to be some setting that allows you to change it. I'm running the latest version, 3.3.1 and the permalink is locked... I have the default permalink structure selected.

Re: Client Portals ~ with video tutorial.

PostPosted: January 26th, 2012, 10:48 pm
by Raam Dev
This would be an issue to address on the WordPress Support Forums, as it's not directly related to s2Member. You might also try searching Google for "cannot edit wordpress permalinks".

Re: Client Portals ~ with video tutorial.

PostPosted: January 26th, 2012, 10:55 pm
by ericc
By playing around with it I think I figured it out - you can't have your permalink structure set as default. You have to use a custom permalink structure - once you do, then you can edit it (I guess it makes sense, since it is custom). Thanks for helping, I appreciate it.

Re: Client Portals ~ with video tutorial.

PostPosted: January 26th, 2012, 11:06 pm
by Raam Dev
Glad to hear you figured it out! Thank you for the update. :)

Re: Client Portals ~ with video tutorial.

PostPosted: January 30th, 2012, 1:00 pm
by kcorcor2
Hi All,

This video was incredibly helpful - thanks!

Quick question: is it possible to have multiple members log into the same password protected pages? ie, we have the client set as the username, custom capabilities, permalink, etc, but would like to have the manager for each account also have the ability to log into the pages as themselves in order to make comments (instead of as the admin)...moreover, some manager would need access to a few client pages. Is this possible?

Thanks!
Kristy

Re: Client Portals ~ with video tutorial.

PostPosted: January 31st, 2012, 1:49 am
by Cristián Lávaque
s2Member doesn't manage the admin side of WordPress, only front-end access to content. You will need some customization. You can find freelance developers in sites like oDesk.com or eLance.com.

i hope that helps. :)

Re: Client Portals ~ with video tutorial.

PostPosted: February 2nd, 2012, 1:01 am
by Kimbro
Hi Jason,
What a great video tutorial! Helped me so much. I am looking to purchase the s2member pro version and have been playing around with the free version to see if I can integrate all that I need.
So far everything looks and acts really well - but I have not been able to set some permissions I need.

I have 2 levels.
L1=Teachers
L2=Students who all have their own portal pages automatically set up at signup - currently students can't see each others pages and that is good.

Students can't do anything except view media uploaded by various teachers - that's what we want.

Teachers can only upload files. They can not enter the students portal pages to view what other teachers may have presented to the students - that's what we want.

Teachers name the files they upload with the students username like:
mike.pdf or mike.jpg or mike.zip etc.
tess.pdf or tess.jpg or tess.zip etc.
The files get uploaded to:
wp-content/plugins/s2member-files/access-s2member-ccap-files

Currently when mike goes to his portal he sees and can download all of his files but he can also see all of tesses files.

How can I set permissions for all the level2 students to only see files prefixed with their usernames in the files list that appears on their portal page.

I have watched all your wonderful videos and tried to figure out a way to set these permissions for days and days - but I am not a programer and I am stumped.

Hoping you can help cheers,
Kitty.

Re: Client Portals ~ with video tutorial.

PostPosted: February 3rd, 2012, 1:06 am
by Cristián Lávaque
Hi Kitty. You may want to check out custom capabilities in combination with download protection. WP Admin -> s2Member -> API / Scripting -> Custom Capability & Member Level Files

I hope that helps. :)

Re: Client Portals ~ with video tutorial.

PostPosted: February 3rd, 2012, 4:12 am
by Kimbro
Cristián Lávaque wrote:Hi Kitty. You may want to check out custom capabilities in combination with download protection. WP Admin -> s2Member -> API / Scripting -> Custom Capability & Member Level Files

I hope that helps. :)

Thanks for your response Christian but I have not been able to set custom capabilities in combination with download protection.To make this work - not experienced enough - really need some help.

Before I go any further perhaps you can tell me that what I am trying to do is even possible.

So far I have set up - due to the great instructions here - automated student portals.
each portal is equipped with a file uploader.
mike (1).jpg
mike (1).jpg (26.98 KiB) Viewed 3136 times

mike (2).jpg
mike (2).jpg (85.73 KiB) Viewed 3136 times

Once the files are uploaded they appear on the students page:

Trouble is that all other students at s2-level2 can see each others files.

Is it possible to only show the files that were uploaded to a particular portal to the user of that portal?

And if so what permissions would I have to write?

Hope you can help.

Cheers,
Kitty.

Re: Client Portals ~ with video tutorial.

PostPosted: February 3rd, 2012, 4:43 am
by Cristián Lávaque
That's a file uploader that is not part of s2Member, so you'll need to customize it to integrate with s2Member's file protection. First learn how to protect files with s2Member without that uploader, so you learn it well, then you'll know what the uploader would need to do so the files are protected.

Jason created a video explaining download protection, but new features were added since, so I recommend you read all the documentation on it too.
http://www.s2member.com/file-download-options-video/
WP Admin -> s2Member -> Downloads Options
WP Admin -> s2Member -> API / Scripting -> Custom Capability & Member Level Files


I hope that helps. :)

Re: Client Portals ~ with video tutorial.

PostPosted: February 3rd, 2012, 6:38 pm
by Kimbro
Cristián Lávaque wrote:That's a file uploader that is not part of s2Member, so you'll need to customize it to integrate with s2Member's file protection. First learn how to protect files with s2Member without that uploader, so you learn it well, then you'll know what the uploader would need to do so the files are protected.

Jason created a video explaining download protection, but new features were added since, so I recommend you read all the documentation on it too.
http://www.s2member.com/file-download-options-video/
WP Admin -> s2Member -> Downloads Options
WP Admin -> s2Member -> API / Scripting -> Custom Capability & Member Level Files


I hope that helps. :)


Hi Christian,
I have studied all the documentation and have no problems creating the custom capabilities and download protections for individual members manually.

So if it was just me adding files for the students on their own individual pages I'd have no problems protecting these files for individuals on the same level - in this case level 2.- and inserting a download link like this:

<a href="http://mysite.com/?s2member_file_download=reports-mike.pdf&
s2member_file_download=<?php echo s2member_file_download_key("reports-mike.pdf"):?>">Download
reports-mike.pdf</a>

As I need the facility for teachers to upload files to individual students I am wondering if there is some sort of hook I can use to assign the uploader to a specific account within:
Sub-Directory: /s2member-files/access-s2member-level2/school-reports/username/

Currently I have the short codes set for the front end uploader in the template page "Portal-For"

[ffm-upload]
[ffm-list type=any count=10 parent=null downloadable=true pagination=bottom]`

and;
[ffm-upload] is set to upload to: /wp-content/plugins/s2member-files/access-s2member-level2/school-reports/username/

I have given all the level2 students ccap "school-reports"

The only way I can see to direct the uploader to a specific username is within the file being uploaded ie;
mike.pdf, mike.jpg, mike.zip etc.
The uploader has a category dropdown box which I have set to "school-reports"

So I need to set up something that will direct the front end uploader to upload to "username.*file" within the protected directory?

Or another option is for s2member to only permit file downloads that were uploaded from a particular users portal.

In other words the teacher can only upload files from within the students portal and only that student out of all the level2 students with ccap "school_reports" can view their own files.

I feel it just needs a hack, hook or filter - that is out of my scope.

I would be happy to pay for your help on this - truly desperate - hope you can help.

Cheers,

Kitty.