From 08e54234e30c10e3130b7d71caba9fd43e3593e3 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Mon, 5 Sep 2011 16:55:40 +0200 Subject: profiles popup menu in sidebar --- boot.php | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index c13116012..10195c2ba 100644 --- a/boot.php +++ b/boot.php @@ -860,9 +860,36 @@ function profile_sidebar($profile, $block = 0) { $connect = False; - // show edit to yourself + // show edit profile to yourself if ($profile['uid'] == local_user()) { $profile['edit'] = array($a->get_baseurl(). '/profiles', t('Profiles'),"", t('Manage/edit profiles')); + + $r = q("SELECT * FROM `profile` WHERE `uid` = %d", + local_user()); + + $profile['menu'] = array( + 'chg_photo' => t('Change profile photo'), + 'cr_new' => t('Create New Profile'), + 'entries' => array(), + ); + + if(count($r)) { + + foreach($r as $rr) { + $profile['menu']['entries'][] = array( + 'photo' => $rr['thumb'], + 'id' => $rr['id'], + 'alt' => t('Profile Image'), + 'profile_name' => $rr['profile-name'], + 'visible' => (($rr['is-default']) ? '' . t('visible to everybody') . '' + : '' . t('Edit visibility') . '') + ); + } + + + } + + } -- cgit v1.2.3