ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Private entry for specific user

May 15, 2011 3:37pm

Subscribe [4]
  • #1 / May 15, 2011 3:37pm

    ibuck

    19 posts

    My client would like the ability to create private member entries.

    For example:
    If there were 2 users, Mike & Bob and a channel called member_pages could there be “mike” & “bob” entries in that channel that were only viewable by the respective user when logged in?

    They are looking to do things such as posting images, files, etc for specific users on a formatted template page.

    Cheers,
    Mike

  • #2 / May 16, 2011 6:27am

    John Henry Donovan

    12339 posts

    Hi Mike,

    You could create new entries and call them Mike and Bob so your url_titles become mike and bob

    Then in your template for the URL http://www.mydomain.com/index.php/member_pages/name/bob

    {exp:channel:entries limit="1" channel="member_pages" url_title="{segment_3}"}
    
    {if logged_in_username == "{url_title}"}
    
    ...member content…
    
    {if:else}
    Not for your eyes
    {/if}
    
    {/exp:channel:entries}

    The above is quite a simple solution but should work in theory 😊

  • #3 / May 16, 2011 10:10am

    Mark Bowen

    12637 posts

    You could also make them the author of the entry and add in the author_id=“CURRENT_USER” parameter to only show ‘their’ entries to them.

    This way no-one can just guess at the URL and get someone else’s entry shown to them.

    Best wishes,

    Mark

  • #4 / May 16, 2011 10:16am

    Sue Crocker

    26054 posts

    Thanks for the assist, Mark!

    ibuck, Mark’s right.. using CURRENT_USER is a great solution…

    Does that help?

  • #5 / May 16, 2011 12:54pm

    ibuck

    19 posts

    That will work. Thanks for the help!

  • #6 / May 16, 2011 1:32pm

    Sue Crocker

    26054 posts

    Glad that solution will work for you.. Feel free to start a new thread if you have any more questions.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases