]> git.mxchange.org Git - friendica.git/commitdiff
Support bbcode size tag - I may regret this...
authorFriendika <info@friendika.com>
Wed, 9 Feb 2011 05:26:28 +0000 (21:26 -0800)
committerFriendika <info@friendika.com>
Wed, 9 Feb 2011 05:26:28 +0000 (21:26 -0800)
boot.php
include/bbcode.php
include/html2bbcode.php
tinymce/jscripts/tiny_mce/plugins/bbcode/editor_plugin_src.js

index 3edd45971ee5816a1db633b3134708dee5670f0c..9d41abec49b0d4ec5514a0f718b0e605016fa3f0 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -305,9 +305,9 @@ class App {
                        $this->scheme = $parsed['scheme'];
 
                        $this->hostname = $parsed['host'];
-                       if($parsed['port'])
+                       if(x($parsed,'port'))
                                $this->hostname .= ':' . $parsed['port'];
-                       if($parsed['path'])
+                       if(x($parsed,'path'))
                                $this->path = trim($parsed['path'],'\\/');
                }
 
index eb0806dc527fee8b6b36a89d6d6239e807ca665e..f39ebd5b92184be34d127926586741718a2e0890 100644 (file)
@@ -49,10 +49,10 @@ function bbcode($Text) {
        $Text = preg_replace("(\[o\](.+?)\[\/o\])is",'<span class="overline">$1</span>',$Text);
 
        // Check for colored text
-       $Text = preg_replace("(\[color=(.+?)\](.+?)\[\/color\])is","<span style=\"color: $1\">$2</span>",$Text);
+       $Text = preg_replace("(\[color=(.+?)\](.+?)\[\/color\])is","<span style=\"color: $1;\">$2</span>",$Text);
 
        // Check for sized text
-       $Text = preg_replace("(\[size=(.+?)\](.+?)\[\/size\])is","<span style=\"font-size: $1px\">$2</span>",$Text);
+       $Text = preg_replace("(\[size=(.+?)\](.+?)\[\/size\])is","<span style=\"font-size: $1;\">$2</span>",$Text);
 
        // Check for list text
        $Text = preg_replace("/\[list\](.+?)\[\/list\]/is", '<ul class="listbullet">$1</ul>' ,$Text);
index 6af8df824e76bbf35552e881b81aaa2c783364c5..bde761f2fc6bb2db1f7b6540c5eecba876454b9c 100644 (file)
@@ -26,6 +26,7 @@ function html2bbcode($s) {
                '/\<a (.*?)href=\"(.*?)\"(.*?)\>(.*?)\<\/a\>/is',
                '/\<code\>(.*?)\<\/code\>/is',
                '/\<span style=\"color:(.*?)\"\>(.*?)\<\/span\>/is',
+               '/\<span style=\"font-size:(.*?)\"\>(.*?)\<\/span\>/is',
                '/\<blockquote\>(.*?)\<\/blockquote\>/is',
                '/\<video(.*?) src=\"(.*?)\" (.*?)\>(.*?)\<\/video\>/is',
                '/\<audio(.*?) src=\"(.*?)\" (.*?)\>(.*?)\<\/audio\>/is',
@@ -51,6 +52,7 @@ function html2bbcode($s) {
                '[url=$2]$4[/url]',
                '[code]$1[/code]',
                '[color="$1"]$2[/color]',
+               '[size=$1]$2[/size]',
                '[quote]$1[/quote]',
                '[video]$1[/video]',
                '[audio]$1[/audio]',
index ebccfb31158daa40e829a5fc358773368543501c..aad83280d43926372711d08da839973fa8438dfa 100644 (file)
                        rep(/\[img=(.*?)x(.*?)\](.*?)\[\/img\]/gi,"<img width=\"$1\" height=\"$2\" src=\"$3\" />");\r
                        rep(/\[img\](.*?)\[\/img\]/gi,"<img src=\"$1\" />");\r
                        rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"<span style=\"color: $1;\">$2</span>");\r
-//                     rep(/\[\/code\]\s*\[code\]/gi,"<br />"); // fold multiline code\r
+                       rep(/\[size=(.*?)\](.*?)\[\/size\]/gi,"<span style=\"font-size: $1;\">$2</span>");\r
                        rep(/\[code\](.*?)\[\/code\]/gi,"<code>$1</code>");\r
                        rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"<blockquote>$1</blockquote>");\r
 \r