shoutbox
[ class tree: shoutbox ] [ index: shoutbox ] [ all elements ]

Source for file mod_shoutbox.php

Documentation is available at mod_shoutbox.php

  1. <?php
  2. /**
  3.  * $Header: /cvsroot/bitweaver/_bit_shoutbox/modules/mod_shoutbox.php,v 1.8 2007/01/01 11:32:42 squareing Exp $
  4.  * @package shoutbox
  5.  * @subpackage functions
  6.  */
  7. global $gQueryUser;
  8.  
  9. /**
  10.  * required setup
  11.  */
  12. include_onceSHOUTBOX_PKG_PATH.'Shoutbox.php' );
  13. $gShout new Shoutbox();
  14.  
  15. $gBitUser->hasPermission'p_shoutbox_view' );
  16. if$gQueryUser && $gQueryUser->isRegistered() ) {
  17.     $shoutUserId $gQueryUser->mUserId;
  18.     $gBitSmarty->assign'moduleTitle'$gQueryUser->getDisplayName().'\'s '.tra'shoutbox' ) );
  19. else {
  20.     $gBitSmarty->assign'moduleTitle'tra'Shoutbox' ) );
  21.     $shoutUserId ROOT_USER_ID;
  22. }
  23.  
  24. $gBitSmarty->assign'toUserId'$shoutUserId );
  25. $shoutFeedbackNULL;
  26.  
  27. if$gBitSystem->isPackageActive'shoutbox' && $gBitUser->hasPermission'p_shoutbox_view' ) ) {
  28.     $parsedUrl parse_url$_SERVER["REQUEST_URI");
  29.  
  30.     ifisset$parsedUrl["query") ) {
  31.         parse_str$parsedUrl["query"]$sht_query );
  32.     }
  33.  
  34.     $shout_father $parsedUrl["path"];
  35.  
  36.     // recreate url parameters and append ? or &amp; that we can add parameters in the tpl
  37.     if!empty$sht_query ) ) {
  38.         $sht_first 1;
  39.         foreach$sht_query as $sht_name => $sht_val {
  40.             $shout_father .= ( ( $sht_first++ == "?" "&amp;" )."$sht_name=$sht_val";
  41.         }
  42.         $shout_father .= '&amp;';
  43.     else {
  44.         $shout_father .= '?';
  45.     }
  46.  
  47.     global $gBitSmarty;
  48.     $gBitSmarty->assign'shout_ownurl'$shout_father );
  49.     ifisset$_REQUEST["shout_remove") ) {
  50.         if$gShout->expunge$_REQUEST["shout_remove") ) {
  51.             $shoutFeedback['success'tra"Message removed" );
  52.         else {
  53.             $shoutFeedback['error'$gShout->mErrors['expunge'];
  54.         }
  55.     }
  56.  
  57.     if$gBitUser->hasPermission'p_shoutbox_post' ) ) {
  58.         ifisset$_REQUEST["shout_send") ) {
  59.             if$gShout->store$_REQUEST ) ) {
  60.                 $shoutFeedback['success'tra"Message posted" );
  61.             else {
  62.                 $shoutFeedback['error'$gShout->mErrors['store'];
  63.             }
  64.         }
  65.     }
  66.  
  67.     $getList array(
  68.         'max_records' => $module_rows,
  69.         'sort_mode' => 'shout_time_desc',
  70.         'to_user_id' => $shoutUserId
  71.     );
  72.     $shout_msgs $gShout->getList$getList );
  73.     $gBitSmarty->assign'shout_msgs'$shout_msgs );
  74.     $gBitSmarty->assign'shoutFeedback'$shoutFeedback );
  75. }
  76.  
  77. ?>

Documentation generated on Thu, 15 Feb 2007 20:45:29 +0000 by phpDocumentor 1.3.0