https://reisub.nsupdate.info/git
/
friendica-addons.git
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1098 from nupplaphil/feat/check_messages
[friendica-addons.git/.git]
/
membersince
/
membersince.php
diff --git
a/membersince/membersince.php
b/membersince/membersince.php
index
8c42c13
..
635a015
100644
(file)
--- a/
membersince/membersince.php
+++ b/
membersince/membersince.php
@@
-4,29
+4,24
@@
* Description: Display membership date in profile
* Version: 1.1
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
* Description: Display membership date in profile
* Version: 1.1
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
- *
+ *
Status: Unsupported
*/
*/
-use Friendica\Core\
Addon
;
-use Friendica\
Core\L10n
;
+use Friendica\Core\
Hook
;
+use Friendica\
DI
;
use Friendica\Util\DateTimeFormat;
function membersince_install()
{
use Friendica\Util\DateTimeFormat;
function membersince_install()
{
-
Addon::registerHook
('profile_advanced', 'addon/membersince/membersince.php', 'membersince_display');
+
Hook::register
('profile_advanced', 'addon/membersince/membersince.php', 'membersince_display');
}
}
-function membersince_
uninstall(
)
+function membersince_
display(Friendica\App $a, &$b
)
{
{
- Addon::unregisterHook('profile_advanced', 'addon/membersince/membersince.php', 'membersince_display');
-}
-
-function membersince_display(&$a, &$b)
-{
- if (current_theme() == 'frio') {
+ if ($a->getCurrentTheme() == 'frio') {
// Works in Frio.
$doc = new DOMDocument();
// Works in Frio.
$doc = new DOMDocument();
- $doc->loadHTML(
$b
);
+ $doc->loadHTML(
mb_convert_encoding($b, 'HTML-ENTITIES', 'UTF-8')
);
$elm = $doc->getElementById('aprofile-fullname');
$elm = $doc->getElementById('aprofile-fullname');
@@
-39,7
+34,7
@@
function membersince_display(&$a, &$b)
$hr->setAttribute('class','profile-separator');
// The label div.
$hr->setAttribute('class','profile-separator');
// The label div.
- $label = $doc->createElement('div',
L10n::
t('Member since:'));
+ $label = $doc->createElement('div',
DI::l10n()->
t('Member since:'));
$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.
$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.
@@
-54,6
+49,6
@@
function membersince_display(&$a, &$b)
$b = $doc->saveHTML();
} else {
// Works in Vier.
$b = $doc->saveHTML();
} else {
// Works in Vier.
- $b = preg_replace('/<\/dl>/', "</dl>\n\n\n<dl id=\"aprofile-membersince\" class=\"aprofile\">\n<dt>" .
L10n::
t('Member since:') . "</dt>\n<dd>" . DateTimeFormat::local($a->profile['register_date']) . "</dd>\n</dl>", $b, 1);
+ $b = preg_replace('/<\/dl>/', "</dl>\n\n\n<dl id=\"aprofile-membersince\" class=\"aprofile\">\n<dt>" .
DI::l10n()->
t('Member since:') . "</dt>\n<dd>" . DateTimeFormat::local($a->profile['register_date']) . "</dd>\n</dl>", $b, 1);
}
}
}
}