From ac3a4824df86795cc7d5f08a3014cf84ac4b327c Mon Sep 17 00:00:00 2001
From: Michael Vogel
Date: Sun, 1 Mar 2015 17:33:55 +0100
Subject: [PATCH 1/8] Check for hashtags when storing them and eventually
adding hashtag links
---
include/items.php | 61 +++++++++++++++++++++++++++++++++++++++++++++++
include/text.php | 3 +++
2 files changed, 64 insertions(+)
diff --git a/include/items.php b/include/items.php
index dd4021775..faeea1eaf 100644
--- a/include/items.php
+++ b/include/items.php
@@ -1239,6 +1239,9 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
logger("item_store: Set network to ".$arr["network"]." for ".$arr["uri"], LOGGER_DEBUG);
}
+ // Check for hashtags in the body and repair or add hashtag links
+ item_body_set_hashtags($arr);
+
$arr['thr-parent'] = $arr['parent-uri'];
if($arr['parent-uri'] === $arr['uri']) {
$parent_id = 0;
@@ -1556,6 +1559,64 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa
return $current_post;
}
+function item_body_set_hashtags(&$item) {
+
+ $tags = get_tags($item["body"]);
+
+ // No hashtags?
+ if(!count($tags))
+ return(false);
+
+ // This sorting is important when there are hashtags that are part of other hashtags
+ // Otherwise there could be problems with hashtags like #test and #test2
+ rsort($tags);
+
+ $a = get_app();
+
+ $URLSearchString = "^\[\]";
+
+ // All hashtags should point to the home server
+ $item["body"] = preg_replace("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
+ "#[url=".$a->get_baseurl()."/search?tag=$2]$2[/url]", $item["body"]);
+
+ $item["tag"] = preg_replace("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
+ "#[url=".$a->get_baseurl()."/search?tag=$2]$2[/url]", $item["tag"]);
+
+ // mask hashtags inside of url, bookmarks and attachments to avoid urls in urls
+ $item["body"] = preg_replace_callback("/\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
+ function ($match){
+ return("[url=".$match[1]."]".str_replace("#", "#", $match[2])."[/url]");
+ },$item["body"]);
+
+ $item["body"] = preg_replace_callback("/\[bookmark\=([$URLSearchString]*)\](.*?)\[\/bookmark\]/ism",
+ function ($match){
+ return("[bookmark=".$match[1]."]".str_replace("#", "#", $match[2])."[/bookmark]");
+ },$item["body"]);
+
+ $item["body"] = preg_replace_callback("/\[attachment (.*)\](.*?)\[\/attachment\]/ism",
+ function ($match){
+ return("[attachment ".str_replace("#", "#", $match[1])."]".$match[2]."[/attachment]");
+ },$item["body"]);
+
+ // Repair recursive urls
+ $item["body"] = preg_replace("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
+ "#$2", $item["body"]);
+
+ foreach($tags as $tag) {
+ if(strpos($tag,'#') !== 0)
+ continue;
+
+ if(strpos($tag,'[url='))
+ continue;
+
+ $basetag = str_replace('_',' ',substr($tag,1));
+ $item["body"] = str_replace($tag,'#[url='.$a->get_baseurl().'/search?tag='.rawurlencode($basetag).']'.$basetag.'[/url]', $item["body"]);
+ }
+
+ // Convert back the masked hashtags
+ $item["body"] = str_replace("#", "#", $item["body"]);
+}
+
function get_item_guid($id) {
$r = q("SELECT `guid` FROM `item` WHERE `id` = %d LIMIT 1", intval($id));
if (count($r))
diff --git a/include/text.php b/include/text.php
index c33dd7995..be74756cd 100644
--- a/include/text.php
+++ b/include/text.php
@@ -752,6 +752,9 @@ if(! function_exists('get_tags')) {
function get_tags($s) {
$ret = array();
+ // Convert hashtag links to hashtags
+ $s = preg_replace("/#\[url\=([^\[\]]*)\](.*?)\[\/url\]/ism", "#$2", $s);
+
// ignore anything in a code block
$s = preg_replace('/\[code\](.*?)\[\/code\]/sm','',$s);
From bf0f7c3d0aae1084f31e7a561e8281123b94f09f Mon Sep 17 00:00:00 2001
From: Michael Vogel
Date: Sun, 1 Mar 2015 20:07:56 +0100
Subject: [PATCH 2/8] New bbcode elements h1 to h6 for a better conversion of
Diaspora content
---
include/bbcode.php | 14 ++++++++++++--
include/html2bbcode.php | 19 +++++++++++++------
view/global.css | 34 +++++++++++++++++++++++++++++++++-
view/theme/vier/style.css | 8 --------
4 files changed, 58 insertions(+), 17 deletions(-)
diff --git a/include/bbcode.php b/include/bbcode.php
index 1da9bf1d2..fa4fa72c7 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -842,8 +842,10 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal
// removing multiplicated newlines
if (get_config("system", "remove_multiplicated_lines")) {
- $search = array("\n\n\n", "\n ", " \n", "[/quote]\n\n", "\n[/quote]", "[/li]\n", "\n[li]", "\n[ul]", "[/ul]\n", "\n\n[share ", "[/attachment]\n");
- $replace = array("\n\n", "\n", "\n", "[/quote]\n", "[/quote]", "[/li]", "[li]", "[ul]", "[/ul]", "\n[share ", "[/attachment]");
+ $search = array("\n\n\n", "\n ", " \n", "[/quote]\n\n", "\n[/quote]", "[/li]\n", "\n[li]", "\n[ul]", "[/ul]\n", "\n\n[share ", "[/attachment]\n",
+ "\n[h1]", "[/h1]\n", "\n[h2]", "[/h2]\n", "\n[h3]", "[/h3]\n", "\n[h4]", "[/h4]\n", "\n[h5]", "[/h5]\n", "\n[h6]", "[/h6]\n");
+ $replace = array("\n\n", "\n", "\n", "[/quote]\n", "[/quote]", "[/li]", "[li]", "[ul]", "[/ul]", "\n[share ", "[/attachment]",
+ "[h1]", "[/h1]", "[h2]", "[/h2]", "[h3]", "[/h3]", "[h4]", "[/h4]", "[h5]", "[/h5]", "[h6]", "[/h6]");
do {
$oldtext = $Text;
$Text = str_replace($search, $replace, $Text);
@@ -923,6 +925,14 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal
$Text = preg_replace("/\[mail\]([$MAILSearchString]*)\[\/mail\]/", '$1', $Text);
$Text = preg_replace("/\[mail\=([$MAILSearchString]*)\](.*?)\[\/mail\]/", '$2', $Text);
+ // Check for headers
+ $Text = preg_replace("(\[h1\](.*?)\[\/h1\])ism",'$1
',$Text);
+ $Text = preg_replace("(\[h2\](.*?)\[\/h2\])ism",'$1
',$Text);
+ $Text = preg_replace("(\[h3\](.*?)\[\/h3\])ism",'$1
',$Text);
+ $Text = preg_replace("(\[h4\](.*?)\[\/h4\])ism",'$1
',$Text);
+ $Text = preg_replace("(\[h5\](.*?)\[\/h5\])ism",'$1
',$Text);
+ $Text = preg_replace("(\[h6\](.*?)\[\/h6\])ism",'$1
',$Text);
+
// Check for bold text
$Text = preg_replace("(\[b\](.*?)\[\/b\])ism",'$1',$Text);
diff --git a/include/html2bbcode.php b/include/html2bbcode.php
index 650bbdcae..1021bcdf1 100644
--- a/include/html2bbcode.php
+++ b/include/html2bbcode.php
@@ -207,12 +207,19 @@ function html2bbcode($message)
//node2bbcode($doc, 'tr', array(), "[tr]", "[/tr]");
//node2bbcode($doc, 'td', array(), "[td]", "[/td]");
- node2bbcode($doc, 'h1', array(), "\n\n[size=xx-large][b]", "[/b][/size]\n");
- node2bbcode($doc, 'h2', array(), "\n\n[size=x-large][b]", "[/b][/size]\n");
- node2bbcode($doc, 'h3', array(), "\n\n[size=large][b]", "[/b][/size]\n");
- node2bbcode($doc, 'h4', array(), "\n\n[size=medium][b]", "[/b][/size]\n");
- node2bbcode($doc, 'h5', array(), "\n\n[size=small][b]", "[/b][/size]\n");
- node2bbcode($doc, 'h6', array(), "\n\n[size=x-small][b]", "[/b][/size]\n");
+ //node2bbcode($doc, 'h1', array(), "\n\n[size=xx-large][b]", "[/b][/size]\n");
+ //node2bbcode($doc, 'h2', array(), "\n\n[size=x-large][b]", "[/b][/size]\n");
+ //node2bbcode($doc, 'h3', array(), "\n\n[size=large][b]", "[/b][/size]\n");
+ //node2bbcode($doc, 'h4', array(), "\n\n[size=medium][b]", "[/b][/size]\n");
+ //node2bbcode($doc, 'h5', array(), "\n\n[size=small][b]", "[/b][/size]\n");
+ //node2bbcode($doc, 'h6', array(), "\n\n[size=x-small][b]", "[/b][/size]\n");
+
+ node2bbcode($doc, 'h1', array(), "\n\n[h1]", "[/h1]\n");
+ node2bbcode($doc, 'h2', array(), "\n\n[h2]", "[/h2]\n");
+ node2bbcode($doc, 'h3', array(), "\n\n[h3]", "[/h3]\n");
+ node2bbcode($doc, 'h4', array(), "\n\n[h4]", "[/h4]\n");
+ node2bbcode($doc, 'h5', array(), "\n\n[h5]", "[/h5]\n");
+ node2bbcode($doc, 'h6', array(), "\n\n[h6]", "[/h6]\n");
node2bbcode($doc, 'a', array('href'=>'/mailto:(.+)/'), '[mail=$1]', '[/mail]');
node2bbcode($doc, 'a', array('href'=>'/(.+)/'), '[url=$1]', '[/url]');
diff --git a/view/global.css b/view/global.css
index 549e1216d..0c6fb6320 100644
--- a/view/global.css
+++ b/view/global.css
@@ -125,4 +125,36 @@ blockquote.shared_content {
.settings-heading a:after{
content: ' ยป';
-}
\ No newline at end of file
+}
+
+/* headers */
+h1, h2, h3, h4, h5, h6 {
+ margin: 10px 0px;
+ font-weight: normal;
+ line-height: normal;
+ text-rendering: optimizelegibility;
+}
+
+h1 {
+ font-size: 38.5px;
+}
+
+h2 {
+ font-size: 31.5px;
+}
+
+h3 {
+ font-size: 24.5px;
+}
+
+h4 {
+ font-size: 20.5px;
+}
+
+h5 {
+ font-size: 16.5px;
+}
+
+h6 {
+ font-size: 14.95px;
+}
diff --git a/view/theme/vier/style.css b/view/theme/vier/style.css
index 479fd348e..779a194dd 100644
--- a/view/theme/vier/style.css
+++ b/view/theme/vier/style.css
@@ -283,10 +283,6 @@ body {
display: table;
}
-h4 {
- font-size: 1.1em;
-}
-
a {
color: #36C;
/* color: #3e3e8c; */
@@ -1202,10 +1198,6 @@ section.minimal {
width: 350px;
float: left;
font-size: 12px;
-}}
-
-h2 {
- line-height: normal;
}
.wall-item-container .wall-item-content {
From 3f1d186106139c7fb1dfcf79e87ca4851c748880 Mon Sep 17 00:00:00 2001
From: Michael Vogel
Date: Sun, 1 Mar 2015 20:40:38 +0100
Subject: [PATCH 3/8] Remove the old hashtag functions, change it to the new
functionality.
---
include/diaspora.php | 83 +-------------------------------------------
include/items.php | 11 +++++-
mod/item.php | 42 +++++++---------------
3 files changed, 23 insertions(+), 113 deletions(-)
diff --git a/include/diaspora.php b/include/diaspora.php
index d464b5d67..2c19cd4c4 100755
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -833,32 +833,6 @@ function diaspora_post($importer,$xml,$msg) {
$str_tags = '';
- $tags = get_tags($body);
- rsort($tags);
-
- if(count($tags)) {
- foreach($tags as $tag) {
- if(strpos($tag,'#') === 0) {
- if(strpos($tag,'[url='))
- continue;
-
- // don't link tags that are already embedded in links
-
- if(preg_match('/\[(\S*?)' . preg_quote($tag,'/') . '(\S*?)\]/',$body))
- continue;
- if(preg_match('/\[(\S*?)\]\((\S*?)' . preg_quote($tag,'/') . '(\S*?)\)/',$body))
- continue;
-
- $basetag = str_replace('_',' ',substr($tag,1));
- $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body);
- if(strlen($str_tags))
- $str_tags .= ',';
- $str_tags .= '#[url=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/url]';
- continue;
- }
- }
- }
-
$cnt = preg_match_all('/@\[url=(.*?)\[\/url\]/ism',$body,$matches,PREG_SET_ORDER);
if($cnt) {
foreach($matches as $mtch) {
@@ -1055,34 +1029,8 @@ function diaspora_fetch_message($guid, $server, $level = 0) {
return false;
$item["tag"] = '';
-
- $tags = get_tags($body);
-
- if(count($tags)) {
- foreach($tags as $tag) {
- if(strpos($tag,'#') === 0) {
- if(strpos($tag,'[url='))
- continue;
-
- // don't link tags that are already embedded in links
-
- if(preg_match('/\[(.*?)' . preg_quote($tag,'/') . '(.*?)\]/',$body))
- continue;
- if(preg_match('/\[(.*?)\]\((.*?)' . preg_quote($tag,'/') . '(.*?)\)/',$body))
- continue;
-
-
- $basetag = str_replace('_',' ',substr($tag,1));
- $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body);
- if(strlen($item["tag"]))
- $item["tag"] .= ',';
- $item["tag"] .= '#[url=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/url]';
- continue;
- }
- }
- }
-
$item["body"] = $body;
+
return $item;
}
@@ -1482,34 +1430,6 @@ function diaspora_comment($importer,$xml,$msg) {
$datarray = array();
- $str_tags = '';
-
- $tags = get_tags($body);
-
- if(count($tags)) {
- foreach($tags as $tag) {
- if(strpos($tag,'#') === 0) {
- if(strpos($tag,'[url='))
- continue;
-
- // don't link tags that are already embedded in links
-
- if(preg_match('/\[(.*?)' . preg_quote($tag,'/') . '(.*?)\]/',$body))
- continue;
- if(preg_match('/\[(.*?)\]\((.*?)' . preg_quote($tag,'/') . '(.*?)\)/',$body))
- continue;
-
-
- $basetag = str_replace('_',' ',substr($tag,1));
- $body = str_replace($tag,'#[url=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/url]',$body);
- if(strlen($str_tags))
- $str_tags .= ',';
- $str_tags .= '#[url=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/url]';
- continue;
- }
- }
- }
-
$datarray['uid'] = $importer['uid'];
$datarray['contact-id'] = $contact['id'];
$datarray['type'] = 'remote-comment';
@@ -1533,7 +1453,6 @@ function diaspora_comment($importer,$xml,$msg) {
$datarray['author-link'] = $person['url'];
$datarray['author-avatar'] = ((x($person,'thumb')) ? $person['thumb'] : $person['photo']);
$datarray['body'] = $body;
- $datarray['tag'] = $str_tags;
// We can't be certain what the original app is if the message is relayed.
if(($parent_item['origin']) && (! $parent_author_signature))
diff --git a/include/items.php b/include/items.php
index faeea1eaf..e56b17aec 100644
--- a/include/items.php
+++ b/include/items.php
@@ -1610,7 +1610,16 @@ function item_body_set_hashtags(&$item) {
continue;
$basetag = str_replace('_',' ',substr($tag,1));
- $item["body"] = str_replace($tag,'#[url='.$a->get_baseurl().'/search?tag='.rawurlencode($basetag).']'.$basetag.'[/url]', $item["body"]);
+
+ $newtag = '#[url='.$a->get_baseurl().'/search?tag='.rawurlencode($basetag).']'.$basetag.'[/url]';
+
+ $item["body"] = str_replace($tag, $newtag, $item["body"]);
+
+ if(!stristr($item["tag"],"/search?tag=".$basetag."]".$basetag."[/url]")) {
+ if(strlen($item["tag"]))
+ $item["tag"] = ','.$item["tag"];
+ $item["tag"] = $newtag.$item["tag"];
+ }
}
// Convert back the masked hashtags
diff --git a/mod/item.php b/mod/item.php
index a3a8dd938..c5fc4ff2c 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -23,6 +23,7 @@ require_once('include/tags.php');
require_once('include/files.php');
require_once('include/threads.php');
require_once('include/text.php');
+require_once('include/items.php');
function item_post(&$a) {
@@ -34,7 +35,6 @@ function item_post(&$a) {
$uid = local_user();
if(x($_REQUEST,'dropitems')) {
- require_once('include/items.php');
$arr_drop = explode(',',$_REQUEST['dropitems']);
drop_items($arr_drop);
$json = array('success' => 1);
@@ -569,7 +569,7 @@ function item_post(&$a) {
* and we are replying, and there isn't one already
*/
- if(($parent_contact) && ($parent_contact['network'] === NETWORK_OSTATUS)
+ if(($parent_contact) && ($parent_contact['network'] === NETWORK_OSTATUS)
&& ($parent_contact['nick']) && (! in_array('@' . $parent_contact['nick'],$tags))) {
$body = '@' . $parent_contact['nick'] . ' ' . $body;
$tags[] = '@' . $parent_contact['nick'];
@@ -582,6 +582,9 @@ function item_post(&$a) {
if(count($tags)) {
foreach($tags as $tag) {
+ if(strpos($tag,'#') === 0)
+ continue;
+
// If we already tagged 'Robert Johnson', don't try and tag 'Robert'.
// Robert Johnson should be first in the $tags array
@@ -713,6 +716,9 @@ function item_post(&$a) {
if($orig_post)
$datarray['edit'] = true;
+ // Search for hashtags
+ item_body_set_hashtags($datarray);
+
// preview mode - prepare the body for display and send it via json
if($preview) {
@@ -1035,10 +1041,9 @@ function item_content(&$a) {
$o = '';
if(($a->argc == 3) && ($a->argv[1] === 'drop') && intval($a->argv[2])) {
- require_once('include/items.php');
$o = drop_item($a->argv[2], !is_ajax());
if (is_ajax()){
- // ajax return: [- , 0 (no perm) | ]
+ // ajax return: [
- , 0 (no perm) | ]
echo json_encode(array(intval($a->argv[2]), intval($o)));
killme();
}
@@ -1047,9 +1052,9 @@ function item_content(&$a) {
}
/**
- * This function removes the tag $tag from the text $body and replaces it with
- * the appropiate link.
- *
+ * This function removes the tag $tag from the text $body and replaces it with
+ * the appropiate link.
+ *
* @param unknown_type $body the text to replace the tag in
* @param unknown_type $inform a comma-seperated string containing everybody to inform
* @param unknown_type $str_tags string to add the tag to
@@ -1063,29 +1068,6 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag, $netwo
$replaced = false;
$r = null;
- //is it a hash tag?
- if(strpos($tag,'#') === 0) {
- //if the tag is replaced...
- if(strpos($tag,'[url='))
- //...do nothing
- return $replaced;
- //base tag has the tags name only
- $basetag = str_replace('_',' ',substr($tag,1));
- //create text for link
- $newtag = '#[url=' . $a->get_baseurl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/url]';
- //replace tag by the link
- $body = str_replace($tag, $newtag, $body);
- $replaced = true;
-
- //is the link already in str_tags?
- if(! stristr($str_tags,$newtag)) {
- //append or set str_tags
- if(strlen($str_tags))
- $str_tags .= ',';
- $str_tags .= $newtag;
- }
- return $replaced;
- }
//is it a person tag?
if(strpos($tag,'@') === 0) {
//is it already replaced?
From 579ac835471d9982363133f71162061cb7b581ea Mon Sep 17 00:00:00 2001
From: Michael Vogel
Date: Sun, 1 Mar 2015 21:22:06 +0100
Subject: [PATCH 4/8] Fixing problems with single linefeeds in the Markdown
conversion.
---
include/bb2diaspora.php | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index 5a3885293..866ac26be 100644
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -20,6 +20,8 @@ function diaspora2bb($s) {
// Remove CR to avoid problems with following code
//$s = str_replace("\r","",$s);
+ $s = str_replace("\n"," \n",$s);
+
// The parser cannot handle paragraphs correctly
$s = str_replace(array("
", "", '
'),array("
", "
", "
"),$s);
From da49814cbb70f1bbfec2c4dbe61090659d732198 Mon Sep 17 00:00:00 2001
From: Michael Vogel
Date: Sun, 1 Mar 2015 21:24:10 +0100
Subject: [PATCH 5/8] Use a header element for the oembed data.
---
include/oembed.php | 4 +++-
view/global.css | 6 +++---
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/include/oembed.php b/include/oembed.php
index 00489193f..87beab239 100755
--- a/include/oembed.php
+++ b/include/oembed.php
@@ -163,6 +163,7 @@ function oembed_format_object($j){
// add link to source if not present in "rich" type
if ($j->type!='rich' || !strpos($j->html,$embedurl) ){
+ $ret .= "";
if (isset($j->title)) {
if (isset($j->provider_name))
$ret .= $j->provider_name.": ";
@@ -189,11 +190,12 @@ function oembed_format_object($j){
}
//if (isset($j->author_name)) $ret.=" by ".$j->author_name;
//if (isset($j->provider_name)) $ret.=" on ".$j->provider_name;
+ $ret .= "
";
} else {
// add for html2bbcode conversion
$ret .= "$embedurl";
+ $ret.="
";
}
- $ret.="
";
return mb_convert_encoding($ret, 'HTML-ENTITIES', mb_detect_encoding($ret));
}
diff --git a/view/global.css b/view/global.css
index 0c6fb6320..06ff9bbef 100644
--- a/view/global.css
+++ b/view/global.css
@@ -129,7 +129,7 @@ blockquote.shared_content {
/* headers */
h1, h2, h3, h4, h5, h6 {
- margin: 10px 0px;
+ margin: 0px 0px 5px 0px;
font-weight: normal;
line-height: normal;
text-rendering: optimizelegibility;
@@ -152,9 +152,9 @@ h4 {
}
h5 {
- font-size: 16.5px;
+ font-size: 18px;
}
h6 {
- font-size: 14.95px;
+ font-size: 16.5px;
}
From 52e33d50ad790e5f7e2653ecb49d1c725b499afc Mon Sep 17 00:00:00 2001
From: Michael Vogel
Date: Sun, 1 Mar 2015 21:58:31 +0100
Subject: [PATCH 6/8] Changing header sizes and changing the header type of
oembed data.
---
include/oembed.php | 4 ++--
view/global.css | 16 ++++++++--------
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/include/oembed.php b/include/oembed.php
index 87beab239..19bdc474f 100755
--- a/include/oembed.php
+++ b/include/oembed.php
@@ -163,7 +163,7 @@ function oembed_format_object($j){
// add link to source if not present in "rich" type
if ($j->type!='rich' || !strpos($j->html,$embedurl) ){
- $ret .= "";
+ $ret .= "";
if (isset($j->title)) {
if (isset($j->provider_name))
$ret .= $j->provider_name.": ";
@@ -190,7 +190,7 @@ function oembed_format_object($j){
}
//if (isset($j->author_name)) $ret.=" by ".$j->author_name;
//if (isset($j->provider_name)) $ret.=" on ".$j->provider_name;
- $ret .= "
";
+ $ret .= "";
} else {
// add for html2bbcode conversion
$ret .= "$embedurl";
diff --git a/view/global.css b/view/global.css
index 06ff9bbef..604a1e449 100644
--- a/view/global.css
+++ b/view/global.css
@@ -136,25 +136,25 @@ h1, h2, h3, h4, h5, h6 {
}
h1 {
- font-size: 38.5px;
-}
-
-h2 {
font-size: 31.5px;
}
-h3 {
+h2 {
font-size: 24.5px;
}
-h4 {
+h3 {
font-size: 20.5px;
}
-h5 {
+h4 {
font-size: 18px;
}
-h6 {
+h5 {
font-size: 16.5px;
}
+
+h6 {
+ font-size: 14.95px;
+}
From 027b11ebb5a32ed4a31afabeb36f00e8daeb3bfa Mon Sep 17 00:00:00 2001
From: Michael Vogel
Date: Mon, 2 Mar 2015 23:34:59 +0100
Subject: [PATCH 7/8] Small bugfix for likes
---
include/bb2diaspora.php | 2 +-
mod/network.php | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index 866ac26be..919bfc331 100644
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -18,7 +18,7 @@ function diaspora2bb($s) {
$s = html_entity_decode($s,ENT_COMPAT,'UTF-8');
// Remove CR to avoid problems with following code
- //$s = str_replace("\r","",$s);
+ $s = str_replace("\r","",$s);
$s = str_replace("\n"," \n",$s);
diff --git a/mod/network.php b/mod/network.php
index c180252f4..0f9b0d233 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -708,7 +708,7 @@ die("ss");
if (!get_config("system", "like_no_comment"))
$sql_extra4 = "(`item`.`deleted` = 0 OR `item`.`verb` = '".ACTIVITY_LIKE."' OR `item`.`verb` = '".ACTIVITY_DISLIKE."')";
else
- $sql_extra4 = "`item`.`deleted` = 0";
+ $sql_extra4 = "`item`.`deleted` = 0 AND `item`.`verb` = '".ACTIVITY_POST."'";
$r = q("SELECT `item`.`parent` AS `item_id`, `item`.`network` AS `item_network`, `contact`.`uid` AS `contact_uid`
FROM $sql_table $sql_post_table INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
From 4a10cb1b99ee9936a281eb5784af79f37c0b6781 Mon Sep 17 00:00:00 2001
From: Michael Vogel
Date: Tue, 3 Mar 2015 14:10:42 +0100
Subject: [PATCH 8/8] Disabled the rewriting of hashtag links
---
include/items.php | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/items.php b/include/items.php
index e56b17aec..b698a0cd3 100644
--- a/include/items.php
+++ b/include/items.php
@@ -1576,11 +1576,11 @@ function item_body_set_hashtags(&$item) {
$URLSearchString = "^\[\]";
// All hashtags should point to the home server
- $item["body"] = preg_replace("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
- "#[url=".$a->get_baseurl()."/search?tag=$2]$2[/url]", $item["body"]);
+ //$item["body"] = preg_replace("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
+ // "#[url=".$a->get_baseurl()."/search?tag=$2]$2[/url]", $item["body"]);
- $item["tag"] = preg_replace("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
- "#[url=".$a->get_baseurl()."/search?tag=$2]$2[/url]", $item["tag"]);
+ //$item["tag"] = preg_replace("/#\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",
+ // "#[url=".$a->get_baseurl()."/search?tag=$2]$2[/url]", $item["tag"]);
// mask hashtags inside of url, bookmarks and attachments to avoid urls in urls
$item["body"] = preg_replace_callback("/\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism",