From c8378260bc28ba09b62155f997695f0eaa24c5ca Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Sun, 8 Jul 2012 08:46:46 -0600 Subject: [PATCH 1/4] check for posted dates based on month only --- include/items.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/items.php b/include/items.php index 36a027eec..e656fc244 100755 --- a/include/items.php +++ b/include/items.php @@ -3621,7 +3621,9 @@ function posted_dates($uid,$wall) { $dnow = substr($dthen,0,8) . '28'; $ret = array(); - while($dnow >= $dthen) { + // 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)) { $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'); From 9fbe921051adec1517e2ded8122033bc3d11ea85 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Sun, 8 Jul 2012 09:18:05 -0600 Subject: [PATCH 2/4] auto-orient uploaded wall photos and profile photos also --- include/Photo.php | 2 +- mod/photos.php | 3 +-- mod/profile_photo.php | 7 +++++++ mod/wall_upload.php | 7 +++++++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/include/Photo.php b/include/Photo.php index 3af1691ee..f07019e71 100644 --- a/include/Photo.php +++ b/include/Photo.php @@ -143,7 +143,7 @@ class Photo { public function orient($filename) { // based off comment on http://php.net/manual/en/function.imagerotate.php - if(! function_exists('exif_read_data')) + if( (! function_exists('exif_read_data')) || ($this->getType() === 'image/png') ) return; $exif = exif_read_data($filename); diff --git a/mod/photos.php b/mod/photos.php index 42cad42f9..624f0bdca 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -740,8 +740,7 @@ function photos_post(&$a) { killme(); } - if($ph->getType() != 'image/png') - $ph->orient($src); + $ph->orient($src); @unlink($src); $max_length = get_config('system','max_image_length'); diff --git a/mod/profile_photo.php b/mod/profile_photo.php index e44707f9b..67b2c4ab4 100644 --- a/mod/profile_photo.php +++ b/mod/profile_photo.php @@ -128,6 +128,7 @@ function profile_photo_post(&$a) { return; } + $ph->orient($src); @unlink($src); return profile_photo_crop_ui_head($a, $ph); @@ -237,6 +238,12 @@ function profile_photo_content(&$a) { if(! function_exists('_crop_ui_head')) { function profile_photo_crop_ui_head(&$a, $ph){ + $max_length = get_config('system','max_image_length'); + if(! $max_length) + $max_length = MAX_IMAGE_LENGTH; + if($max_length > 0) + $ph->scaleImage($max_length); + $width = $ph->getWidth(); $height = $ph->getHeight(); diff --git a/mod/wall_upload.php b/mod/wall_upload.php index 5990f2834..07d97d17a 100644 --- a/mod/wall_upload.php +++ b/mod/wall_upload.php @@ -101,8 +101,15 @@ function wall_upload_post(&$a) { killme(); } + $ph->orient($src); @unlink($src); + $max_length = get_config('system','max_image_length'); + if(! $max_length) + $max_length = MAX_IMAGE_LENGTH; + if($max_length > 0) + $ph->scaleImage($max_length); + $width = $ph->getWidth(); $height = $ph->getHeight(); From fb4295f07f6c4a98147936b4442d69d88989d720 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Sun, 8 Jul 2012 11:17:50 -0600 Subject: [PATCH 3/4] better check for image EXIF support --- include/Photo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Photo.php b/include/Photo.php index f07019e71..ba4241a7b 100644 --- a/include/Photo.php +++ b/include/Photo.php @@ -143,7 +143,7 @@ class Photo { public function orient($filename) { // based off comment on http://php.net/manual/en/function.imagerotate.php - if( (! function_exists('exif_read_data')) || ($this->getType() === 'image/png') ) + if( (! function_exists('exif_read_data')) || ($this->getType() !== 'image/jpeg') ) return; $exif = exif_read_data($filename); From f47585073974339b607f93b70391c09c35da6947 Mon Sep 17 00:00:00 2001 From: tomtom84 Date: Sun, 8 Jul 2012 21:50:17 +0200 Subject: [PATCH 4/4] diabook: add notification in website-title, whenever new notifications arrive --- view/theme/diabook/bottom.tpl | 12 ++++++++++++ view/theme/diabook/nav.tpl | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/view/theme/diabook/bottom.tpl b/view/theme/diabook/bottom.tpl index 50a15788d..0ab7de78e 100644 --- a/view/theme/diabook/bottom.tpl +++ b/view/theme/diabook/bottom.tpl @@ -42,6 +42,7 @@ $(document).ready(function() { }); + function tautogrow(id){ $("textarea#comment-edit-text-" +id).autogrow(); }; @@ -128,6 +129,17 @@ $(document).ready(function() { function cmtBbClose(id) { $(".comment-edit-bb-" + id).hide(); } + + $(document).ready(function(){ + var doctitle = document.title; + function checkNotify() { + if(document.getElementById("notify-update").innerHTML != "") + document.title = "("+document.getElementById("notify-update").innerHTML+") " + doctitle; + else + document.title = doctitle; + }; + setInterval(function () {checkNotify();}, 10 * 1000); + }) diff --git a/view/theme/diabook/nav.tpl b/view/theme/diabook/nav.tpl index 4165656bd..1424c0e39 100644 --- a/view/theme/diabook/nav.tpl +++ b/view/theme/diabook/nav.tpl @@ -137,7 +137,7 @@ -
$langselector
+
$langselector