From 22ac032cc3ca8580dd974ac0c55ea2378b0680c1 Mon Sep 17 00:00:00 2001 From: rabuzarus Date: Tue, 6 Feb 2018 18:24:03 +0100 Subject: [PATCH 1/3] membersince addon works now with frio --- membersince/membersince.php | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/membersince/membersince.php b/membersince/membersince.php index 63482579..de7519c9 100644 --- a/membersince/membersince.php +++ b/membersince/membersince.php @@ -23,9 +23,37 @@ function membersince_uninstall() function membersince_display(&$a, &$b) { - // Works in Vier - $b = preg_replace('/<\/dl>/', "\n\n\n
\n
" . L10n::t('Member since:') . "
\n
" . DateTimeFormat::local($a->profile['register_date']) . "
\n
", $b, 1); + if (current_theme() == 'frio') { + // Works in Frio. + $doc = new DOMDocument(); + $doc->loadHTML($b); - // Trying for Frio - //$b = preg_replace('/<\/div>/', "

" . L10n::t('Member since:') . "
" . DateTimeFormat::local($a->profile['register_date']) . "
", $b, 1); + $elm = $doc->getElementById('aprofile-fullname'); + + $div = $doc->createElement('div'); + $div->setAttribute('id','aprofile-membersince'); + $div->setAttribute('class','col-lg-12 col-md-12 col-sm-12 col-xs-12 aprofile'); + + // The seperator line. + $hr = $doc->createElement('hr',''); + $hr->setAttribute('class','profile-separator'); + + // The label div. + $label = $doc->createElement('div', 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. + $entry = $doc->createElement('div', DateTimeFormat::local($a->profile['register_date'])); + $entry->setAttribute('class', 'col-lg-8 col-md-8 col-sm-8 col-xs-12 profile-entry'); + + $div->appendChild($hr); + $div->appendChild($label); + $div->appendChild($entry); + $elm->parentNode->appendChild($div); + + $b = $doc->saveHTML(); + } else { + // Works in Vier. + $b = preg_replace('/<\/dl>/', "\n\n\n
\n
" . L10n::t('Member since:') . "
\n
" . DateTimeFormat::local($a->profile['register_date']) . "
\n
", $b, 1); + } } From 40f99e48287c6cb44e3f1d3df3e8dabfb9d9c259 Mon Sep 17 00:00:00 2001 From: rabuzarus Date: Tue, 6 Feb 2018 18:26:34 +0100 Subject: [PATCH 2/3] update membersince addon to version 1.1 since it does now support frio --- membersince/membersince.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/membersince/membersince.php b/membersince/membersince.php index de7519c9..67d29e1d 100644 --- a/membersince/membersince.php +++ b/membersince/membersince.php @@ -2,7 +2,7 @@ /** * Name: MemberSince * Description: Display membership date in profile - * Version: 1.0 + * Version: 1.1 * Author: Mike Macgirvin * */ From 9faa56702aeaa5cba1ec512a9868d75545e8a34f Mon Sep 17 00:00:00 2001 From: rabuzarus Date: Wed, 7 Feb 2018 14:34:30 +0100 Subject: [PATCH 3/3] membersince is now added in frio after the fullname entry --- membersince/membersince.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/membersince/membersince.php b/membersince/membersince.php index 67d29e1d..8c42c135 100644 --- a/membersince/membersince.php +++ b/membersince/membersince.php @@ -49,7 +49,7 @@ function membersince_display(&$a, &$b) $div->appendChild($hr); $div->appendChild($label); $div->appendChild($entry); - $elm->parentNode->appendChild($div); + $elm->parentNode->insertBefore($div, $elm->nextSibling); $b = $doc->saveHTML(); } else {