diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-05-14 09:51:41 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-05-14 09:51:41 +0100 |
| commit | c6b9954c7f1ef88e372747a855d1859868ff802f (patch) | |
| tree | 525cc1443c88fc135ab7ca64d20321e55214256c | |
| parent | 465182f8a748c53cb9667146071d0fba6a90c3f8 (diff) | |
| download | messages-c6b9954c7f1ef88e372747a855d1859868ff802f.tar.gz messages-c6b9954c7f1ef88e372747a855d1859868ff802f.tar.bz2 messages-c6b9954c7f1ef88e372747a855d1859868ff802f.zip | |
php-cs-fixer tidies to php8.5 standards
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| -rwxr-xr-x | admin/schema_inc.php | 3 | ||||
| -rwxr-xr-x | broadcast.php | 2 | ||||
| -rwxr-xr-x | compose.php | 4 | ||||
| -rwxr-xr-x | contact.php | 2 | ||||
| -rwxr-xr-x | includes/bit_setup_inc.php | 1 | ||||
| -rwxr-xr-x | includes/classes/Messages.php | 16 | ||||
| -rwxr-xr-x | index.php | 2 | ||||
| -rwxr-xr-x | message_box.php | 3 | ||||
| -rwxr-xr-x | read.php | 3 | ||||
| -rwxr-xr-x | templates/index.php | 2 |
10 files changed, 14 insertions, 24 deletions
diff --git a/admin/schema_inc.php b/admin/schema_inc.php index 3630605..0a2675f 100755 --- a/admin/schema_inc.php +++ b/admin/schema_inc.php @@ -30,7 +30,7 @@ $tables = [ priority I4, is_hidden C(1) CONSTRAINT ', CONSTRAINT `messages_system_message_ref` FOREIGN KEY (`msg_id`) REFERENCES `" . BIT_DB_PREFIX . "messages` (`msg_id`)' -" +", // CONSTRAINT ', CONSTRAINT messages_to_user_ref FOREIGN KEY (to_user_id) REFERENCES `".BIT_DB_PREFIX."users_users` (user_id) // , CONSTRAINT messages_from_user_ref FOREIGN KEY (from_user_id) REFERENCES `".BIT_DB_PREFIX."users_users` (user_id)' @@ -49,7 +49,6 @@ $gBitInstaller->registerPackageInfo( MESSAGES_PKG_NAME, [ 'requirements' => 'If you are using MySQL, at least version 4.1', ] ); - // ### Default User Permissions $gBitInstaller->registerUserPermissions( MESSAGES_PKG_NAME, [ [ 'p_messages_send', 'Can use the messaging system', 'registered', MESSAGES_PKG_NAME ], diff --git a/broadcast.php b/broadcast.php index 0c30dbf..cb01a88 100755 --- a/broadcast.php +++ b/broadcast.php @@ -25,7 +25,7 @@ $gBitSystem->verifyPermission( 'p_messages_broadcast' ); $messages = new Messages(); -$feedback = array(); +$feedback = []; if( isset( $_REQUEST['send'] ) ) { if( $messages->postSystemMessage( $_REQUEST ) ) { diff --git a/compose.php b/compose.php index 2ef3f96..a230a73 100755 --- a/compose.php +++ b/compose.php @@ -50,7 +50,7 @@ if (!isset($_REQUEST['priority'])) $_REQUEST['priority'] = 3; if( !empty( $_REQUEST['action']['reply'] ) || !empty( $_REQUEST['action']['replyall'] ) ) { - $replyToUser = $gBitUser->getUserInfo( array( 'user_id' => $_REQUEST['replyto'] ) ); + $replyToUser = $gBitUser->getUserInfo( [ 'user_id' => $_REQUEST['replyto'] ] ); $_REQUEST['to'] = $replyToUser['login']; if( !empty( $_REQUEST['action']['replyall'] ) ) { $_REQUEST['cc'] = preg_replace( "/".$replyToUser['login'].",/", "", $_REQUEST['replyallto'] ); @@ -71,7 +71,7 @@ $gBitSmarty->assign('body', $_REQUEST['body']); $gBitSmarty->assign('priority', $_REQUEST['priority']); $gBitSmarty->assign('sent', 0); -$feedback = array(); +$feedback = []; $gBitSmarty->assign( 'feedback', $feedback ); if (isset($_REQUEST['replyto']) || isset($_REQUEST['replyallto'])) { diff --git a/contact.php b/contact.php index affaaeb..20f38cf 100755 --- a/contact.php +++ b/contact.php @@ -36,5 +36,5 @@ if( !empty( $_REQUEST['send'] )) { $gBitSmarty->assign( 'feedback', $feedback ); } -$gBitSystem->display( 'bitpackage:messages/contact.tpl', NULL, array( 'display_mode' => 'display' )); +$gBitSystem->display( 'bitpackage:messages/contact.tpl', NULL, [ 'display_mode' => 'display' ]); ?> diff --git a/includes/bit_setup_inc.php b/includes/bit_setup_inc.php index 38c9e5f..e30dcf2 100755 --- a/includes/bit_setup_inc.php +++ b/includes/bit_setup_inc.php @@ -1,5 +1,6 @@ <?php namespace Bitweaver\Messages; + global $gBitSystem, $gBitUser, $gBitSmarty; $pRegisterHash = [ diff --git a/includes/classes/Messages.php b/includes/classes/Messages.php index 104f02a..227d1c8 100755 --- a/includes/classes/Messages.php +++ b/includes/classes/Messages.php @@ -13,6 +13,7 @@ * @package messages */ namespace Bitweaver\Messages; + use Bitweaver\BitBase; use Bitweaver\KernelTools; use Bitweaver\Liberty\LibertyBase; @@ -45,7 +46,7 @@ class Messages extends BitBase { $pParamHash['userInfo']['email'], KernelTools::tra( 'New message arrived from ' ).$gBitSystem->getConfig( 'kernel_server_name', $_SERVER["SERVER_NAME"] ), $gBitSmarty->fetch( 'bitpackage:messages/message_notification.tpl' ), - "From: ".$gBitSystem->getConfig( 'site_sender_email' )."\r\nContent-type: text/plain;charset=utf-8\r\n" + "From: ".$gBitSystem->getConfig( 'site_sender_email' )."\r\nContent-type: text/plain;charset=utf-8\r\n", ); } } @@ -169,9 +170,6 @@ class Messages extends BitBase { $query = "SELECT COUNT(*) FROM `".BIT_DB_PREFIX."messages` mm WHERE mm.`to_user_id`=? $whereSql"; $cant = $this->mDb->getOne( $query, $bindVars ); - - - // ====================== Broadcast Messages ====================== //array_unshift( $bindVars, $gBitUser->mUserId, ROOT_USER_ID, $gBitUser->mUserId ); $bindVars = [ $gBitUser->mUserId, ROOT_USER_ID, $gBitUser->mUserId ]; @@ -223,9 +221,6 @@ class Messages extends BitBase { WHERE mm.`to_user_id`=? AND mm.`group_id` IN (SELECT `group_id` FROM `".BIT_DB_PREFIX."users_groups_map` WHERE `user_id` = ?) $whereSql"; $cant2 = $this->mDb->getOne($query, $bindVars); - - - // ====================== insane message mergin and sorting ====================== $sort_mode = $pListHash['sort_mode']; $ret = []; @@ -290,7 +285,6 @@ class Messages extends BitBase { $ret[$key] = $msg; } - $pListHash["cant"] = $cant + $cant2; LibertyBase::postGetList( $pListHash ); return $ret; @@ -405,8 +399,6 @@ class Messages extends BitBase { return $normalCount + $broadcastCount + $broadcastCount2; } - - // ==================== system messages ==================== public function postSystemMessage( $pParamHash ) { $pParamHash['to_login'] = ROOT_USER_ID; @@ -414,10 +406,10 @@ class Messages extends BitBase { if( @BitBase::verifyId( $pParamHash['group_id'] ) ) { return $this->postMessage( $pParamHash ); - } else { + } $this->mErrors['group_id'] = KernelTools::tra( "You need to specify a group id to broadcast the message to." ); return FALSE; - } + } public function getSystemMessageList() { @@ -1,4 +1,4 @@ -<?php +<?php // This is not a package. header ("location: ../index.php"); diff --git a/message_box.php b/message_box.php index 177f876..ab1c6e4 100755 --- a/message_box.php +++ b/message_box.php @@ -20,10 +20,9 @@ require_once( '../kernel/includes/setup_inc.php' ); use Bitweaver\Messages\Messages; use Bitweaver\KernelTools; - if( !$gBitUser->isRegistered() ) { $gBitSmarty->assign('msg', KernelTools::tra("You are not logged in")); - $gBitSystem->display( 'error.tpl' , NULL, array( 'display_mode' => 'display' )); + $gBitSystem->display( 'error.tpl' , NULL, [ 'display_mode' => 'display' ]); die; } @@ -20,7 +20,6 @@ require_once( '../kernel/includes/setup_inc.php' ); use Bitweaver\Messages\Messages; use Bitweaver\KernelTools; - if( !$gBitUser->isRegistered() ) { $gBitSystem->fatalError( KernelTools::tra( "You are not logged in" ) ); } @@ -61,4 +60,4 @@ $messages->flagMessage( $flagHash ); $msg = $messages->getMessage( $gBitUser->mUserId, $_REQUEST['msg_id']); $gBitSmarty->assign( 'msg', $msg ); -$gBitSystem->display( 'bitpackage:messages/read.tpl', NULL, array( 'display_mode' => 'display' )); +$gBitSystem->display( 'bitpackage:messages/read.tpl', NULL, [ 'display_mode' => 'display' ]); diff --git a/templates/index.php b/templates/index.php index 3e305fe..c0437d0 100755 --- a/templates/index.php +++ b/templates/index.php @@ -1,4 +1,4 @@ -<?php +<?php // This is not a package. header ("location: ../index.php"); |
