mirror of
https://github.com/friendica/friendica
synced 2026-01-22 01:18:40 +01:00
Initial checkin
This commit is contained in:
commit
6348e70daa
393 changed files with 59765 additions and 0 deletions
25
mod/photo.php
Normal file
25
mod/photo.php
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
function photo_init(&$a) {
|
||||
|
||||
if($a->argc != 2) {
|
||||
killme();
|
||||
}
|
||||
$resolution = 0;
|
||||
$photo = $a->argv[1];
|
||||
$photo = str_replace('.jpg','',$photo);
|
||||
if(substr($photo,-2,1) == '-') {
|
||||
$resolution = intval(substr($photo,-1,1));
|
||||
$photo = substr($photo,0,-2);
|
||||
}
|
||||
$r = q("SELECT * FROM `photo` WHERE `resource-id` = '%s'
|
||||
AND `scale` = %d LIMIT 1",
|
||||
dbesc($photo),
|
||||
intval($resolution));
|
||||
if($r === NULL || (! count($r))) {
|
||||
killme();
|
||||
}
|
||||
header("Content-type: image/jpeg");
|
||||
echo $r[0]['data'];
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue