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 ?
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)
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
Oh yes; and it can be seen in action – again – at http://testbed.amoral.org
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… ?
🙂
yes the code would be nice to get.. i wouldn’t mind pop in this on to my site
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
Anonymous
How do I make it display? ToT thanks
Yes – Good question. How do you add it?
<?php LatestComments; ?>
Thanks!
Never mind… Im a bit slow.
I got it. Works great thanks for the plugin!
<?php LatestComments(5,20); ?>
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.