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.

Is there a way to display unregistered comments differently than registered comments?

June 11, 2008 7:16pm

Subscribe [0]
  • #1 / Jun 11, 2008 7:16pm

    ewitch

    16 posts

    We currently allow people to comment without registering. We would like to display the comments of registered users in a different font color than the comments of unregistered users. I’ve looked at http://expressionengine.com/docs/modules/comment/entries.html and don’t see any conditional that would let me differentiate the two types of comments, but I thought I would ask here. Thanks!

  • #2 / Jun 11, 2008 7:39pm

    Justin Hurlburt

    344 posts

    I believe the {author_id} is what you are looking for.

    Let us know if you have any questions!

  • #3 / Jun 11, 2008 7:40pm

    Mark Bowen

    12637 posts

    Hiya,

    I could be wrong on this one but I think that if you allow anonymous comments to be posted then because the user doesn’t have an account their author_id for that comment will equal 0. You may be able to use that in a conditional to do what you want?

    Something like :

    {if author_id == "0"}
    This comment was made by someone without an account
    {if:else}
    Standard comments code
    {/if}

    Not tested but I think it would work?

    Best wishes,

    Mark

  • #4 / Jun 12, 2008 7:03pm

    ewitch

    16 posts

    These posts solved my problem - I just wasn’t reading the manual closely enough. Thanks!

  • #5 / Jun 12, 2008 7:30pm

    Mark Bowen

    12637 posts

    No problem.

    Let us know if you need anything else.

    Best wishes,

    Mark

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

ExpressionEngine News!

#eecms, #events, #releases