]> git.mxchange.org Git - friendica.git/blobdiff - include/items.php
missing $submit
[friendica.git] / include / items.php
index 5c797424bfc634819707791adbfe5b844a0a877b..05134ef8f5e35f68d85cc01129e2bcb881cae143 100755 (executable)
@@ -814,6 +814,12 @@ function item_store($arr,$force_parent = false) {
                        if($r[0]['private'])
                                $arr['private'] = 1;
 
+                       // Edge case. We host a public forum that was originally posted to privately.
+                       // The original author commented, but as this is a comment, the permissions
+                       // weren't fixed up so it will still show the comment as private unless we fix it here. 
+
+                       if((intval($r[0]['forum_mode']) == 1) && (! $r[0]['private']))
+                               $arr['private'] = 0;
                }
                else {
 
@@ -3424,8 +3430,10 @@ function posted_dates($uid,$wall) {
 
        $ret = array();
        while($dnow >= $dthen) {
-               $start_month = datetime_convert('','','first day of ' . $dnow,'Y-m-d');
-               $end_month = datetime_convert('','','last day of ' . $dnow,'Y-m-d');
+               $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 Y'));
                $ret[] = array($str,$end_month,$start_month);
                $dnow = datetime_convert('','',$dnow . ' -1 month', 'Y-m-d');
@@ -3437,12 +3445,6 @@ function posted_dates($uid,$wall) {
 function posted_date_widget($url,$uid,$wall) {
        $o = '';
 
-       // "first day of " constructs were added in php 5.3
-       // TODO: emulate posted_dates() logic for prior releases
-
-       if(version_compare(PHP_VERSION, '5.3.0') < 0)
-               return $o;
-
        // For former Facebook folks that left because of "timeline"
 
        if($wall && intval(get_pconfig($uid,'system','no_wall_archive_widget')))