diff --git a/mod/photos.php b/mod/photos.php index ebb88c7391..52c1fc3616 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -42,42 +42,59 @@ function photos_init(&$a) { $sql_extra = permissions_sql($a->data['user']['uid']); - $albums = q("SELECT distinct(`album`) AS `album` FROM `photo` WHERE `uid` = %d $sql_extra order by created desc", - intval($a->data['user']['uid']) + $albums = q("SELECT count(distinct `resource-id`) AS `total`, `album` FROM `photo` WHERE `uid` = %d AND `album` != '%s' AND `album` != '%s' + $sql_extra group by album order by created desc", + intval($a->data['user']['uid']), + dbesc('Contact Photos'), + dbesc( t('Contact Photos')) ); - if(count($albums)) { - $a->data['albums'] = $albums; + $albums_visible = ((intval($a->data['user']['hidewall']) && (! local_user()) && (! remote_user())) ? false : true); - $albums_visible = ((intval($a->data['user']['hidewall']) && (! local_user()) && (! remote_user())) ? false : true); + // add various encodings to the array so we can just loop through and pick them out in a template + $ret = array('success' => false); - if($albums_visible) { - $o .= ''; - } if(! x($a->page,'aside')) $a->page['aside'] = ''; $a->page['aside'] .= $vcard_widget; $a->page['aside'] .= $o; + $a->page['aside'] .= $photo_albums_widget; $tpl = get_markup_template("photos_head.tpl"); diff --git a/view/templates/photo_albums.tpl b/view/templates/photo_albums.tpl new file mode 100644 index 0000000000..02b4392957 --- /dev/null +++ b/view/templates/photo_albums.tpl @@ -0,0 +1,17 @@ + diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index 34d7f1c25c..63322035e1 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -83,6 +83,8 @@ blockquote { margin-right: 5px; } +.pull-right { float: right } + /* nav */ @@ -3367,7 +3369,7 @@ ul.menu-popup { #recip { } -.autocomplete-w1 { background: #ffffff; no-repeat bottom right; position:absolute; top:0px; left:0px; margin:6px 0 0 6px; /* IE6 fix: */ _background:none; _margin:1px 0 0 0; } +.autocomplete-w1 { background: #ffffff no-repeat bottom right; position:absolute; top:0px; left:0px; margin:6px 0 0 6px; /* IE6 fix: */ _background:none; _margin:1px 0 0 0; } .autocomplete { color:#000; border:1px solid #999; background:#FFF; cursor:default; text-align:left; max-height:350px; overflow:auto; margin:-6px 6px 6px -6px; /* IE6 specific: */ _height:350px; _margin:0; _overflow-x:hidden; } .autocomplete .selected { background:#F0F0F0; } .autocomplete div { padding:2px 5px; white-space:nowrap; overflow:hidden; } @@ -3443,7 +3445,7 @@ ul.menu-popup { .nav-ajax-left {margin-left: -1em; margin-top: 0px; } nav #site-location, nav #banner { position: relative; clear:both; } - ul.menu-popup { left: 0px; top 20px; } + ul.menu-popup { left: 0px; top: 20px; } } diff --git a/view/theme/frost/style.css b/view/theme/frost/style.css index 74ae6c90aa..8b87c3bd42 100644 --- a/view/theme/frost/style.css +++ b/view/theme/frost/style.css @@ -21,7 +21,7 @@ body { div.container { display: block; - width: 785 px; + width: 785px; margin-top: 0px; margin-bottom: 0px; margin-left: auto; @@ -111,6 +111,8 @@ blockquote { margin-right: 5px; } +.pull-right { float: right } + /* nav */ @@ -4094,7 +4096,7 @@ ul.notifications-menu-popup { #recip { } -.autocomplete-w1 { background: #ffffff; no-repeat bottom right; position:absolute; top:0px; left:0px; margin:6px 0 0 6px; /* IE6 fix: */ _background:none; _margin:1px 0 0 0; } +.autocomplete-w1 { background: #ffffff no-repeat bottom right; position:absolute; top:0px; left:0px; margin:6px 0 0 6px; /* IE6 fix: */ _background:none; _margin:1px 0 0 0; } .autocomplete { color:#000; border:1px solid #999; background:#FFF; cursor:default; text-align:left; max-height:350px; overflow:auto; margin:-6px 6px 6px -6px; /* IE6 specific: */ _height:350px; _margin:0; _overflow-x:hidden; } .autocomplete .selected { background:#F0F0F0; } .autocomplete div { padding:2px 5px; white-space:nowrap; overflow:hidden; } diff --git a/view/theme/quattro/dark/style.css b/view/theme/quattro/dark/style.css index c8bd7d406b..16d261432e 100644 --- a/view/theme/quattro/dark/style.css +++ b/view/theme/quattro/dark/style.css @@ -414,7 +414,8 @@ a:hover { .left { float: left; } -.right { +.right, +.pull-right { float: right; } .hidden { diff --git a/view/theme/quattro/green/style.css b/view/theme/quattro/green/style.css index 9c18771fff..2073f2ccdd 100644 --- a/view/theme/quattro/green/style.css +++ b/view/theme/quattro/green/style.css @@ -414,7 +414,8 @@ a:hover { .left { float: left; } -.right { +.right, +.pull-right { float: right; } .hidden { diff --git a/view/theme/quattro/lilac/style.css b/view/theme/quattro/lilac/style.css index 97cf540fc2..28e0e107bf 100644 --- a/view/theme/quattro/lilac/style.css +++ b/view/theme/quattro/lilac/style.css @@ -414,7 +414,8 @@ a:hover { .left { float: left; } -.right { +.right, +.pull-right { float: right; } .hidden { diff --git a/view/theme/quattro/quattro.less b/view/theme/quattro/quattro.less index fbfb4bcb30..d38db76486 100644 --- a/view/theme/quattro/quattro.less +++ b/view/theme/quattro/quattro.less @@ -44,7 +44,7 @@ a:visited { color: @LinkVisited; text-decoration: none; } a:hover {color: @LinkHover; text-decoration: underline; } .left { float: left; } -.right { float: right; } +.right, .pull-right { float: right; } .hidden { display: none; } .clear { clear: both; } diff --git a/view/theme/smoothly/style.css b/view/theme/smoothly/style.css index 46d8902aeb..f3ca397284 100644 --- a/view/theme/smoothly/style.css +++ b/view/theme/smoothly/style.css @@ -104,6 +104,8 @@ input[type=submit]:active { top: 1px; } +.pull-right { float: right } + #search-text, #search-submit, #search-save {