WordPress.org

Ready to get started?Download WordPress

Forums

Another comments plug-in (13 posts)

  1. rcs1000
    Member
    Posted 9 years ago #

    Hi,
    I looked around the various "latest comments" hacks available for WordPress, and found them all a little sparse for my liking.
    I have written a more decorative one, and it can be seen at http://testbed.amoral.org (despite the URL it's really nothing dodgy; it's just my dad's political commentary blog.)
    Now, I would love to contribute this back to the WordPress community, if they want it!
    Two questions:
    (1) Is it a useful enough hack that anyone is interested?
    (2) If it is, how do I hand the code over?
    Regards,
    Robert

  2. Mark (podz)
    Support Maven
    Posted 9 years ago #

    1. Can you explain in a little more detail what the code does ? (I can see it, but it'll need a description if it's to be distributed)
    2. Is it a plugin ? or a Hack ?

  3. rcs1000
    Member
    Posted 9 years ago #

    I was using WordPress 1.0.1. So, I had no access to plug-ins. I am currently upgrading to 1.2 to turn it into a plug-in rather than a hack.
    I will post again once I have changed it.
    Thanks,
    Robert
    ps (the upgrade hss, of course, temporarily removed the comment hack - if you still want to see it, it is at http://www.politicalbetting.com)

  4. rcs1000
    Member
    Posted 9 years ago #

    OK Podz,
    Details: latest_comments.php is now a plug-in. The plug-in contains a function taking two variables: the number of comments you wish to display and the amount of each comment you wish to show.
    The function is simple: it runs a query on the wp_comments table, pulls out the data, and formats it. About 40 lines of code. Nothing spectacularly difficult, but I like the effect.
    Regards,
    Robert

  5. rcs1000
    Member
    Posted 9 years ago #

    Oh yes; and it can be seen in action - again - at http://testbed.amoral.org

  6. Mark (podz)
    Support Maven
    Posted 9 years ago #

    Robert - I was just editing the wiki to add this, and I needed the link for the plugin code... so I came back here to get it ..... and .. erm... ?
    :)

  7. Chadwick
    Member
    Posted 9 years ago #

    yes the code would be nice to get.. i wouldn't mind pop in this on to my site

  8. rcs1000
    Member
    Posted 9 years ago #

    The plug-in can be downloaded here (I wasn't feeling particularly smart last night, I had a nightmare system administration problem, that turned out to simply be due to someone else on another VM taking all the CPU time...):
    http://amoral.org/latest_comments.php.txt
    Thanks
    Robert

  9. Anonymous
    Unregistered
    Posted 9 years ago #

    How do I make it display? ToT thanks

  10. bleucube
    Member
    Posted 9 years ago #

    Yes - Good question. How do you add it?
    <?php LatestComments; ?>
    Thanks!

  11. bleucube
    Member
    Posted 9 years ago #

    Never mind... Im a bit slow.
    I got it. Works great thanks for the plugin!
    <?php LatestComments(5,20); ?>

  12. mattnaugle2
    Member
    Posted 9 years ago #

    It works great!

    But how do I make the text "break" to the next line if one line is too long? for example, if someone entered in a long url to a newspaper address, i want it to be broken into multiple lines.

  13. mattnaugle2
    Member
    Posted 9 years ago #

    (Sorry- Double post.)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.