Commit ee2fbfbe authored by redflo's avatar redflo

fixed bug in article image caching

parent 98f6f68e
<?php
// $Header: /cvsroot/tikiwiki/tiki/article_image.php,v 1.6 2003-11-28 04:47:38 mose Exp $
// $Header: /cvsroot/tikiwiki/tiki/article_image.php,v 1.7 2003-12-04 15:10:03 redflo Exp $
// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
# $Header: /cvsroot/tikiwiki/tiki/article_image.php,v 1.6 2003-11-28 04:47:38 mose Exp $
# $Header: /cvsroot/tikiwiki/tiki/article_image.php,v 1.7 2003-12-04 15:10:03 redflo Exp $
// application to display an image from the database with
// option to resize the image dynamically creating a thumbnail on the fly.
......@@ -20,12 +20,13 @@ if (is_file($topiccachefile) and (!isset($_REQUEST["reload"]))) {
$size = getimagesize($topiccachefile);
header ("Content-type: ".$size['mime']);
readfile($topiccachefile);
die();
} else {
include_once ('lib/init/initlib.php');
include_once ('db/tiki-db.php');
include_once ('lib/tikilib.php');
$tikilib = new Tikilib($dbTiki);
$data = $tikilib->get_topic_image($_REQUEST["id"]);
$data = $tikilib->get_article_image($_REQUEST["id"]);
$type = $data["image_type"];
$data = $data["image_data"];
if ($data["image_data"]) {
......
......@@ -2217,6 +2217,14 @@ function get_topic_image($topicId) {
return $res;
}
/*shared*/
function get_article_image($id) {
$query = "select `image_name` ,`image_size`,`image_type`, `image_data` from `tiki_articles` where `articleId`=?";
$result = $this->query($query, array((int) $id));
$res = $result->fetchRow();
return $res;
}
/*shared*/
function get_featured_links($max = 10) {
$query = "select * from `tiki_featured_links` where `position` > ? order by ".$this->convert_sortmode("position_asc");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment