Merge https://github.com/annando/friendica into annando
Conflicts: view/admin_site.tpl
This commit is contained in:
commit
a29842e301
14 changed files with 236 additions and 285 deletions
|
|
@ -3,6 +3,14 @@
|
|||
require_once("include/oembed.php");
|
||||
require_once('include/event.php');
|
||||
|
||||
function bb_cleanstyle($st) {
|
||||
return "<span style=\"".cleancss($st[1]).";\">".$st[2]."</span>";
|
||||
}
|
||||
|
||||
function bb_cleanclass($st) {
|
||||
return "<span class=\"".cleancss($st[1])."\">".$st[2]."</span>";
|
||||
}
|
||||
|
||||
function cleancss($input) {
|
||||
|
||||
$cleaned = "";
|
||||
|
|
@ -213,7 +221,7 @@ function bb_ShareAttributes($match) {
|
|||
$author = "";
|
||||
preg_match("/author='(.*?)'/ism", $attributes, $matches);
|
||||
if ($matches[1] != "")
|
||||
$author = $matches[1];
|
||||
$author = html_entity_decode($matches[1],ENT_QUOTES,'UTF-8');
|
||||
|
||||
preg_match('/author="(.*?)"/ism', $attributes, $matches);
|
||||
if ($matches[1] != "")
|
||||
|
|
@ -385,10 +393,10 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
|
|||
$Text = str_replace("[*]", "<li>", $Text);
|
||||
|
||||
// Check for style sheet commands
|
||||
$Text = preg_replace("(\[style=(.*?)\](.*?)\[\/style\])ism","<span style=\"$1;\">$2</span>",$Text);
|
||||
$Text = preg_replace_callback("(\[style=(.*?)\](.*?)\[\/style\])ism","bb_cleanstyle",$Text);
|
||||
|
||||
// Check for CSS classes
|
||||
$Text = preg_replace("(\[class=(.*?)\](.*?)\[\/class\])ism","<span class=\"$1\">$2</span>",$Text);
|
||||
$Text = preg_replace_callback("(\[class=(.*?)\](.*?)\[\/class\])ism","bb_cleanclass",$Text);
|
||||
|
||||
// handle nested lists
|
||||
$endlessloop = 0;
|
||||
|
|
|
|||
|
|
@ -960,12 +960,12 @@ function diaspora_reshare($importer,$xml,$msg) {
|
|||
|
||||
$person = find_diaspora_person_by_handle($orig_author);
|
||||
|
||||
if(is_array($person) && x($person,'name') && x($person,'url'))
|
||||
/*if(is_array($person) && x($person,'name') && x($person,'url'))
|
||||
$details = '[url=' . $person['url'] . ']' . $person['name'] . '[/url]';
|
||||
else
|
||||
$details = $orig_author;
|
||||
|
||||
$prefix = html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8') . $details . "\n";
|
||||
$prefix = html_entity_decode("♲ ", ENT_QUOTES, 'UTF-8') . $details . "\n";*/
|
||||
|
||||
|
||||
// allocate a guid on our system - we aren't fixing any collisions.
|
||||
|
|
@ -1012,7 +1012,7 @@ function diaspora_reshare($importer,$xml,$msg) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$datarray['uid'] = $importer['uid'];
|
||||
$datarray['contact-id'] = $contact['id'];
|
||||
$datarray['wall'] = 0;
|
||||
|
|
@ -1024,16 +1024,8 @@ function diaspora_reshare($importer,$xml,$msg) {
|
|||
$datarray['owner-name'] = $contact['name'];
|
||||
$datarray['owner-link'] = $contact['url'];
|
||||
$datarray['owner-avatar'] = ((x($contact,'thumb')) ? $contact['thumb'] : $contact['photo']);
|
||||
if (intval(get_config('system','diaspora_newreshare'))) {
|
||||
// Let reshared messages look like wall-to-wall posts
|
||||
// we have to set an additional value in the item in the future
|
||||
// to distinct the wall-to-wall-posts from reshared/repeated messages
|
||||
$datarray['author-name'] = $person['name'];
|
||||
$datarray['author-link'] = $person['url'];
|
||||
$datarray['author-avatar'] = ((x($person,'thumb')) ? $person['thumb'] : $person['photo']);
|
||||
$datarray['body'] = $body;
|
||||
} else {
|
||||
$prefix = "[share author='".$person['name'].
|
||||
if (intval(get_config('system','new_share'))) {
|
||||
$prefix = "[share author='".str_replace("'", "'",$person['name']).
|
||||
"' profile='".$person['url'].
|
||||
"' avatar='".((x($person,'thumb')) ? $person['thumb'] : $person['photo']).
|
||||
"' link='".$orig_url."']";
|
||||
|
|
@ -1041,6 +1033,12 @@ function diaspora_reshare($importer,$xml,$msg) {
|
|||
$datarray['author-link'] = $contact['url'];
|
||||
$datarray['author-avatar'] = $contact['thumb'];
|
||||
$datarray['body'] = $prefix.$body."[/share]";
|
||||
} else {
|
||||
// Let reshared messages look like wall-to-wall posts
|
||||
$datarray['author-name'] = $person['name'];
|
||||
$datarray['author-link'] = $person['url'];
|
||||
$datarray['author-avatar'] = ((x($person,'thumb')) ? $person['thumb'] : $person['photo']);
|
||||
$datarray['body'] = $body;
|
||||
}
|
||||
|
||||
$datarray['tag'] = $str_tags;
|
||||
|
|
|
|||
|
|
@ -808,20 +808,24 @@ function get_atom_elements($feed,$item) {
|
|||
if (($name != "") and ($uri != "") and ($avatar != "") and ($message != "")) {
|
||||
logger('get_atom_elements: fixing sender of repeated message.');
|
||||
|
||||
/*$res["owner-name"] = $res["author-name"];
|
||||
$res["owner-link"] = $res["author-link"];
|
||||
$res["owner-avatar"] = $res["author-avatar"];
|
||||
if (intval(get_config('system','new_share'))) {
|
||||
$prefix = "[share author='".str_replace("'", "'",$name).
|
||||
"' profile='".$uri.
|
||||
"' avatar='".$avatar.
|
||||
"' link='".$orig_uri."']";
|
||||
|
||||
$res["author-name"] = $name;
|
||||
$res["author-link"] = $uri;
|
||||
$res["author-avatar"] = $avatar;*/
|
||||
$res["body"] = $prefix.html2bbcode($message)."[/share]";
|
||||
} else {
|
||||
$res["owner-name"] = $res["author-name"];
|
||||
$res["owner-link"] = $res["author-link"];
|
||||
$res["owner-avatar"] = $res["author-avatar"];
|
||||
|
||||
$prefix = "[share author='".$name.
|
||||
"' profile='".$uri.
|
||||
"' avatar='".$avatar.
|
||||
"' link='".$orig_uri."']";
|
||||
$res["author-name"] = $name;
|
||||
$res["author-link"] = $uri;
|
||||
$res["author-avatar"] = $avatar;
|
||||
|
||||
$res["body"] = $prefix.html2bbcode($message)."[/share]";
|
||||
$res["body"] = html2bbcode($message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -398,14 +398,15 @@ function onepoll_run(&$argv, &$argc){
|
|||
// Is it a reply?
|
||||
$reply = ((substr(strtolower($datarray['title']), 0, 3) == "re:") or
|
||||
(substr(strtolower($datarray['title']), 0, 3) == "re-") or
|
||||
(raw_refs != ""));
|
||||
($raw_refs != ""));
|
||||
|
||||
// Remove Reply-signs in the subject
|
||||
$datarray['title'] = RemoveReply($datarray['title']);
|
||||
|
||||
// If it seems to be a reply but a header couldn't be found take the last message with matching subject
|
||||
if(!x($datarray,'parent-uri') and $reply) {
|
||||
$r = q("SELECT `uri` , `parent-uri` FROM `item` WHERE MATCH (`title`) AGAINST ('".'"%s"'."' IN BOOLEAN MODE) AND `uid` = %d ORDER BY `created` DESC LIMIT 1",
|
||||
//$r = q("SELECT `uri` , `parent-uri` FROM `item` WHERE MATCH (`title`) AGAINST ('".'"%s"'."' IN BOOLEAN MODE) AND `uid` = %d ORDER BY `created` DESC LIMIT 1",
|
||||
$r = q("SELECT `uri` , `parent-uri` FROM `item` WHERE `title` = \"%s\" AND `uid` = %d ORDER BY `created` DESC LIMIT 1",
|
||||
dbesc(protect_sprintf($datarray['title'])),
|
||||
intval($importer_uid));
|
||||
if(count($r))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue