2011-10-18 08:36:14 +02:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Name: MemberSince
|
|
|
|
* Description: Display membership date in profile
|
|
|
|
* Version: 1.0
|
|
|
|
* Author: Mike Macgirvin <http://macgirvin.com/profile/mike>
|
2018-01-20 14:57:41 +01:00
|
|
|
*
|
2011-10-18 08:36:14 +02:00
|
|
|
*/
|
2018-01-25 03:29:09 +01:00
|
|
|
|
2018-01-17 01:51:12 +01:00
|
|
|
use Friendica\Core\Addon;
|
2018-01-22 20:03:11 +01:00
|
|
|
use Friendica\Core\L10n;
|
2018-01-27 03:39:02 +01:00
|
|
|
use Friendica\Util\DateTimeFormat;
|
2011-10-18 08:36:14 +02:00
|
|
|
|
2018-01-20 14:57:41 +01:00
|
|
|
require_once 'include/datetime.php';
|
|
|
|
|
|
|
|
function membersince_install()
|
|
|
|
{
|
|
|
|
Addon::registerHook('profile_advanced', 'addon/membersince/membersince.php', 'membersince_display');
|
|
|
|
}
|
2011-10-18 08:36:14 +02:00
|
|
|
|
2018-01-20 14:57:41 +01:00
|
|
|
function membersince_uninstall()
|
|
|
|
{
|
|
|
|
Addon::unregisterHook('profile_advanced', 'addon/membersince/membersince.php', 'membersince_display');
|
|
|
|
}
|
2011-10-18 08:36:14 +02:00
|
|
|
|
2018-01-20 14:57:41 +01:00
|
|
|
function membersince_display(&$a, &$b)
|
|
|
|
{
|
|
|
|
// Works in Vier
|
2018-01-27 03:39:02 +01:00
|
|
|
$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);
|
2011-10-18 08:36:14 +02:00
|
|
|
|
2018-01-20 14:57:41 +01:00
|
|
|
// Trying for Frio
|
2018-01-27 03:39:02 +01:00
|
|
|
//$b = preg_replace('/<\/div>/', "<div id=\"aprofile-membersince\" class=\"aprofile\"><hr class=\"profile-separator\"><div class=\"profile-label-name\">" . L10n::t('Member since:') . "</div><div class=\"profile-entry\">" . DateTimeFormat::local($a->profile['register_date']) . "</div></div>", $b, 1);
|
2018-01-20 14:57:41 +01:00
|
|
|
}
|