X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fmanage.php;h=adcc3d787aac0d58563cbd5d38e82e50384498d2;hb=300007a0cff41a25117d31c3707e65cb512fdaba;hp=84dfa6917c3529c05293fcf39d83c06d692b1dfb;hpb=80b57e664a3df68994108a3d511468b249e0bbff;p=friendica.git diff --git a/mod/manage.php b/mod/manage.php old mode 100755 new mode 100644 index 84dfa6917c..adcc3d787a --- a/mod/manage.php +++ b/mod/manage.php @@ -1,5 +1,7 @@ get_baseurl(true) . '/profile/' . $a->user['nickname']); + $ret = array(); + call_hooks('home_init',$ret); + + goaway( $a->get_baseurl() . "/profile/" . $a->user['nickname'] ); // NOTREACHED } @@ -87,26 +97,51 @@ function manage_content(&$a) { return; } - $o = '

' . t('Manage Identities and/or Pages') . '

'; + if ($_GET['identity']) { + $_POST['identity'] = $_GET['identity']; + manage_post($a); + return; + } - - $o .= '
' . t('Toggle between different identities or community/group pages which share your account details or which you have been granted "manage" permissions') . '
'; + $identities = $a->identities; - $o .= '
' . t('Select an identity to manage: ') . '
'; + //getting additinal information for each identity + foreach ($identities as $key=>$id) { + $thumb = q("SELECT `thumb` FROM `contact` WHERE `uid` = '%s' AND `self` = 1", + dbesc($id['uid']) + ); - $o .= '
' . "\r\n"; - $o .= '
' . "\r\n"; - $o .= '' . "\r\n"; - $o .= '
' . "\r\n"; + $notifications = 0; + + $r = q("SELECT DISTINCT(`parent`) FROM `notify` WHERE `uid` = %d AND NOT `seen` AND NOT (`type` IN (%d, %d))", + intval($id['uid']), intval(NOTIFY_INTRO), intval(NOTIFY_MAIL)); + if ($r) + $notifications = sizeof($r); + + $r = q("SELECT DISTINCT(`convid`) FROM `mail` WHERE `uid` = %d AND NOT `seen`", + intval($id['uid'])); + if ($r) + $notifications = $notifications + sizeof($r); + + $r = q("SELECT COUNT(*) AS `introductions` FROM `intro` WHERE NOT `blocked` AND NOT `ignore` AND `uid` = %d", + intval($id['uid'])); + if ($r) + $notifications = $notifications + $r[0]["introductions"]; + + $identities[$key]['notifications'] = $notifications; + } - $o .= '
' . "\r\n"; + $o = replace_macros(get_markup_template('manage.tpl'), array( + '$title' => t('Manage Identities and/or Pages'), + '$desc' => t('Toggle between different identities or community/group pages which share your account details or which you have been granted "manage" permissions'), + '$choose' => t('Select an identity to manage: '), + '$identities' => $identities, + '$submit' => t('Submit'), + )); return $o;