Calendar_XH 1.4.6 plugin and php 7.07
Moderator: Tata
-
- Posts: 155
- Joined: Thu Oct 06, 2011 7:00 am
Calendar_XH 1.4.6 plugin and php 7.07
I can't save calendar evetns on php 7.07. There were no proplems on my development server running php 5.6 but when the plugin was moved to a server with php 7.07 no event data can be saved, exept of hours. I changed file permmissions to 777 with no results. Any ideas what's changed in php 7.07?
Re: Calendar_XH 1.4.6 plugin and php 7.07
Hi Jerry!
I assume the issue is that PHP 7.0.0 has removed support for the e modifier in preg_replace(). See http://cmsimpleforum.com/viewtopic.php? ... 374#p41374 for a possible fix.
I assume the issue is that PHP 7.0.0 has removed support for the e modifier in preg_replace(). See http://cmsimpleforum.com/viewtopic.php? ... 374#p41374 for a possible fix.
Christoph M. Becker – Plugins for CMSimple_XH
-
- Posts: 155
- Joined: Thu Oct 06, 2011 7:00 am
Re: Calendar_XH 1.4.6 plugin and php 7.07
Removing e parameter from preg_replace solved some, but not all bugs. Events are not highlighted in calendar view and nextevent marquee dosen't contain any data. NMay be I didn't find all preg_replace in the source, but I quess that there are som other changes in php 7 that teases.
Re: Calendar_XH 1.4.6 plugin and php 7.07
I found at least one other issue, namely in includes/calendar.php line 890:simpleSolutions.dk wrote:Removing e parameter from preg_replace solved some, but not all bugs. Events are not highlighted in calendar view and nextevent marquee dosen't contain any data. NMay be I didn't find all preg_replace in the source, but I quess that there are som other changes in php 7 that teases.
Code: Select all
$$event_type_array[$keys]=$i;
Code: Select all
${$event_type_array[$keys]}=$i;
PPS: includes/nextevent.php lines 234-246 have to be changed accordingly:
Code: Select all
array_push($event_1stline_array, ${$calendar_cf['marquee_1stline']});
PPPPS: a hopefully complete diff:
Code: Select all
includes/calendar.php | 2 +-
includes/editevents.php | 24 ++++++++++++------------
includes/nextevent.php | 22 +++++++++++-----------
includes/simplemarkup.php | 4 ++--
4 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/includes/calendar.php b/includes/calendar.php
index 3367a5d..fe7c790 100644
--- a/includes/calendar.php
+++ b/includes/calendar.php
@@ -887,7 +887,7 @@ while ($extramonths < $number) {
)
{
//producing variables ($shortevent, $startevent, $midevent, $endevent. $holiday) that can be filled with a date
- $$event_type_array[$keys]=$i;
+ ${$event_type_array[$keys]}=$i;
// extracting the holiday name
$day_name = $holiday_array[$keys];
diff --git a/includes/editevents.php b/includes/editevents.php
index 88ef61e..e9d2a68 100644
--- a/includes/editevents.php
+++ b/includes/editevents.php
@@ -156,25 +156,25 @@ if ($dataset=='' && !$newfilename) {
//expanding single digit day, months and double digit years (in case datepicker is off)
$datestart[$j] = preg_replace(array(
- '/([\.|\-|\/])(\d)[\.|\-|\/]/e', //single digit months
- '/([\.|\-|\/])(\d\d)$/e', //double digit years
- '/^(\d)([\.|\-|\/])/e' //single digit days
+ '/([\.|\-|\/])(\d)[\.|\-|\/]/', //single digit months
+ '/([\.|\-|\/])(\d\d)$/', //double digit years
+ '/^(\d)([\.|\-|\/])/' //single digit days
),
array(
- "dpSeperator().'0$2'. dpSeperator()",
- "dpSeperator().'20$2'",
- "'0$1'.dpSeperator()"
+ dpSeperator().'0$2'. dpSeperator(),
+ dpSeperator().'20$2',
+ '0$1'.dpSeperator()
),
$datestart[$j]);
$dateend[$j] = preg_replace(array(
- '/([\.|\-|\/])(\d)[\.|\-|\/]/e', //single digit months
- '/([\.|\-|\/])(\d\d)$/e', //double digit years
- '/^(\d)([\.|\-|\/])/e' //single digit days
+ '/([\.|\-|\/])(\d)[\.|\-|\/]/', //single digit months
+ '/([\.|\-|\/])(\d\d)$/', //double digit years
+ '/^(\d)([\.|\-|\/])/' //single digit days
),
array(
- "dpSeperator().'0$2'. dpSeperator()",
- "dpSeperator().'20$2'",
- "'0$1'.dpSeperator()"
+ dpSeperator().'0$2'. dpSeperator(),
+ dpSeperator().'20$2',
+ '0$1'.dpSeperator()
),
$dateend[$j]);
//Checking the date format. Entering ?, ??, -, -- is permitted. Some impossible dates can be given, but don't crash the plugin.
diff --git a/includes/nextevent.php b/includes/nextevent.php
index 0d2768b..2025e33 100644
--- a/includes/nextevent.php
+++ b/includes/nextevent.php
@@ -157,12 +157,12 @@ if(is_file($eventfile))
$age_txt_2 = $calendar_cf['marquee_age']=='2' ? $age_txt:'';
array_push($event_sorting_array, strtotime("$event_month/$event_day/$anniversary 23:59"));
- array_push($event_1stline_array, $$calendar_cf['marquee_1stline'] . $age_txt_1);
+ array_push($event_1stline_array, ${$calendar_cf['marquee_1stline']} . $age_txt_1);
array_push($event_headline_array, $event_day . dpSeperator() . $event_month . dpSeperator() . $anniversary . $age_txt_date);
if($yearly) {
- array_push($event_2ndline_array, $$calendar_cf['marquee_2ndline'] . ' ' . $age_txt_2);
+ array_push($event_2ndline_array, ${$calendar_cf['marquee_2ndline']} . ' ' . $age_txt_2);
} else {
- array_push($event_2ndline_array, $$calendar_cf['marquee_2ndline']);
+ array_push($event_2ndline_array, ${$calendar_cf['marquee_2ndline']});
}
$anniversary++;
$age++;
@@ -192,9 +192,9 @@ if(is_file($eventfile))
if($eventtime) {$headline .= " — " . $eventtime;}
array_push($event_sorting_array, $weekly_event);
- array_push($event_1stline_array, $$calendar_cf['marquee_1stline']);
+ array_push($event_1stline_array, ${$calendar_cf['marquee_1stline']});
array_push($event_headline_array, $headline);
- array_push($event_2ndline_array, $$calendar_cf['marquee_2ndline']);
+ array_push($event_2ndline_array, ${$calendar_cf['marquee_2ndline']});
}
$weekly_event = strtotime("+1 week", $weekly_event);
}
@@ -204,9 +204,9 @@ if(is_file($eventfile))
if($eventtime) {$headline .= " — " . $eventtime;}
array_push($event_sorting_array, $value);
- array_push($event_1stline_array, $$calendar_cf['marquee_1stline']);
+ array_push($event_1stline_array, ${$calendar_cf['marquee_1stline']});
array_push($event_headline_array, $headline);
- array_push($event_2ndline_array, $$calendar_cf['marquee_2ndline']);
+ array_push($event_2ndline_array, ${$calendar_cf['marquee_2ndline']});
}
}
}
@@ -231,9 +231,9 @@ if(is_file($eventfile))
} else {
array_push($event_sorting_array, $start);
}
- array_push($event_1stline_array, $$calendar_cf['marquee_1stline']);
+ array_push($event_1stline_array, ${$calendar_cf['marquee_1stline']});
array_push($event_headline_array, /*'<b>normal</b>' .*/ $txt);
- array_push($event_2ndline_array, $$calendar_cf['marquee_2ndline']);
+ array_push($event_2ndline_array, ${$calendar_cf['marquee_2ndline']});
if($additional) {
foreach ($additionaldatesarray as $value) {
@@ -241,9 +241,9 @@ if(is_file($eventfile))
if($eventtime) {$headline .= " — " . $eventtime;}
array_push($event_sorting_array, $value);
- array_push($event_1stline_array, $$calendar_cf['marquee_1stline']);
+ array_push($event_1stline_array, ${$calendar_cf['marquee_1stline']});
array_push($event_headline_array, $headline);
- array_push($event_2ndline_array, $$calendar_cf['marquee_2ndline']);
+ array_push($event_2ndline_array, ${$calendar_cf['marquee_2ndline']});
}
}
diff --git a/includes/simplemarkup.php b/includes/simplemarkup.php
index 1a690dc..2a98635 100644
--- a/includes/simplemarkup.php
+++ b/includes/simplemarkup.php
@@ -82,7 +82,7 @@ function simpleMarkupToHtml($text)
'/(\\\)\*/', //7 - escaped *
'/\s*\n*\s*$/', //12- delete all empty lines at the end
- '/\n/e' //13- transform any remaining line breaks to <br>
+ '/\n/' //13- transform any remaining line breaks to <br>
);
$replacement = array(
@@ -95,7 +95,7 @@ function simpleMarkupToHtml($text)
'*', //7 - *
'', //12- no empty lines at the end
- "tag('br')" //13- replace line breaks by <br>
+ tag('br') //13- replace line breaks by <br>
);
$text = preg_replace($pattern, $replacement, $text);
Last edited by cmb on Wed Jun 01, 2016 12:25 pm, edited 5 times in total.
Reason: added PS, PPS, PPPS and PPPPS
Reason: added PS, PPS, PPPS and PPPPS
Christoph M. Becker – Plugins for CMSimple_XH
Re: Calendar_XH 1.4.6 plugin and php 7.07
When about may be the PHP7 compatible version available?
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: Calendar_XH 1.4.6 plugin and php 7.07
svasti is still short of time, so we have moved the Calendar plugin on Github for the time being. A new version which is supposed to solve the PHP 7 incompatibilities is available.Tata wrote:When about may be the PHP7 compatible version available?
As the URL of the version.nfo for the Update-Check has been changed, users of 1.4.6 won't get notified for now, so spread the word!
Happy calendaring!
Christoph M. Becker – Plugins for CMSimple_XH
Re: Calendar_XH 1.4.6 plugin and php 7.07
Thanx a lot. It works fine. I just need to complete the translation.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: Calendar_XH 1.4.6 plugin and php 7.07
I have found one more thing:
If using the function editevents directly without loging in, the imagemanager doesn't work. The dialogue window opens, but this is the last step. Not yet tested on server. But locally it definitely doesn't work. No big problem, just to let you know.
If using the function editevents directly without loging in, the imagemanager doesn't work. The dialogue window opens, but this is the last step. Not yet tested on server. But locally it definitely doesn't work. No big problem, just to let you know.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Re: Calendar_XH 1.4.6 plugin and php 7.07
That is a documented limitation. From the help file:Tata wrote:If using the function editevents directly without loging in, the imagemanager doesn't work. The dialogue window opens, but this is the last step. Not yet tested on server. But locally it definitely doesn't work. No big problem, just to let you know.
I'm afraid this can't be easily improved.You may want to offer selected visitors to your site the possibility to enter events. Just put {{{PLUGIN:editevents();}}} on the page. For security reasons the filebrowser is disabled so that visitors are prevented from deleting or uploading files.
Christoph M. Becker – Plugins for CMSimple_XH
Re: Calendar_XH 1.4.6 plugin and php 7.07
It's OK so. I don't need memberspages/register on that website. It has basically only one admin, resp. two. And they are chief/subordinate. So they securly may use a regular login in the case that images shall be put in events plan. Otherways the editevent can be used. The page with editevent has difficultly detectable name.
Or - in other case - I can install memberpages and put membersloginform directly to the editeventpage.
Or - in other case - I can install memberpages and put membersloginform directly to the editeventpage.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.