valid rss date

git-svn-id: file:///home/shish/svn/shimmie2/trunk@54 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2007-05-03 15:27:10 +00:00
parent 9bb567aa60
commit f6ea5118d9
3 changed files with 12 additions and 4 deletions

View File

@ -121,7 +121,7 @@ class Database {
}
if($positive_tag_count + $negative_tag_count == 0) {
$query = new Querylet("SELECT * FROM images ");
$query = new Querylet("SELECT *,UNIX_TIMESTAMP(posted) AS posted_timestamp FROM images ");
}
else {
$s_tag_array = array_map("sql_escape", $tag_search->variables);
@ -139,7 +139,9 @@ class Database {
array($positive_tag_count)
)
);
$query = new Querylet("SELECT * FROM ({$subquery->sql}) AS images ", $subquery->variables);
$query = new Querylet("
SELECT *, UNIX_TIMESTAMP(posted) AS posted_timestamp
FROM ({$subquery->sql}) AS images ", $subquery->variables);
}
if(strlen($img_search->sql) > 0) {
@ -180,7 +182,12 @@ class Database {
if($limit < 1) $limit = 1;
if(count($tags) == 0) {
$result = $this->db->Execute("SELECT * FROM images ORDER BY id DESC LIMIT ?,?", array($start, $limit));
$result = $this->db->Execute("
SELECT *,UNIX_TIMESTAMP(posted) AS posted_timestamp
FROM images
ORDER BY id DESC
LIMIT ?,?
", array($start, $limit));
}
else {
$querylet = $this->build_search_querylet($tags);

View File

@ -26,6 +26,7 @@ class Image {
$this->width = $row['width'];
$this->height = $row['height'];
$this->posted = $row['posted'];
$this->posted_timestamp = $row['posted_timestamp'];
}
private function mime_to_ext($mime) {

View File

@ -32,7 +32,7 @@ class RSS_Images extends Extension {
$link = make_link("post/view/{$image->id}");
$tags = $image->get_tag_list();
$owner = $image->get_owner();
$posted = $image->posted; // FIXME: MySQL date != RSS date
$posted = strftime("%a, %d %b %Y %T %Z", $image->posted_timestamp);
$content = html_escape(
"<p>" . build_thumb_html($image) . "</p>" .
"<p>Uploaded by " . $owner->name . "</p>"