Changeset 19


Ignore:
Timestamp:
Apr 9, 2007, 2:06:10 PM (12 years ago)
Author:
julian
Message:
  • Reintegrated BBCode
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/core/Functions.class.php

    r16 r19  
    3030    }
    3131
    32     function unifyUserName($UserName) {
     32    public static function unifyUserName($UserName) {
    3333        $DB = Factory::singleton('DB');
    3434
     
    3737    }
    3838
    39     function unifyEmailAddress($emailAddress) {
     39    public static function unifyEmailAddress($emailAddress) {
    4040        $DB = Factory::singleton('DB');
    4141
     
    9191        $Lng = Factory::singleton('Language');
    9292        return date($Lng->getString('time_format'),$Timestamp);
     93    }
     94
     95    public static function addHttp($text) {
     96        if(substr($text,0,7) != "http://") $text = "http://".$text;
     97        return $text;
     98    }
     99
     100    public static function br2nl($text) {
     101        $text = str_replace('<br>',"\n",$text);
     102        $text = str_replace('<br/>',"\n",$text);
     103        return str_replace('<br />',"\n",$text);
    93104    }
    94105
  • trunk/modules/Constants.class.php

    r15 r19  
    2020        define('PROFILE_FIELD_TYPE_SELECTSINGLE',2);
    2121        define('PROFILE_FIELD_TYPE_SELECTMULTI',3);
     22
     23        define('BBCODE_QUOTE',0);
     24        define('BBCODE_CODE',1);
     25        define('BBCODE_BOLD',2);
     26        define('BBCODE_ITALIC',3);
     27        define('BBCODE_UNDERLINE',4);
     28        define('BBCODE_STRIKE',5);
     29        define('BBCODE_CENTER',6);
     30        define('BBCODE_EMAIL',7);
     31        define('BBCODE_IMAGE',8);
     32        define('BBCODE_LINK',9);
     33        define('BBCODE_COLOR',10);
    2234    }
    2335}
  • trunk/modules/ForumIndex.class.php

    r6 r19  
    66        'Cache',
    77        'Config',
     8        'BBCode',
    89        'DB',
    910        'Language',
     
    1415
    1516    public function executeMe() {
     17        //echo $this->modules['BBCode']->parse('[quote]test[/quote][quote=xxx]test[/quote][b]bold[/b][i]italic[/i][u]underline[/u][s]strike[/s][center]center[/center][email]juulian@tritanium-scripts.com[/email][img]tralala.gif[/img][url=http://www.julianbackes.de]jb[/url][url]http://www.julianbackes.de[/url][color=#FFFFFF]weisser text[/color][code]hehehe[/code]');
    1618        $baseCatID = isset($_GET['baseCatID']) ? intval($_GET['baseCatID']) : 1;
    1719        $catID = isset($_GET['catID']) ? intval($_GET['catID']) : $baseCatID;
  • trunk/modules/PrivateMessages.class.php

    r15 r19  
    44    protected $requiredModules = array(
    55        'Auth',
     6        'BBCode',
    67        'Cache',
    78        'Config',
  • trunk/modules/ViewTopic.class.php

    r15 r19  
    44    protected $requiredModules = array(
    55        'Auth',
     6        'BBCode',
    67        'Cache',
    78        'Constants',
     
    224225            //
    225226            $curPost['_postText'] = $curPost['postText'];
    226             if($curPost['postEnableHtmlCode'] != 1 || $forumID != 0 && $forumData['forumEnableHtmlCode'] != 1) $curPost['_postText'] = Functions::HTMLSpecialChars($curPost['_postText']);
    227             if($curPost['postEnableSmilies'] == 1 && ($forumID == 0 || $forumData['forumEnableSmilies'] == 1)) $curPost['_postText'] = strtr($curPost['_postText'],$smiliesData);
     227            if($curPost['postEnableHtmlCode'] != 1 || $forumData['forumEnableHtmlCode'] != 1) $curPost['_postText'] = Functions::HTMLSpecialChars($curPost['_postText']);
     228            if($curPost['postEnableSmilies'] == 1 && $forumData['forumEnableSmilies'] == 1) $curPost['_postText'] = strtr($curPost['_postText'],$smiliesData);
    228229            $curPost['_postText'] = nl2br($curPost['_postText']);
    229230            //if($curPost['post_enable_urltransformation'] == 1  && ($forum_id == 0 || $forumData['forum_enable_urltransformation'] == 1)) $curPost['post_text'] = transform_urls($curPost['post_text']);
    230             //if($curPost['post_enable_bbcode'] == 1 && ($forum_id == 0 || $forumData['forum_enable_bbcode'] == 1)) $curPost['post_text'] = bbcode($curPost['post_text']);
     231            if($curPost['postEnableBBCode'] == 1 && $forumData['forumEnableBBCode'] == 1) $curPost['_postText'] = $this->modules['BBCode']->parse($curPost['_postText']);
    231232
    232233
     
    240241                    if($this->modules['Config']->getValue('allow_sig_smilies') == 1) $parsedSignatures[$curPost['posterID']] = strtr($parsedSignatures[$curPost['posterID']],$smiliesData);
    241242                    $parsedSignatures[$curPost['posterID']] = nl2br($parsedSignatures[$curPost['posterID']]);
    242                     //if($this->modules['Config']->getValue('allow_sig_bbcode') == 1) $parsed_signatures[$curPost['PosterID']] = bbcode($parsed_signatures[$curPost['PosterID']]);
     243                    if($this->modules['Config']->getValue('allow_sig_bbcode') == 1) $parsedSignatures[$curPost['posterID']] = $this->modules['BBCode']->parse($parsedSignatures[$curPost['posterID']]);
    243244                }
    244245                $curSignature = $parsedSignatures[$curPost['posterID']];
     
    328329            SELECT
    329330                t1.*,
    330                 t2.userEmail AS postPosterEmail,
     331                t2.userEmailAddress AS postPosterEmailAddress,
    331332                t2.userNick AS postPosterNick,
    332333                t2.userSignature AS postPosterSignature,
  • trunk/templates/std/files/ViewTopic.tpl

    r17 r19  
    6161     <table border="0" cellpadding="0" cellspacing="0">
    6262      <tr>
    63        {if $curPost.show.deleteButton}<td><a href="{$indexFile}?action=DeletePost&amp;postID={$curPost.postID}&amp;{$mySID}"><img src="templates/std/templates/images/buttons/de/delete.png" class="ImageButton" alt="" border="0"/></a></td>{/if}
    64        {if $curPost.show.editButton}<td><a href="javascript:toggleFastEdit('{$curPost.postID}');"><img src="templates/std/templates/images/buttons/de/test.png" alt="" class="ImageButton" border="0"/></a></td>{/if}
    65        {if $curPost.show.editButton}<td><a href="{$indexFile}?action=Posting&amp;mode=Edit&amp;postID={$curPost.postID}&amp;{$mySID}"><img src="templates/std/templates/images/buttons/de/test.png" class="ImageButton" alt="" border="0"/></a></td>{/if}
    66        {if $curPost.postPosterHideEmailAddress != 1 && $curPost.postPosterEmailAddress != ''}<td><a href="mailto:{$curPost.postPosterEmailAddress}"><img src="templates/std/templates/images/buttons/de/email.png" class="ImageButton" alt="{$curPost.postPosterEmailAddress}" border="0"/></a>{else}<td>{if $curPost.postPosterReceiveEmails == 1}<a href="{$indexFile}?action=ViewProfile&amp;profileID={$curPost.UserID}&amp;mode=SendMail&amp;{$mySID}"><img src="{$modules.Template->getTemplateDir()}/images/button_user_email.gif" alt="{$modules.Language->getString('Send_email')}" border="0"/></a></td>{/if}{/if}
    67        <td><a href="{$indexFile}?action=Posting&amp;mode=Reply&amp;topicID={$topicID}&amp;Quote={$curPost.postID}&amp;{$mySID}"><img src="templates/std/templates/images/buttons/de/quote.png" class="ImageButton" alt="" border="0"/></a></td>
     63       {if $curPost.show.deleteButton}<td><a href="{$indexFile}?action=DeletePost&amp;postID={$curPost.postID}&amp;{$mySID}"><img src="{$modules.Template->getTD()}/images/buttons/de/delete.png" class="ImageButton" alt="" border="0"/></a></td>{/if}
     64       {if $curPost.show.editButton}<td><a href="javascript:toggleFastEdit('{$curPost.postID}');"><img src="{$modules.Template->getTD()}/images/buttons/de/test.png" alt="" class="ImageButton" border="0"/></a></td>{/if}
     65       {if $curPost.show.editButton}<td><a href="{$indexFile}?action=Posting&amp;mode=Edit&amp;postID={$curPost.postID}&amp;{$mySID}"><img src="{$modules.Template->getTD()}/images/buttons/de/test.png" class="ImageButton" alt="" border="0"/></a></td>{/if}
     66       {if $curPost.postPosterHideEmailAddress != 1 && $curPost.postPosterEmailAddress != ''}<td><a href="mailto:{$curPost.postPosterEmailAddress}"><img src="{$modules.Template->getTD()}/images/buttons/de/email.png" class="ImageButton" alt="{$curPost.postPosterEmailAddress}" border="0"/></a>{else}<td>{if $curPost.postPosterReceiveEmails == 1}<a href="{$indexFile}?action=ViewProfile&amp;profileID={$curPost.UserID}&amp;mode=SendMail&amp;{$mySID}"><img src="{$modules.Template->getTemplateDir()}/images/button_user_email.gif" alt="{$modules.Language->getString('Send_email')}" border="0"/></a></td>{/if}{/if}
     67       <td><a href="{$indexFile}?action=Posting&amp;mode=Reply&amp;topicID={$topicID}&amp;Quote={$curPost.postID}&amp;{$mySID}"><img src="{$modules.Template->getTD()}/images/buttons/de/quote.png" class="ImageButton" alt="" border="0"/></a></td>
    6868      </tr>
    6969     </table>
Note: See TracChangeset for help on using the changeset viewer.