]> git.mxchange.org Git - friendica-addons.git/blobdiff - public_server/public_server.php
Remove references to include/bbcode.php
[friendica-addons.git] / public_server / public_server.php
index 1b30b40b3e490cf6ea54689ae1cfd17e643282c2..a5c4cec7ef0a31e25943bf53182098364ff13e20 100644 (file)
@@ -5,10 +5,12 @@
  * Version: 1.1
  * Author: Keith Fernie <http://friendika.me4.it/profile/keith>
  */
+
 use Friendica\Core\Addon;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
 use Friendica\Model\User;
+use Friendica\Util\DateTimeFormat;
 
 function public_server_install() {
 
@@ -37,7 +39,7 @@ function public_server_register_account($a,$b) {
                return;
 
        $r = q("UPDATE user set account_expires_on = '%s', expire = %d where uid = %d",
-               dbesc(datetime_convert('UTC','UTC','now +' . $days . ' days')),
+               dbesc(DateTimeFormat::utc('now +' . $days . ' days')),
                intval($days_posts),
                intval($uid)
        );
@@ -67,7 +69,7 @@ function public_server_cron($a,$b) {
                        ]);
 
                        q("update user set expire_notification_sent = '%s' where uid = %d",
-                               dbesc(datetime_convert()),
+                               dbesc(DateTimeFormat::utcNow()),
                                intval($rr['uid'])
                        );
                }
@@ -85,7 +87,7 @@ function public_server_cron($a,$b) {
                if(count($r)) {
                        foreach($r as $rr)
                                q("update user set account_expires_on = '%s' where uid = %d",
-                                       dbesc(datetime_convert('UTC','UTC','now +' . '6 days')),
+                                       dbesc(DateTimeFormat::utc('now +' . '6 days')),
                                        intval($rr['uid'])
                        );
                }
@@ -98,7 +100,7 @@ function public_server_cron($a,$b) {
                if(count($r)) {
                        foreach($r as $rr)
                                q("update user set account_expires_on = '%s' where uid = %d",
-                                       dbesc(datetime_convert('UTC','UTC','now +' . '6 days')),
+                                       dbesc(DateTimeFormat::utc('now +' . '6 days')),
                                        intval($rr['uid'])
                                );
                }
@@ -125,9 +127,9 @@ function public_server_enotify(&$a, &$b) {
     if (x($b, 'params') && $b['params']['type'] == NOTIFY_SYSTEM
                && x($b['params'], 'system_type') && $b['params']['system_type'] === 'public_server_expire') {
         $b['itemlink'] = $a->get_baseurl();
-        $b['epreamble'] = $b['preamble'] = sprintf(L10n::t('Your account on %s will expire in a few days.'), Config::get('system','sitename'));
+        $b['epreamble'] = $b['preamble'] = L10n::t('Your account on %s will expire in a few days.', Config::get('system', 'sitename'));
         $b['subject'] = L10n::t('Your Friendica account is about to expire.');
-        $b['body'] = sprintf(L10n::t("Hi %1\$s,\n\nYour account on %2\$s will expire in less than five days. You may keep your account by logging in at least once every 30 days"), $b['params']['to_name'], "[url=" . $app->config["system"]["url"] . "]" . $app->config["sitename"] . "[/url]");
+        $b['body'] = L10n::t("Hi %1\$s,\n\nYour account on %2\$s will expire in less than five days. You may keep your account by logging in at least once every 30 days", $b['params']['to_name'], "[url=" . $app->config["system"]["url"] . "]" . $app->config["sitename"] . "[/url]");
     }
 }
 
@@ -136,7 +138,7 @@ function public_server_login($a,$b) {
        if(! $days)
                return;
        $r = q("UPDATE user set account_expires_on = '%s' where uid = %d and account_expires_on > '0000-00-00 00:00:00'",
-       dbesc(datetime_convert('UTC','UTC','now +' . $days . ' days')),
+       dbesc(DateTimeFormat::utc('now +' . $days . ' days')),
        local_user()
        );
 }