Source for file mod_shoutbox.php
Documentation is available at mod_shoutbox.php
* $Header: /cvsroot/bitweaver/_bit_shoutbox/modules/mod_shoutbox.php,v 1.8 2007/01/01 11:32:42 squareing Exp $
include_once( SHOUTBOX_PKG_PATH. 'Shoutbox.php' );
$gBitUser->hasPermission( 'p_shoutbox_view' );
if( $gQueryUser && $gQueryUser->isRegistered() ) {
$shoutUserId = $gQueryUser->mUserId;
$gBitSmarty->assign( 'moduleTitle', $gQueryUser->getDisplayName(). '\'s '. tra( 'shoutbox' ) );
$gBitSmarty->assign( 'moduleTitle', tra( 'Shoutbox' ) );
$gBitSmarty->assign( 'toUserId', $shoutUserId );
if( $gBitSystem->isPackageActive( 'shoutbox' ) && $gBitUser->hasPermission( 'p_shoutbox_view' ) ) {
$parsedUrl = parse_url( $_SERVER["REQUEST_URI"] );
if( isset ( $parsedUrl["query"] ) ) {
parse_str( $parsedUrl["query"], $sht_query );
$shout_father = $parsedUrl["path"];
// recreate url parameters and append ? or & that we can add parameters in the tpl
if( !empty( $sht_query ) ) {
foreach( $sht_query as $sht_name => $sht_val ) {
$shout_father .= ( ( $sht_first++ == 1 ) ? "?" : "&" ). "$sht_name=$sht_val";
$shout_father .= '&';
$gBitSmarty->assign( 'shout_ownurl', $shout_father );
if( isset ( $_REQUEST["shout_remove"] ) ) {
if( $gShout->expunge( $_REQUEST["shout_remove"] ) ) {
$shoutFeedback['success'] = tra( "Message removed" );
$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" );
$shoutFeedback['error'] = $gShout->mErrors['store'];
'max_records' => $module_rows,
'sort_mode' => 'shout_time_desc',
'to_user_id' => $shoutUserId
$shout_msgs = $gShout->getList( $getList );
$gBitSmarty->assign( 'shout_msgs', $shout_msgs );
$gBitSmarty->assign( 'shoutFeedback', $shoutFeedback );
|