From 53dcede27894c655cbe1abaa9149dd0bed043a8d Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 14 Mar 2011 20:19:45 -0700 Subject: pub_keywords -> meta keywords --- mod/profile.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index 5615573b9..88fc16ebb 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -28,6 +28,11 @@ function profile_init(&$a) { $a->page['htmlhead'] .= '' . "\r\n"; } + $keywords = ((x($a->profile,'pub_keywords')) ? $a->profile['pub_keywords'] : ''); + $keywords = str_replace(array(',',' ',',,'),array(' ',',',','),$keywords); + if(strlen($keywords)) + $a->page['htmlhead'] .= '' . "\r\n" ; + $a->page['htmlhead'] .= '' . "\r\n" ; $a->page['htmlhead'] .= '' . "\r\n" ; $uri = urlencode('acct:' . $a->profile['nickname'] . '@' . $a->get_hostname() . (($a->path) ? '/' . $a->path : '')); -- cgit v1.2.3 From 3f432a7b82480dd985dbc2a67ae23cfc1ed258c6 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 16 Mar 2011 19:36:59 -0700 Subject: share,retweet,relay,forward, whatever --- mod/profile.php | 1 + 1 file changed, 1 insertion(+) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index 88fc16ebb..3354bc9a3 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -311,6 +311,7 @@ function profile_content(&$a, $update = 0) { '$id' => $item['id'], '$likethis' => t("I like this \x28toggle\x29"), '$nolike' => t("I don't like this \x28toggle\x29"), + '$share' => t('Share'), '$wait' => t('Please wait') )); } -- cgit v1.2.3 From 334353e502db5abd7ee248d183a915ff7468de3a Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 16 Mar 2011 21:14:22 -0700 Subject: vorbis audio/video link buttons --- mod/profile.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index 3354bc9a3..a464b7c06 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -157,6 +157,8 @@ function profile_content(&$a, $update = 0) { '$upload' => t('Upload photo'), '$weblink' => t('Insert web link'), '$youtube' => t('Insert YouTube video'), + '$video' => t('Insert Vorbis [.ogg] video'), + '$audio' => t('Insert Vorbis [.ogg] audio'), '$setloc' => t('Set your location'), '$noloc' => t('Clear browser location'), '$wait' => t('Please wait'), -- cgit v1.2.3 From 47f0abf27e2aa0f5443badd2a43617b922662bba Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 16 Mar 2011 22:04:00 -0700 Subject: no sharing icon for private msgs --- mod/profile.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index a464b7c06..c0989bd28 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -267,6 +267,7 @@ function profile_content(&$a, $update = 0) { $cmnt_tpl = load_view_file('view/comment_item.tpl'); $like_tpl = load_view_file('view/like.tpl'); + $noshare_tpl = load_view_file('view/like_noshare.tpl'); $tpl = load_view_file('view/wall_item.tpl'); @@ -309,7 +310,7 @@ function profile_content(&$a, $update = 0) { if(can_write_wall($a,$a->profile['profile_uid'])) { if($item['id'] == $item['parent']) { - $likebuttons = replace_macros($like_tpl,array( + $likebuttons = replace_macros((($item['private']) ? $noshare_tpl : $like_tpl),array( '$id' => $item['id'], '$likethis' => t("I like this \x28toggle\x29"), '$nolike' => t("I don't like this \x28toggle\x29"), -- cgit v1.2.3 From 9f5201dcaa4737427da7ec37969556c574e4711f Mon Sep 17 00:00:00 2001 From: Friendika Date: Fri, 18 Mar 2011 00:30:34 -0700 Subject: edit posting after submission --- mod/profile.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index c0989bd28..1053e4a1e 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -348,6 +348,12 @@ function profile_content(&$a, $update = 0) { else $sparkle = ''; + + $edpost = ''; + if((local_user()) && ($a->profile['profile_uid'] == local_user()) && ($item['id'] == $item['parent']) && (intval($item['wall']) == 1)) + $edpost = ''; + + // We would prefer to use our own avatar link for this item because the one in the author-avatar might reference a // remote site (which could be down). We will use author-avatar if we haven't got something stored locally. // We use this same logic block in mod/network.php to determine it this is a third party post and we don't have any @@ -400,6 +406,7 @@ function profile_content(&$a, $update = 0) { '$location' => $location, '$indent' => $indent, '$plink' => get_plink($item), + '$edpost' => $edpost, '$drop' => $drop, '$like' => $like, '$vote' => $likebuttons, -- cgit v1.2.3 From 798c83b6aa3887622299ec4071c0d817953f3db9 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 21 Mar 2011 00:21:35 -0700 Subject: localise some more templates --- mod/profile.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index 1053e4a1e..82a84c39e 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -130,7 +130,12 @@ function profile_content(&$a, $update = 0) { $a->page['htmlhead'] .= replace_macros($tpl, array( '$baseurl' => $a->get_baseurl(), '$geotag' => $geotag, - '$nickname' => $a->profile['nickname'] + '$nickname' => $a->profile['nickname'], + '$linkurl' => t('Please enter a link URL:'), + '$utubeurl' => t('Please enter a YouTube link:'), + '$vidurl' => t("Please enter a video\x28.ogg\x29 link/URL:"), + '$audurl' => t("Please enter an audio\x28.ogg\x29 link/URL:"), + '$whereareu' => t('Where are you right now?') )); require_once('include/acl_selectors.php'); -- cgit v1.2.3 From 94cbf3bb80371d5b4160db8bef1d70f28f8a0d97 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 21 Mar 2011 04:10:08 -0700 Subject: another template down --- mod/profile.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index 82a84c39e..fad8bc79b 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -98,7 +98,10 @@ function profile_content(&$a, $update = 0) { $o .= replace_macros($tpl,array( '$url' => $a->get_baseurl() . '/' . $a->cmd, - '$phototab' => $a->get_baseurl() . '/photos/' . $a->profile['nickname'] + '$phototab' => $a->get_baseurl() . '/photos/' . $a->profile['nickname'], + '$status' => t('Status') + '$profile' => t('Profile'), + '$photos' => t('Photos') )); -- cgit v1.2.3 From d71db3e0645a71cf65b095f9cf0dcfdd2b2b8980 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 21 Mar 2011 15:12:40 -0700 Subject: typo --- mod/profile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index fad8bc79b..4b5f92a1f 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -99,7 +99,7 @@ function profile_content(&$a, $update = 0) { $o .= replace_macros($tpl,array( '$url' => $a->get_baseurl() . '/' . $a->cmd, '$phototab' => $a->get_baseurl() . '/photos/' . $a->profile['nickname'], - '$status' => t('Status') + '$status' => t('Status'), '$profile' => t('Profile'), '$photos' => t('Photos') )); -- cgit v1.2.3 From 51447932f707e1d0177ee4700266285ed80be2f6 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 24 Mar 2011 01:16:14 -0700 Subject: link same as visited --- mod/profile.php | 1 - 1 file changed, 1 deletion(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index 4b5f92a1f..d33c9aeb2 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -437,6 +437,5 @@ function profile_content(&$a, $update = 0) { $o .= paginate($a); $o .= '
' . t('Shared content is covered by the Creative Commons Attribution 3.0 license.') . '
'; - return $o; } -- cgit v1.2.3 From c962f5c4bcc26fa7bad98a714cdb5e92b6acb57c Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 27 Mar 2011 19:53:36 -0700 Subject: comment collapsing, pagination wasn't advancing past 16 --- mod/profile.php | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 58 insertions(+), 8 deletions(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index d33c9aeb2..9544512ba 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -243,31 +243,52 @@ function profile_content(&$a, $update = 0) { FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 - AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` AND `wall` = 1 ) + AND `item`.`id` = `item`.`parent` AND `item`.`wall` = 1 $sql_extra ", intval($a->profile['profile_uid']) ); - if(count($r)) + if(count($r)) { $a->set_pager_total($r[0]['total']); + $a->set_pager_itemspage(40); + } - $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, - `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`network`, `contact`.`rel`, - `contact`.`thumb`, `contact`.`self`, - `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` + $r = q("SELECT `item`.`id` AS `item_id`, `contact`.`uid` AS `contact-uid` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 - AND `item`.`parent` IN ( SELECT `parent` FROM `item` WHERE `id` = `parent` AND `wall` = 1 ) + AND `item`.`id` = `item`.`parent` AND `item`.`wall` = 1 $sql_extra - ORDER BY `parent` DESC, `gravity` ASC, `id` ASC LIMIT %d ,%d ", + LIMIT %d ,%d ", intval($a->profile['profile_uid']), intval($a->pager['start']), intval($a->pager['itemspage']) ); + $parents_arr = array(); + $parents_str = ''; + + if(count($r)) { + foreach($r as $rr) + $parents_arr[] = $rr['item_id']; + $parents_str = implode(', ', $parents_arr); + + $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, + `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`network`, `contact`.`rel`, + `contact`.`thumb`, `contact`.`self`, + `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` + FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` + WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 + AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 + AND `item`.`parent` IN ( %s ) + $sql_extra + ORDER BY `parent` DESC, `gravity` ASC, `item`.`id` ASC ", + intval($a->profile['profile_uid']), + dbesc($parents_str) + ); + } if($is_owner && ! $update) $o .= get_birthdays(); @@ -292,6 +313,16 @@ function profile_content(&$a, $update = 0) { if($r !== false && count($r)) { + $comments = array(); + foreach($r as $rr) { + if(intval($rr['gravity']) == 6) { + if(! x($comments,$rr['parent'])) + $comments[$rr['parent']] = 1; + else + $comments[$rr['parent']] += 1; + } + } + foreach($r as $item) { like_puller($a,$item,$alike,'like'); like_puller($a,$item,$dlike,'dislike'); @@ -311,6 +342,25 @@ function profile_content(&$a, $update = 0) { && ($item['id'] != $item['parent'])) continue; + if($item['id'] == $item['parent']) { + $comments_seen = 0; + $comments_collapsed = false; + } + else + $comments_seen ++; + + + if(($comments[$item['parent']] > 2) && ($comments_seen <= ($comments[$item['parent']] - 2)) && ($item['gravity'] == 6)) { + if(! $comments_collapsed) { + $o .= ''; + $o .= ''; + } + $lock = ((($item['private']) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) || strlen($item['deny_cid']) || strlen($item['deny_gid'])))) ? '
' . t('Private Message') . '
' -- cgit v1.2.3 From b57214cb783ca2f741760a2ccfbd01babfbd165b Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 27 Mar 2011 19:59:27 -0700 Subject: wrong date order profile page --- mod/profile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index 9544512ba..8fb483007 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -260,7 +260,7 @@ function profile_content(&$a, $update = 0) { AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0 AND `item`.`id` = `item`.`parent` AND `item`.`wall` = 1 $sql_extra - LIMIT %d ,%d ", + ORDER BY `item`.`created` DESC LIMIT %d ,%d ", intval($a->profile['profile_uid']), intval($a->pager['start']), intval($a->pager['itemspage']) -- cgit v1.2.3 From 7defb1768bff1c3da7ea63957cf8c7c928d379ab Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 27 Mar 2011 20:37:44 -0700 Subject: collapse posts by same author (but not you). --- mod/profile.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index 8fb483007..1101c6998 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -328,6 +328,8 @@ function profile_content(&$a, $update = 0) { like_puller($a,$item,$dlike,'dislike'); } + $comments_collapsed = false; + foreach($r as $item) { $sparkle = ''; -- cgit v1.2.3 From 066bdca30dde91fd94c58707f638536ec0ba9002 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 29 Mar 2011 18:57:26 -0700 Subject: optionally set article title --- mod/profile.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index 1101c6998..17f6a2d45 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -138,7 +138,8 @@ function profile_content(&$a, $update = 0) { '$utubeurl' => t('Please enter a YouTube link:'), '$vidurl' => t("Please enter a video\x28.ogg\x29 link/URL:"), '$audurl' => t("Please enter an audio\x28.ogg\x29 link/URL:"), - '$whereareu' => t('Where are you right now?') + '$whereareu' => t('Where are you right now?'), + '$title' => t('Enter a title for this item') )); require_once('include/acl_selectors.php'); @@ -169,6 +170,7 @@ function profile_content(&$a, $update = 0) { '$audio' => t('Insert Vorbis [.ogg] audio'), '$setloc' => t('Set your location'), '$noloc' => t('Clear browser location'), + '$title' => t('Set title'), '$wait' => t('Please wait'), '$permset' => t('Permission settings'), '$content' => '', -- cgit v1.2.3 From fe67c346e5ed9f65fe25dd9337b6424c04d09c4a Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Thu, 31 Mar 2011 16:52:51 +0200 Subject: Moved popup logic in boot.php, added 'item_photo_menu' hook --- mod/profile.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index 17f6a2d45..ab1e8f738 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -454,10 +454,12 @@ function profile_content(&$a, $update = 0) { if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0) $indent .= ' shiny'; + $tmp_item = replace_macros($template,array( '$id' => $item['item_id'], '$linktitle' => t('View $name\'s profile'), '$profile_url' => $profile_link, + '$item_photo_menu' => item_photo_menu($item), '$name' => $profile_name, '$thumb' => $profile_avatar, '$sparkle' => $sparkle, -- cgit v1.2.3 From 742bdd3054408433f8d639acbb07d0fd9c3ad4f7 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 4 Apr 2011 05:52:59 -0700 Subject: make photo menu work better on remote profile logins --- mod/profile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index ab1e8f738..b421591f6 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -402,7 +402,7 @@ function profile_content(&$a, $update = 0) { // This is my profile page but I'm not the author of this post/comment. If it's somebody that's a fan or mutual friend, // I can go directly to their profile as an authenticated guest. - if(local_user() && ($item['contact-uid'] == $_SESSION['uid']) + if(local_user() && ($item['contact-uid'] == local_user()) && ($item['network'] === 'dfrn') && (! $item['self'] )) { $profile_url = $redirect_url; $sparkle = ' sparkle'; -- cgit v1.2.3 From 5d5a94c88a173b95e902afc31a9a2e527b6d3098 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 7 Apr 2011 16:19:46 -0700 Subject: comment open/close anomolies in non-English languages --- mod/profile.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index b421591f6..3d0b79a70 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -391,6 +391,8 @@ function profile_content(&$a, $update = 0) { '$mylink' => $contact['url'], '$mytitle' => t('This is you'), '$myphoto' => $contact['thumb'], + '$comment' => t('Comment'), + '$submit' => t('Submit'), '$ww' => '' )); } -- cgit v1.2.3 From e35a5bac55e0e259c7c587adfaf546484b032c92 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 7 Apr 2011 23:10:43 -0700 Subject: the rest of the english html templates except for htconfig --- mod/profile.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index 3d0b79a70..88e23a8a4 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -106,16 +106,9 @@ function profile_content(&$a, $update = 0) { if($tab === 'profile') { - $profile_lang = get_config('system','language'); - if(! $profile_lang) - $profile_lang = 'en'; - if(file_exists("view/$profile_lang/profile_advanced.php")) - require_once("view/$profile_lang/profile_advanced.php"); - else - require_once('view/profile_advanced.php'); - + require_once('include/profile_advanced.php'); + $o .= advanced_profile($a); call_hooks('profile_advanced',$o); - return $o; } -- cgit v1.2.3 From a0956ee9556d4daffdd3dff7eee408dc412bcb90 Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 10 Apr 2011 23:01:38 -0700 Subject: some w3c validation issues --- mod/profile.php | 200 ++------------------------------------------------------ 1 file changed, 6 insertions(+), 194 deletions(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index 88e23a8a4..f98c28f8f 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -288,205 +288,17 @@ function profile_content(&$a, $update = 0) { if($is_owner && ! $update) $o .= get_birthdays(); - $cmnt_tpl = load_view_file('view/comment_item.tpl'); - $like_tpl = load_view_file('view/like.tpl'); - $noshare_tpl = load_view_file('view/like_noshare.tpl'); + require_once('include/conversation.php'); - $tpl = load_view_file('view/wall_item.tpl'); + $o .= conversation($a,$r,'profile',$display); - $droptpl = load_view_file('view/wall_item_drop.tpl'); - $fakedrop = load_view_file('view/wall_fake_drop.tpl'); - if($update) - $return_url = $_SESSION['return_url']; - else - $return_url = $_SESSION['return_url'] = $a->cmd; - - $alike = array(); - $dlike = array(); - - if($r !== false && count($r)) { - - $comments = array(); - foreach($r as $rr) { - if(intval($rr['gravity']) == 6) { - if(! x($comments,$rr['parent'])) - $comments[$rr['parent']] = 1; - else - $comments[$rr['parent']] += 1; - } - } - - foreach($r as $item) { - like_puller($a,$item,$alike,'like'); - like_puller($a,$item,$dlike,'dislike'); - } - - $comments_collapsed = false; - - foreach($r as $item) { - - $sparkle = ''; - $comment = ''; - $likebuttons = ''; - - $template = $tpl; - - $redirect_url = $a->get_baseurl() . '/redir/' . $item['cid'] ; - - if(((activity_match($item['verb'],ACTIVITY_LIKE)) || (activity_match($item['verb'],ACTIVITY_DISLIKE))) - && ($item['id'] != $item['parent'])) - continue; - - if($item['id'] == $item['parent']) { - $comments_seen = 0; - $comments_collapsed = false; - } - else - $comments_seen ++; - - - if(($comments[$item['parent']] > 2) && ($comments_seen <= ($comments[$item['parent']] - 2)) && ($item['gravity'] == 6)) { - if(! $comments_collapsed) { - $o .= ''; - $o .= ''; - } - - $lock = ((($item['private']) || (($item['uid'] == local_user()) && (strlen($item['allow_cid']) || strlen($item['allow_gid']) - || strlen($item['deny_cid']) || strlen($item['deny_gid'])))) - ? '
' . t('Private Message') . '
' - : '
'); - - if(can_write_wall($a,$a->profile['profile_uid'])) { - if($item['id'] == $item['parent']) { - $likebuttons = replace_macros((($item['private']) ? $noshare_tpl : $like_tpl),array( - '$id' => $item['id'], - '$likethis' => t("I like this \x28toggle\x29"), - '$nolike' => t("I don't like this \x28toggle\x29"), - '$share' => t('Share'), - '$wait' => t('Please wait') - )); - } - if($item['last-child']) { - $comment = replace_macros($cmnt_tpl,array( - '$return_path' => '', - '$jsreload' => '', // $_SESSION['return_url'], - '$type' => 'wall-comment', - '$id' => $item['item_id'], - '$parent' => $item['parent'], - '$profile_uid' => $a->profile['profile_uid'], - '$mylink' => $contact['url'], - '$mytitle' => t('This is you'), - '$myphoto' => $contact['thumb'], - '$comment' => t('Comment'), - '$submit' => t('Submit'), - '$ww' => '' - )); - } - } - - - $profile_url = $item['url']; - - // This is my profile page but I'm not the author of this post/comment. If it's somebody that's a fan or mutual friend, - // I can go directly to their profile as an authenticated guest. - - if(local_user() && ($item['contact-uid'] == local_user()) - && ($item['network'] === 'dfrn') && (! $item['self'] )) { - $profile_url = $redirect_url; - $sparkle = ' sparkle'; - } - else - $sparkle = ''; - - - $edpost = ''; - if((local_user()) && ($a->profile['profile_uid'] == local_user()) && ($item['id'] == $item['parent']) && (intval($item['wall']) == 1)) - $edpost = ''; - - - // We would prefer to use our own avatar link for this item because the one in the author-avatar might reference a - // remote site (which could be down). We will use author-avatar if we haven't got something stored locally. - // We use this same logic block in mod/network.php to determine it this is a third party post and we don't have any - // local contact info at all. In this module you should never encounter a third-party author, but we still will do - // the right thing if you ever do. - - $diff_author = ((link_compare($item['url'],$item['author-link'])) ? false : true); - - $profile_name = (((strlen($item['author-name'])) && $diff_author) ? $item['author-name'] : $item['name']); - $profile_avatar = (((strlen($item['author-avatar'])) && $diff_author) ? $item['author-avatar'] : $item['thumb']); - - $profile_link = $profile_url; - - $drop = ''; - $dropping = false; - - if(($item['contact-id'] == remote_user()) || ($item['uid'] == local_user())) - $dropping = true; - - $drop = replace_macros((($dropping)? $droptpl : $fakedrop), array('$id' => $item['id'], '$delete' => t('Delete'))); - - - $like = ((isset($alike[$item['id']])) ? format_like($alike[$item['id']],$alike[$item['id'] . '-l'],'like',$item['id']) : ''); - $dislike = ((isset($dlike[$item['id']])) ? format_like($dlike[$item['id']],$dlike[$item['id'] . '-l'],'dislike',$item['id']) : ''); - $location = (($item['location']) ? '' . $item['location'] . '' : ''); - $coord = (($item['coord']) ? '' . $item['coord'] . '' : ''); - if($coord) { - if($location) - $location .= '
(' . $coord . ')'; - else - $location = '' . $coord . ''; - } - - $indent = (($item['parent'] != $item['item_id']) ? ' comment' : ''); - - if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0) - $indent .= ' shiny'; - - - $tmp_item = replace_macros($template,array( - '$id' => $item['item_id'], - '$linktitle' => t('View $name\'s profile'), - '$profile_url' => $profile_link, - '$item_photo_menu' => item_photo_menu($item), - '$name' => $profile_name, - '$thumb' => $profile_avatar, - '$sparkle' => $sparkle, - '$title' => $item['title'], - '$body' => smilies(bbcode($item['body'])), - '$ago' => relative_date($item['created']), - '$lock' => $lock, - '$location' => $location, - '$indent' => $indent, - '$plink' => get_plink($item), - '$edpost' => $edpost, - '$drop' => $drop, - '$like' => $like, - '$vote' => $likebuttons, - '$dislike' => $dislike, - '$comment' => $comment - )); - - $arr = array('item' => $item, 'output' => $tmp_item); - call_hooks('display_item', $arr); - - $o .= $arr['output']; - - } - } - - if($update) { - return $o; - } + if(! $update) { - $o .= paginate($a); - $o .= '
' . t('Shared content is covered by the Creative Commons Attribution 3.0 license.') . '
'; + $o .= paginate($a); + $o .= '
' . t('Shared content is covered by the Creative Commons Attribution 3.0 license.') . '
'; + } return $o; } -- cgit v1.2.3 From c8f32536ff77193689efe69702f91122f97c1f36 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 11 Apr 2011 03:22:09 -0700 Subject: pull in new 'writable' dfrn flag --- mod/profile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index f98c28f8f..a12fd9af2 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -272,7 +272,7 @@ function profile_content(&$a, $update = 0) { $r = q("SELECT `item`.*, `item`.`id` AS `item_id`, `contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`network`, `contact`.`rel`, - `contact`.`thumb`, `contact`.`self`, + `contact`.`thumb`, `contact`.`self`, `contact`.`writable`, `contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 -- cgit v1.2.3 From ff15ea099310bab5cdcaa724274f3ef22301fcb4 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 11 Apr 2011 15:45:19 -0700 Subject: wrong variable passed --- mod/profile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index a12fd9af2..0a044069a 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -291,7 +291,7 @@ function profile_content(&$a, $update = 0) { require_once('include/conversation.php'); - $o .= conversation($a,$r,'profile',$display); + $o .= conversation($a,$r,'profile',$update); if(! $update) { -- cgit v1.2.3 From 5654ce926ca012acd9f725c8c7d6e32609a17646 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 12 Apr 2011 17:58:16 -0700 Subject: move all message display sub-functions from boot.php into conversation.php --- mod/profile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index 0a044069a..923f4fb90 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -50,6 +50,7 @@ function profile_content(&$a, $update = 0) { require_once("include/bbcode.php"); require_once('include/security.php'); + require_once('include/conversation.php'); $groups = array(); @@ -289,7 +290,6 @@ function profile_content(&$a, $update = 0) { $o .= get_birthdays(); - require_once('include/conversation.php'); $o .= conversation($a,$r,'profile',$update); -- cgit v1.2.3 From ab099e91028122dfb6b10cf9510b1b061f6f547f Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 17 Apr 2011 23:27:11 -0700 Subject: email integration, cont. --- mod/profile.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index 923f4fb90..fa2c261df 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -147,6 +147,26 @@ function profile_content(&$a, $update = 0) { $jotplugins = ''; $jotnets = ''; + + $mail_enabled = false; + $pubmail_enabled = false; + + if($is_owner) { + $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1", + intval(local_user()) + ); + if(count($r)) { + $mail_enabled = true; + if(intval($r[0]['pubmail'])) + $pubmail_enabled = true; + } + } + if($mail_enabled) { + $selected = (($pubmail_enabled) ? ' checked="checked" ' : ''); + $jotnets .= '
' + . t("Post to Email") . '
'; + } + call_hooks('jot_tool', $jotplugins); call_hooks('jot_networks', $jotnets); -- cgit v1.2.3 From a0179235d2d4672ba9dc79b33505555766b3228a Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 18 Apr 2011 20:20:04 -0700 Subject: provide a way to disable mailbox integration --- mod/profile.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index fa2c261df..77df6cbdb 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -148,10 +148,12 @@ function profile_content(&$a, $update = 0) { $jotplugins = ''; $jotnets = ''; + $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1); + $mail_enabled = false; $pubmail_enabled = false; - if($is_owner) { + if(($is_owner) && (! $mail_disabled)) { $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1", intval(local_user()) ); -- cgit v1.2.3 From e302741e49adc73150bcd3027de1fdb157600a9b Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 20 Apr 2011 05:48:12 -0700 Subject: merge status editor instances --- mod/profile.php | 95 ++++++++------------------------------------------------- 1 file changed, 13 insertions(+), 82 deletions(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index 77df6cbdb..eea6b92a5 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -120,88 +120,19 @@ function profile_content(&$a, $update = 0) { if(can_write_wall($a,$a->profile['profile_uid'])) { - $geotag = ((($is_owner || $commvisitor) && $a->profile['allow_location']) ? load_view_file('view/jot_geotag.tpl') : ''); - - $tpl = load_view_file('view/jot-header.tpl'); - - $a->page['htmlhead'] .= replace_macros($tpl, array( - '$baseurl' => $a->get_baseurl(), - '$geotag' => $geotag, - '$nickname' => $a->profile['nickname'], - '$linkurl' => t('Please enter a link URL:'), - '$utubeurl' => t('Please enter a YouTube link:'), - '$vidurl' => t("Please enter a video\x28.ogg\x29 link/URL:"), - '$audurl' => t("Please enter an audio\x28.ogg\x29 link/URL:"), - '$whereareu' => t('Where are you right now?'), - '$title' => t('Enter a title for this item') - )); - - require_once('include/acl_selectors.php'); - - $tpl = load_view_file('view/jot.tpl'); - - if(is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid'])))) - $lockstate = 'lock'; - else - $lockstate = 'unlock'; - - $jotplugins = ''; - $jotnets = ''; - - $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1); - - $mail_enabled = false; - $pubmail_enabled = false; - - if(($is_owner) && (! $mail_disabled)) { - $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1", - intval(local_user()) - ); - if(count($r)) { - $mail_enabled = true; - if(intval($r[0]['pubmail'])) - $pubmail_enabled = true; - } - } - if($mail_enabled) { - $selected = (($pubmail_enabled) ? ' checked="checked" ' : ''); - $jotnets .= '
' - . t("Post to Email") . '
'; - } - - call_hooks('jot_tool', $jotplugins); - - call_hooks('jot_networks', $jotnets); - - $tpl = replace_macros($tpl,array('$jotplugins' => $jotplugins)); - - $o .= replace_macros($tpl,array( - '$baseurl' => $a->get_baseurl(), - '$action' => 'item', - '$share' => t('Share'), - '$upload' => t('Upload photo'), - '$weblink' => t('Insert web link'), - '$youtube' => t('Insert YouTube video'), - '$video' => t('Insert Vorbis [.ogg] video'), - '$audio' => t('Insert Vorbis [.ogg] audio'), - '$setloc' => t('Set your location'), - '$noloc' => t('Clear browser location'), - '$title' => t('Set title'), - '$wait' => t('Please wait'), - '$permset' => t('Permission settings'), - '$content' => '', - '$post_id' => '', - '$defloc' => (($is_owner) ? $a->user['default-location'] : ''), - '$return_path' => $a->cmd, - '$visitor' => (($is_owner || $commvisitor) ? 'block' : 'none'), - '$lockstate' => $lockstate, - '$emailcc' => t('CC: email addresses'), - '$jotnets' => $jotnets, - '$emtitle' => t('Example: bob@example.com, mary@example.com'), - '$bang' => '', - '$acl' => (($is_owner) ? populate_acl($a->user, $celeb) : ''), - '$profile_uid' => $a->profile['profile_uid'] - )); + $x = array( + 'is_owner' => $is_owner, + 'allow_location' => ((($is_owner || $commvisitor) && $a->profile['allow_location']) ? true : false), + 'default_location' => (($is_owner) ? $a->user['default-location'] : ''), + 'nickname' => $a->profile['nickname'], + 'lockstate' => (((is_array($a->user) && ((strlen($a->user['allow_cid'])) || (strlen($a->user['allow_gid'])) || (strlen($a->user['deny_cid'])) || (strlen($a->user['deny_gid']))))) ? 'lock' : 'unlock'), + 'acl' => (($is_owner) ? populate_acl($a->user, $celeb) : ''), + 'bang' => '', + 'visitor' => (($is_owner || $commvisitor) ? 'block' : 'none'), + 'profile_uid' => $a->profile['profile_uid'] + ); + + $o .= status_editor($a,$x); } // This is ugly, but we can't pass the profile_uid through the session to the ajax updater, -- cgit v1.2.3 From c0b7000a836b5abe6b1e5b9edfac30a75a4a1178 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 20 Apr 2011 05:51:02 -0700 Subject: missing acl selector after merge --- mod/profile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index eea6b92a5..dfa5649e0 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -51,7 +51,7 @@ function profile_content(&$a, $update = 0) { require_once("include/bbcode.php"); require_once('include/security.php'); require_once('include/conversation.php'); - + require_once('include/acl_selectors.php'); $groups = array(); $tab = 'posts'; -- cgit v1.2.3 From 9e19eef1941fff3e2a8785e5daa6d978e9de4900 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 21 Apr 2011 17:29:47 -0700 Subject: "firewall" setting - block all public pages from the public if configured to do so --- mod/profile.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index dfa5649e0..c350aa087 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -2,6 +2,9 @@ function profile_init(&$a) { + if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) + return; + if($a->argc > 1) $which = $a->argv[1]; else { @@ -48,6 +51,13 @@ function profile_init(&$a) { function profile_content(&$a, $update = 0) { + if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) { + notice( t('Public access denied.') . EOL); + return; + } + + + require_once("include/bbcode.php"); require_once('include/security.php'); require_once('include/conversation.php'); -- cgit v1.2.3 From eeb3c13ad3af963b9150821fbdd6a5145d1cb188 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 21 Apr 2011 18:39:07 -0700 Subject: when public access is blocked, profile page should show login box --- mod/profile.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index c350aa087..2af6f2429 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -52,8 +52,7 @@ function profile_init(&$a) { function profile_content(&$a, $update = 0) { if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) { - notice( t('Public access denied.') . EOL); - return; + return login(); } -- cgit v1.2.3 From c052d688284fda76c612325b237d8352f2abb5d4 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 10 May 2011 16:12:50 -0700 Subject: don't use load_view_file() except in email templates and install of htconfig - to avoid getting wrong file when package is updated by copying over an older version. --- mod/profile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index 2af6f2429..0691c64b3 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -104,7 +104,7 @@ function profile_content(&$a, $update = 0) { if(x($_GET,'tab')) $tab = notags(trim($_GET['tab'])); - $tpl = load_view_file('view/profile_tabs.tpl'); + $tpl = file_get_contents('view/profile_tabs.tpl'); $o .= replace_macros($tpl,array( '$url' => $a->get_baseurl() . '/' . $a->cmd, -- cgit v1.2.3 From a00813497fccf295d72e35537599409b3f1eaa22 Mon Sep 17 00:00:00 2001 From: Friendika Date: Tue, 10 May 2011 23:35:31 -0700 Subject: bring back load_view_file for dispy templates --- mod/profile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index 0691c64b3..2af6f2429 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -104,7 +104,7 @@ function profile_content(&$a, $update = 0) { if(x($_GET,'tab')) $tab = notags(trim($_GET['tab'])); - $tpl = file_get_contents('view/profile_tabs.tpl'); + $tpl = load_view_file('view/profile_tabs.tpl'); $o .= replace_macros($tpl,array( '$url' => $a->get_baseurl() . '/' . $a->cmd, -- cgit v1.2.3 From b2e92e0af32f86212d15748c6d432d658905d4b6 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 11 May 2011 04:37:13 -0700 Subject: deprecate load_view_file --- mod/profile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index 2af6f2429..340c96d86 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -104,7 +104,7 @@ function profile_content(&$a, $update = 0) { if(x($_GET,'tab')) $tab = notags(trim($_GET['tab'])); - $tpl = load_view_file('view/profile_tabs.tpl'); + $tpl = get_markup_template('profile_tabs.tpl'); $o .= replace_macros($tpl,array( '$url' => $a->get_baseurl() . '/' . $a->cmd, -- cgit v1.2.3 From 22cf6b3fe681af22b23de48610cb4801b742b04b Mon Sep 17 00:00:00 2001 From: Friendika Date: Fri, 20 May 2011 19:28:48 -0700 Subject: 'mark seen' not getting all msgs on profile page --- mod/profile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mod/profile.php') diff --git a/mod/profile.php b/mod/profile.php index 340c96d86..634aec460 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -168,7 +168,7 @@ function profile_content(&$a, $update = 0) { // Oh - while we're here... reset the Unseen messages $r = q("UPDATE `item` SET `unseen` = 0 - WHERE `type` != 'remote' AND `unseen` = 1 AND `uid` = %d", + WHERE `wall` = 1 AND `unseen` = 1 AND `uid` = %d", intval($_SESSION['uid']) ); -- cgit v1.2.3