Jump to content

Man2u2uk

Members
  • Posts

    14
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Man2u2uk's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have now solved this issue. - Please close.
  2. Hi mikosiko, that is the only line of code i have. Hi jesirose, post_name (without the $ )is referenced alot throughout the wordpress code.
  3. I think post_name is a variable. its stored in the database as post_name.
  4. Sorry jesirose, maybe they do sort of link together as they equal the same value? I tried the following but that just redirected everyone to the home page: <a href="<?php echo (defined('post_name') ? post_name : 'home');?>/">Client Area</a> I thought an IF statement would work as we could check to see if S2MEMBER_CURRENT_USER_LOGIN is equal to post_name if show redirect to their page and if not redirect to the home page?
  5. Hi, Regardless of what user i log on as if i hover over the "Client Area" link it always links to the username of whatever user is logged in. http://www.yourwebsitehere/usersname
  6. It doesn't. S2MEMBER_CURRENT_USER_LOGIN just grabs the current logged in users username and because i hyperlinked it if a page exists with the same name it just takes them to it and if it does not match takes the user to a 404 page.. post_name is what wordpress uses to store the page name in the database.
  7. Sorry. I understand what you mean but not sure how to implement it? i tried the following: <a href="<?php echo (defined('S2MEMBER_CURRENT_USER_LOGIN') ? S2MEMBER_CURRENT_USER_LOGIN : '<a href="home/"</a>>');?>/">Client Area</a> But that did nothing as i thought it was as i'm a PHP noob lol
  8. Thanks, <a href="<?php echo (defined('S2MEMBER_CURRENT_USER_LOGIN') ? S2MEMBER_CURRENT_USER_LOGIN : 'home');?>/">Client Area</a> That code stopped the error but its still redirecting the users who don't have a page created to an 404 error. i think if S2MEMBER_CURRENT_USER_LOGIN does not match post_name then redirect needs to be added into the code somehow?
  9. Hi, I have just logged onto my machine and pasted the following code, <a href="<?php echo (isset(S2MEMBER_CURRENT_USER_LOGIN) ? S2MEMBER_CURRENT_USER_LOGIN : 'home');?>/">Client Area</a> but it gives the following error: Parse error: syntax error, unexpected ')', expecting T_PAAMAYIM_NEKUDOTAYIM A quick Google mentions its about the scope operator ( :: ) but i'm not sure what this means or how to fix it?
  10. Thanks for the reply. I will test this code out this evening when i get home. As per your comment: It should be S2MEMBER_CURRENT_USER_LOGIN
  11. Unfortunatly not darkfreaks, Maybe i did not explain my self correctly. The way my client portal works is that if i have a user called Alex and a page called Alex and he clicks on the "Client Area" link. The following code will take them to their page <a href="?php echo S2MEMBER_CURRENT_USER_LOGIN; ?>/">Client Area</a> The issue i have is that if i have a user called Ben and he does not have a page and clicks on the "Client Area" link he will get a 404 error. I somehow need to wrap an if statement around the following link <a href="?php echo S2MEMBER_CURRENT_USER_LOGIN; ?>/">Client Area</a>
  12. I doubt this is correct. But i need something like this: $S2MEMBER_CURRENT_USER_LOGIN = username; if ( $username == post_name ) { header( 'Location: http://www.yoursite.com?username' ) ; } else { header( 'Location: http://www.example.com/home' ) ; } to link in with: <a href="?php echo S2MEMBER_CURRENT_USER_LOGIN; ?>/">Client Area</a>
  13. Hi All, I'm currently using the s2member plugin for wordpress to allow me to create a client portal where users can log in and visit their own secure unique page. (This uses custom capability and the page must be called the same as their username.) But then i also have people that just log on to view my blog and are not clients and do not have pages created for them. I have the following code: <a href="?php echo S2MEMBER_CURRENT_USER_LOGIN; ?>/">Client Area</a> This works fine when logged in as a user who has a page created but gives an 404 error for a user that does not have a page. My question is: Could the above code be wrapped in an if statement to say that if the S2MEMBER_CURRENT_USER_LOGIN does not = post_name then redirect them to the home page?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.