Calificación:
  • 0 voto(s) - 0 Media
  • 1
  • 2
  • 3
  • 4
  • 5
PHPOST BBcode [tu]
#1
¿Cómo se usa? Con poner [tu] saldrá el nick del usuario logueado, caso contrario saldrá "visitante".

Instalación:

en inc/class ir a c.core.php y buscar lo siguiente:


Código:
function parseBBCode($bbcode, $type = 'normal'){
         // CLASS BBCode
         include_once(TS_EXTRA . 'bbcode.inc.php');
         $parser =& BBCode::getInstance();
         switch($type){
                 // NORMAL
                 case 'normal':
                         // RESTRICTIONS
                         $parser->restriction = array('url', 'code', 'quote', 'quotePHPost', 'font', 'size', 'color', 'img', 'b', 'i', 'u', 'align', 'spoiler', 'swf', 'goear', 'hr', 'li');
                         // CONVERTIMOS
                         $html = $parser->parseString($bbcode);
                         // SMILES
                         $html = $parser->parseSmiles($html, $this->settings['default'].'/images/smiles/');
                         // MENCIONES
                         $html = $this->setMenciones($html);
                 break;
                 // FIRMA
                 case 'firma':
                         // BBCodes permitidos
                         $parser->restriction = array('url', 'font', 'size', 'color', 'img', 'b', 'i', 'u', 'align', 'spoiler');
                         // CONVERTIMOS
                         $html = $parser->parseString($bbcode);
                 break;
                 // NOTICIAS
                 case 'news':
                         // BBCodes permitidos
                         $parser->restriction = array('url', 'b', 'i', 'u');
                         // CONVERTIMOS
                         $html = $parser->parseString($bbcode);
                         // SMILES
                         $html = $parser->parseSmiles($html, $this->settings['default'].'/images/smiles/');
                 break;
                 // SOLO SMILES
                 case 'smiles':
                         $parser->restriction = array('url', 'code', 'quote', 'quotePHPost', 'font', 'size', 'color', 'img', 'b', 'i', 'u', 'align', 'spoiler', 'swf', 'goear', 'hr', 'li');
                         // SMILES
                         $html = $parser->parseSmiles($bbcode, $this->settings['default'].'/images/smiles/');
                         // MENCIONES
                         $html = $this->setMenciones($html);
                 break;
         }
         //
         return $html;
}

Ahora a todo eso lo reemplazan por esto:

Código:
function parseBBCode($bbcode, $type = 'normal'){
global $tsUser;
                // CLASS BBCode
                include_once(TS_EXTRA . 'bbcode.inc.php');
                $parser =& BBCode::getInstance();
                switch($type){
                        // NORMAL
                        case 'normal':
                                // RESTRICTIONS
                                $parser->restriction = array('url', 'code', 'quote', 'quotePHPost', 'font', 'size', 'color', 'img', 'b', 'i', 'u', 'align', 'spoiler', 'swf', 'goear', 'hr', 'li');
                                // CONVERTIMOS
                                $html = $parser->parseString($bbcode);
                                // SMILES
                                $html = $parser->parseSmiles($html, $this->settings['default'].'/images/smiles/');
                                // MENCIONES
                                $html = $this->setMenciones($html);
                        break;
                        // FIRMA
                        case 'firma':
                                // BBCodes permitidos
                                $parser->restriction = array('url', 'font', 'size', 'color', 'img', 'b', 'i', 'u', 'align', 'spoiler');
                                // CONVERTIMOS
                                $html = $parser->parseString($bbcode);
                        break;
                        // NOTICIAS
                        case 'news':
                                // BBCodes permitidos
                                $parser->restriction = array('url', 'b', 'i', 'u');
                                // CONVERTIMOS
                                $html = $parser->parseString($bbcode);
                                // SMILES
                                $html = $parser->parseSmiles($html, $this->settings['default'].'/images/smiles/');
                        break;
                        // SOLO SMILES
                        case 'smiles':
                                $parser->restriction = array('url', 'code', 'quote', 'quotePHPost', 'font', 'size', 'color', 'img', 'b', 'i', 'u', 'align', 'spoiler', 'swf', 'goear', 'hr', 'li');
                                // SMILES
                                $html = $parser->parseSmiles($bbcode, $this->settings['default'].'/images/smiles/');
                                // MENCIONES
                                $html = $this->setMenciones($html);
                        break;
                }
                //
                $html = str_replace('[tu]', ($tsUser ? $tsUser->nick : 'visitante'), $html);
                return $html;
}

Creditos A : Nico
#2
Me gustaS Este mod Es muy Importante




Usuarios navegando en este tema: 1 invitado(s)