Avoid warnings in addons #639
1 changed files with 30 additions and 17 deletions
|
@ -11,29 +11,42 @@ use Friendica\Core\Addon;
|
|||
use Friendica\Core\Config;
|
||||
use Friendica\Core\L10n;
|
||||
|
||||
function newmemberwidget_install () {
|
||||
Addon::registerHook( 'network_mod_init', 'addon/newmemberwidget/newmemberwidget.php', 'newmemberwidget_network_mod_init');
|
||||
logger('newmemberwidget installed');
|
||||
}
|
||||
function newmemberwidget_uninstall () {
|
||||
Addon::unregisterHook( 'network_mod_init', 'addon/newmemberwidget/newmemberwidget.php', 'newmemberwidget_network_mod_init');
|
||||
function newmemberwidget_install()
|
||||
{
|
||||
Addon::registerHook( 'network_mod_init', 'addon/newmemberwidget/newmemberwidget.php', 'newmemberwidget_network_mod_init');
|
||||
logger('newmemberwidget installed');
|
||||
}
|
||||
|
||||
function newmemberwidget_network_mod_init ( $a, $b) {
|
||||
if (x($_SESSION['new_member'])) {
|
||||
function newmemberwidget_uninstall()
|
||||
{
|
||||
Addon::unregisterHook( 'network_mod_init', 'addon/newmemberwidget/newmemberwidget.php', 'newmemberwidget_network_mod_init');
|
||||
}
|
||||
|
||||
function newmemberwidget_network_mod_init ($a, $b)
|
||||
{
|
||||
if (empty($_SESSION['new_member'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$t = '<div id="newmember_widget" class="widget">'.EOL;
|
||||
$t .= '<h3>'.L10n::t('New Member').'</h3>'.EOL;
|
||||
$t .= '<a href="newmember" id="newmemberwidget-tips">' . L10n::t('Tips for New Members') . '</a><br />'.EOL;
|
||||
if (Config::get('newmemberwidget','linkglobalsupport')==1)
|
||||
$t .= '<a href="https://forum.friendi.ca/profile/helpers" target="_new">'.L10n::t('Global Support Forum').'</a><br />'.EOL;
|
||||
if (Config::get('newmemberwidget','linklocalsupport')==1)
|
||||
$t .= '<a href="'.$a->get_baseurl().'/profile/'.Config::get('newmemberwidget','localsupport').'" target="_new">'.L10n::t('Local Support Forum').'</a><br />'.EOL;
|
||||
$ft = Config::get('newmemberwidget','freetext');
|
||||
if (!trim($ft)=="")
|
||||
$t .= '<p>'.BBCode::convert(trim($ft)).'</p>';
|
||||
|
||||
if (Config::get('newmemberwidget','linkglobalsupport', false)) {
|
||||
$t .= '<a href="https://forum.friendi.ca/profile/helpers" target="_new">'.L10n::t('Global Support Forum').'</a><br />'.EOL;
|
||||
}
|
||||
|
||||
if (Config::get('newmemberwidget','linklocalsupport', false)) {
|
||||
$t .= '<a href="'.$a->get_baseurl().'/profile/'.Config::get('newmemberwidget','localsupport').'" target="_new">'.L10n::t('Local Support Forum').'</a><br />'.EOL;
|
||||
}
|
||||
|
||||
$ft = Config::get('newmemberwidget','freetext', '');
|
||||
if (!empty($ft)) {
|
||||
$t .= '<p>'.BBCode::convert(trim($ft)).'</p>';
|
||||
}
|
||||
|
||||
$t .= '</div><div class="clear"></div>';
|
||||
$a->page['aside'] = $t . $a->page['aside'];
|
||||
}
|
||||
$a->page['aside'] = $t . $a->page['aside'];
|
||||
}
|
||||
|
||||
function newmemberwidget_addon_admin_post(&$a)
|
||||
|
|
Loading…
Reference in a new issue