diff options
Diffstat (limited to 'mod/fbrowser.php')
-rw-r--r-- | mod/fbrowser.php | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/mod/fbrowser.php b/mod/fbrowser.php index cdcde4b17..19bd77914 100644 --- a/mod/fbrowser.php +++ b/mod/fbrowser.php @@ -5,7 +5,7 @@ * @author Fabio Comuni <fabrixxm@kirgroup.com> */ -require_once('include/Photo.php'); +require_once('include/photo/photo_driver.php'); /** * @param App $a @@ -45,7 +45,7 @@ function fbrowser_content($a){ $path[]=array($a->get_baseurl()."/fbrowser/image/".$a->argv[2]."/", $album); } - $r = q("SELECT `resource_id`, `id`, `filename`, type, 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`, `description` FROM `photo` WHERE `uid` = %d $sql_extra GROUP BY `resource_id` $sql_extra2", intval(local_user()) @@ -53,11 +53,20 @@ function fbrowser_content($a){ function files1($rr){ global $a; - $types = Photo::supportedTypes(); + $ph = photo_factory(''); + $types = $ph->supportedTypes(); $ext = $types[$rr['type']]; + + if($a->get_template_engine() === 'internal') { + $filename_e = template_escape($rr['filename']); + } + else { + $filename_e = $rr['filename']; + } + return array( $a->get_baseurl() . '/photo/' . $rr['resource_id'] . '-' . $rr['hiq'] . '.' .$ext, - template_escape($rr['filename']), + $filename_e, $a->get_baseurl() . '/photo/' . $rr['resource_id'] . '-' . $rr['loq'] . '.'. $ext ); } @@ -70,6 +79,7 @@ function fbrowser_content($a){ '$path' => $path, '$folders' => $albums, '$files' =>$files, + '$cancel' => t('Cancel'), )); @@ -83,7 +93,15 @@ function fbrowser_content($a){ function files2($rr){ global $a; list($m1,$m2) = explode("/",$rr['filetype']); $filetype = ( (file_exists("images/icons/$m1.png"))?$m1:"zip"); - return array( $a->get_baseurl() . '/attach/' . $rr['id'], template_escape($rr['filename']), $a->get_baseurl() . '/images/icons/16/' . $filetype . '.png'); + + if($a->get_template_engine() === 'internal') { + $filename_e = template_escape($rr['filename']); + } + else { + $filename_e = $rr['filename']; + } + + return array( $a->get_baseurl() . '/attach/' . $rr['id'], $filename_e, $a->get_baseurl() . '/images/icons/16/' . $filetype . '.png'); } $files = array_map("files2", $files); //echo "<pre>"; var_dump($files); killme(); @@ -96,6 +114,7 @@ function fbrowser_content($a){ '$path' => array( array($a->get_baseurl()."/fbrowser/image/", t("Files")) ), '$folders' => false, '$files' =>$files, + '$cancel' => t('Cancel'), )); } |