From 3f432a7b82480dd985dbc2a67ae23cfc1ed258c6 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 16 Mar 2011 19:36:59 -0700 Subject: [PATCH 1/7] share,retweet,relay,forward, whatever --- boot.php | 2 +- images/remote-link.gif | Bin 357 -> 365 bytes images/share.gif | Bin 0 -> 155 bytes mod/display.php | 1 + mod/network.php | 1 + mod/photos.php | 3 ++- mod/profile.php | 1 + mod/profile_photo.php | 2 +- mod/share.php | 23 +++++++++++++++++++++++ view/de/jot-header.tpl | 10 ++++++++++ view/en/jot-header.tpl | 8 ++++++++ view/fr/jot-header.tpl | 9 +++++++++ view/it/jot-header.tpl | 9 +++++++++ view/like.tpl | 1 + view/like_noshare.tpl | 5 +++++ view/theme/duepuntozero/style.css | 4 ++++ view/theme/loozah/style.css | 4 ++++ 17 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 images/share.gif create mode 100644 mod/share.php create mode 100644 view/like_noshare.tpl diff --git a/boot.php b/boot.php index b03221bf8..08caa72ab 100644 --- a/boot.php +++ b/boot.php @@ -2,7 +2,7 @@ set_time_limit(0); -define ( 'FRIENDIKA_VERSION', '2.1.919' ); +define ( 'FRIENDIKA_VERSION', '2.1.920' ); define ( 'DFRN_PROTOCOL_VERSION', '2.1' ); define ( 'DB_UPDATE_VERSION', 1043 ); diff --git a/images/remote-link.gif b/images/remote-link.gif index 008397fe8d957604ef4be8ec2ab96f4f1b6805b0..1224e3db5fb7f8c72353b5291029ef1ef965dbd3 100644 GIT binary patch delta 167 zcmaFL^p=|?zfIt8U8Q4k>%rEfJ zk!tN;VpOSPpfhzvYo<<$OT?QmKcZu7Zk}S=8IpJC@jE9cPc4f@yb(Q9I_&z~+>dIMz{anrBf9S4A;8ZUqTn(!LW)g3*Ns~^Qb|EcD09II T!A(Nz*3U@wj@jkn$Y2csfMPZH delta 159 zcmaFM^pt7Bx%!_hj9d)%3_1)zAOM66Y)uE|7kKDMwYDxXs?;&inYuzXFeA++V$ISj zmKd9xT;>jH+#DUg6*UtA#F$y#w=j0MGIqXroKfN;!y&E|T_L2v#;>R(%f-SV$&)Oo zBqgAv$ji)R?^7{FNkV|1kDJkraluqJd6DI=jKYyh5(-K}>s=Vxg$4Ht39;{RPCb(9 Ke%#HG!5RS7=qZr^ diff --git a/images/share.gif b/images/share.gif new file mode 100644 index 0000000000000000000000000000000000000000..035fa2e3817e32e4ac4eeb8b11b1e4bb7a119785 GIT binary patch literal 155 zcmV;M0A&A1Nk%w1VGsZi0OJn;GiI4Lj^$9C=v|}gX{zjYvF(Dn?~lOno5u2|&GfX? z^}yWs&Expl>iXvK{Qv*|A^8LW3IGoPEC2ui01yBW000C?@X1NvBBW{yy4aM^bqOeq zodPl_Fi;4AI7Co5jZsiU`)-XE!sKWjOpikgfK(V54}^ $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') )); } diff --git a/mod/network.php b/mod/network.php index 32c7216d4..1f92145d1 100644 --- a/mod/network.php +++ b/mod/network.php @@ -364,6 +364,7 @@ function network_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') )); } diff --git a/mod/photos.php b/mod/photos.php index 929d1c971..4bb6e3eab 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -1073,7 +1073,7 @@ function photos_content(&$a) { $tpl = load_view_file('view/photo_item.tpl'); $return_url = $a->cmd; - $like_tpl = load_view_file('view/like.tpl'); + $like_tpl = load_view_file('view/lik_noshare.tpl'); $likebuttons = ''; @@ -1082,6 +1082,7 @@ function photos_content(&$a) { '$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') )); } 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') )); } diff --git a/mod/profile_photo.php b/mod/profile_photo.php index 0f84a85c9..5365aa3b8 100644 --- a/mod/profile_photo.php +++ b/mod/profile_photo.php @@ -87,7 +87,7 @@ function profile_photo_post(&$a) { ); // Update global directory in background - $url = $_SESSION['my_url']; + $url = $a->get_baseurl() . '/profile/' . $a->user['nickname']; if($url && strlen(get_config('system','directory_submit_url'))) proc_run('php',"include/directory.php","$url"); } diff --git a/mod/share.php b/mod/share.php new file mode 100644 index 000000000..8a8229e8a --- /dev/null +++ b/mod/share.php @@ -0,0 +1,23 @@ +argc > 1) ? intval($a->argv[1]) : 0); + if((! $post_id) || (! local_user())) + killme(); + + $r = q("SELECT * FROM `item` WHERE `id` = %d LIMIT 1", + intval($post_id) + ); + if(! count($r) || $r[0]['private']) + killme(); + + $o = ''; + + $o .= '♲ ' . $r[0]['author-name'] . '
'; + $o .= prepare_body($r[0]); + echo $o . '
'; + killme(); +} \ No newline at end of file diff --git a/view/de/jot-header.tpl b/view/de/jot-header.tpl index 58403f1ba..25d28c3a7 100644 --- a/view/de/jot-header.tpl +++ b/view/de/jot-header.tpl @@ -111,6 +111,16 @@ tinyMCE.init({ } } + function jotShare(id) { + $('#like-rotator-' + id).show(); + $.get('share/' + id, function(data) { + tinyMCE.execCommand('mceInsertRawHTML',false,data); + $('#like-rotator-' + id).hide(); + $(window).scrollTop(0); + }); + } + + function linkdropper(event) { var linkFound = event.dataTransfer.types.contains("text/uri-list"); diff --git a/view/en/jot-header.tpl b/view/en/jot-header.tpl index fe818410e..20f84b851 100644 --- a/view/en/jot-header.tpl +++ b/view/en/jot-header.tpl @@ -111,6 +111,14 @@ tinyMCE.init({ } } + function jotShare(id) { + $('#like-rotator-' + id).show(); + $.get('share/' + id, function(data) { + tinyMCE.execCommand('mceInsertRawHTML',false,data); + $('#like-rotator-' + id).hide(); + $(window).scrollTop(0); + }); + } function linkdropper(event) { var linkFound = event.dataTransfer.types.contains("text/uri-list"); diff --git a/view/fr/jot-header.tpl b/view/fr/jot-header.tpl index ff7e543a5..a4c5f42a4 100644 --- a/view/fr/jot-header.tpl +++ b/view/fr/jot-header.tpl @@ -110,6 +110,15 @@ tinyMCE.init({ } } + function jotShare(id) { + $('#like-rotator-' + id).show(); + $.get('share/' + id, function(data) { + tinyMCE.execCommand('mceInsertRawHTML',false,data); + $('#like-rotator-' + id).hide(); + $(window).scrollTop(0); + }); + } + function linkdropper(event) { var linkFound = event.dataTransfer.types.contains("text/uri-list"); diff --git a/view/it/jot-header.tpl b/view/it/jot-header.tpl index 117cd1651..ff28def61 100644 --- a/view/it/jot-header.tpl +++ b/view/it/jot-header.tpl @@ -111,6 +111,15 @@ tinyMCE.init({ } } + function jotShare(id) { + $('#like-rotator-' + id).show(); + $.get('share/' + id, function(data) { + tinyMCE.execCommand('mceInsertRawHTML',false,data); + $('#like-rotator-' + id).hide(); + $(window).scrollTop(0); + }); + } + function linkdropper(event) { var linkFound = event.dataTransfer.types.contains("text/uri-list"); diff --git a/view/like.tpl b/view/like.tpl index e36a624a4..4f530407e 100644 --- a/view/like.tpl +++ b/view/like.tpl @@ -1,5 +1,6 @@ diff --git a/view/like_noshare.tpl b/view/like_noshare.tpl new file mode 100644 index 000000000..e36a624a4 --- /dev/null +++ b/view/like_noshare.tpl @@ -0,0 +1,5 @@ + diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index 54a522881..e44ab80c2 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -921,6 +921,10 @@ input#dfrn-url { cursor: pointer; } +.wall-item-share-buttons { + margin-left: 5px; +} + .wall-item-links-wrapper { float: left; } diff --git a/view/theme/loozah/style.css b/view/theme/loozah/style.css index f1de801cb..13c2dda27 100644 --- a/view/theme/loozah/style.css +++ b/view/theme/loozah/style.css @@ -993,6 +993,10 @@ input#dfrn-url { border-right: 2px solid #fff; } +.wall-item-share-buttons { + margin-left: 5px; +} + .wall-item-links-wrapper { float: left; } From 8fd989c568f6452ce1a91914cef4a33c5d3b4d76 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 16 Mar 2011 19:57:13 -0700 Subject: [PATCH 2/7] protect tags from double expansion during RT --- mod/item.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mod/item.php b/mod/item.php index 90fb546bc..6e6e822d0 100644 --- a/mod/item.php +++ b/mod/item.php @@ -212,6 +212,8 @@ function item_post(&$a) { if(count($tags)) { foreach($tags as $tag) { if(strpos($tag,'#') === 0) { + if(strpos($tag,'[url=')) + continue; $basetag = str_replace('_',' ',substr($tag,1)); $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?search=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body); if(strlen($str_tags)) @@ -220,6 +222,8 @@ function item_post(&$a) { continue; } if(strpos($tag,'@') === 0) { + if(strpos($tag,'[url=')) + continue; $stat = false; $name = substr($tag,1); if((strpos($name,'@')) || (strpos($name,'http://'))) { From 9e1ca52e45263c38776bfa15f1ed2a9907b39597 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 16 Mar 2011 20:14:19 -0700 Subject: [PATCH 3/7] small position adjustment --- view/theme/duepuntozero/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index e44ab80c2..ad2aac9be 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -922,7 +922,7 @@ input#dfrn-url { } .wall-item-share-buttons { - margin-left: 5px; + margin-left: 10px; } .wall-item-links-wrapper { From 334353e502db5abd7ee248d183a915ff7468de3a Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 16 Mar 2011 21:14:22 -0700 Subject: [PATCH 4/7] vorbis audio/video link buttons --- images/audio.gif | Bin 0 -> 559 bytes images/video.gif | Bin 0 -> 257 bytes mod/network.php | 2 ++ mod/profile.php | 2 ++ view/de/jot-header.tpl | 14 ++++++++++++++ view/en/jot-header.tpl | 15 +++++++++++++++ view/fr/jot-header.tpl | 14 ++++++++++++++ view/it/jot-header.tpl | 14 ++++++++++++++ view/jot.tpl | 8 +++++++- view/theme/duepuntozero/style.css | 14 ++++++++++++-- view/theme/loozah/style.css | 16 +++++++++++++--- 11 files changed, 93 insertions(+), 6 deletions(-) create mode 100644 images/audio.gif create mode 100644 images/video.gif diff --git a/images/audio.gif b/images/audio.gif new file mode 100644 index 0000000000000000000000000000000000000000..4be9771161520992606bf9859e9211569539a54b GIT binary patch literal 559 zcmZ?wbhEHb6krfwI2O&IYh-R{X65b^=;a?A5gi|vkeQH@k(7~}m|c>TQ<|Aum{U-a zQB<8*R90G1Q&v@1Qrlfs*H~58RMXg6-`w8R*45hC+u1v@eZtJ12~#>I&hD5rt7Fpa zzDd(MC(r4cGN*gW+^(r}yQeLfICbXaxyvTcT|Q~v>RIy^&7Qw_+JcqS7p|JKZ2g=S zTNW>0y<`Otty!>g)6$h|7p&U0Y}LAjYj>?!vth})?Mv6~Sh8Wy>h+t~Y}m4F)Bd%a zwyod1edE@htG6HBwBz8mUHdj1IJtZO;r)k?A3ApG$ceMZPoF=2=E8|H7Y?1haq8Tq z)8{UqK7aY_#jA%eeLQ#R+U4tauHL+R_2#{6x9;7z^WgUVCwCq^x%=?x-G|SvKYst8 zzCiIO3nLdpJ%bJd5P;%@fxV}pzNxvTKFGYav&k*UsH@f0F36<6+1=75)M9GAkFK+C zxP7OC0h7Fjop(rtb*GaivzD>5UqFyfr+*Z?m$9w0vxi!znKqM(vbv$Zqf(~;CnJxL zsI0QBLZ>PR11lS^sHBZdSD>#a3zx9CmE4?QZhkQKi<_X K(9FchU=08g7)Pc6 literal 0 HcmV?d00001 diff --git a/images/video.gif b/images/video.gif new file mode 100644 index 0000000000000000000000000000000000000000..e4d5e8cddf83895a031908864820be43634e57ed GIT binary patch literal 257 zcmZ?wbhEHb6krfwXpv%IWMtIW)z>f&^>X)0OiXO3@0-*)Y39rYjmu8YTe)@5o@0wo zyxo1`+Jy_(PTzQS>+YlL58pq2`u5D1%g^6@egFQ`%P;>Q|9bZG$M^5Q|Ns8;9}_74 zWMSlDkY~_g00NMm46Jnu-+EIrnbM;87z70hd}IVTd7>7-t?{#vZxATDAkyd2+o-@I z6E(9b*-=zNpV7gkP{BpKW5a= 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'), 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'), diff --git a/view/de/jot-header.tpl b/view/de/jot-header.tpl index 25d28c3a7..62fbe84e4 100644 --- a/view/de/jot-header.tpl +++ b/view/de/jot-header.tpl @@ -104,6 +104,20 @@ tinyMCE.init({ } } + function jotVideoURL() { + reply = prompt("Please enter a video(.ogg) link/URL:"); + if(reply && reply.length) { + tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]'); + } + } + + function jotAudioURL() { + reply = prompt("Please enter an audio(.ogg) link/URL:"); + if(reply && reply.length) { + tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]'); + } + } + function jotGetLocation() { reply = prompt("Wo bist du im Moment?", $('#jot-location').val()); if(reply && reply.length) { diff --git a/view/en/jot-header.tpl b/view/en/jot-header.tpl index 20f84b851..d73fe7d62 100644 --- a/view/en/jot-header.tpl +++ b/view/en/jot-header.tpl @@ -104,6 +104,21 @@ tinyMCE.init({ } } + function jotVideoURL() { + reply = prompt("Please enter a video(.ogg) link/URL:"); + if(reply && reply.length) { + tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]'); + } + } + + function jotAudioURL() { + reply = prompt("Please enter an audio(.ogg) link/URL:"); + if(reply && reply.length) { + tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]'); + } + } + + function jotGetLocation() { reply = prompt("Where are you right now?", $('#jot-location').val()); if(reply && reply.length) { diff --git a/view/fr/jot-header.tpl b/view/fr/jot-header.tpl index a4c5f42a4..b1b6dacf0 100644 --- a/view/fr/jot-header.tpl +++ b/view/fr/jot-header.tpl @@ -103,6 +103,20 @@ tinyMCE.init({ } } + function jotVideoURL() { + reply = prompt("Please enter a video(.ogg) link/URL:"); + if(reply && reply.length) { + tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]'); + } + } + + function jotAudioURL() { + reply = prompt("Please enter an audio(.ogg) link/URL:"); + if(reply && reply.length) { + tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]'); + } + } + function jotGetLocation() { reply = prompt("Where are you right now?", $('#jot-location').val()); if(reply && reply.length) { diff --git a/view/it/jot-header.tpl b/view/it/jot-header.tpl index ff28def61..8ca5a0717 100644 --- a/view/it/jot-header.tpl +++ b/view/it/jot-header.tpl @@ -104,6 +104,20 @@ tinyMCE.init({ } } + function jotVideoURL() { + reply = prompt("Please enter a video(.ogg) link/URL:"); + if(reply && reply.length) { + tinyMCE.execCommand('mceInsertRawHTML',false,'[video]' + reply + '[/video]'); + } + } + + function jotAudioURL() { + reply = prompt("Please enter an audio(.ogg) link/URL:"); + if(reply && reply.length) { + tinyMCE.execCommand('mceInsertRawHTML',false,'[audio]' + reply + '[/audio]'); + } + } + function jotGetLocation() { reply = prompt("Dove ti trovi ora?", $('#jot-location').val()); if(reply && reply.length) { diff --git a/view/jot.tpl b/view/jot.tpl index 68139ddc0..fd85b9267 100644 --- a/view/jot.tpl +++ b/view/jot.tpl @@ -26,7 +26,13 @@ $weblink
- $youtube + $youtube +
+
+ $video +
+
+ $audio
$setloc diff --git a/view/theme/duepuntozero/style.css b/view/theme/duepuntozero/style.css index ad2aac9be..ce75655fb 100644 --- a/view/theme/duepuntozero/style.css +++ b/view/theme/duepuntozero/style.css @@ -206,8 +206,10 @@ div.wall-item-content-wrapper.shiny { /* from default */ #jot-perms-icon, #profile-location, -#profile-nolocation, +#profile-nolocation, +#profile-youtube, #profile-video, +#profile-audio, #profile-link, #wall-image-upload, #profile-upload-wrapper, @@ -1056,6 +1058,14 @@ input#dfrn-url { float: left; margin-left: 20px; } +#profile-video-wrapper { + float: left; + margin-left: 20px; +} +#profile-audio-wrapper { + float: left; + margin-left: 20px; +} #profile-location-wrapper { float: left; margin-left: 20px; @@ -1067,7 +1077,7 @@ input#dfrn-url { #profile-jot-perms { float: left; - margin-left: 200px; + margin-left: 150px; font-weight: bold; font-size: 1.2em; } diff --git a/view/theme/loozah/style.css b/view/theme/loozah/style.css index 13c2dda27..1c378793a 100644 --- a/view/theme/loozah/style.css +++ b/view/theme/loozah/style.css @@ -107,8 +107,10 @@ blockquote:before { #jot-perms-icon, #profile-location, -#profile-nolocation, -#profile-video, +#profile-nolocation, +#profile-youtube, +#profile-video, +#profile-audio, #profile-link, #wall-image-upload, #profile-upload-wrapper, @@ -1125,6 +1127,14 @@ padding: 5px 10px 0px; float: left; margin-left: 20px; } +#profile-video-wrapper { + float: left; + margin-left: 20px; +} +#profile-audio-wrapper { + float: left; + margin-left: 20px; +} #profile-location-wrapper { float: left; margin-left: 20px; @@ -1136,7 +1146,7 @@ padding: 5px 10px 0px; #profile-jot-perms { float: left; - margin-left: 200px; + margin-left: 150px; font-weight: bold; font-size: 1.2em; } From 9d9176f87e6db2f34c85ee098cede766d0744e9b Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 16 Mar 2011 21:49:28 -0700 Subject: [PATCH 5/7] no sharing from thread display page --- mod/display.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/display.php b/mod/display.php index f919cba64..059952adc 100644 --- a/mod/display.php +++ b/mod/display.php @@ -104,7 +104,7 @@ function display_content(&$a) { $cmnt_tpl = load_view_file('view/comment_item.tpl'); - $like_tpl = load_view_file('view/like.tpl'); + $like_tpl = load_view_file('view/like_noshare.tpl'); $tpl = load_view_file('view/wall_item.tpl'); $wallwall = load_view_file('view/wallwall_item.tpl'); From 47f0abf27e2aa0f5443badd2a43617b922662bba Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 16 Mar 2011 22:04:00 -0700 Subject: [PATCH 6/7] no sharing icon for private msgs --- mod/network.php | 3 ++- mod/profile.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mod/network.php b/mod/network.php index ad028df1f..abdf59c48 100644 --- a/mod/network.php +++ b/mod/network.php @@ -219,6 +219,7 @@ function network_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'); $wallwall = load_view_file('view/wallwall_item.tpl'); @@ -362,7 +363,7 @@ function network_content(&$a, $update = 0) { $likebuttons = ''; 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"), 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"), From b3050d3bc8fc812f0579982e1c866ab07499e0a8 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 16 Mar 2011 22:27:34 -0700 Subject: [PATCH 7/7] no birthdays for nonexistent contacts --- boot.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boot.php b/boot.php index 08caa72ab..d02ecd344 100644 --- a/boot.php +++ b/boot.php @@ -2428,6 +2428,8 @@ function get_birthdays() { $o .= '
'; foreach($r as $rr) { + if(! strlen($rr['name'])) + continue; $now = strtotime('now'); $today = (((strtotime($rr['start'] . ' +00:00') < $now) && (strtotime($rr['finish'] . ' +00:00') > $now)) ? true : false);