Community Support Forums — WordPress® ( Users Helping Users ) — 2012-02-04T19:09:19-05:00 http://www.primothemes.com/forums/feed.php?f=36&t=586 2012-02-04T19:09:19-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=62321#p62321 <![CDATA[Re: Client Portals ~ with video tutorial.]]> Perhaps a better way to ask this question - is there a way to identify the user through the file name that the teachers upload - automatically?
Then have only the files attached to that identity enabled for download by the user they are intended for?
Cheers,
Kitty.

Statistics: Posted by Kimbro — February 4th, 2012, 7:09 pm


]]>
2012-02-04T08:02:19-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=62309#p62309 <![CDATA[Re: Client Portals ~ with video tutorial.]]>
Cristián Lávaque wrote:
You're getting closer, but that's not exactly right.

If all reports are protected with the same access, like Level 2, then all users at Level 2 can download all the reports if they can guess the name, which wouldn't be hard.

This is why I was suggesting custom capabilities. If the user Mike has custom capability Mike and the report mike.pdf is in the download directory for the custom capability Mike, then John won't be able to download it even if he knew the URL to it, only Mike would.

E.g. /s2member-files/access-s2member-ccap-mike/reports-mike.pdf
http://mysite.com/?s2member_file_download=access-s2member-ccap-mike/reports-mike.pdf

Each user needs to have his own ccap. The uploader would need to upload to the directory for the ccap of the user the report is for.

I hope that makes more sense now. :)


Hi Cristian,
I realize what you are saying but I need to automate this.
Is there a way to configure the ccap something like:
http://mysite.com/?s2member_file_downlo ... mber-ccap-%%user_name%%reports-%%username%%.*file

Then if the teachers rename every file they want to upload to the students username like
mike.pdf

Any suggestions would be most welcome.

Thanks,

Kitty.

Statistics: Posted by Kimbro — February 4th, 2012, 8:02 am


]]>
2012-02-04T04:20:11-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=62299#p62299 <![CDATA[Re: Client Portals ~ with video tutorial.]]>
If all reports are protected with the same access, like Level 2, then all users at Level 2 can download all the reports if they can guess the name, which wouldn't be hard.

This is why I was suggesting custom capabilities. If the user Mike has custom capability Mike and the report mike.pdf is in the download directory for the custom capability Mike, then John won't be able to download it even if he knew the URL to it, only Mike would.

E.g. /s2member-files/access-s2member-ccap-mike/reports-mike.pdf
http://mysite.com/?s2member_file_download=access-s2member-ccap-mike/reports-mike.pdf

Each user needs to have his own ccap. The uploader would need to upload to the directory for the ccap of the user the report is for.

I hope that makes more sense now. :)

Statistics: Posted by Cristián Lávaque — February 4th, 2012, 4:20 am


]]>
2012-02-03T18:38:29-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=62289#p62289 <![CDATA[Re: Client Portals ~ with video tutorial.]]>
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.

Statistics: Posted by Kimbro — February 3rd, 2012, 6:38 pm


]]>
2012-02-03T04:43:41-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=62252#p62252 <![CDATA[Re: Client Portals ~ with video tutorial.]]>
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. :)

Statistics: Posted by Cristián Lávaque — February 3rd, 2012, 4:43 am


]]>
2012-02-03T04:12:34-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=62245#p62245 <![CDATA[Re: Client Portals ~ with video tutorial.]]>
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 (2).jpg
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.

Statistics: Posted by Kimbro — February 3rd, 2012, 4:12 am


]]>
2012-02-03T01:06:23-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=62230#p62230 <![CDATA[Re: Client Portals ~ with video tutorial.]]> WP Admin -> s2Member -> API / Scripting -> Custom Capability & Member Level Files

I hope that helps. :)

Statistics: Posted by Cristián Lávaque — February 3rd, 2012, 1:06 am


]]>
2012-02-02T01:01:45-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=62133#p62133 <![CDATA[Re: Client Portals ~ with video tutorial.]]> 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.

Statistics: Posted by Kimbro — February 2nd, 2012, 1:01 am


]]>
2012-01-31T01:49:56-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=61977#p61977 <![CDATA[Re: Client Portals ~ with video tutorial.]]>
i hope that helps. :)

