aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2012-04-18 15:15:52 +0200
committerFabio Comuni <fabrix.xm@gmail.com>2012-04-18 15:15:52 +0200
commitfddf21d983e97b489c26dba95aa35227b15fe9f3 (patch)
tree6828741c1f3100f3d0fa120328f10f557e19b7ae /mod
parent063012045563f7c41663e0da5eba24a4191d36d0 (diff)
downloadvolse-hubzilla-fddf21d983e97b489c26dba95aa35227b15fe9f3.tar.gz
volse-hubzilla-fddf21d983e97b489c26dba95aa35227b15fe9f3.tar.bz2
volse-hubzilla-fddf21d983e97b489c26dba95aa35227b15fe9f3.zip
filebrowser: fix style, show 10 recent photos if not in an album
Diffstat (limited to 'mod')
-rw-r--r--mod/fbrowser.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/mod/fbrowser.php b/mod/fbrowser.php
index 33695b30f..66ff9252e 100644
--- a/mod/fbrowser.php
+++ b/mod/fbrowser.php
@@ -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())
);