X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=blackout%2Fblackout.php;h=3678969e340e7f689f522acfeab1946525657fb8;hb=a56448895fcfa31c8d0c0443c5c2116c7e2e791e;hp=ffd59dca64991d1fc131d898e3b3feb54381b7d6;hpb=858758e92c5d8c1c41e188284fea53ae50fb0855;p=friendica-addons.git diff --git a/blackout/blackout.php b/blackout/blackout.php index ffd59dca..3678969e 100644 --- a/blackout/blackout.php +++ b/blackout/blackout.php @@ -1,10 +1,10 @@ = 5.3 * License: MIT * Version: 1.0 - * Author: Tobias Diekershoff + * Author: Tobias Diekershoff * * About * ===== @@ -62,6 +62,10 @@ function blackout_redirect ($a, $b) { if (local_user()) { return true; } + + if (! (version_compare(PHP_VERSION, '5.3.0') >= 0)) + return true; + // else... $mystart = get_config('blackout','begindate'); $myend = get_config('blackout','enddate'); @@ -89,9 +93,10 @@ function blackout_plugin_admin(&$a, &$o) { if (! is_string($myend)) { $myend = "YYYY-MM-DD:hhmm"; } $myurl = get_config('blackout','url'); if (! is_string($myurl)) { $myurl = "http://www.example.com"; } - $t = file_get_contents( dirname(__file__)."/admin.tpl" ); - $o = replace_macros($t, array( - '$submit' => t('Submit'), + $t = get_markup_template( "admin.tpl", "addon/blackout/" ); + + $o = replace_macros($t, array( + '$submit' => t('Save Settings'), '$rurl' => array("rurl", "Redirect URL", $myurl, "all your visitors from the web will be redirected to this URL"), '$startdate' => array("startdate", "Begin of the Blackout
(YYYY-MM-DD hh:mm)", $mystart, "format is YYYY year, MM month, DD day, hh hour and mm minute"), '$enddate' => array("enddate", "End of the Blackout
(YYYY-MM-DD hh:mm)", $myend, ""),