Pixelpost

Authentic Photoblog Flavour


Go Back   Pixelpost Forum > SUPPORT / INFORMATION > Pixelpost Help

Post Reply
 
Thread Tools
  #1  
Old 12-09-2004, 02:25 PM
turnover Offline
pixelpost guru
 
Join Date: Oct 2004
Location: Paris, France
Posts: 136
rss feed and image date

It's a bug ? When i set a date and time for my image.

example : i post one image today (9 december 2004) and i want to be appears the days after tomorrow (good movie) (11 december 2004).
In the rss feed, the image appears today ... with the good date ...
__________________
TurNover - PhotoBlog NEW REOPEN
Reply With Quote
  #2  
Old 12-09-2004, 02:29 PM
pixelpunk's Avatar
pixelpunk Offline
pixelpost guru
 
Join Date: Oct 2004
Location: Sweden
Posts: 504
Send a message via ICQ to pixelpunk
turnover, you have your rss separated from the script, I do remember you wanted that.

This is the reason future images shows up in your feed - your external rss.php is not "patched" to deal with future images.

You need to add an where condition to the mysql query that excludes images that has a future date, something lika "and (datetime<='$currentdate')" where $currentdate holds the current date and time.

Let me know if you need help with this.

// punk
__________________
icq: 66760929
Reply With Quote
  #3  
Old 12-09-2004, 02:35 PM
turnover Offline
pixelpost guru
 
Join Date: Oct 2004
Location: Paris, France
Posts: 136
Rhaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Sorryyyyyyyyyyyyyyyyyyyyyyy

i don't remember that !!

Sorryyyyyyyyyyyyyyyyyyyyyyyyyyyy ops: ops: ops: ops:

This is my old code

Code:
<?php 

 error_reporting(0); 

 // ##########################################################################################//
 // PIXELPOST RSS ONLY 
 // ##########################################################################################//

 require("admin/pixelpost.php"); 
 /* start up mysql */ 
 mysql_connect($pixelpost_db_host, $pixelpost_db_user, $pixelpost_db_pass) || die("Error: ". mysql_error()); 
 mysql_select_db($pixelpost_db_pixelpost) || die("Error: ". mysql_error()); 

 // get config stuff 
 $cfgquery = mysql_query("select * from pixelpost_config"); 
 $cfgrow = mysql_fetch_array($cfgquery); 
 $pixelpost_site_title = $cfgrow['sitetitle']; 
 $siteurl = ereg_replace("http://","",$cfgrow['siteurl']); 
 $image = "$siteurl/thumbnails/thumb_".$cfgrow['name']; 
 // rss output 

   $output = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?> 
   <rss version=\"2.0\"> 
   <channel> 
   <title>".$cfgrow['sitetitle']."</title> 
   <link>".$cfgrow['siteurl']."</link> 
   <description>".$cfgrow['sitetitle']." photoblog</description> 
   "; 
   $query = mysql_query("select id,datetime,headline,body,image from pixelpost_pixelpost order by datetime desc limit 0,10");
   while(list($id,$datetime,$headline,$body,$image) = mysql_fetch_row($query)) { 
     $headline = pullout($headline); 
     $body = pullout($body); 
     $image = $cfgrow['siteurl']."thumbnails/thumb_$image"; 
     $output .= " 
     <item> 
     <title>$headline</title> 
     <link>".$cfgrow['siteurl']."index.php?showimage=$id</link> 
     <description><img src="$image" align="right"> $body</description> 
     <pubDate>$datetime</pubDate> 
     </item> 
     "; 
     } 
   $output .= " 
     </channel> 
     </rss>"; 
 echo $output; 
 exit; 


 // ##########################################################################################//
 // functions 
 // ##########################################################################################//
 function pullout($string) { 
  $string = stripslashes($string); 
  $string = htmlentities($string); 
  $string = nl2br($string); 
  return $string; 
  } 

 ?>
__________________
TurNover - PhotoBlog NEW REOPEN
Reply With Quote
  #4  
Old 12-09-2004, 02:47 PM
pixelpunk's Avatar
pixelpunk Offline
pixelpost guru
 
Join Date: Oct 2004
Location: Sweden
Posts: 504
Send a message via ICQ to pixelpunk
Code:
<?php 

 error_reporting(0); 


 require("admin/pixelpost.php"); 
 /* start up mysql */ 
 mysql_connect($pixelpost_db_host, $pixelpost_db_user, $pixelpost_db_pass) || die("Error: ". mysql_error()); 
 mysql_select_db($pixelpost_db_pixelpost) || die("Error: ". mysql_error()); 

 // get config stuff 
 $cfgquery = mysql_query("select * from pixelpost_config"); 
 $cfgrow = mysql_fetch_array($cfgquery); 
 $pixelpost_site_title = $cfgrow['sitetitle']; 
 $siteurl = ereg_replace("http://","",$cfgrow['siteurl']); 
 $image = "$siteurl/thumbnails/thumb_".$cfgrow['name']; 

$current_date = date("Y-m-d H:i:s");

 // rss output 

   $output = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?> 
   <rss version=\"2.0\"> 
   <channel> 
   <title>".$cfgrow['sitetitle']."</title> 
   <link>".$cfgrow['siteurl']."</link> 
   <description>".$cfgrow['sitetitle']." photoblog</description> 
   "; 
   $query = mysql_query("select id,datetime,headline,body,image from pixelpost_pixelpost where datetime<='$current_date' order by datetime desc limit 0,10");
   while(list($id,$datetime,$headline,$body,$image) = mysql_fetch_row($query)) { 
     $headline = pullout($headline); 
     $body = pullout($body); 
     $image = $cfgrow['siteurl']."thumbnails/thumb_$image"; 
     $output .= " 
     <item> 
     <title>$headline</title> 
     <link>".$cfgrow['siteurl']."index.php?showimage=$id</link> 
     <description><img src="$image" align="right"> $body</description> 
     <pubDate>$datetime</pubDate> 
     </item> 
     "; 
     } 
   $output .= " 
     </channel> 
     </rss>"; 
 echo $output; 
 exit; 

 function pullout($string) { 
  $string = stripslashes($string); 
  $string = htmlentities($string); 
  $string = nl2br($string); 
  return $string; 
  } 

 ?>
That should do it.
__________________
icq: 66760929
Reply With Quote
  #5  
Old 12-09-2004, 09:17 PM
turnover Offline
pixelpost guru
 
Join Date: Oct 2004
Location: Paris, France
Posts: 136
Thks punk ! i have find alone
__________________
TurNover - PhotoBlog NEW REOPEN
Reply With Quote
Post Reply


Thread Tools




All times are GMT. The time now is 02:54 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. | Style Design: d3 designs