|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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 |
|
#3
|
|||
|
|||
|
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>&lt;img src=&quot;$image&quot; align=&quot;right&quot;&gt; $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 |
|
#4
|
||||
|
||||
|
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>&lt;img src=&quot;$image&quot; align=&quot;right&quot;&gt; $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;
}
?>
__________________
icq: 66760929 |
|
#5
|
|||
|
|||
|
Thks punk ! i have find alone
__________________
TurNover - PhotoBlog NEW REOPEN |
| Post Reply |
| Thread Tools | |
|
|