diff --git a/include/nav.php b/include/nav.php index 5008b6269..24449409b 100644 --- a/include/nav.php +++ b/include/nav.php @@ -119,14 +119,6 @@ EOT; $gdirpath = 'directory'; - if(strlen(get_config('system','singleuser'))) { - $gdir = dirname(get_config('system','directory_submit_url')); - if(strlen($gdir)) - $gdirpath = $gdir; - } - elseif(! get_config('system','no_community_page')) - $nav['community'] = array('community', t('Community'), "", t('Conversations on this site')); - $nav['directory'] = array($gdirpath, t('Directory'), "", t('People directory')); /** @@ -141,9 +133,8 @@ EOT; $nav['home'] = array('channel/' . $channel['channel_address'], t('Home'), "", t('Your posts and conversations')); - if($channel['channel_pageflags'] == PAGE_NORMAL) { - $nav['introductions'] = array('notifications/intros', t('Introductions'), "", t('Connection Requests')); - } + $nav['intros'] = array('intro', t('Introductions'), "", t('New Connections')); + $nav['notifications'] = array('notifications', t('Notifications'), "", t('Notifications')); $nav['notifications']['all']=array('notifications/system', t('See all notifications'), "", ""); @@ -212,7 +203,7 @@ function nav_set_selected($item){ 'network' => null, 'home' => null, 'profiles' => null, - 'introductions' => null, + 'intros' => null, 'notifications' => null, 'messages' => null, 'directory' => null, diff --git a/mod/intro.php b/mod/intro.php new file mode 100644 index 000000000..4b9d63629 --- /dev/null +++ b/mod/intro.php @@ -0,0 +1,99 @@ + t('Introductions and Connection Requests') + )); + + $r = q("select count(abook_id) as total from abook where abook_channel = %d and (abook_flags & %d) and not (abook_flags & %d) ", + intval(local_user()), + intval(ABOOK_FLAG_PENDING), + intval(ABOOK_FLAG_SELF) + ); + if($r) { + $a->set_pager_total($r[0]['total']); + if(! intval($r[0]['total'])) { + notice( t('No pending introductions.') . EOL); + return; + } + } + else { + notice( t('System error. Please try again later.') . EOL); + return; + } + + $r = q("select abook.*, xchan.* from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and (abook_flags & %d) and not (abook_flags & %d) LIMIT %d, %d", + intval(local_user()), + intval(ABOOK_FLAG_PENDING), + intval(ABOOK_FLAG_SELF), + intval($a->pager['start']), + intval($a->pager['itemspage']) + ); + + if($r) { + + $tpl = get_markup_template("intros.tpl"); + + foreach($r as $rr) { + $o .= replace_macros($tpl,array( + '$uid' => local_user(), + + '$contact_id' => $rr['abook_id'], + '$photo' => ((x($rr,'xchan_photo_l')) ? $rr['xchan_photo_l'] : "images/person-175.jpg"), + '$fullname' => $rr['xchan_name'], + '$hidden' => array('hidden', t('Hide this contact from others'), ($rr['abook_flags'] & ABOOK_FLAG_HIDDEN), ''), + '$activity' => array('activity', t('Post a new friend activity'), (intval(get_pconfig(local_user(),'system','post_newfriend')) ? '1' : 0), t('if applicable')), + '$url' => zid($rr['xchan_url']), + '$approve' => t('Approve'), + '$block' => t('Block'), + '$ignore' => t('Ignore'), + '$discard' => t('Discard') + + )); + } + } + + $o .= paginate($a); + return $o; + +} \ No newline at end of file diff --git a/view/tpl/intros.tpl b/view/tpl/intros.tpl index e7fd53ca4..6d1f1baa0 100644 --- a/view/tpl/intros.tpl +++ b/view/tpl/intros.tpl @@ -1,27 +1,17 @@
diff --git a/view/tpl/intros_header.tpl b/view/tpl/intros_header.tpl new file mode 100644 index 000000000..17afd0cbd --- /dev/null +++ b/view/tpl/intros_header.tpl @@ -0,0 +1 @@ +