Exemple #1
0
/**
 * @copyright       The XUUPS Project http://sourceforge.net/projects/xuups/
 * @license         http://www.fsf.org/copyleft/gpl.html GNU public license
 * @package         Shoutbox
 * @author          Alphalogic <*****@*****.**>
 * @author          tank <*****@*****.**>
 * @author          trabis <*****@*****.**>
 * @version         $Id: shoutframe.php 0 2010-01-29 18:47:04Z trabis $
 */
include_once dirname(__FILE__) . '/header.php';
include_once XOOPS_ROOT_PATH . '/modules/shoutbox/class/shoutbox.php';
include_once XOOPS_ROOT_PATH . '/modules/shoutbox/include/functions.php';
$shoutbox = new Shoutbox($xoopsModuleConfig['storage_type']);
// Admins may delete posts
if (!empty($_POST['clear']) && !empty($xoopsUser) && $xoopsUser->isAdmin()) {
    $shoutbox->deleteShouts();
}
$addit = true;
$double = false;
$message = !empty($_POST['message']) ? trim($_POST['message']) : '';
$isUser = is_object($xoopsUser);
$isAnonymous = !$isUser && $xoopsModuleConfig['guests_may_post'];
$isMessage = !empty($message);
if ($isMessage && ($isUser || $isAnonymous)) {
    //Populate uid and name and verify captcha
    if ($isAnonymous) {
        $uid = 0;
        $post_uname = isset($_POST['uname']) ? trim($_POST['uname']) : '';
        if ($xoopsModuleConfig['guests_may_chname'] && !empty($post_uname)) {
            $uname = $post_uname;
        } else {