X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=membersince%2Fmembersince.php;h=f8128eb705c428582453e1bf57809fff275765b0;hb=46fdcc1c0ed09bc7c6e71f87845668362c2ee9ac;hp=6e96e904fb212296949e2a35d5f33e1ec13f404f;hpb=c67ad31c8bf3749ac21bc62116ecb21c52daa544;p=friendica-addons.git diff --git a/membersince/membersince.php b/membersince/membersince.php index 6e96e904..f8128eb7 100644 --- a/membersince/membersince.php +++ b/membersince/membersince.php @@ -7,6 +7,7 @@ * Status: Unsupported */ +use Friendica\App; use Friendica\Core\Hook; use Friendica\DI; use Friendica\Util\DateTimeFormat; @@ -16,14 +17,9 @@ function membersince_install() Hook::register('profile_advanced', 'addon/membersince/membersince.php', 'membersince_display'); } -function membersince_uninstall() +function membersince_display(array &$b) { - Hook::unregister('profile_advanced', 'addon/membersince/membersince.php', 'membersince_display'); -} - -function membersince_display(Friendica\App $a, &$b) -{ - if ($a->getCurrentTheme() == 'frio') { + if (DI::app()->getCurrentTheme() == 'frio') { // Works in Frio. $doc = new DOMDocument(); $doc->loadHTML(mb_convert_encoding($b, 'HTML-ENTITIES', 'UTF-8')); @@ -43,7 +39,7 @@ function membersince_display(Friendica\App $a, &$b) $label->setAttribute('class', 'col-lg-4 col-md-4 col-sm-4 col-xs-12 profile-label-name text-muted'); // The div for the register date of the profile owner. - $entry = $doc->createElement('div', DateTimeFormat::local($a->profile['register_date'])); + $entry = $doc->createElement('div', DateTimeFormat::local(DI::app()->profile['register_date'])); $entry->setAttribute('class', 'col-lg-8 col-md-8 col-sm-8 col-xs-12 profile-entry'); $div->appendChild($hr); @@ -54,6 +50,6 @@ function membersince_display(Friendica\App $a, &$b) $b = $doc->saveHTML(); } else { // Works in Vier. - $b = preg_replace('/<\/dl>/', "\n\n\n
\n
" . DI::l10n()->t('Member since:') . "
\n
" . DateTimeFormat::local($a->profile['register_date']) . "
\n
", $b, 1); + $b = preg_replace('/<\/dl>/', "\n\n\n
\n
" . DI::l10n()->t('Member since:') . "
\n
" . DateTimeFormat::local(DI::app()->profile['register_date']) . "
\n
", $b, 1); } }