Esempio n. 1
0
    if ($gShout->expunge($_REQUEST["remove"])) {
        $feedback['success'] = tra("Message removed");
    } else {
        $feedback['error'] = $gShout->mErrors['expunge'];
    }
} elseif (isset($_REQUEST["shoutbox_admin"]) && $gBitUser->isAdmin()) {
    $gBitSystem->storeConfig('shoutbox_autolink', isset($_REQUEST["shoutbox_autolink"]) ? $_REQUEST["shoutbox_autolink"] : NULL, SHOUTBOX_PKG_NAME);
    $gBitSystem->storeConfig('shoutbox_email_notice', isset($_REQUEST["shoutbox_email_notice"]) ? 'y' : NULL, SHOUTBOX_PKG_NAME);
    $gBitSystem->storeConfig('shoutbox_smileys', isset($_REQUEST["shoutbox_smileys"]) ? 'y' : NULL, SHOUTBOX_PKG_NAME);
    // to be on the safe side, we will simply nuke the entire shoutbox cache
    $gShout->mCache->expungeCache();
}
if (!empty($_REQUEST["save"]) && $gBitUser->hasPermission('p_shoutbox_post')) {
    if ($gShout->store($_REQUEST)) {
        $feedback['success'] = tra("Message saved");
    } else {
        $feedback['error'] = $gShout->mErrors;
    }
}
if (!empty($_REQUEST["shout_id"])) {
    $edit = $gShout->getShout($_REQUEST["shout_id"]);
    $gBitSmarty->assign("shout_id", $_REQUEST["shout_id"]);
}
$listHash = $_REQUEST;
$channels = $gShout->getList($listHash);
$gBitSmarty->assign('channels', $channels);
$gBitSmarty->assign('listInfo', $listHash['listInfo']);
$gBitSmarty->assign('shout', $edit);
$gBitSmarty->assign('feedback', $feedback);
// Display the template
$gBitSystem->display('bitpackage:shoutbox/shoutbox.tpl', tra('Shoutbox'), array('display_mode' => 'display'));
Esempio n. 2
0
            $shout_father .= ($sht_first++ == 1 ? "?" : "&") . "{$sht_name}={$sht_val}";
        }
        $shout_father .= '&';
    } else {
        $shout_father .= '?';
    }
    global $gBitSmarty;
    $_template->tpl_vars['shout_ownurl'] = new Smarty_variable($shout_father);
    if (isset($_REQUEST["shout_remove"])) {
        if ($gShout->expunge($_REQUEST["shout_remove"])) {
            $shoutFeedback['success'] = tra("Message removed");
        } else {
            $shoutFeedback['error'] = $gShout->mErrors['expunge'];
        }
    }
    if ($gBitUser->hasPermission('p_shoutbox_post')) {
        if (isset($_REQUEST["shout_send"])) {
            if ($gShout->store($_REQUEST)) {
                $shoutFeedback['success'] = tra("Message posted");
            } else {
                $shoutFeedback['error'] = $gShout->mErrors['store'];
            }
        }
    }
    // moduleParams contains lots of goodies: extract for easier handling
    extract($moduleParams);
    $getList = array('max_records' => $module_rows, 'sort_mode' => 'shout_time_desc', 'to_user_id' => $shoutUserId);
    $shout_msgs = $gShout->getList($getList);
    $_template->tpl_vars['shout_msgs'] = new Smarty_variable($shout_msgs);
    $_template->tpl_vars['shoutFeedback'] = new Smarty_variable($shoutFeedback);
}