friendica-addons/membersince/membersince.php

21 lines
1 KiB
PHP
Raw Normal View History

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>
*
*/
use Friendica\Core\Addon;
2011-10-18 08:36:14 +02: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
function membersince_uninstall(){ Addon::unregisterHook('profile_advanced','addon/membersince/membersince.php','membersince_display'); }
2011-10-18 08:36:14 +02:00
2012-02-08 05:18:42 +01:00
function membersince_display(&$a,&$b) {
2012-02-08 05:35:25 +01:00
$b = preg_replace('/<\/dl>/',"</dl>\n\n\n<dl id=\"aprofile-membersince\" class=\"aprofile\">\n<dt>" . t('Member since:') . "</dt>\n<dd>" . datetime_convert('UTC',date_default_timezone_get(),$a->profile['register_date']) . "</dd>\n</dl>" ,$b, 1);
2012-02-08 05:18:42 +01:00
//$b = str_replace('</div>' . "\n" . '<div id="advanced-profile-name-end"></div>',sprintf( t(' - Member since: %s') . EOL, datetime_convert('UTC',date_default_timezone_get(),$a->profile['register_date'])) . '</div>' . "\n" . '<div id="advanced-profile-name-end"></div>',$b);
}