]> git.mxchange.org Git - friendica.git/blobdiff - mod/fbrowser.php
Merge pull request #3965 from tobiasd/20171126-docGettingStarted
[friendica.git] / mod / fbrowser.php
index 21b9b2e7b416605842ee36378cb24a0d9587247a..ce90eaee9152980c28aef8619339da3dfd2a29bf 100644 (file)
@@ -6,6 +6,7 @@
  */
 
 use Friendica\App;
+use Friendica\Core\System;
 
 require_once('include/Photo.php');
 
@@ -55,7 +56,8 @@ function fbrowser_content(App $a) {
                                $path[]=array($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`, ANY_VALUE(`id`) AS `id`, ANY_VALUE(`filename`) AS `filename`, ANY_VALUE(`type`) AS `type`,
+                                       min(`scale`) AS `hiq`, max(`scale`) AS `loq`, ANY_VALUE(`desc`) AS `desc`, ANY_VALUE(`created`) AS `created`
                                        FROM `photo` WHERE `uid` = %d $sql_extra AND `album` != '%s' AND `album` != '%s'
                                        GROUP BY `resource-id` $sql_extra2",
                                intval(local_user()),
@@ -84,9 +86,9 @@ function fbrowser_content(App $a) {
                                        $scale = $rr['loq'];
 
                                return array(
-                                       App::get_baseurl() . '/photos/' . $a->user['nickname'] . '/image/' . $rr['resource-id'],
+                                       System::baseUrl() . '/photos/' . $a->user['nickname'] . '/image/' . $rr['resource-id'],
                                        $filename_e,
-                                       App::get_baseurl() . '/photo/' . $rr['resource-id'] . '-' . $scale . '.'. $ext
+                                       System::baseUrl() . '/photo/' . $rr['resource-id'] . '-' . $scale . '.'. $ext
                                );
                        }
                        $files = array_map("_map_files1", $r);
@@ -95,7 +97,7 @@ function fbrowser_content(App $a) {
 
                        $o =  replace_macros($tpl, array(
                                '$type'     => 'image',
-                               '$baseurl'  => App::get_baseurl(),
+                               '$baseurl'  => System::baseUrl(),
                                '$path'     => $path,
                                '$folders'  => $albums,
                                '$files'    => $files,
@@ -122,7 +124,7 @@ function fbrowser_content(App $a) {
                                                $filename_e = $rr['filename'];
                                        }
 
-                                       return array( App::get_baseurl() . '/attach/' . $rr['id'], $filename_e, App::get_baseurl() . '/images/icons/16/' . $filetype . '.png');
+                                       return array( System::baseUrl() . '/attach/' . $rr['id'], $filename_e, System::baseUrl() . '/images/icons/16/' . $filetype . '.png');
                                }
                                $files = array_map("_map_files2", $files);
 
@@ -130,7 +132,7 @@ function fbrowser_content(App $a) {
                                $tpl = get_markup_template($template_file);
                                $o = replace_macros($tpl, array(
                                        '$type'     => 'file',
-                                       '$baseurl'  => App::get_baseurl(),
+                                       '$baseurl'  => System::baseUrl(),
                                        '$path'     => array( array( "", t("Files")) ),
                                        '$folders'  => false,
                                        '$files'    =>$files,