Statistics: Posted by Cristián Lávaque — January 31st, 2012, 1:49 am


]]>
2012-01-30T13:00:57-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=61921#p61921 <![CDATA[Re: Client Portals ~ with video tutorial.]]>
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

Statistics: Posted by kcorcor2 — January 30th, 2012, 1:00 pm


]]>
2012-01-26T23:06:12-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=61733#p61733 <![CDATA[Re: Client Portals ~ with video tutorial.]]>

Statistics: Posted by Raam Dev — January 26th, 2012, 11:06 pm


]]>
2012-01-26T22:55:45-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=61728#p61728 <![CDATA[Re: Client Portals ~ with video tutorial.]]> Statistics: Posted by ericc — January 26th, 2012, 10:55 pm


]]>
2012-01-26T22:48:07-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=61725#p61725 <![CDATA[Re: Client Portals ~ with video tutorial.]]> WordPress Support Forums, as it's not directly related to s2Member. You might also try searching Google for "cannot edit wordpress permalinks".

Statistics: Posted by Raam Dev — January 26th, 2012, 10:48 pm


]]>
2012-01-26T22:29:40-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=61717#p61717 <![CDATA[Re: Client Portals ~ with video tutorial.]]> Statistics: Posted by ericc — January 26th, 2012, 10:29 pm


]]>
2012-01-26T22:23:12-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=61713#p61713 <![CDATA[Re: Client Portals ~ with video tutorial.]]>
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.

Statistics: Posted by Raam Dev — January 26th, 2012, 10:23 pm


]]>
2012-01-26T18:14:07-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=61691#p61691 <![CDATA[Re: Client Portals ~ with video tutorial.]]> 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

Statistics: Posted by ericc — January 26th, 2012, 6:14 pm


]]>
2012-01-24T12:10:14-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=61394#p61394 <![CDATA[Re: Client Portals ~ with video tutorial.]]>
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:
<?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:
<?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

Statistics: Posted by adam1987 — January 24th, 2012, 12:10 pm


]]>
2012-01-17T10:19:56-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=60816#p60816 <![CDATA[Re: Client Portals ~ with video tutorial.]]>
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

Statistics: Posted by tegancat — January 17th, 2012, 10:19 am


]]>
2012-01-15T17:55:55-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=60613#p60613 <![CDATA[Re: Client Portals ~ with video tutorial.]]>
I set the level restrictions, created the users page, custom capabilities.

What am I missing? WP 3.3.1

Statistics: Posted by catchacold — January 15th, 2012, 5:55 pm


]]>
2012-01-06T18:34:01-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=59872#p59872 <![CDATA[Re: Client Portals ~ with video tutorial.]]>
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. :)

Statistics: Posted by Eduan — January 6th, 2012, 6:34 pm


]]>
2012-01-05T22:17:28-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=59836#p59836 <![CDATA[Re: Client Portals ~ with video 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?

Statistics: Posted by murraystewart — January 5th, 2012, 10:17 pm


]]>
2012-01-05T00:24:11-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=59730#p59730 <![CDATA[Re: Client Portals ~ with video tutorial.]]>
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:
<?php
$user 
= wp_get_current_user();
if(
$user->has_cap("access_s2member_ccap_maryjane"))
    echo 'This page is for Mary Jane';
?>

Statistics: Posted by Jason Caldwell — January 5th, 2012, 12:24 am


]]>
2012-01-04T18:56:13-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=59688#p59688 <![CDATA[Re: Client Portals ~ with video tutorial.]]>

Statistics: Posted by Raam Dev — January 4th, 2012, 6:56 pm


]]>
2012-01-04T06:28:20-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=59631#p59631 <![CDATA[Re: Client Portals ~ with video tutorial.]]>
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:
<?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!

Statistics: Posted by hb060992 — January 4th, 2012, 6:28 am


]]>
2012-01-03T05:32:21-05:00 http://www.primothemes.com/forums/viewtopic.php?t=586&p=59504#p59504 <![CDATA[Re: Client Portals ~ with video tutorial.]]>
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

Statistics: Posted by Cristián Lávaque — January 3rd, 2012, 5:32 am


]]>