Example #1
0
<?php

require '../../model/MensagemChat.php';
$curdir = getcwd();
chdir('/home/ccvteam/public_html/forum');
require_once '/home/ccvteam/public_html/forum/global.php';
require_once '/home/ccvteam/public_html/forum/includes/class_bbcode.php';
require_once '/home/ccvteam/public_html/forum/includes/functions_newpost.php';
chdir($curdir);
$userid = $vbulletin->userinfo['userid'];
if ($userid != '0') {
    $shouter = utf8_encode($vbulletin->userinfo['musername']);
    // clean input
    $vbulletin->input->clean_array_gpc('p', array('message' => TYPE_STR));
    $shout = $vbulletin->GPC['message'];
    // trata aspas
    $shout = addslashes($shout);
    // trata ajax urlencoded
    $shout = convert_urlencoded_unicode($shout);
    // convert links
    $shout = convert_url_to_bbcode($shout);
    // parseador de bbCode
    $parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
    // do_parse($text, $do_html = false, $do_smilies = true, $do_bbcode = true , $do_imgcode = true, $do_nl2br = true, $cachable = false)
    $shout = $parser->do_parse($shout, false, true, true, false, false, false);
    $timestamp = date("Y-m-d H:i:s");
    $msg = new MensagemChat($shout, $shouter, $timestamp, $userid);
    $msg->Save();
}