Merge https://github.com/redmatrix/hubzilla into pending_merge
This commit is contained in:
@@ -162,10 +162,10 @@ function diaspora2bb($s, $use_zrl = false) {
|
||||
}
|
||||
|
||||
//$s = preg_replace("/([^\]\=]|^)(https?\:\/\/)(vimeo|youtu|www\.youtube|soundcloud)([a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)/ism", '$1[url=$2$3$4]$2$3$4[/url]',$s);
|
||||
$s = bb_tag_preg_replace("/\[url\=?(.*?)\]https?:\/\/www.youtube.com\/watch\?v\=(.*?)\[\/url\]/ism",'[youtube]$2[/youtube]','url',$s);
|
||||
$s = bb_tag_preg_replace("/\[url\=https?:\/\/www.youtube.com\/watch\?v\=(.*?)\].*?\[\/url\]/ism",'[youtube]$1[/youtube]','url',$s);
|
||||
$s = bb_tag_preg_replace("/\[url\=?(.*?)\]https?:\/ \/vimeo.com\/([0-9]+)(.*?)\[\/url\]/ism",'[vimeo]$2[/vimeo]','url',$s);
|
||||
$s = bb_tag_preg_replace("/\[url\=https?:\/\/vimeo.com\/([0-9]+)\](.*?)\[\/url\]/ism",'[vimeo]$1[/vimeo]','url',$s);
|
||||
$s = bb_tag_preg_replace("/\[url\=?(.*?)\]https?:\/\/www.youtube.com\/watch\?v\=(.*?)\[\/url\]/ism",'[embed]https://www.youtube.com/watch?v=$2[/embed]','url',$s);
|
||||
$s = bb_tag_preg_replace("/\[url\=https?:\/\/www.youtube.com\/watch\?v\=(.*?)\].*?\[\/url\]/ism",'[embed]https://www.youtube.com/watch?v=$1[/embed]','url',$s);
|
||||
$s = bb_tag_preg_replace("/\[url\=?(.*?)\]https?:\/ \/vimeo.com\/([0-9]+)(.*?)\[\/url\]/ism",'[embed]https://vimeo.com/$2[/embed]','url',$s);
|
||||
$s = bb_tag_preg_replace("/\[url\=https?:\/\/vimeo.com\/([0-9]+)\](.*?)\[\/url\]/ism",'[embed]https://vimeo.com/$1[/embed]','url',$s);
|
||||
// remove duplicate adjacent code tags
|
||||
$s = preg_replace("/(\[code\])+(.*?)(\[\/code\])+/ism","[code]$2[/code]", $s);
|
||||
|
||||
@@ -440,6 +440,9 @@ function bb2diaspora($Text,$preserve_nl = false, $fordiaspora = true) {
|
||||
// So take off the angle brackets of any such URL
|
||||
$Text = preg_replace("/<http(.*?)>/is", "http$1", $Text);
|
||||
|
||||
// Remove empty zrl links
|
||||
$Text = preg_replace("/\[zrl\=\].*?\[\/zrl\]/is", "", $Text);
|
||||
|
||||
// Remove all unconverted tags
|
||||
$Text = strip_tags($Text);
|
||||
|
||||
|
||||
@@ -681,7 +681,6 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $
|
||||
|
||||
$body = prepare_body($item,true);
|
||||
|
||||
$is_photo = ((($item['resource_type'] == 'photo') && (feature_enabled($profile_owner,'large_photos'))) ? true : false);
|
||||
$has_tags = (($body['tags'] || $body['categories'] || $body['mentions'] || $body['attachments'] || $body['folders']) ? true : false);
|
||||
|
||||
$tmp_item = array(
|
||||
@@ -698,6 +697,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $
|
||||
'thumb' => $profile_avatar,
|
||||
'title' => $item['title'],
|
||||
'body' => $body['html'],
|
||||
'photo' => $body['photo'],
|
||||
'tags' => $body['tags'],
|
||||
'categories' => $body['categories'],
|
||||
'mentions' => $body['mentions'],
|
||||
@@ -738,7 +738,6 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $
|
||||
'previewing' => $previewing,
|
||||
'wait' => t('Please wait'),
|
||||
'thread_level' => 1,
|
||||
'is_photo' => $is_photo,
|
||||
'has_tags' => $has_tags,
|
||||
);
|
||||
|
||||
|
||||
@@ -734,6 +734,11 @@ function import_channel_photo($photo,$type,$aid,$uid) {
|
||||
$photo_failure = true;
|
||||
}
|
||||
|
||||
return(($photo_failure)? false : true);
|
||||
//return(($photo_failure)? false : true);
|
||||
|
||||
if($photo_failure)
|
||||
return false;
|
||||
else
|
||||
return $hash;
|
||||
|
||||
}
|
||||
|
||||
@@ -137,4 +137,4 @@ class photo_gd extends photo_driver {
|
||||
return $string;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1233,7 +1233,7 @@ function theme_attachments(&$item) {
|
||||
if($label == ' ')
|
||||
$label = t('Unknown Attachment');
|
||||
|
||||
$title = t('Attachment') . ' - ' . (($r['length']) ? userReadableSize($r['length']) : t('Size Unknown'));
|
||||
$title = t('Size') . ' ' . (($r['length']) ? userReadableSize($r['length']) : t('unknown'));
|
||||
|
||||
require_once('include/identity.php');
|
||||
if(is_foreigner($item['author_xchan']))
|
||||
|
||||
@@ -814,7 +814,34 @@ function import_xchan($arr,$ud_flags = UPDATE_FLAGS_UPDATED, $ud_arr = null) {
|
||||
if ($local) {
|
||||
$ph = z_fetch_url($arr['photo'], true);
|
||||
if ($ph['success']) {
|
||||
import_channel_photo($ph['body'], $arr['photo_mimetype'], $local[0]['channel_account_id'],$local[0]['channel_id']);
|
||||
|
||||
$hash = import_channel_photo($ph['body'], $arr['photo_mimetype'], $local[0]['channel_account_id'], $local[0]['channel_id']);
|
||||
|
||||
if($hash) {
|
||||
// unless proven otherwise
|
||||
$is_default_profile = 1;
|
||||
|
||||
$profile = q("select is_default from profile where aid = %d and uid = %d limit 1",
|
||||
intval($local[0]['channel_account_id']),
|
||||
intval($local[0]['channel_id'])
|
||||
);
|
||||
if($profile) {
|
||||
if(! intval($profile[0]['is_default']))
|
||||
$is_default_profile = 0;
|
||||
}
|
||||
|
||||
// If setting for the default profile, unset the profile photo flag from any other photos I own
|
||||
if($is_default_profile) {
|
||||
q("UPDATE photo SET photo_usage = %d WHERE photo_usage = %d AND resource_id != '%s' AND aid = %d AND uid = %d",
|
||||
intval(PHOTO_NORMAL),
|
||||
intval(PHOTO_PROFILE),
|
||||
dbesc($hash),
|
||||
intval($local[0]['channel_account_id']),
|
||||
intval($local[0]['channel_id'])
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// reset the names in case they got messed up when we had a bug in this function
|
||||
$photos = array(
|
||||
z_root() . '/photo/profile/l/' . $local[0]['channel_id'],
|
||||
|
||||
Reference in New Issue
Block a user