summary refs log tree commit diff stats
path: root/includes/bbcode.php
diff options
context:
space:
mode:
authorStarla Insigna <starla4444@gmail.com>2010-10-15 19:21:59 -0400
committerStarla Insigna <starla4444@gmail.com>2010-10-15 19:21:59 -0400
commit05fef4cd88030e04f233b332a8e32057fb57d5e4 (patch)
treeacbba15de8db693961dbfe1c08a6611593e4497e /includes/bbcode.php
parent16e9aedc756003c2ab6fb6ee2d8842c5e7384aa7 (diff)
downloadfourisland-05fef4cd88030e04f233b332a8e32057fb57d5e4.tar.gz
fourisland-05fef4cd88030e04f233b332a8e32057fb57d5e4.tar.bz2
fourisland-05fef4cd88030e04f233b332a8e32057fb57d5e4.zip
Backported [nosmilies] from Layout 8
Diffstat (limited to 'includes/bbcode.php')
-rwxr-xr-xincludes/bbcode.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/includes/bbcode.php b/includes/bbcode.php index a7bb247..b83e403 100755 --- a/includes/bbcode.php +++ b/includes/bbcode.php
@@ -58,9 +58,10 @@ class BBCode
58 $this->bbcodes['thumb'] = '<a href="/images/{CONTENT}"><img src="http://fourisland.com/thumb.php?file=images/{CONTENT}&amp;mode=scale&amp;by=521&amp;side=0" alt="Image" /></a>'; 58 $this->bbcodes['thumb'] = '<a href="/images/{CONTENT}"><img src="http://fourisland.com/thumb.php?file=images/{CONTENT}&amp;mode=scale&amp;by=521&amp;side=0" alt="Image" /></a>';
59 $this->bbcodes['thumb2'] = '<a href="/images/{CONTENT}"><img src="http://fourisland.com/thumb.php?file=images/{CONTENT}&amp;mode=scale&amp;by=260&amp;side=0" align="right" alt="Image" /></a>'; 59 $this->bbcodes['thumb2'] = '<a href="/images/{CONTENT}"><img src="http://fourisland.com/thumb.php?file=images/{CONTENT}&amp;mode=scale&amp;by=260&amp;side=0" align="right" alt="Image" /></a>';
60 $this->bbcodes['thumb3'] = '<a href="/images/{CONTENT}"><img src="http://fourisland.com/thumb.php?file=images/{CONTENT}&amp;mode=scale&amp;by=260&amp;side=0" align="left" style="margin-right: 2em" alt="Image" /></a>'; 60 $this->bbcodes['thumb3'] = '<a href="/images/{CONTENT}"><img src="http://fourisland.com/thumb.php?file=images/{CONTENT}&amp;mode=scale&amp;by=260&amp;side=0" align="left" style="margin-right: 2em" alt="Image" /></a>';
61 $this->bbcodes['project'] = '<a href="http://projects.fourisland.com/projects/show/{CONTENT}">{CONTENT}</a>'; 61 $this->bbcodes['project'] = '<a href="http://projects.fourisland.com/projects/show/{CONTENT}">{CONTENT}</a>';
62 $this->bbcodes['hr'] = '<hr size="2" color="black" />'; 62 $this->bbcodes['hr'] = '<hr size="2" color="black" />';
63 $this->bbcodes2['audio'] = '<p id="audioplayer_{CONTENT}">Click to download: <a href="{PARAM}">{CONTENT}</a></p><script>AudioPlayer.embed("audioplayer_{CONTENT}", {soundFile: "{PARAM}", titles: "{CONTENT}"});</script>'; 63 $this->bbcodes2['audio'] = '<p id="audioplayer_{CONTENT}">Click to download: <a href="{PARAM}">{CONTENT}</a></p><script>AudioPlayer.embed("audioplayer_{CONTENT}", {soundFile: "{PARAM}", titles: "{CONTENT}"});</script>';
64 $this->bbcodes['nosmilies'] = '{CONTENT}';
64 65
65 $this->init = true; 66 $this->init = true;
66 } 67 }
@@ -85,11 +86,16 @@ class BBCode
85 $to_parse = substr_replace($to_parse, $otag, $bbpos, strlen($name) + 2); 86 $to_parse = substr_replace($to_parse, $otag, $bbpos, strlen($name) + 2);
86 $to_parse = substr_replace($to_parse, $ctag, strpos(substr($to_parse, $bbpos), '[/' . $name . ']') + $bbpos, strlen($name) + 3); 87 $to_parse = substr_replace($to_parse, $ctag, strpos(substr($to_parse, $bbpos), '[/' . $name . ']') + $bbpos, strlen($name) + 3);
87 88
88 if (strpos($this->bbcodes[$name], '<pre>') !== -1) 89 if (strpos($this->bbcodes[$name], '<pre>') !== FALSE)
89 { 90 {
90 $to_parse = substr_replace($to_parse, str_replace('[br]', '', substr($to_parse, strpos($to_parse, $otag) + strlen($otag), strpos($to_parse, $ctag) - (strpos($to_parse, $otag) + strlen($otag)))), strpos($to_parse, $otag) + strlen($otag), strpos($to_parse, $ctag) - (strpos($to_parse, $otag) + strlen($otag))); 91 $to_parse = substr_replace($to_parse, str_replace('[br]', '', substr($to_parse, strpos($to_parse, $otag) + strlen($otag), strpos($to_parse, $ctag) - (strpos($to_parse, $otag) + strlen($otag)))), strpos($to_parse, $otag) + strlen($otag), strpos($to_parse, $ctag) - (strpos($to_parse, $otag) + strlen($otag)));
91 } 92 }
92 93
94 if ($name == 'nosmilies')
95 {
96 $to_parse = preg_replace('/\[emoticon\](..)\[\/emoticon\]/', '\1', $to_parse);
97 }
98
93 $value = str_replace('{CONTENT}', '\1', $value); 99 $value = str_replace('{CONTENT}', '\1', $value);
94 $to_parse = preg_replace('/\[' . $name . ':' . $bbcode_uid . '\](.*)\[\/' . $name . ':' . $bbcode_uid . '\]/', $value, $to_parse); 100 $to_parse = preg_replace('/\[' . $name . ':' . $bbcode_uid . '\](.*)\[\/' . $name . ':' . $bbcode_uid . '\]/', $value, $to_parse);
95 } 101 }