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.

Showing Comments by Author

October 24, 2010 3:10pm

Subscribe [5]
  • #1 / Oct 24, 2010 3:10pm

    eyevariety

    158 posts

    I have been unable to show all comments by an author using the comments tag. I have been using EE for years and I was surprised I have never had this need.  I am trying to use the comments:entries tag:

    {exp:comment:entries limit="2" author_id="1" dynamic="off" sort="desc" weblog="articles" orderby="date"}

    I am aware that the documentation does say it requires having an entry_id value, but also aware that it works to show all entries by everyone historically. 

    I would like to show comments by an individual user is this possible in 1.6.x?

    What is the preferred method of achieving this?

  • #2 / Oct 25, 2010 3:49am

    John Henry Donovan

    12339 posts

    eyevariety,

    Parameter author_id doesn’t exist so I would probably go with a conditional.

    {exp:comment:entries sort="asc" limit="2" dynamic="off" entries sort="desc" weblog="articles" orderby="date"}  
    
    {if author_id == '1'}
    {comment}
    {/if}
    
    {/exp:comment:entries}

    Does that help?

  • #3 / Oct 25, 2010 10:44am

    eyevariety

    158 posts

    In that case it would only show the comment content if one of the last two was by that author- right?

    I want to list off all of a member’s comments. The site has thousands of entries and tens of thousands of comments.  How would I do that? 

    Something like this seems like a crazy pipe dream:

    {exp:comment:entries limit="30000" dynamic="off" sort="desc" weblog="articles" orderby="date"}  
    
    {if author_id == '1'}
    {comment}
    {/if}
    
    {/exp:comment:entries}
  • #4 / Oct 25, 2010 4:38pm

    Ingmar

    29245 posts

    While EE2 supports an author_id parameter EE1 does not, unfortunately. In this case a custom SQL query might be the best option, actually.

  • #5 / Oct 25, 2010 4:55pm

    eyevariety

    158 posts

    Ok Gotcha.  Thanks Ingmar

  • #6 / Oct 25, 2010 5:12pm

    Ingmar

    29245 posts

    If you need help with that, let us know and I can move the thread to the CodeShare Corner. Thanks.

  • #7 / Dec 02, 2010 10:55am

    Sue Crocker

    26054 posts

    Closing older thread…

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

ExpressionEngine News!

#eecms, #events, #releases