View Full Version : Recents comments enchanced
reflejandome
08-26-2005, 07:33 PM
I enchanched recent coments addon for show the thumbnails of the image. Yu can see it at http://www.reflectingmyself.com/photoblog/index.php?x=fancyarchive
If anyone it is interested i can put the code here :)
Joe[y]
08-27-2005, 10:07 AM
connection to your site is 'refused'.
reflejandome
08-27-2005, 12:32 PM
']connection to your site is 'refused'.
perhaps it is due a ip ban or the spam addon .... i remove all ip bans, try now :)
Joe[y]
08-27-2005, 05:20 PM
works fine now. nice improvement. would be cool if you just made them an option you could turn on and off now. maybe just a variable in the script than can be changed. ie, true or false.
-okapi-
09-01-2005, 09:03 AM
where can i get the improved addon?
reflejandome
09-03-2005, 01:36 PM
I have no many time to join the two version but here you have the code, so if anyone wants to do it :)
<?php
/*
Requires Pixelpost version 1.3
Recent Comments Addon version 0.2.1
Written by: Mark Lewin
Modified by:Alfonso Bernal (http://www.reflectingmyself.com)
Contact: info@markmyshots.com
To see it in action go to: http://www.markmyshots.com
Pixelpost www: http://www.pixelpunk.se/software/
License: http://www.gnu.org/copyleft/gpl.html
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
$addon_name = "Most Recent Comments";
$addon_description = "Adds one new tag to display the most recent set of comments. <br /><br />
<LAST_COMMENTS><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.2.1";
$limit_comments = 5; // 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 != '-mark-' ORDER BY t1.id DESC limit $limit_comments");
while(list($parent_id, $comment_message, $comment_name, $comment_url, $comment_headline, $comment_image_id,$comment_fichero) = mysql_fetch_row($recentquery)) {
$comment_message = pullout($comment_message);
$comment_name = pullout($comment_name);
$comment_headline = pullout($comment_headline);
$comment_image = pullout($comment_image);
$comment_fichero = pullout($comment_fichero);
$thumbnail = "thumbnails/thumb_$comment_fichero";
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' target='_blank'>$comment_name</a>";
}
$comment_headline = "<a href='index.php?showimage=$comment_image_id' title='$comment_headline' target='_blank'><img src='$thumbnail' alt='$comment_headline' title='$$comment_headline' class='thumbnails'></a>";
$recent_comments .="<table class=\"thumbnails\" cellpadding=\"0\" cellspacing=\"0\" width=\"$table_width\">";
$recent_comments .= "<tr><td valign='top'><b>$comment_headline</b></td><td valign='top'><b>$comment_name</b><br />$comment_message <br /><br /></td></tr></table>";
}
$recent_comments .= "";
$tpl = ereg_replace("<LAST_COMMENTS>",$recent_comments,$tpl);
?>
thanx for posting...
however, it seems it 's not working when the photoblog is placed in a subdirectory and not on the root directory of the domain...
example... http://www.yoursite.com/pixelpost/index.php
instead of:
http://www.yoursite.com/index.php
[or at least it doesn't seem to work in mine]
beerad
03-19-2006, 09:23 PM
Watch out If You copy,
$tpl = ereg_replace("<LAST_COMMENTS>",$recent_comments,$t pl);
There is an extra space and should be
$tpl = ereg_replace("<LAST_COMMENTS>",$recent_comments,$tpl);
posefius
04-05-2006, 06:11 PM
I tried to use it but I get the following error in the admin panel;
Parse error: parse error, unexpected T_STRING in /www/addons/recent_comments.php on line 59
I,m using Pixelpost 1.5
posefius
04-05-2006, 06:27 PM
SORRY the problem was the extra space
vBulletin® v3.7.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.