diff --git a/boot.php b/boot.php index b03221bf8..d02ecd344 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 ); @@ -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); diff --git a/images/audio.gif b/images/audio.gif new file mode 100644 index 000000000..4be977116 Binary files /dev/null and b/images/audio.gif differ diff --git a/images/remote-link.gif b/images/remote-link.gif index 008397fe8..1224e3db5 100644 Binary files a/images/remote-link.gif and b/images/remote-link.gif differ diff --git a/images/share.gif b/images/share.gif new file mode 100644 index 000000000..035fa2e38 Binary files /dev/null and b/images/share.gif differ diff --git a/images/video.gif b/images/video.gif new file mode 100644 index 000000000..e4d5e8cdd Binary files /dev/null and b/images/video.gif differ diff --git a/mod/display.php b/mod/display.php index 096ea16c9..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'); @@ -155,6 +155,7 @@ function display_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/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://'))) { diff --git a/mod/network.php b/mod/network.php index 32c7216d4..abdf59c48 100644 --- a/mod/network.php +++ b/mod/network.php @@ -92,6 +92,8 @@ function network_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'), @@ -217,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'); @@ -360,10 +363,11 @@ 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"), + '$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..c0989bd28 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'), @@ -265,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'); @@ -307,10 +310,11 @@ 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"), + '$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'] . '