diff -u -r pixelpost_1.4.2/includes/functions.php pixelpost_1.4.2.mine/includes/functions.php
--- pixelpost_1.4.2/includes/functions.php 2005-06-08 13:27:00.000000000 +0200
+++ pixelpost_1.4.2.mine/includes/functions.php 2005-08-01 10:41:25.697625000 +0200
@@ -8,8 +8,8 @@
$comment_count = 0;
$image_comments = "
"; // comments stored in this string
- $cquery = mysql_query("select datetime, message, name, url, email from ".$pixelpost_db_prefix."comments where parent_id='".$imageid."' order by id asc");
- while(list($comment_datetime, $comment_message, $comment_name, $comment_url, $comment_email) = mysql_fetch_row($cquery)) {
+ $cquery = mysql_query("select id, datetime, message, name, url, email from ".$pixelpost_db_prefix."comments where parent_id='".$imageid."' order by id asc");
+ while(list($id, $comment_datetime, $comment_message, $comment_name, $comment_url, $comment_email) = mysql_fetch_row($cquery)) {
$comment_message = pullout($comment_message);
$comment_name = pullout($comment_name);
// addyd by Ramin for email field in comments
@@ -21,7 +21,7 @@
}
$comment_datetime = strtotime($comment_datetime);
$comment_datetime = date($cfgrow['dateformat'],$comment_datetime);
- $image_comments .= "- $comment_message
$comment_name @ $comment_datetime ";
+ $image_comments .= "- $comment_message
$comment_name @ $comment_datetime ";
$comment_count++;
}
if($comment_count == 0) { $image_comments .= "- $lang_no_comments_yet
"; }
diff -u -r pixelpost_1.4.2/index.php pixelpost_1.4.2.mine/index.php
--- pixelpost_1.4.2/index.php 2005-07-16 20:53:00.000000000 +0200
+++ pixelpost_1.4.2.mine/index.php 2005-08-01 10:40:47.853875000 +0200
@@ -576,6 +576,65 @@
}
// ##########################################################################################//
+// RSS 2.0 FEED for comments
+// ##########################################################################################//
+if($_GET['x'] == "rsscomment") {
+ pullout($cfgrow['sitetitle']);
+ $output = "
+
+
+ ".$cfgrow['sitetitle']." - Comments
+ ".$cfgrow['siteurl']."
+ ".$cfgrow['sitetitle']." photoblog - Comments
+ http://blogs.law.harvard.edu/tech/rss
+ pixelpost
+ ";
+ $tzoner = $cfgrow['timezone'];
+ $tprefix = '+';
+ $tzoner = sprintf ("%01.2f", $tzoner);
+ if (substr($tzoner,0,1)=='-') {
+ $tzoner = (substr($tzoner,1));
+ $tprefix = '-';
+ }
+ if ($tzoner < 10){$tzoner = "0".$tzoner;}
+ $hh = substr($tzoner,0,2);
+ $mm = substr($tzoner,-2);
+ $tzoner = $tprefix.$hh.$mm;
+ $query = mysql_query("select c.id,c.parent_id,c.datetime,c.message,c.name,p.headline from ".$pixelpost_db_prefix."comments c, ".$pixelpost_db_prefix."pixelpost p where c.parent_id = p.id and (c.datetime<='$cdate') order by c.datetime desc limit 10");
+ while(list($id,$parent_id,$datetime,$message,$name,$headline) = mysql_fetch_row($query)) {
+ $headline = pullout($headline);
+ $message = pullout($message);
+ $name = pullout($name);
+
+ $datetime = strtotime($datetime);
+ $datetime = date("D, d M Y H:i",$datetime);
+ $datetime .= ' ' .$tzoner;
+ $message = stripslashes($message);
+ $message = str_replace("\n","<br />",$message);
+ // added to remove HTML tags
+ $message = strip_tags( $message );
+ $name = stripslashes($name);
+ $name = str_replace("\n","<br />",$name);
+ // added to remove HTML tags
+ $name = strip_tags( $name );
+ $output .= "
+ -
+ $headline - comment by $name
+ ".$cfgrow['siteurl']."?popup=comment&showimage=$parent_id#c$id
+ $message
+ $datetime
+
+ ";
+ }
+ $output .= "
+
+ ";
+ header("Content-type:application/xml");
+ echo $output;
+ exit;
+ }
+
+// ##########################################################################################//
// ATOM FEED - re and triple check the encoding please please please
// ##########################################################################################//
$atom_url = "http://".$HTTP_HOST.$REQUEST_URI."&x=atom";
@@ -637,9 +696,80 @@
exit;
}
+// ##########################################################################################//
+// ATOM FEED comments - re and triple check the encoding please please please
+// ##########################################################################################//
+$atom_comment_url = "http://".$HTTP_HOST.$REQUEST_URI."&x=atomcomment";
+$tpl = str_replace("",$atom_comment_url,$tpl);
+if($_GET['x'] == "atomcomment") {
+ header("content-type: application/atom+xml");
+ $tzoner = $cfgrow['timezone'];
+ $tprefix = '+';
+ $tzoner = sprintf ("%01.2f", $tzoner);
+ if (substr($tzoner,0,1)=='-') {
+ $tzoner = (substr($tzoner,1));
+ $tprefix = '-';
+ }
+ if ($tzoner < 10){$tzoner = "0".$tzoner;}
+ $hh = substr($tzoner,0,2);
+ $mm = substr($tzoner,-2);
+ $tzoner = $tprefix.$hh.":".$mm;
+ pullout($cfgrow['sitetitle']);
+ pullout($cfgrow['headline']);
+ $url = $cfgrow['siteurl'];
+ $atom = "
+
+ ".$cfgrow['sitetitle']." - Comments
+
+
+ ".$cfgrow['sitetitle']."
+ $url
+
+ Pixelpost
+ ".date("Y-m-d\TH:i:s$tzoner")."
+ ";
+ $tag_url = $_SERVER['HTTP_HOST'];
+ $query = mysql_query("select c.id,c.parent_id,c.datetime,c.message,c.name,p.headline from ".$pixelpost_db_prefix."comments c, ".$pixelpost_db_prefix."pixelpost p where c.parent_id = p.id and (c.datetime<='$cdate') order by c.datetime desc limit 10");
+ while(list($id,$parent_id,$datetime,$message,$name,$headline) = mysql_fetch_row($query)) {
+ $headline = pullout($headline);
+ $message = pullout($message);
+ $name = pullout($name);
+ $message = strip_tags( $message );
+ $name = strip_tags( $name );
+
+ $tag_date = substr($datetime,0,10);
+ $modified_date = substr($datetime,0,10);
+ $modified_date = $modified_date."T".(substr($datetime,11,8));
+ $datetime = strtotime($datetime);
+ $atom .= "
+ $headline - comment by $name
+
+ tag:$tag_url,$tag_date:$id
+
+
+
+ $tag_date
+ $modified_date$tzoner
+
+ ";
+ }
+ $atom .= "";
+ echo $atom;
+ exit;
+ }
$tpl = str_replace("","ATOM feed",$tpl);
+$tpl = str_replace("","Comments ATOM feed",$tpl);
$tpl = str_replace("","RSS 2.0",$tpl);
+$tpl = str_replace("","Comments RSS 2.0",$tpl);
// deactivated because of Referer-Spam
// $tpl = str_replace("","index.php?x=ref",$tpl);