From 3f432a7b82480dd985dbc2a67ae23cfc1ed258c6 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 16 Mar 2011 19:36:59 -0700 Subject: [PATCH] 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 b03221bf80..08caa72ab9 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 32c7216d44..1f92145d10 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 929d1c971c..4bb6e3eab4 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 88fc16ebb1..3354bc9a33 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 0f84a85c92..5365aa3b87 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 0000000000..8a8229e8a1 --- /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 58403f1ba6..25d28c3a7b 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 fe818410e5..20f84b851e 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 ff7e543a5e..a4c5f42a43 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 117cd16511..ff28def619 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 e36a624a41..4f530407e1 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 0000000000..e36a624a41 --- /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 54a522881f..e44ab80c28 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 f1de801cb0..13c2dda272 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; }