mirror of
https://github.com/friendica/friendica
synced 2025-04-23 21:50:10 +00:00
png support: update database.sql, fix some typos, fix tinymce image browser
This commit is contained in:
parent
7cc8c369cb
commit
2438c6e45d
6 changed files with 35 additions and 20 deletions
|
@ -4,7 +4,9 @@
|
|||
* @subpackage FileBrowser
|
||||
* @author Fabio Comuni <fabrixxm@kirgroup.com>
|
||||
*/
|
||||
|
||||
|
||||
require_once('include/Photo.php');
|
||||
|
||||
/**
|
||||
* @param App $a
|
||||
*/
|
||||
|
@ -43,14 +45,22 @@ function fbrowser_content($a){
|
|||
$path[]=array($a->get_baseurl()."/fbrowser/image/".$a->argv[2]."/", $album);
|
||||
}
|
||||
|
||||
$r = q("SELECT `resource-id`, `id`, `filename`, min(`scale`) AS `hiq`,max(`scale`) AS `loq`, `desc`
|
||||
$r = q("SELECT `resource-id`, `id`, `filename`, type, min(`scale`) AS `hiq`,max(`scale`) AS `loq`, `desc`
|
||||
FROM `photo` WHERE `uid` = %d $sql_extra
|
||||
GROUP BY `resource-id` $sql_extra2",
|
||||
intval(local_user())
|
||||
);
|
||||
|
||||
|
||||
function files1($rr){ global $a; return array( $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $rr['hiq'] . '.jpg', template_escape($rr['filename']), $a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $rr['loq'] . '.jpg'); }
|
||||
function files1($rr){
|
||||
global $a;
|
||||
$types = Photo::supportedTypes();
|
||||
$ext = $types[$rr['type']];
|
||||
return array(
|
||||
$a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $rr['hiq'] . '.' .$ext,
|
||||
template_escape($rr['filename']),
|
||||
$a->get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $rr['loq'] . '.'. $ext
|
||||
);
|
||||
}
|
||||
$files = array_map("files1", $r);
|
||||
|
||||
$tpl = get_markup_template("filebrowser.tpl");
|
||||
|
|
|
@ -682,9 +682,9 @@ function photos_post(&$a) {
|
|||
$filesize = intval($_FILES['userfile']['size']);
|
||||
$type = $_FILES['userfile']['type'];
|
||||
}
|
||||
|
||||
if ($type=="") $type=guess_image_type($filename);
|
||||
|
||||
logger('photos: upload: received file: ' . $filename . ' as ' . $src . ' '. $type . ' ' . $filesize . ' bytes', LOGGER_DEBUG);
|
||||
logger('photos: upload: received file: ' . $filename . ' as ' . $src . ' ('. $type . ') ' . $filesize . ' bytes', LOGGER_DEBUG);
|
||||
|
||||
$maximagesize = get_config('system','maximagesize');
|
||||
|
||||
|
|
|
@ -109,7 +109,8 @@ function profile_photo_post(&$a) {
|
|||
$filename = basename($_FILES['userfile']['name']);
|
||||
$filesize = intval($_FILES['userfile']['size']);
|
||||
$filetype = $_FILES['userfile']['type'];
|
||||
|
||||
if ($filetype=="") $filetype=guess_image_type($filename);
|
||||
|
||||
$maximagesize = get_config('system','maximagesize');
|
||||
|
||||
if(($maximagesize) && ($filesize > $maximagesize)) {
|
||||
|
|
|
@ -69,7 +69,8 @@ function wall_upload_post(&$a) {
|
|||
$filesize = intval($_FILES['media']['size']);
|
||||
$filetype = $_FILES['media']['type'];
|
||||
}
|
||||
|
||||
|
||||
if ($filetype=="") $filetype=guess_image_type($filename);
|
||||
$maximagesize = get_config('system','maximagesize');
|
||||
|
||||
if(($maximagesize) && ($filesize > $maximagesize)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue