From 4f285911f05fa07b14d16960180b2a4985824fa2 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 14 Feb 2016 16:15:55 -0800 Subject: form cleanup (profile_photo and cover_photo), admin 'user_approve' not found, missing close div in mood_content.tpl --- include/items.php | 54 ++++++++++++++++++++++++++++++++++++++++++ mod/admin.php | 6 ++--- mod/profile_photo.php | 54 ++---------------------------------------- version.inc | 2 +- view/tpl/cover_photo.tpl | 42 +++++++++++++++++++-------------- view/tpl/mood_content.tpl | 38 ++++++++++++++++-------------- view/tpl/profile_photo.tpl | 58 ++++++++++++++++++++++++++++------------------ 7 files changed, 139 insertions(+), 115 deletions(-) diff --git a/include/items.php b/include/items.php index 1231b6209..ab859bebd 100755 --- a/include/items.php +++ b/include/items.php @@ -5306,3 +5306,57 @@ function asencode_person($p) { return $ret; } + + +function send_profile_photo_activity($channel,$photo,$profile) { + + // for now only create activities for the default profile + + if(! intval($profile['is_default'])) + return; + + $arr = array(); + $arr['item_thread_top'] = 1; + $arr['item_origin'] = 1; + $arr['item_wall'] = 1; + $arr['obj_type'] = ACTIVITY_OBJ_PHOTO; + $arr['verb'] = ACTIVITY_UPDATE; + + $arr['object'] = json_encode(array( + 'type' => $arr['obj_type'], + 'id' => z_root() . '/photo/profile/l/' . $channel['channel_id'], + 'link' => array('rel' => 'photo', 'type' => $photo['type'], 'href' => z_root() . '/photo/profile/l/' . $channel['channel_id']) + )); + + if(stripos($profile['gender'],t('female')) !== false) + $t = t('%1$s updated her %2$s'); + elseif(stripos($profile['gender'],t('male')) !== false) + $t = t('%1$s updated his %2$s'); + else + $t = t('%1$s updated their %2$s'); + + $ptext = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo['resource_id'] . ']' . t('profile photo') . '[/zrl]'; + + $ltext = '[zrl=' . z_root() . '/profile/' . $channel['channel_address'] . ']' . '[zmg=150x150]' . z_root() . '/photo/' . $photo['resource_id'] . '-4[/zmg][/zrl]'; + + $arr['body'] = sprintf($t,$channel['channel_name'],$ptext) . "\n\n" . $ltext; + + $acl = new AccessList($channel); + $x = $acl->get(); + $arr['allow_cid'] = $x['allow_cid']; + + $arr['allow_gid'] = $x['allow_gid']; + $arr['deny_cid'] = $x['deny_cid']; + $arr['deny_gid'] = $x['deny_gid']; + + $arr['uid'] = $channel['channel_id']; + $arr['aid'] = $channel['channel_account_id']; + + $arr['owner_xchan'] = $channel['channel_hash']; + $arr['author_xchan'] = $channel['channel_hash']; + + post_activity_item($arr); + + +} + diff --git a/mod/admin.php b/mod/admin.php index 09bfef84a..5195db320 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -7,7 +7,7 @@ */ require_once('include/queue_fn.php'); - +require_once('include/account.php'); /** * @param App &$a @@ -861,13 +861,13 @@ function admin_page_users_post($a) { // registration approved button was submitted if (x($_POST, 'page_users_approve')) { foreach ($pending as $hash) { - user_allow($hash); + account_allow($hash); } } // registration deny button was submitted if (x($_POST, 'page_users_deny')) { foreach ($pending as $hash) { - user_deny($hash); + account_deny($hash); } } diff --git a/mod/profile_photo.php b/mod/profile_photo.php index 0091d0585..9dc71f256 100644 --- a/mod/profile_photo.php +++ b/mod/profile_photo.php @@ -274,58 +274,6 @@ function profile_photo_post(&$a) { } -function send_profile_photo_activity($channel,$photo,$profile) { - - // for now only create activities for the default profile - - if(! intval($profile['is_default'])) - return; - - $arr = array(); - $arr['item_thread_top'] = 1; - $arr['item_origin'] = 1; - $arr['item_wall'] = 1; - $arr['obj_type'] = ACTIVITY_OBJ_PHOTO; - $arr['verb'] = ACTIVITY_UPDATE; - - $arr['object'] = json_encode(array( - 'type' => $arr['obj_type'], - 'id' => z_root() . '/photo/profile/l/' . $channel['channel_id'], - 'link' => array('rel' => 'photo', 'type' => $photo['type'], 'href' => z_root() . '/photo/profile/l/' . $channel['channel_id']) - )); - - if(stripos($profile['gender'],t('female')) !== false) - $t = t('%1$s updated her %2$s'); - elseif(stripos($profile['gender'],t('male')) !== false) - $t = t('%1$s updated his %2$s'); - else - $t = t('%1$s updated their %2$s'); - - $ptext = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo['resource_id'] . ']' . t('profile photo') . '[/zrl]'; - - $ltext = '[zrl=' . z_root() . '/profile/' . $channel['channel_address'] . ']' . '[zmg=150x150]' . z_root() . '/photo/' . $photo['resource_id'] . '-4[/zmg][/zrl]'; - - $arr['body'] = sprintf($t,$channel['channel_name'],$ptext) . "\n\n" . $ltext; - - $acl = new AccessList($channel); - $x = $acl->get(); - $arr['allow_cid'] = $x['allow_cid']; - - $arr['allow_gid'] = $x['allow_gid']; - $arr['deny_cid'] = $x['deny_cid']; - $arr['deny_gid'] = $x['deny_gid']; - - $arr['uid'] = $channel['channel_id']; - $arr['aid'] = $channel['channel_account_id']; - - $arr['owner_xchan'] = $channel['channel_hash']; - $arr['author_xchan'] = $channel['channel_hash']; - - post_activity_item($arr); - - -} - /* @brief Generate content of profile-photo view * @@ -452,6 +400,8 @@ function profile_photo_content(&$a) { '$title' => t('Upload Profile Photo'), '$submit' => t('Upload'), '$profiles' => $profiles, + '$single' => ((count($profiles) == 1) ? true : false), + '$profile0' => $profiles[0], '$form_security_token' => get_form_security_token("profile_photo"), // FIXME - yuk '$select' => sprintf('%s %s', t('or'), ($newuser) ? '' . t('skip this step') . '' : '' . t('select a photo from your photo albums') . '') diff --git a/version.inc b/version.inc index 86359b809..0e9185e63 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2016-02-12.1307H +2016-02-14.1309H diff --git a/view/tpl/cover_photo.tpl b/view/tpl/cover_photo.tpl index 1db139e7b..4352501ae 100755 --- a/view/tpl/cover_photo.tpl +++ b/view/tpl/cover_photo.tpl @@ -1,23 +1,29 @@ -
-

{{$title}}

+
+
+

{{$title}}

+
+
-
- + + -
+
- - -
+ + +
+
+
+
+ +
+
-
- -
-
- -
- - + +
+
+ +
diff --git a/view/tpl/mood_content.tpl b/view/tpl/mood_content.tpl index 4059620ce..315ee4c8a 100755 --- a/view/tpl/mood_content.tpl +++ b/view/tpl/mood_content.tpl @@ -5,27 +5,29 @@
-
{{$desc}}
+
{{$desc}}
-
-
+
+
-
-
-
+ +
+
- + -
- -
-
-
- -
+
+ +
+
+
+ + +
+ diff --git a/view/tpl/profile_photo.tpl b/view/tpl/profile_photo.tpl index fbed32606..88e17407b 100755 --- a/view/tpl/profile_photo.tpl +++ b/view/tpl/profile_photo.tpl @@ -1,31 +1,43 @@ -
-

{{$title}}

+
+
+

{{$title}}

+
+
-
- + + -
+
- - -
+ + +
- - -
+ {{if $single}} + + {{else}} -
- -
-
+ + +
+
+
+ {{/if}} - +
+ +
+
- + +
+
+ +
-- cgit v1.2.3