]> git.mxchange.org Git - friendica.git/commitdiff
filebrowser: fix style, show 10 recent photos if not in an album
authorFabio Comuni <fabrix.xm@gmail.com>
Wed, 18 Apr 2012 13:15:52 +0000 (15:15 +0200)
committerFabio Comuni <fabrix.xm@gmail.com>
Wed, 18 Apr 2012 13:15:52 +0000 (15:15 +0200)
mod/fbrowser.php
view/filebrowser.tpl

index 33695b30f670e2947962a8e9f2d90760c1ee86f3..66ff9252ebbcf77f1e2f895b59d235c288b86b32 100644 (file)
@@ -22,6 +22,9 @@ function fbrowser_content($a){
                case "image":
                        $path = array( array($a->get_baseurl()."/fbrowser/image/", t("Photos")));
                        $albums = false;
+                       $sql_extra = "";
+                       $sql_extra2 = " ORDER BY created DESC LIMIT 0, 10";
+                       
                        if ($a->argc==2){
                                $albums = q("SELECT distinct(`album`) AS `album` FROM `photo` WHERE `uid` = %d ",
                                        intval(local_user())
@@ -36,11 +39,13 @@ function fbrowser_content($a){
                        if ($a->argc==3){
                                $album = hex2bin($a->argv[2]);
                                $sql_extra = sprintf("AND `album` = '%s' ",dbesc($album));
+                               $sql_extra2 = "";
                                $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`  FROM `photo` WHERE `uid` = %d $sql_extra
-                               AND `scale` <= 4 $sql_extra GROUP BY `resource-id`",
+                       $r = q("SELECT `resource-id`, `id`, `filename`, 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())                                    
                        );
                        
index 45ba3dab9d5c61461d11b55b0124d4945e206669..1e97237f478998fed141e0fb6399d8ab07e99b23 100644 (file)
@@ -3,11 +3,13 @@
        <head>
        <script type="text/javascript" src="$baseurl/library/tinymce/jscripts/tiny_mce/tiny_mce_popup.js"></script>
        <style>
+               .panel_wrapper div.current{.overflow: auto; height: auto!important; }
                .filebrowser.path { font-family: fixed; font-size: 10px; background-color: #f0f0ee; height:auto; overflow:auto;}
                .filebrowser.path a { border-left: 1px solid #C0C0AA; background-color: #E0E0DD; display: block; float:left; padding: 0.3em 1em;}
                .filebrowser ul{ list-style-type: none; padding:0px; }
                .filebrowser.folders a { display: block; padding: 0.3em }
                .filebrowser.folders a:hover { background-color: #f0f0ee; }
+               .filebrowser.files.image { overflow: auto; height: auto; }
                .filebrowser.files.image img { height:50px;}
                .filebrowser.files.image li { display: block; padding: 5px; float: left; }
                .filebrowser.files.image span { display: none;}