From 893957c41481a0cd5eb624096337762ffa54ff28 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Sun, 9 Aug 2009 09:14:58 -0400 Subject: Created layout 7 The following changes were also made in this revision: * All HTML was changed to XHTML and a !DOCTYPE was included to reflect this * Rewrote quotes tracking system to be much less complicated and actually working * Changed quotes rendering to look more like Chirpy than Rash * Fixed comment textarea bug * Rewrote a ton of CSS so it's not as bloated * Added a JavaScript confirmation when deleting a comment * AJAXified voting on the POTW * AJAXified voting and flagging quotes * AJAXified commenting * AJAXified voting on posts * Added DateFinder back after it was accidentally deleted in Layout 4.5 The following database changes must be performed as soon as possible: * Fix title of NO post (the < is missing the semicolon) * Restore post Frasty Tha Snaman from a backup * Reset "flag" field of all rows in "rash_quotes" to 0 * Remove the "vote" and "flag" columns of "rash_tracking" * Rename the "quote_id" column of "rash_tracking" to "vote" The following external code changes must also be performed as soon as possible: * Add the following line to the end of the // Four Island block in The Fourm's functions.php: require('/svr/www/hatkirby/fourisland/main/includes/specialdates.php'); --- includes/bbcode.php | 66 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 28 deletions(-) (limited to 'includes/bbcode.php') diff --git a/includes/bbcode.php b/includes/bbcode.php index af0b1a4..b116e7a 100755 --- a/includes/bbcode.php +++ b/includes/bbcode.php @@ -30,30 +30,33 @@ class BBCode function init() { - $this->bbcodes['b'] = '{CONTENT}'; - $this->bbcodes['i'] = '{CONTENT}'; - $this->bbcodes['u'] = '{CONTENT}'; - $this->bbcodes['url'] = '{CONTENT}'; - $this->bbcodes2['url'] = '{CONTENT}'; - $this->bbcodes['img'] = 'Image'; - $this->bbcodes2['img'] = '{PARAM}'; - $this->bbcodes['big'] = '{CONTENT}'; - $this->bbcodes['small'] = '{CONTENT}'; - $this->bbcodes['ul'] = ''; - $this->bbcodes['ol'] = '
    {CONTENT}
'; - $this->bbcodes['li'] = '
  • {CONTENT}
  • '; - $this->bbcodes['code'] = '{CONTENT}'; - $this->bbcodes['pre'] = '

    {CONTENT}
    '; - $this->bbcodes2['blog'] = '{CONTENT}'; - $this->bbcodes2['quote'] = '{CONTENT}'; - $this->bbcodes['ins'] = '{CONTENT}'; - $this->bbcodes['del'] = '{CONTENT}'; - $this->bbcodes['bquote'] = '

    {CONTENT}
    Anonymous
    '; - $this->bbcodes2['bquote'] = '

    {CONTENT}
    {PARAM}
    '; - $this->bbcodes2['abbr'] = '{CONTENT}'; - $this->bbcodes['hidden'] = '{CONTENT}'; - $this->bbcodes['thumb'] = 'Image'; - $this->bbcodes['thumb2'] = 'Image'; + $this->bbcodes['b'] = '{CONTENT}'; + $this->bbcodes['i'] = '{CONTENT}'; + $this->bbcodes['u'] = '{CONTENT}'; + $this->bbcodes['url'] = '{CONTENT}'; + $this->bbcodes2['url'] = '{CONTENT}'; + $this->bbcodes['img'] = 'Image'; + $this->bbcodes2['img'] = '{PARAM}'; + $this->bbcodes['big'] = '{CONTENT}'; + $this->bbcodes['small'] = '{CONTENT}'; + $this->bbcodes['ul'] = ''; + $this->bbcodes['ol'] = '
      {CONTENT}
    '; + $this->bbcodes['li'] = '
  • {CONTENT}
  • '; + $this->bbcodes['code'] = '{CONTENT}'; + $this->bbcodes['pre'] = '
    {CONTENT}
    '; + $this->bbcodes['pref'] = '
    {CONTENT}
    '; + $this->bbcodes2['blog'] = '{CONTENT}'; + $this->bbcodes['quote'] = '#{CONTENT}'; + $this->bbcodes2['quote'] = '{CONTENT}'; + $this->bbcodes['ins'] = '{CONTENT}'; + $this->bbcodes['del'] = '{CONTENT}'; + $this->bbcodes['bquote'] = '
    {CONTENT}
    Anonymous
    '; + $this->bbcodes2['bquote'] = '
    {CONTENT}
    {PARAM}
    '; + $this->bbcodes2['abbr'] = '{CONTENT}'; + $this->bbcodes['hidden'] = '{CONTENT}'; + $this->bbcodes['thumb'] = 'Image'; + $this->bbcodes['thumb2'] = 'Image'; + $this->bbcodes['project'] = '{CONTENT}'; $this->init = true; } @@ -73,8 +76,15 @@ class BBCode { $bbcode_uid = unique_id(); $bbpos = strpos($to_parse, '[' . $name . ']'); - $to_parse = substr_replace($to_parse, '[' . $name . ':' . $bbcode_uid . ']', $bbpos, strlen($name) + 2); - $to_parse = substr_replace($to_parse, '[/' . $name . ':' . $bbcode_uid . ']', strpos(substr($to_parse, $bbpos), '[/' . $name . ']') + $bbpos, strlen($name) + 3); + $otag = '[' . $name . ':' . $bbcode_uid . ']'; + $ctag = '[/' . $name . ':' . $bbcode_uid . ']'; + $to_parse = substr_replace($to_parse, $otag, $bbpos, strlen($name) + 2); + $to_parse = substr_replace($to_parse, $ctag, strpos(substr($to_parse, $bbpos), '[/' . $name . ']') + $bbpos, strlen($name) + 3); + + if (strpos($this->bbcodes[$name], '
    ') !== -1)
    +				{
    +					$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)));
    +				}
     
     				$value = str_replace('{CONTENT}', '\1', $value);
     				$to_parse = preg_replace('/\[' . $name . ':' . $bbcode_uid . '\](.*)\[\/' . $name . ':' . $bbcode_uid . '\]/', $value, $to_parse);
    @@ -96,13 +106,13 @@ class BBCode
     			}
     		}
     
    -		return str_replace('[br]','
    ',$to_parse); + return str_replace('[br]','
    ',$to_parse); } } function parseBBCode($text) { - global $bbcode; + static $bbcode; if (!isset($bbcode)) { $bbcode = new BBCode(); -- cgit 1.4.1