Statistics: Posted by Kimbro — February 4th, 2012, 7:09 pm
Statistics: Posted by Kimbro — February 4th, 2012, 8:02 am
Statistics: Posted by Cristián Lávaque — February 4th, 2012, 4:20 am
Statistics: Posted by Kimbro — February 3rd, 2012, 6:38 pm
Statistics: Posted by Cristián Lávaque — February 3rd, 2012, 4:43 am
Statistics: Posted by Kimbro — February 3rd, 2012, 4:12 am
Statistics: Posted by Cristián Lávaque — February 3rd, 2012, 1:06 am
Statistics: Posted by Kimbro — February 2nd, 2012, 1:01 am
Statistics: Posted by Cristián Lávaque — January 31st, 2012, 1:49 am
Statistics: Posted by kcorcor2 — January 30th, 2012, 1:00 pm
Statistics: Posted by Raam Dev — January 26th, 2012, 11:06 pm
Statistics: Posted by Raam Dev — January 26th, 2012, 10:48 pm
Statistics: Posted by Raam Dev — January 26th, 2012, 10:23 pm
Statistics: Posted by ericc — January 26th, 2012, 6:14 pm
<?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) : "";
}
?>
<?php echo s2_list_ccap_files("maryjane"); ?>
Statistics: Posted by adam1987 — January 24th, 2012, 12:10 pm
Statistics: Posted by tegancat — January 17th, 2012, 10:19 am
Statistics: Posted by catchacold — January 15th, 2012, 5:55 pm
Statistics: Posted by Eduan — January 6th, 2012, 6:34 pm
Statistics: Posted by murraystewart — January 5th, 2012, 10:17 pm
<?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
Statistics: Posted by Raam Dev — January 4th, 2012, 6:56 pm
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) 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?
<?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%", "(.+?)");
}
?>
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.
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!
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
Statistics: Posted by hb060992 — January 4th, 2012, 6:28 am
Statistics: Posted by Cristián Lávaque — January 3rd, 2012, 5:32 am