XCL Web Application Platform
2.5.0
The XoopsCube Legacy Project
📘
Loading...
Searching...
No Matches
image.php
1
<?php
13
14
if
(function_exists(
'mb_http_output'
)) {
15
mb_http_output(
'pass'
);
16
}
17
18
$image_id = isset($_GET[
'id'
]) ? (int)$_GET[
'id'
] : 0;
19
if
($image_id > 0) {
20
include
'./mainfile.php'
;
21
$imagehandler = & xoops_gethandler(
'image'
);
22
$criteria =
new
CriteriaCompo
(
new
Criteria
(
'i.image_display'
, 1));
23
$criteria->add(
new
Criteria
(
'i.image_id'
, $image_id));
24
$image = & $imagehandler->getObjects($criteria,
false
,
true
);
25
if
(count($image) > 0) {
26
header(
'Content-type: '
.$image[0]->getVar(
'image_mimetype'
));
27
header(
'Cache-control: max-age=31536000'
);
28
header(
'Expires: '
.gmdate(
'D, d M Y H:i:s'
, time() + 31536000) .
'GMT'
);
29
header(
'Content-disposition: filename='
.$image[0]->getVar(
'image_name'
));
30
header(
'Content-Length: '
.strlen($image[0]->getVar(
'image_body'
)));
31
header(
'Last-Modified: '
.gmdate(
'D, d M Y H:i:s'
, $image[0]->getVar(
'image_created'
)) .
'GMT'
);
32
echo $image[0]->getVar(
'image_body'
);
33
exit();
34
}
35
}
36
header(
'Content-type: image/gif'
);
37
readfile(
'./images/blank.gif'
);
CriteriaCompo
Definition
criteria.php:267
Criteria
Definition
criteria.php:402
html
image.php
Generated by
1.13.2