Merge branch 'master' of git://github.com/friendika/friendika

This commit is contained in:
Tobias Diekershoff 2011-03-17 07:08:48 +01:00
commit f4f5095e19
21 changed files with 184 additions and 12 deletions

View file

@ -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 .= '<div id="birthday-title-end"></div>';
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);

BIN
images/audio.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 559 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 357 B

After

Width:  |  Height:  |  Size: 365 B

BIN
images/share.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

BIN
images/video.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

View file

@ -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')
));
}

View file

@ -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://'))) {

View file

@ -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')
));
}

View file

@ -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')
));
}

View file

@ -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')
));
}

View file

@ -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");
}

23
mod/share.php Normal file
View file

@ -0,0 +1,23 @@
<?php
require_once('bbcode.php');
function share_init(&$a) {
$post_id = (($a->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 .= '&#x2672; <a href="' . $r[0]['author-link'] . '">' . $r[0]['author-name'] . '</a><br />';
$o .= prepare_body($r[0]);
echo $o . '<br />';
killme();
}

View file

@ -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) {
@ -111,6 +125,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");

View file

@ -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) {
@ -111,6 +126,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");

View file

@ -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) {
@ -110,6 +124,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");

View file

@ -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) {
@ -111,6 +125,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");

View file

@ -26,7 +26,13 @@
<img id="profile-link" src="images/link-icon.gif" alt="$weblink" title="$weblink" ondragenter="return linkdropper(event);" ondragover="return linkdropper(event);" ondrop="linkdrop(event);" onclick="jotGetLink();" />
</div>
<div id="profile-youtube-wrapper" style="display: $visitor;" >
<img id="profile-video" src="images/youtube_icon.gif" alt="$youtube" title="$youtube" onclick="jotGetVideo();" />
<img id="profile-youtube" src="images/youtube_icon.gif" alt="$youtube" title="$youtube" onclick="jotGetVideo();" />
</div>
<div id="profile-video-wrapper" style="display: $visitor;" >
<img id="profile-video" src="images/video.gif" alt="$video" title="$video" onclick="jotVideoURL();" />
</div>
<div id="profile-audio-wrapper" style="display: $visitor;" >
<img id="profile-audio" src="images/audio.gif" alt="$audio" title="$audio" onclick="jotAudioURL();" />
</div>
<div id="profile-location-wrapper" style="display: $visitor;" >
<img id="profile-location" src="images/globe.gif" alt="$setloc" title="$setloc" onclick="jotGetLocation();" />

View file

@ -1,5 +1,6 @@
<div class="wall-item-like-buttons" id="wall-item-like-buttons-$id">
<img src="images/like.gif" alt="$likethis" title="$likethis" onclick="dolike($id,'like');" />
<img src="images/dislike.gif" alt="$nolike" title="$nolike" onclick="dolike($id,'dislike');" />
<img src="images/share.gif" alt="$share" title="$share" class="wall-item-share-buttons" onclick="jotShare($id);" />
<img id="like-rotator-$id" class="like-rotator" src="images/rotator.gif" alt="$wait" title="$wait" style="display: none;" />
</div>

5
view/like_noshare.tpl Normal file
View file

@ -0,0 +1,5 @@
<div class="wall-item-like-buttons" id="wall-item-like-buttons-$id">
<img src="images/like.gif" alt="$likethis" title="$likethis" onclick="dolike($id,'like');" />
<img src="images/dislike.gif" alt="$nolike" title="$nolike" onclick="dolike($id,'dislike');" />
<img id="like-rotator-$id" class="like-rotator" src="images/rotator.gif" alt="$wait" title="$wait" style="display: none;" />
</div>

View file

@ -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,
@ -921,6 +923,10 @@ input#dfrn-url {
cursor: pointer;
}
.wall-item-share-buttons {
margin-left: 10px;
}
.wall-item-links-wrapper {
float: left;
}
@ -1052,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;
@ -1063,7 +1077,7 @@ input#dfrn-url {
#profile-jot-perms {
float: left;
margin-left: 200px;
margin-left: 150px;
font-weight: bold;
font-size: 1.2em;
}

View file

@ -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,
@ -993,6 +995,10 @@ input#dfrn-url {
border-right: 2px solid #fff;
}
.wall-item-share-buttons {
margin-left: 5px;
}
.wall-item-links-wrapper {
float: left;
}
@ -1121,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;
@ -1132,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;
}