From ffec100965184c6bf045f0096101768def108b43 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Wed, 31 Jul 2013 17:30:08 +0200 Subject: Index media file usage in the metadata index and use it in ft_mediause() --- inc/media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/media.php') diff --git a/inc/media.php b/inc/media.php index fbe1363ec..c76f2986c 100644 --- a/inc/media.php +++ b/inc/media.php @@ -178,7 +178,7 @@ function media_inuse($id) { global $conf; $mediareferences = array(); if($conf['refcheck']){ - $mediareferences = ft_mediause($id,$conf['refshow']); + $mediareferences = ft_mediause($id,true); if(!count($mediareferences)) { return false; } else { -- cgit v1.2.3 From cc036f74ff14c387f24d72f5a52f2f158208846e Mon Sep 17 00:00:00 2001 From: Klap-in Date: Thu, 1 Aug 2013 23:06:03 +0200 Subject: remove hash for external images, but use token url parameter instead --- inc/media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/media.php') diff --git a/inc/media.php b/inc/media.php index fbe1363ec..c0e3e9f82 100644 --- a/inc/media.php +++ b/inc/media.php @@ -1900,7 +1900,7 @@ function media_crop_image($file, $ext, $w, $h=0){ */ function media_get_token($id,$w,$h){ // token is only required for modified images - if ($w || $h) { + if ($w || $h || media_isexternal($id)) { $token = $id; if ($w) $token .= '.'.$w; if ($h) $token .= '.'.$h; -- cgit v1.2.3 From 89274c0d2b04d8f0524cc37fa18bdd4cc592294a Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Sat, 3 Aug 2013 17:15:09 +0200 Subject: move the media search formlet up Currently the search box is below the media file list, where it is effectively inaccessible in a namespace with lots of files. This change moves the search box above the media file list and below the upload form. --- inc/media.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'inc/media.php') diff --git a/inc/media.php b/inc/media.php index c4378fe9e..a182ecb33 100644 --- a/inc/media.php +++ b/inc/media.php @@ -586,7 +586,10 @@ function media_filelist($ns,$auth=null,$jump='',$fullscreenview=false,$sort=fals // FIXME: print permission warning here instead? echo '
'.$lang['nothingfound'].'
'.NL; }else{ - if (!$fullscreenview) media_uploadform($ns, $auth); + if (!$fullscreenview) { + media_uploadform($ns, $auth); + media_searchform($ns); + } $dir = utf8_encodeFN(str_replace(':','/',$ns)); $data = array(); @@ -609,7 +612,6 @@ function media_filelist($ns,$auth=null,$jump='',$fullscreenview=false,$sort=fals if ($fullscreenview) echo ''.NL; } } - if (!$fullscreenview) media_searchform($ns); } /** -- cgit v1.2.3 From 00e3e3940de140e6fe6ce3c558c71a47f676b456 Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Sat, 3 Aug 2013 17:17:58 +0200 Subject: fix the default ordering of media files to be "natural". also allow the order to be specified in more places. --- inc/media.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'inc/media.php') diff --git a/inc/media.php b/inc/media.php index a182ecb33..a9f6be771 100644 --- a/inc/media.php +++ b/inc/media.php @@ -1296,7 +1296,7 @@ function media_restore($image, $rev, $auth){ * @author Kate Arzamastseva * @triggers MEDIA_SEARCH */ -function media_searchlist($query,$ns,$auth=null,$fullscreen=false,$sort=''){ +function media_searchlist($query,$ns,$auth=null,$fullscreen=false,$sort='natural'){ global $conf; global $lang; @@ -1316,15 +1316,10 @@ function media_searchlist($query,$ns,$auth=null,$fullscreen=false,$sort=''){ $conf['mediadir'], 'search_media', array('showmsg'=>false,'pattern'=>$pattern), - $dir); + $dir, + 1, + $sort); } - - $data = array(); - foreach ($evdata['data'] as $k => $v) { - $data[$k] = ($sort == 'date') ? $v['mtime'] : $v['id']; - } - array_multisort($data, SORT_DESC, SORT_NUMERIC, $evdata['data']); - $evt->advise_after(); unset($evt); } -- cgit v1.2.3 From fe578fe947d692a258e3a5f436b6359ada06c8da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Wed, 13 Nov 2013 22:40:09 +0200 Subject: media_isexternal do not capture do not capture groups in media_isexternal. saves perhaps some cpu cycles and some bytes memory --- inc/media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/media.php') diff --git a/inc/media.php b/inc/media.php index a9f6be771..f8fb3d496 100644 --- a/inc/media.php +++ b/inc/media.php @@ -90,7 +90,7 @@ function media_metasave($id,$auth,$data){ * @return bool */ function media_isexternal($id){ - if (preg_match('#^(https?|ftp)://#i', $id)) return true; + if (preg_match('#^(?:https?|ftp)://#i', $id)) return true; return false; } -- cgit v1.2.3 From 5381a7ee4e6527c7d6d6af67134ef92ba97f8745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Wed, 13 Nov 2013 22:52:40 +0200 Subject: remove 'infos' misspelling http://english.stackexchange.com/questions/117552/why-does-information-not-have-a-plural-form --- inc/media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/media.php') diff --git a/inc/media.php b/inc/media.php index a9f6be771..6b87960e1 100644 --- a/inc/media.php +++ b/inc/media.php @@ -1484,7 +1484,7 @@ function media_printfile_thumbs($item,$auth,$jump=false,$display_namespace=false } /** - * Prints a thumbnail and metainfos + * Prints a thumbnail and metainfo */ function media_printimgdetail($item, $fullscreen=false){ // prepare thumbnail -- cgit v1.2.3