diff options
author | redmatrix <git@macgirvin.com> | 2016-01-14 20:51:59 -0800 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-01-14 20:51:59 -0800 |
commit | f888548e0e722933e5b03b49fd5e19dd6e55743e (patch) | |
tree | 7f3bd1471595f2e96a574c542712aea84e5f70c7 /mod/cover_photo.php | |
parent | 6ff192c4ead307b65df793a138f9c1e18de81e5f (diff) | |
download | volse-hubzilla-f888548e0e722933e5b03b49fd5e19dd6e55743e.tar.gz volse-hubzilla-f888548e0e722933e5b03b49fd5e19dd6e55743e.tar.bz2 volse-hubzilla-f888548e0e722933e5b03b49fd5e19dd6e55743e.zip |
issue with plugin loadable layouts
Diffstat (limited to 'mod/cover_photo.php')
-rw-r--r-- | mod/cover_photo.php | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/mod/cover_photo.php b/mod/cover_photo.php index 832d5ad8e..de11857b0 100644 --- a/mod/cover_photo.php +++ b/mod/cover_photo.php @@ -68,6 +68,14 @@ function cover_photo_post(&$a) { $srcW = $_POST['xfinal'] - $srcX; $srcH = $_POST['yfinal'] - $srcY; + + $r = q("select gender from profile where uid = %d and is_default = 1 limit 1", + intval(local_channel()) + ); + if($r) { + $profile = $r[0]; + } + $r = q("SELECT * FROM photo WHERE resource_id = '%s' AND uid = %d AND scale = 0 LIMIT 1", dbesc($image_id), intval(local_channel()) @@ -148,7 +156,7 @@ function cover_photo_post(&$a) { } $channel = $a->get_channel(); - send_cover_photo_activity($channel,$base_image); + send_cover_photo_activity($channel,$base_image,$profile); } @@ -203,7 +211,7 @@ function cover_photo_post(&$a) { } -function send_cover_photo_activity($channel,$photo) { +function send_cover_photo_activity($channel,$photo,$profile) { $arr = array(); $arr['item_thread_top'] = 1; @@ -218,7 +226,12 @@ function send_cover_photo_activity($channel,$photo) { 'link' => array('rel' => 'photo', 'type' => $photo['type'], 'href' => z_root() . '/photo/' . $photo['resource_id'] . '-7') )); - $t = t('%1$s updated their %2$s'); + if($profile && stripos($profile['gender'],t('female')) !== false) + $t = t('%1$s updated her %2$s'); + elseif($profile && 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('cover photo') . '[/zrl]'; |