Exemplo n.º 1
0
            xoops_load('XoopsCaptcha');
            $xoopsCaptcha = XoopsCaptcha::getInstance();
            if (!$xoopsCaptcha->verify()) {
                $xoopsTpl->assign('captcha_error', $xoopsCaptcha->getMessage());
                $xoopsTpl->assign('message', $message);
                $xoopsTpl->assign('uname', $uname);
                $addit = false;
            }
        }
    } else {
        $uid = $xoopsUser->getVar('uid');
        $uname = shoutbox_getUserName($uid);
    }
    //check if it is a double post
    if ($addit && $shoutbox->shoutExists($message)) {
        $addit = false;
        $xoopsTpl->assign('refresh', true);
    }
    if ($addit) {
        $shoutbox->saveShout($uid, $uname, $message);
        $shoutbox->pruneShouts($xoopsModuleConfig['maxshouts_trim']);
        $xoopsTpl->assign('refresh', true);
    }
}
$shouts = $shoutbox->getShouts(0, $xoopsModuleConfig['allow_bbcode'], $xoopsModuleConfig['maxshouts_view']);
if (!empty($shouts)) {
    $xoopsTpl->assign('shouts', $shouts);
}
$xoopsTpl->assign('config', $xoopsModuleConfig);
$xoopsTpl->xoops_setCaching(0);
$xoopsTpl->display('db:shoutbox_shoutframe.html');