diff options
author | redmatrix <git@macgirvin.com> | 2016-02-25 15:14:57 -0800 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-02-25 15:14:57 -0800 |
commit | 6892ba4cd8668ec48d036876d999ed9685165256 (patch) | |
tree | 413576d1912df0fe6a9b5197d851659affca52ab | |
parent | 7972de13caf21647c8cc2e82c499a344f7191a22 (diff) | |
parent | 5ad9b48f1d916425e41f475319c7237293d055b9 (diff) | |
download | volse-hubzilla-6892ba4cd8668ec48d036876d999ed9685165256.tar.gz volse-hubzilla-6892ba4cd8668ec48d036876d999ed9685165256.tar.bz2 volse-hubzilla-6892ba4cd8668ec48d036876d999ed9685165256.zip |
Merge https://github.com/redmatrix/hubzilla into pending_merge
-rw-r--r-- | include/conversation.php | 4 | ||||
-rw-r--r-- | include/datetime.php | 2 | ||||
-rw-r--r-- | include/group.php | 2 | ||||
-rw-r--r-- | include/identity.php | 9 | ||||
-rwxr-xr-x | mod/cal.php | 3 | ||||
-rw-r--r-- | mod/group.php | 4 | ||||
-rwxr-xr-x | view/tpl/events_cal-js.tpl | 1 | ||||
-rwxr-xr-x | view/tpl/profile_advanced.tpl | 3 |
8 files changed, 18 insertions, 10 deletions
diff --git a/include/conversation.php b/include/conversation.php index e2dfccac9..39119b2bb 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1599,7 +1599,7 @@ function profile_tabs($a, $is_owner = false, $nickname = null){ $uid = (($a->profile['profile_uid']) ? $a->profile['profile_uid'] : local_channel()); if($uid == local_channel()) { - $cal_link = '/events'; + $cal_link = ''; } else { $cal_link = '/cal/' . $nickname; @@ -1653,7 +1653,7 @@ function profile_tabs($a, $is_owner = false, $nickname = null){ ); } - if($p['view_stream']) { + if($p['view_stream'] && $cal_link) { $tabs[] = array( 'label' => t('Events'), 'url' => $a->get_baseurl() . $cal_link, diff --git a/include/datetime.php b/include/datetime.php index bfd806f32..2f2727ae5 100644 --- a/include/datetime.php +++ b/include/datetime.php @@ -549,7 +549,7 @@ function update_birthdays() { $ev['event_xchan'] = $rr['xchan_hash']; $ev['start'] = datetime_convert('UTC', 'UTC', $rr['abook_dob']); $ev['finish'] = datetime_convert('UTC', 'UTC', $rr['abook_dob'] . ' + 1 day '); - $ev['adjust'] = 1; + $ev['adjust'] = 0; $ev['summary'] = sprintf( t('%1$s\'s birthday'), $rr['xchan_name']); $ev['description'] = sprintf( t('Happy Birthday %1$s'), '[zrl=' . $rr['xchan_url'] . ']' . $rr['xchan_name'] . '[/zrl]') ; diff --git a/include/group.php b/include/group.php index bef008afd..22f221059 100644 --- a/include/group.php +++ b/include/group.php @@ -200,7 +200,7 @@ function group_get_members($gid) { if(intval($gid)) { $r = q("SELECT * FROM `group_member` LEFT JOIN abook ON abook_xchan = `group_member`.`xchan` left join xchan on xchan_hash = abook_xchan - WHERE `gid` = %d AND abook_channel = %d and `group_member`.`uid` = %d and xchan_deleted = 0 and abook_blocked = 0 and abook_pending = 0 ORDER BY xchan_name ASC ", + WHERE `gid` = %d AND abook_channel = %d and `group_member`.`uid` = %d and xchan_deleted = 0 and abook_self = 0 and abook_blocked = 0 and abook_pending = 0 ORDER BY xchan_name ASC ", intval($gid), intval(local_channel()), intval(local_channel()) diff --git a/include/identity.php b/include/identity.php index a389a613e..0a88ed208 100644 --- a/include/identity.php +++ b/include/identity.php @@ -1237,10 +1237,6 @@ function advanced_profile(&$a) { if(! perm_is_allowed($a->profile['profile_uid'],get_observer_hash(),'view_profile')) return ''; - $o = ''; - - $o .= '<h2>' . t('Profile') . '</h2>'; - if($a->profile['name']) { $tpl = get_markup_template('profile_advanced.tpl'); @@ -1351,6 +1347,10 @@ function advanced_profile(&$a) { $profile['extra_fields'] = $a->profile['extra_fields']; } + + $is_owner = (($a->profile['profile_uid'] == local_channel()) ? true : false); + $edit = (($is_owner) ? array('link' => $a->get_baseurl() . '/profiles/' . $a->profile['profile_uid'], 'label' => t('Edit')) : ''); + $things = get_things($a->profile['profile_guid'],$a->profile['profile_uid']); // logger('mod_profile: things: ' . print_r($things,true), LOGGER_DATA); @@ -1360,6 +1360,7 @@ function advanced_profile(&$a) { '$canlike' => (($profile['canlike'])? true : false), '$likethis' => t('Like this thing'), '$profile' => $profile, + '$edit' => $edit, '$things' => $things )); } diff --git a/mod/cal.php b/mod/cal.php index 1e2405cd0..453f46f69 100755 --- a/mod/cal.php +++ b/mod/cal.php @@ -80,6 +80,8 @@ function cal_content(&$a) { $o = ''; + $tabs = profile_tabs($a, True, $channel['channel_address']); + $mode = 'view'; $y = 0; $m = 0; @@ -333,6 +335,7 @@ function cal_content(&$a) { '$today' => t('Today'), '$form' => $form, '$expandform' => ((x($_GET,'expandform')) ? true : false), + '$tabs' => $tabs )); if (x($_GET,'id')){ echo $o; killme(); } diff --git a/mod/group.php b/mod/group.php index 7eaad771f..c63ccfa9b 100644 --- a/mod/group.php +++ b/mod/group.php @@ -117,7 +117,7 @@ function group_content(&$a) { check_form_security_token_ForbiddenOnErr('group_member_change', 't'); - $r = q("SELECT abook_xchan from abook left join xchan on abook_xchan = xchan_hash where abook_xchan = '%s' and abook_channel = %d and xchan_deleted = 0 and abook_blocked = 0 and abook_pending = 0 limit 1", + $r = q("SELECT abook_xchan from abook left join xchan on abook_xchan = xchan_hash where abook_xchan = '%s' and abook_channel = %d and xchan_deleted = 0 and abook_self = 0 and abook_blocked = 0 and abook_pending = 0 limit 1", dbesc(base64url_decode(argv(2))), intval(local_channel()) ); @@ -208,7 +208,7 @@ function group_content(&$a) { group_rmv_member(local_channel(),$group['name'],$member['xchan_hash']); } - $r = q("SELECT abook.*, xchan.* FROM `abook` left join xchan on abook_xchan = xchan_hash WHERE `abook_channel` = %d AND abook_blocked = 0 and abook_pending = 0 and xchan_deleted = 0 order by xchan_name asc", + $r = q("SELECT abook.*, xchan.* FROM `abook` left join xchan on abook_xchan = xchan_hash WHERE `abook_channel` = %d AND abook_self = 0 and abook_blocked = 0 and abook_pending = 0 and xchan_deleted = 0 order by xchan_name asc", intval(local_channel()) ); diff --git a/view/tpl/events_cal-js.tpl b/view/tpl/events_cal-js.tpl index b3c7ff03b..bc8a3aa31 100755 --- a/view/tpl/events_cal-js.tpl +++ b/view/tpl/events_cal-js.tpl @@ -1,3 +1,4 @@ +{{$tabs}} <div class="generic-content-wrapper"> <div class="section-title-wrapper"> <div class="pull-right"> diff --git a/view/tpl/profile_advanced.tpl b/view/tpl/profile_advanced.tpl index a027a7c2e..780626cf9 100755 --- a/view/tpl/profile_advanced.tpl +++ b/view/tpl/profile_advanced.tpl @@ -12,6 +12,9 @@ <i class="icon-thumbs-up-alt" title="{{$profile.likethis}}"></i> </button> {{/if}} + {{if $edit}} + <a href="{{$edit.link}}" class="btn btn-primary btn-xs"><i class="icon-pencil"></i> {{$edit.label}}</a> + {{/if}} </div> <h2>{{$title}}</h2> <div class="clear"></div> |