View Full Version : Recent Comments
anela
05-27-2005, 11:25 PM
Now, I am pretty positive that while going through the board archives yesterday I stumbled on a post by someone who was offering an addon for the most recent comments - it showed the user's name and their comment, in a list. However, it wasn't what I was looking for at the time, and now I can't find it... go figure.
Does anyone know of an addon like this?
Thank you! :)
blinking8s
05-27-2005, 11:51 PM
http://www.pixelpost.org/v1/devfiles/?id=48
anela
05-28-2005, 02:49 PM
Thanks, once again!
Very nice, I like this addon! :) http://resonate.ws/index.php?x=recent
doffer
05-28-2005, 04:05 PM
I've made a list of recent comments on my site too... But i want images too... So that the image commented is showed together with the comment... I guess this should be possible somehow, but I don't know how :(
pixelpunk
05-28-2005, 06:16 PM
Should be easy to include an image since you already have the id. Just get the imagename from the db and include the thumb or whatever.
// unk
doffer
05-28-2005, 09:05 PM
Hi punk :)
Could you describe how to do this? I tried the <IMAGE_NAME> stuff, but it didn't work out...
BTW... Did you get my email?
Regards
anela
05-29-2005, 01:53 AM
I have been trying on and off all day to get this plugin to function like the WordPress plugin here: http://meidell.dk/archives/2004/09/12/brians-latest-comments/ (see http://meidell.dk, right sidebar, "activity" for example) only with showing the image. So far I'm not having any luck, but I'll keep working on it. Guess I need to get out my PHP books and refresh myself. :lol:
anela
05-29-2005, 02:09 AM
Oh wait, I think I got it... or at least partially (to what I want to end up with).
This code should show you the thumbnail followed by the same info as was before in a table.
Line 39 becomes: $recentquery = mysql_query("select t1.parent_id, t1.message, t1.name, t1.url, t2.headline, t2.id, t2.image from ".$pixelpost_db_prefix."comments as t1 inner join pixelpost_pixelpost t2 on t1.parent_id = t2.id where t1.name != '-mark-' ORDER BY t1.id DESC limit $limit_comments");
Add just below line 44: $theimage = pullout($theimage);
Change line 51 (now 52) to: $recent_comments .= "<table><tr><td valign=\"top\"><img src=\"thumbnails/thumb_$theimage\"></td><td valign=\"top\"><b>$comment_name</b> on <b>$comment_headline</b><br />$comment_message</td></tr></table>";
Example: http://www.resonate.ws/index.php?x=recent
Now I want to group them together, have only each thumbnail/image listed once with most recent comments below it... etc...
Of course, the above code does not link the thumbnail to the image, but that can very easily be done...
doffer
05-29-2005, 09:03 PM
Somehow I didn't get it right... Could you just post the entire code here?
anela
05-29-2005, 09:19 PM
This is everything except for the author's notes and the copyright info.
If you find the part where it says &loz; valerie &loz; you can change that to your own name. Keeps your own comments, if you leave any at your site, from appearing in the recent comment list. When the code is all put together, it's somewhere around line 39...
$addon_name = "Most Recent Comments";
$addon_description = "Adds one new tag to display the most recent set of comments. <br /><br />
&lt;LAST_COMMENTS&gt;<br /><br />
This addon will show the most recent set of comments that were left. The value is decided by you.<br /><br />
";
$addon_version = "0.1";
$limit_comments = 20; // Change this to show however many you want
$recent_comments = ""; // comments stored in this string
if($_GET['showimage'] == "") { $imageid = $image_id; } else { $imageid = $_GET['showimage']; }
$recentquery = mysql_query("select t1.parent_id, t1.message, t1.name, t1.url, t2.headline, t2.id, t2.image from ".$pixelpost_db_prefix."comments as t1 inner join pixelpost_pixelpost t2 on t1.parent_id = t2.id where t1.name != '&loz; valerie &loz;' ORDER BY t1.id DESC limit $limit_comments");
while(list($parent_id, $comment_message, $comment_name, $comment_url, $comment_headline, $comment_image_id, $theimage) = mysql_fetch_row($recentquery)) {
$comment_message = pullout($comment_message);
$comment_name = pullout($comment_name);
$comment_headline = pullout($comment_headline);
$comment_image = pullout($comment_image);
$theimage = pullout($theimage);
if($comment_url != "") {
$comment_url = "http://$comment_url"; // i'm running for president...
$comment_url = str_replace("http://http://","http://",$comment_url); // you see?
$comment_name = "<a href='$comment_url' title='$lang_visit_homepage'>$comment_name</a>";
}
$comment_headline = "<a href='/index.php?showimage=$comment_image_id' title='$comment_headline'>$comment_headline</a>";
$recent_comments .= "<table><tr><td valign=\"top\"><img src=\"thumbnails/thumb_$theimage\"></td><td valign=\"top\"><b>$comment_name</b> on <b>$comment_headline</b><br />$comment_message</td></tr></table>";
}
$recent_comments .= "";
$tpl = ereg_replace("<LAST_COMMENTS>",$recent_comments,$tpl);
vBulletin® v3.7.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.