From 30348a1bc0b52c5b4cbfd2843214c53c9278111c Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Tue, 19 May 2015 01:03:08 +0200 Subject: [PATCH 1/4] port of red matrix archive-widget --- include/items.php | 51 +++++++++++++++++++++++--- view/templates/posted_date_widget.tpl | 52 +++++++++++++++++++++++---- view/theme/duepuntozero/style.css | 4 +-- view/theme/frost/style.css | 4 +-- view/theme/quattro/dark/style.css | 3 ++ view/theme/quattro/green/style.css | 3 ++ view/theme/quattro/lilac/style.css | 3 ++ view/theme/smoothly/style.css | 9 ++--- view/theme/vier/style.css | 6 +++- 9 files changed, 113 insertions(+), 22 deletions(-) diff --git a/include/items.php b/include/items.php index 5a0aa9ed51..85d02ab60d 100644 --- a/include/items.php +++ b/include/items.php @@ -4858,6 +4858,37 @@ function first_post_date($uid,$wall = false) { return false; } +/* modified posted_dates() {below} to arrange the list in years */ +function list_post_dates($uid, $wall) { + $dnow = datetime_convert('',date_default_timezone_get(),'now','Y-m-d'); + + $dthen = first_post_date($uid, $wall); + if(! $dthen) + return array(); + + // Set the start and end date to the beginning of the month + $dnow = substr($dnow,0,8).'01'; + $dthen = substr($dthen,0,8).'01'; + + $ret = array(); + + // Starting with the current month, get the first and last days of every + // month down to and including the month of the first post + while(substr($dnow, 0, 7) >= substr($dthen, 0, 7)) { + $dyear = intval(substr($dnow,0,4)); + $dstart = substr($dnow,0,8) . '01'; + $dend = substr($dnow,0,8) . get_dim(intval($dnow),intval(substr($dnow,5))); + $start_month = datetime_convert('','',$dstart,'Y-m-d'); + $end_month = datetime_convert('','',$dend,'Y-m-d'); + $str = day_translate(datetime_convert('','',$dnow,'F')); + if(! $ret[$dyear]) + $ret[$dyear] = array(); + $ret[$dyear][] = array($str,$end_month,$start_month); + $dnow = datetime_convert('','',$dnow . ' -1 month', 'Y-m-d'); + } + return $ret; +} + function posted_dates($uid,$wall) { $dnow = datetime_convert('',date_default_timezone_get(),'now','Y-m-d'); @@ -4895,16 +4926,28 @@ function posted_date_widget($url,$uid,$wall) { /* if($wall && intval(get_pconfig($uid,'system','no_wall_archive_widget'))) return $o;*/ - - $ret = posted_dates($uid,$wall); + + $visible_years = get_pconfig($uid,'system','archive_visible_years'); + if(! $visible_years) + $visible_years = 5; + + $ret = list_post_dates($uid,$wall); + if(! count($ret)) return $o; + $cutoff_year = intval(datetime_convert('',date_default_timezone_get(),'now','Y')) - $visible_years; + $cutoff = ((array_key_exists($cutoff_year,$ret))? true : false); + $o = replace_macros(get_markup_template('posted_date_widget.tpl'),array( '$title' => t('Archives'), - '$size' => ((count($ret) > 6) ? 6 : count($ret)), + '$size' => $visible_years, + '$cutoff_year' => $cutoff_year, + '$cutoff' => $cutoff, '$url' => $url, - '$dates' => $ret + '$dates' => $ret, + '$showmore' => t('show more') + )); return $o; } diff --git a/view/templates/posted_date_widget.tpl b/view/templates/posted_date_widget.tpl index 009fa60a65..878b1d3605 100644 --- a/view/templates/posted_date_widget.tpl +++ b/view/templates/posted_date_widget.tpl @@ -1,9 +1,47 @@ + + +

{{$title}}

- - -
+ + + + + {{/if}} + + \ No newline at end of file diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index 1b20042a5d..024e63f5f6 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -2026,11 +2026,11 @@ a.mail-list-link { margin-top: 10px; } -.nets-ul, .fileas-ul, .categories-ul { +.nets-ul, .fileas-ul, .categories-ul, .datebrowse-ul { list-style-type: none; } -.nets-ul li, .fileas-ul li, .categories-ul li { +.nets-ul li, .fileas-ul li, .categories-ul li, .datebrowse-ul li { margin-top: 10px; } diff --git a/view/theme/frost/style.css b/view/theme/frost/style.css index aed0dc0ab1..74ae6c90aa 100644 --- a/view/theme/frost/style.css +++ b/view/theme/frost/style.css @@ -2327,11 +2327,11 @@ a.mail-list-link { margin-top: 10px; } -.nets-ul, .fileas-ul, .categories-ul { +.nets-ul, .fileas-ul, .categories-ul, .datebrowse-ul { list-style-type: none; } -.nets-ul li, .fileas-ul li, .categories-ul li { +.nets-ul li, .fileas-ul li, .categories-ul li, .datebrowse-ul li { margin-top: 10px; } diff --git a/view/theme/quattro/dark/style.css b/view/theme/quattro/dark/style.css index 5f4b005c8e..a1555565d2 100644 --- a/view/theme/quattro/dark/style.css +++ b/view/theme/quattro/dark/style.css @@ -840,6 +840,9 @@ aside #dfrn-request-link:hover { aside #profiles-menu { width: 20em; } +aside .posted-date-selector-months { + margin-left: 10px; +} #contact-block { overflow: auto; height: auto; diff --git a/view/theme/quattro/green/style.css b/view/theme/quattro/green/style.css index c2826a3c0c..ef6b16aad3 100644 --- a/view/theme/quattro/green/style.css +++ b/view/theme/quattro/green/style.css @@ -840,6 +840,9 @@ aside #dfrn-request-link:hover { aside #profiles-menu { width: 20em; } +aside .posted-date-selector-months { + margin-left: 10px; +} #contact-block { overflow: auto; height: auto; diff --git a/view/theme/quattro/lilac/style.css b/view/theme/quattro/lilac/style.css index 28c5cd47a9..2d4f7cec6c 100644 --- a/view/theme/quattro/lilac/style.css +++ b/view/theme/quattro/lilac/style.css @@ -840,6 +840,9 @@ aside #dfrn-request-link:hover { aside #profiles-menu { width: 20em; } +aside .posted-date-selector-months { + margin-left: 10px; +} #contact-block { overflow: auto; height: auto; diff --git a/view/theme/smoothly/style.css b/view/theme/smoothly/style.css index d9dba9818c..46d8902aeb 100644 --- a/view/theme/smoothly/style.css +++ b/view/theme/smoothly/style.css @@ -945,13 +945,14 @@ ul .sidebar-group-li .icon { width: 12px; } -.nets-ul, .fileas-ul, .categories-ul { +.nets-ul, .fileas-ul, .categories-ul, .datebrowse-ul { list-style-type: none; } .nets-ul li, .fileas-ul li, -.categories-ul li { +.categories-ul li, +.datebrowse-link { } .nets-link { @@ -4605,10 +4606,6 @@ div #datebrowse-sidebar.widget { #id_npassword {} -#posted-date-selector { - margin-left: 33px; -} - #hide-comments-page-widget { margin-left: 40px; } diff --git a/view/theme/vier/style.css b/view/theme/vier/style.css index 779a194dd8..e75934c8c5 100644 --- a/view/theme/vier/style.css +++ b/view/theme/vier/style.css @@ -427,12 +427,16 @@ a.sidebar-group-element { color: #737373; } -#follow-sidebar form, #peoplefind-sidebar form, #netsearch-box form, #posted-date-selector { +#follow-sidebar form, #peoplefind-sidebar form, #netsearch-box form { margin-left: 10px; margin-top: 3px; margin-bottom: 3px; } +.posted-date-selector-months { + margin-left: 10px; +} + #sidebar-ungrouped, .side-link { padding-top: 5px; } From 101804d505acd20fcb1fc8744d4d79fcb8d350db Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Tue, 19 May 2015 01:07:40 +0200 Subject: [PATCH 2/4] minor polishing --- view/templates/posted_date_widget.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/templates/posted_date_widget.tpl b/view/templates/posted_date_widget.tpl index 878b1d3605..c4c9937e66 100644 --- a/view/templates/posted_date_widget.tpl +++ b/view/templates/posted_date_widget.tpl @@ -44,4 +44,4 @@ function showHideDates() { {{/if}} - \ No newline at end of file + From 9c803f7dbb298c5880fef690fe4f48bc38da64f7 Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Sat, 23 May 2015 17:45:44 +0200 Subject: [PATCH 3/4] quattro css changes added to the less file --- view/theme/quattro/dark/style.css | 7 ------- view/theme/quattro/green/style.css | 7 ------- view/theme/quattro/lilac/style.css | 7 ------- view/theme/quattro/quattro.less | 2 ++ 4 files changed, 2 insertions(+), 21 deletions(-) diff --git a/view/theme/quattro/dark/style.css b/view/theme/quattro/dark/style.css index a1555565d2..8ab307a1cc 100644 --- a/view/theme/quattro/dark/style.css +++ b/view/theme/quattro/dark/style.css @@ -514,7 +514,6 @@ header { margin: 0px; padding: 0px; /*width: 100%; height: 12px; */ - z-index: 110; color: #ffffff; } @@ -847,7 +846,6 @@ aside .posted-date-selector-months { overflow: auto; height: auto; /*.contact-block-div { width:60px; height: 60px; }*/ - } #contact-block .contact-block-h4 { float: left; @@ -929,7 +927,6 @@ aside .posted-date-selector-months { margin-bottom: 2em; /*.action .s10 { width: 10px; overflow: hidden; padding: 0px;} .action .s16 { width: 16px; overflow: hidden; padding: 0px;}*/ - } .widget h3 { padding: 0px; @@ -1211,7 +1208,6 @@ section { height: 32px; margin-left: 16px; /*background: url(../../../images/icons/22/user.png) no-repeat center center;*/ - } .comment-edit-preview .contact-photo-menu-button { top: 15px !important; @@ -1286,9 +1282,6 @@ section { opacity: 0.5; }*/ .wwto { - position: absolute !important; - width: 25px; - height: 25px; background: #FFFFFF; border: 2px solid #364e59; height: 25px; diff --git a/view/theme/quattro/green/style.css b/view/theme/quattro/green/style.css index ef6b16aad3..cd492d2668 100644 --- a/view/theme/quattro/green/style.css +++ b/view/theme/quattro/green/style.css @@ -514,7 +514,6 @@ header { margin: 0px; padding: 0px; /*width: 100%; height: 12px; */ - z-index: 110; color: #ffffff; } @@ -847,7 +846,6 @@ aside .posted-date-selector-months { overflow: auto; height: auto; /*.contact-block-div { width:60px; height: 60px; }*/ - } #contact-block .contact-block-h4 { float: left; @@ -929,7 +927,6 @@ aside .posted-date-selector-months { margin-bottom: 2em; /*.action .s10 { width: 10px; overflow: hidden; padding: 0px;} .action .s16 { width: 16px; overflow: hidden; padding: 0px;}*/ - } .widget h3 { padding: 0px; @@ -1211,7 +1208,6 @@ section { height: 32px; margin-left: 16px; /*background: url(../../../images/icons/22/user.png) no-repeat center center;*/ - } .comment-edit-preview .contact-photo-menu-button { top: 15px !important; @@ -1286,9 +1282,6 @@ section { opacity: 0.5; }*/ .wwto { - position: absolute !important; - width: 25px; - height: 25px; background: #FFFFFF; border: 2px solid #364e59; height: 25px; diff --git a/view/theme/quattro/lilac/style.css b/view/theme/quattro/lilac/style.css index 2d4f7cec6c..73bbd6e587 100644 --- a/view/theme/quattro/lilac/style.css +++ b/view/theme/quattro/lilac/style.css @@ -514,7 +514,6 @@ header { margin: 0px; padding: 0px; /*width: 100%; height: 12px; */ - z-index: 110; color: #ffffff; } @@ -847,7 +846,6 @@ aside .posted-date-selector-months { overflow: auto; height: auto; /*.contact-block-div { width:60px; height: 60px; }*/ - } #contact-block .contact-block-h4 { float: left; @@ -929,7 +927,6 @@ aside .posted-date-selector-months { margin-bottom: 2em; /*.action .s10 { width: 10px; overflow: hidden; padding: 0px;} .action .s16 { width: 16px; overflow: hidden; padding: 0px;}*/ - } .widget h3 { padding: 0px; @@ -1211,7 +1208,6 @@ section { height: 32px; margin-left: 16px; /*background: url(../../../images/icons/22/user.png) no-repeat center center;*/ - } .comment-edit-preview .contact-photo-menu-button { top: 15px !important; @@ -1286,9 +1282,6 @@ section { opacity: 0.5; }*/ .wwto { - position: absolute !important; - width: 25px; - height: 25px; background: #FFFFFF; border: 2px solid #364e59; height: 25px; diff --git a/view/theme/quattro/quattro.less b/view/theme/quattro/quattro.less index 172fad31b5..7309fd6d39 100644 --- a/view/theme/quattro/quattro.less +++ b/view/theme/quattro/quattro.less @@ -353,6 +353,8 @@ aside { } #profiles-menu { width: 20em; } + + .posted-date-selector-months { margin-left: 10px; } } From 76283ff205b446524f522a116347538dc3c20efb Mon Sep 17 00:00:00 2001 From: rabuzarus Date: Sat, 23 May 2015 17:50:18 +0200 Subject: [PATCH 4/4] cleanup quattro less file --- view/theme/quattro/dark/style.css | 2 +- view/theme/quattro/green/style.css | 2 +- view/theme/quattro/lilac/style.css | 2 +- view/theme/quattro/quattro.less | 206 +++++++++++++---------------- 4 files changed, 98 insertions(+), 114 deletions(-) diff --git a/view/theme/quattro/dark/style.css b/view/theme/quattro/dark/style.css index 8ab307a1cc..1ec672d227 100644 --- a/view/theme/quattro/dark/style.css +++ b/view/theme/quattro/dark/style.css @@ -1282,13 +1282,13 @@ section { opacity: 0.5; }*/ .wwto { + position: absolute !important; background: #FFFFFF; border: 2px solid #364e59; height: 25px; width: 25px; overflow: hidden; padding: 1px; - position: absolute !important; top: 40px; left: 30px; -webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.7); diff --git a/view/theme/quattro/green/style.css b/view/theme/quattro/green/style.css index cd492d2668..89dc3dad86 100644 --- a/view/theme/quattro/green/style.css +++ b/view/theme/quattro/green/style.css @@ -1282,13 +1282,13 @@ section { opacity: 0.5; }*/ .wwto { + position: absolute !important; background: #FFFFFF; border: 2px solid #364e59; height: 25px; width: 25px; overflow: hidden; padding: 1px; - position: absolute !important; top: 40px; left: 30px; -webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.7); diff --git a/view/theme/quattro/lilac/style.css b/view/theme/quattro/lilac/style.css index 73bbd6e587..11adc44b92 100644 --- a/view/theme/quattro/lilac/style.css +++ b/view/theme/quattro/lilac/style.css @@ -1282,13 +1282,13 @@ section { opacity: 0.5; }*/ .wwto { + position: absolute !important; background: #FFFFFF; border: 2px solid #364e59; height: 25px; width: 25px; overflow: hidden; padding: 1px; - position: absolute !important; top: 40px; left: 30px; -webkit-box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.7); diff --git a/view/theme/quattro/quattro.less b/view/theme/quattro/quattro.less index 7309fd6d39..dded1514a5 100644 --- a/view/theme/quattro/quattro.less +++ b/view/theme/quattro/quattro.less @@ -12,9 +12,9 @@ body { h4 { font-size: 1.1em } .shadow(@x: 0px, @y: 5px){ - -webkit-box-shadow:@x @y 10px rgba(0, 0, 0, 0.7); - -moz-box-shadow:@x @y 10px rgba(0, 0, 0, 0.7); - box-shadow:@x @y 10px rgba(0, 0, 0, 0.7); + -webkit-box-shadow:@x @y 10px rgba(0, 0, 0, 0.7); + -moz-box-shadow:@x @y 10px rgba(0, 0, 0, 0.7); + box-shadow:@x @y 10px rgba(0, 0, 0, 0.7); } .rounded(@tr: 5px, @tl: 5px, @bl: 5px, @br: 5px){ @@ -52,10 +52,10 @@ a:hover {color: @LinkHover; text-decoration: underline; } .fakelink:hover { color: @LinkHover; text-decoration: underline; } blockquote { - background:@BlockquoteBackgroundColor; - padding: 1em; - margin-left: 1em; - border-left: 1em solid @BlockquoteBorderColor; + background:@BlockquoteBackgroundColor; + padding: 1em; + margin-left: 1em; + border-left: 1em solid @BlockquoteBorderColor; } @@ -86,9 +86,7 @@ code { } - /* tool */ - .tool { height: auto; overflow: auto; .label { float: left;} @@ -97,8 +95,6 @@ code { } - - /* popup notifications */ #jGrowl.top-right { top: 30px; @@ -144,6 +140,7 @@ header { #logo-text { font-size: 22px } } } + /* nav */ nav { width: 100%; height: 32px; @@ -223,7 +220,7 @@ nav { #nav-notifications-linkmenu.on .icon.s22.notify, #nav-notifications-linkmenu.selected .icon.s22.notify { background-image: url("../../../images/icons/22/notify_on.png") } - #nav-introductions-link.on .icon.s22.intro, + #nav-introductions-link.on .icon.s22.intro, #nav-introductions-link.selected .icon.s22.intro { background-image: url("icons/contacts_on.png") } #nav-messages-link.on .icon.s22.mail, #nav-messages-link.selected .icon.s22.mail { background-image: url("icons/messages_on.png") } @@ -302,8 +299,6 @@ ul.menu-popup { } - - /* aside 230px*/ aside { display: table-cell; @@ -355,8 +350,6 @@ aside { #profiles-menu { width: 20em; } .posted-date-selector-months { margin-left: 10px; } - - } #contact-block { @@ -667,72 +660,70 @@ section { }*/ .wwto { - position: absolute !important; - width: 25px; height: 25px; - background: #FFFFFF; - border: 2px solid @Metalic3; - height: 25px; - width: 25px; - overflow: hidden; - padding: 1px; - position: absolute !important; - top: 40px; - left: 30px; - - .shadow(0px, 0px) + position: absolute !important; + background: #FFFFFF; + border: 2px solid @Metalic3; + height: 25px; + width: 25px; + overflow: hidden; + padding: 1px; + top: 40px; + left: 30px; + + .shadow(0px, 0px); } .wwto .contact-photo { width: 25px; height: 25px; } /* reshare e embed */ .wall-item-container .wall-item-content .type-link img, .type-link img { - max-width: 160px; - max-height: 160px; - float: left; - margin-right: 10px; + max-width: 160px; + max-height: 160px; + float: left; + margin-right: 10px; - &.attachment-image { - max-width: 650px; - max-height: inital; - float: none; - margin-right: 0px; - } + &.attachment-image { + max-width: 650px; + max-height: inital; + float: none; + margin-right: 0px; + } } .type-link { - blockquote { - margin: 1em 0px; - max-height: 160px; - overflow: hidden; - padding-left: 1em; - } - .oembed {} + blockquote { + margin: 1em 0px; + max-height: 160px; + overflow: hidden; + padding-left: 1em; + } + .oembed {} } .type-video blockquote { padding-left: 1em; } .shared_header { - height: 32px; - color: #999; - border-top: 1px solid @ThreadBottomBorderColor; - padding-top: 5px; - margin-top: 5px; - - img { - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - float: left; - } - - span { margin-left: 9px; } + height: 32px; + color: #999; + border-top: 1px solid @ThreadBottomBorderColor; + padding-top: 5px; + margin-top: 5px; + + img { + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + float: left; + } + + span { margin-left: 9px; } } blockquote.shared_content { - margin-left: 32px; - color: #000; - border: none; + margin-left: 32px; + color: #000; + border: none; } @@ -800,21 +791,21 @@ blockquote.shared_content { /*.threaded .hide-comments-outer { margin-left: 20px; }*/ span[id^="showmore-teaser"]{ - background: url("showmore-bg.jpg") no-repeat center bottom; + background: url("showmore-bg.jpg") no-repeat center bottom; } span[id^="showmore-wrap"] { - border-top: 1px solid #999999; - color: #999999; - display: block; - text-align: center; - background-color: @ThreadBackgroundColor; + border-top: 1px solid #999999; + color: #999999; + display: block; + text-align: center; + background-color: @ThreadBackgroundColor; } #pause { - position: fixed; - bottom: 5px; - right: 5px; + position: fixed; + bottom: 5px; + right: 5px; } @@ -900,8 +891,7 @@ span[id^="showmore-wrap"] { #jot { width: 100%; - margin: 0px 2em 20px 0px; - + margin: 0px 2em 20px 0px; .profile-jot-text { height: 1em; width: 99%; font-size: 10px; @@ -1041,7 +1031,6 @@ span[id^="showmore-wrap"] { } - #acl-wrapper { width: 690px; float:left; @@ -1183,7 +1172,6 @@ ul.tabs { overflow: auto; width: 100%; - label { float: left; width: 200px; @@ -1205,7 +1193,6 @@ ul.tabs { } - .onoff { float: left; width: 80px; @@ -1294,7 +1281,7 @@ ul.tabs { #profile-edit-pubkeywords, #profile-edit-prvkeywords, #profile-edit-homepage { - margin-top: 5px; + margin-top: 5px; } /* oauth */ @@ -1511,8 +1498,8 @@ ul.tabs { footer { height: 100px; display: table-row; } .pager { - margin-top: 25px; - clear: both; + margin-top: 25px; + clear: both; } /** @@ -1590,7 +1577,6 @@ footer { height: 100px; display: table-row; } } /* edit buttons for comments */ - .icon.dim { opacity: 0.3;filter:alpha(opacity=30); } .comment-edit-bb { list-style: none; @@ -1606,12 +1592,12 @@ footer { height: 100px; display: table-row; } } .editicon { - display: inline-block; - width: 16px; - height: 16px; - background-image: url(icons/bbedit.png); - text-decoration: none; - :hover {background-color: #ccc;} + display: inline-block; + width: 16px; + height: 16px; + background-image: url(icons/bbedit.png); + text-decoration: none; + :hover {background-color: #ccc;} } .boldbb { background-position: 0px 0px; } .boldbb:hover { background-position: 0px -16px; } @@ -1634,37 +1620,36 @@ footer { height: 100px; display: table-row; } /** range input css **/ /* slider root element */ .slider { - height:2px; - position:relative; - cursor:pointer; - border:1px solid #333; - width:200px; - margin:10px 0px 10px 0px; - float: left; + height:2px; + position:relative; + cursor:pointer; + border:1px solid #333; + width:200px; + margin:10px 0px 10px 0px; + float: left; } /* progress bar (enabled with progress: true) */ .progress { - height:9px; - background-color:#C5FF00; - display:none; - opacity:0.6; + height:9px; + background-color:#C5FF00; + display:none; + opacity:0.6; } /* drag handle */ .handle { - background-color:#ccc; - height:16px; - width:8px; - top:-8px; - position:absolute; - display:block; - margin-top:1px; - border:1px solid #000; - cursor:move; - .roundbottom(); - .shadow(); - + background-color:#ccc; + height:16px; + width:8px; + top:-8px; + position:absolute; + display:block; + margin-top:1px; + border:1px solid #000; + cursor:move; + .roundbottom(); + .shadow(); } /* the input field */ @@ -1675,4 +1660,3 @@ footer { height: 100px; display: table-row; } border: 0px; color: @FieldHelpColor; } -