diff options
| author | lsces <lester@lsces.co.uk> | 2026-03-09 20:23:02 +0000 |
|---|---|---|
| committer | lsces <lester@lsces.co.uk> | 2026-03-09 20:23:02 +0000 |
| commit | 27b224f36d0587e79447fce1e5cb62161005e616 (patch) | |
| tree | 065d8d1767672ad08cd3e3a3197e6630769b6f6b /admin | |
| parent | 23dd61e8cabda4b922e2ef28ad6a52db847f2cf0 (diff) | |
| download | boards-27b224f36d0587e79447fce1e5cb62161005e616.tar.gz boards-27b224f36d0587e79447fce1e5cb62161005e616.tar.bz2 boards-27b224f36d0587e79447fce1e5cb62161005e616.zip | |
As with articles, boards has had a blanket Smarty5 and PHP8.4 sweep of the code, but as yet this has not been tested. VSCode is currently saying the files are now clean.
Diffstat (limited to 'admin')
| -rwxr-xr-x[-rw-r--r--] | admin/admin_boards_inc.php | 77 | ||||
| -rwxr-xr-x[-rw-r--r--] | admin/boardsync_cron.php | 10 | ||||
| -rwxr-xr-x[-rw-r--r--] | admin/boardsync_inc.php | 86 | ||||
| -rwxr-xr-x[-rw-r--r--] | admin/phpbb_migrate.php | 12 | ||||
| -rwxr-xr-x[-rw-r--r--] | admin/schema_inc.php | 60 | ||||
| -rwxr-xr-x[-rw-r--r--] | admin/upgrade_inc.php | 3 | ||||
| -rwxr-xr-x[-rw-r--r--] | admin/upgrades/1.0.1.php | 4 |
7 files changed, 124 insertions, 128 deletions
diff --git a/admin/admin_boards_inc.php b/admin/admin_boards_inc.php index e9c494e..3ece564 100644..100755 --- a/admin/admin_boards_inc.php +++ b/admin/admin_boards_inc.php @@ -10,57 +10,57 @@ // $gBitSmarty->assign('home_bitboard', $_REQUEST["homeBitBoards"]); //} -require_once( BOARDS_PKG_CLASS_PATH.'BitBoard.php' ); +namespace Bitweaver\Boards;; -$formBitBoardsLists = array( - 'boards_thread_track' => array( +$formBitBoardsLists = [ + 'boards_thread_track' => [ 'label' => 'Enable Topic Status Tracking', - 'note' => 'Allow users to see what topic have been changed since they last logged on.', - ), - 'boards_thread_notification' => array( + 'note' => 'Allow users to see what topic have been changed since they last logged on.', + ], + 'boards_thread_notification' => [ 'label' => 'Enable Topic Reply Notification', - 'note' => 'Allow users to be sent emails when topics they are interested in receive replies.', - ), - 'boards_posts_anon_moderation' => array( + 'note' => 'Allow users to be sent emails when topics they are interested in receive replies.', + ], + 'boards_posts_anon_moderation' => [ 'label' => 'Require Anonymous Post Moderation', - 'note' => 'Require that ALL Anonymous posts must be validated before they are shown.', - ), - 'boards_hide_edit_tpl' => array( + 'note' => 'Require that ALL Anonymous posts must be validated before they are shown.', + ], + 'boards_hide_edit_tpl' => [ 'label' => 'Hide Linked Boards Option', - 'note' => 'Hide the <em>Linked Boards</em> option on edit pages to link any given content to a forum thread. If you hide this, you will have to manually assign content to a forum thread if you want to make full use of the boards.', - ), - 'boards_link_by_pigeonholes' => array( + 'note' => 'Hide the <em>Linked Boards</em> option on edit pages to link any given content to a forum thread. If you hide this, you will have to manually assign content to a forum thread if you want to make full use of the boards.', + ], + 'boards_link_by_pigeonholes' => [ 'label' => 'Link by Pigeonholes', - 'note' => 'Link content to boards based on pigeonholes. This is useful when you have only one board in a given pigeonhole and want all content in the same pigeonhole to be shown in the board. Note that you MUST run the following SQL on your database to allow content in more than one board: "alter table boards_map drop constraint boards_map_pkey;" This is therfore a very advanced option.' - ), -); + 'note' => 'Link content to boards based on pigeonholes. This is useful when you have only one board in a given pigeonhole and want all content in the same pigeonhole to be shown in the board. Note that you MUST run the following SQL on your database to allow content in more than one board: "alter table boards_map drop constraint boards_map_pkey;" This is therfore a very advanced option.', + ], +]; $gBitSmarty->assign( 'formBitBoardsLists',$formBitBoardsLists ); -$formBitBoardsSync = array( - 'boards_sync_mail_server' => array( +$formBitBoardsSync = [ + 'boards_sync_mail_server' => [ 'label' => 'Email Server', - 'note' => 'Internet address of your mail server.', - ), - 'boards_sync_user' => array( + 'note' => 'Internet address of your mail server.', + ], + 'boards_sync_user' => [ 'label' => 'Email Username', - 'note' => 'Username used to login to the board sync email account.', - ), - 'boards_sync_password' => array( + 'note' => 'Username used to login to the board sync email account.', + ], + 'boards_sync_password' => [ 'label' => 'Email Password', - 'note' => 'Password used to login to the board sync email account.', - ), -); + 'note' => 'Password used to login to the board sync email account.', + ], +]; $gBitSmarty->assign( 'formBitBoardsSync',$formBitBoardsSync ); $processForm = set_tab(); -$formBoardsEmailList = array( - "boards_email_list" => array( +$formBoardsEmailList = [ + "boards_email_list" => [ 'label' => 'Group Email List', - 'note' => 'Enable groups to have an associated email list', - ), -); + 'note' => 'Enable groups to have an associated email list', + ], +]; $gBitSmarty->assign( 'formBoardsEmailList',$formBoardsEmailList ); -$formBoardsEmailText = array( 'boards_email_host', 'boards_email_admin', 'server_mailman_bin', 'server_mailman_cmd', 'server_newaliases_cmd', 'server_aliases_file' ); +$formBoardsEmailText = [ 'boards_email_host', 'boards_email_admin', 'server_mailman_bin', 'server_mailman_cmd', 'server_newaliases_cmd', 'server_aliases_file' ]; if( $processForm ) { $bitboardToggles = array_merge( $formBitBoardsLists,$formBoardsEmailList ); @@ -68,16 +68,15 @@ if( $processForm ) { simple_set_toggle( $item, BOARDS_PKG_NAME ); } foreach( $formBitBoardsSync as $key => $data ) { - $gBitSystem->storeConfig( $key, (!empty( $_REQUEST[$key] ) ? $_REQUEST[$key] : NULL), BOARDS_PKG_NAME ); + $gBitSystem->storeConfig( $key, $_REQUEST[$key] ?? null, BOARDS_PKG_NAME ); } foreach( $formBoardsEmailText as $text ) { - $gBitSystem->storeConfig( $text, ( !empty( $_REQUEST[$text] ) ? trim( $_REQUEST[$text] ) : NULL ), BOARDS_PKG_NAME ); + $gBitSystem->storeConfig( $text, !empty( $_REQUEST[$text] ) ? trim( $_REQUEST[$text] ) : null, BOARDS_PKG_NAME ); } } $board = new BitBoard(); $boards = $board->getBoardSelectList( $_REQUEST ); -$gBitSmarty->assignByRef(BOARDS_PKG_NAME, $boards['data']); -?> +$gBitSmarty->assign(BOARDS_PKG_NAME, $boards['data'] ?? ''); diff --git a/admin/boardsync_cron.php b/admin/boardsync_cron.php index 9ea170c..40f6600 100644..100755 --- a/admin/boardsync_cron.php +++ b/admin/boardsync_cron.php @@ -1,13 +1,13 @@ <?php global $gShellScript, $gArgs, $gBitUser; chdir( dirname( __FILE__ ) ); -$gShellScript = TRUE; -//$gDebug = TRUE; +$gShellScript = true; +//$gDebug = true; -require_once( '../../kernel/includes/setup_inc.php' ); +require_once '../../kernel/includes/setup_inc.php'; -require_once( BOARDS_PKG_INCLUDE_PATH.'admin/boardsync_inc.php'); +require_once BOARDS_PKG_INCLUDE_PATH . 'admin/boardsync_inc.php'; print "Running: ".date(DATE_RFC822)."\r\n"; -board_sync_run(TRUE); +board_sync_run(true); diff --git a/admin/boardsync_inc.php b/admin/boardsync_inc.php index 622a4ff..86b521a 100644..100755 --- a/admin/boardsync_inc.php +++ b/admin/boardsync_inc.php @@ -1,8 +1,8 @@ <?php -function board_sync_run($pLog = FALSE) { +function board_sync_run($pLog = false) { global $gBitUser, $gBitSystem; - $gBitUser->setPermissionOverride('p_users_bypass_captcha', TRUE); + $gBitUser->setPermissionOverride('p_users_bypass_captcha', true); $connectionString = '{'.$gBitSystem->getConfig('boards_sync_mail_server','imap').':'.$gBitSystem->getConfig('boards_sync_mail_port','993').'/'.$gBitSystem->getConfig('boards_sync_mail_protocol','imap').'/ssl/novalidate-cert}'; @@ -18,7 +18,7 @@ function board_sync_run($pLog = FALSE) { if( $messageNumbers = imap_sort( $mbox, SORTDATE, 0 ) ) { foreach( $messageNumbers as $msgNum ) { if ($pLog) print "Processing Msg#: ".$msgNum."\n"; - $deleteMsg = FALSE; + $deleteMsg = false; $header = imap_headerinfo( $mbox, $msgNum ); // Is this a moderation message? @@ -57,10 +57,10 @@ function board_sync_run($pLog = FALSE) { // Is this a reminder message that we just skip? } elseif( preg_match('/[0-9]+ .*? moderator request.* waiting/', $header->subject) ) { if ($pLog) print "Deleting reminder.\n"; - $deleteMsg = TRUE; + $deleteMsg = true; } elseif( preg_match('/Welcome to the .* mailing list/', $header->subject) ) { if ($pLog) print "Deleting welcome message.\n"; - $deleteMsg = TRUE; + $deleteMsg = true; } else { // imap_headerinfo acts retarded on these emails and improperly parses the header unless we call fetchstructure first - so do it. // note this problem does not occure above when parsing the temp email in a moderated msg - god damn spooky @@ -69,7 +69,7 @@ function board_sync_run($pLog = FALSE) { // With multiple To: recipients it is often handy to know who the message is "Delivered-To" by the MTA $raw_headers = imap_fetchheader($mbox, $msgNum); $deliveredTo = board_sync_delivered_to($raw_headers); - $deleteMsg = board_sync_process_message( $mbox, $msgNum, $msgHeader, $msgStructure, FALSE, $pLog, $deliveredTo); + $deleteMsg = board_sync_process_message( $mbox, $msgNum, $msgHeader, $msgStructure, false, $pLog, $deliveredTo); // vd($deleteMsg); } if( $deleteMsg && empty( $gDebug ) && empty( $gArgs['test'] ) ) { @@ -191,7 +191,7 @@ function board_sync_get_user( $pFrom ) { return $gBitUser->getUserInfo( array( 'user_id'=>-1 ) ); } -function cache_check_content_prefs( $pName, $pValue, $pLower = FALSE ) { +function cache_check_content_prefs( $pName, $pValue, $pLower = false ) { global $gBitDb, $gBitSystem; static $prefs; @@ -206,13 +206,13 @@ function cache_check_content_prefs( $pName, $pValue, $pLower = FALSE ) { return $prefs[$pLower][$pName][$pValue]; } - return NULL; + return null; } /** * $pMsgHeader is a imap_headerinfo generated array **/ -function board_sync_process_message( $pMbox, $pMsgNum, $pMsgHeader, $pMsgStructure, $pModerate = FALSE , $pLog=FALSE, $pDeliveredTo=NULL) { +function board_sync_process_message( $pMbox, $pMsgNum, $pMsgHeader, $pMsgStructure, $pModerate = false , $pLog=false, $pDeliveredTo=null) { global $gBitSystem, $gBitDb; // vd( $pMsgHeader ); @@ -231,8 +231,8 @@ function board_sync_process_message( $pMbox, $pMsgNum, $pMsgHeader, $pMsgStructu if ($pLog) print(" Subject: ".$subject."\n"); - $matches = array(); - $toAddresses = array(); + $matches = []; + $toAddresses = []; $allRecipients = ""; if (empty($pDeliveredTo)) { if( isset( $pMsgHeader->toaddress ) ){ @@ -248,8 +248,8 @@ function board_sync_process_message( $pMbox, $pMsgNum, $pMsgHeader, $pMsgStructu $allSplit = split( ',', $allRecipients ); foreach( $allSplit as $s ) { $s = trim( $s ); - $matches = array(); - if( strpos( $s, '<' ) !== FALSE ) { + $matches = []; + if( strpos( $s, '<' ) !== false ) { if( preg_match( "/\s*(.*)\s*<\s*(.*)\s*>/", $s, $matches ) ) { $toAddresses[] = array( 'name'=>$matches[1], 'email'=>$matches[2] ); } elseif( preg_match('/<\s*(.*)\s*>\s*(.*)\s*/', $s, $matches) ) { @@ -282,12 +282,12 @@ function board_sync_process_message( $pMbox, $pMsgNum, $pMsgHeader, $pMsgStructu foreach( $toAddresses AS $to ) { if ($pLog) print( " Processing email: " . strtolower($to['email']) . "\n"); // get a board match for the email address - if( $boardContentId = cache_check_content_prefs( 'board_sync_list_address', strtolower($to['email']), TRUE ) ) { + if( $boardContentId = cache_check_content_prefs( 'board_sync_list_address', strtolower($to['email']), true ) ) { if ($pLog) print "Found Board Content $boardContentId for $to[email]\n"; // Do we already have this message in this board? - $contentId = NULL; - if( $message_id != NULL ) { + $contentId = null; + if( $message_id != null ) { $sql = "SELECT `content_id` FROM `".BIT_DB_PREFIX."liberty_comments` WHERE `message_guid`=? AND `root_id`=?"; $contentId = $gBitDb->getOne( $sql, array( $message_id, $boardContentId ) ); } @@ -312,7 +312,7 @@ function board_sync_process_message( $pMbox, $pMsgNum, $pMsgHeader, $pMsgStructu } $userInfo = board_sync_get_user( $fromaddress ); // prep the storage hash - $storeRow = array(); + $storeRow = []; $storeRow['created'] = strtotime( $date ); $storeRow['last_modified'] = $storeRow['created']; $storeRow['user_id'] = $userInfo['user_id']; @@ -325,7 +325,7 @@ function board_sync_process_message( $pMbox, $pMsgNum, $pMsgHeader, $pMsgStructu $storeRow['root_id'] = $rootId; $storeRow['parent_id'] = $replyId; - $partHash = array(); + $partHash = []; switch( $pMsgStructure->type ) { case '0': @@ -403,7 +403,7 @@ function board_sync_process_message( $pMbox, $pMsgNum, $pMsgHeader, $pMsgStructu if( $userInfo['user_id'] != ANONYMOUS_USER_ID ) { $userClass = $gBitSystem->getConfig( 'user_class', 'BitPermUser' ); $newBitUser = new $userClass( $userInfo['user_id'] ); - $newBitUser->load( TRUE ); + $newBitUser->load( true ); } if( !empty( $newBitUser ) && $newBitUser->isValid() ){ // flip gBitUser to our message sender @@ -411,7 +411,7 @@ function board_sync_process_message( $pMbox, $pMsgNum, $pMsgHeader, $pMsgStructu } // Load the parent board - $board = new BitBoard( NULL, $boardContentId ); + $board = new BitBoard( null, $boardContentId ); $board->load(); // Check the permission for the user on the board @@ -440,7 +440,7 @@ function board_sync_process_message( $pMbox, $pMsgNum, $pMsgHeader, $pMsgStructu } - $storeComment = new LibertyComment( NULL ); + $storeComment = new LibertyComment( null ); $gBitDb->StartTrans(); if( $storeComment->storeComment($storeRow) ) { // undo the attachment permission @@ -449,12 +449,12 @@ function board_sync_process_message( $pMbox, $pMsgNum, $pMsgHeader, $pMsgStructu // set moderation approval if( !$pModerate && $gBitSystem->isPackageActive('moderation') && $gBitSystem->isPackageActive('modcomments') ) { global $gModerationSystem, $gBitUser; - $moderation = $gModerationSystem->getModeration(NULL, $storeComment->mContentId); + $moderation = $gModerationSystem->getModeration(null, $storeComment->mContentId); if( !empty($moderation) ) { // Allow to moderate - $gBitUser->setPermissionOverride('p_admin', TRUE); + $gBitUser->setPermissionOverride('p_admin', true); $gModerationSystem->setModerationReply($moderation['moderation_id'], MODERATION_APPROVED); - $gBitUser->setPermissionOverride('p_admin', FALSE); + $gBitUser->setPermissionOverride('p_admin', false); } } @@ -469,44 +469,44 @@ function board_sync_process_message( $pMbox, $pMsgNum, $pMsgHeader, $pMsgStructu // done $gBitDb->CompleteTrans(); - return TRUE; + return true; }else{ bit_error_log( "Email sync error: Message Id not set. You shouldn't have even gotten this far." ); $gBitDb->RollbackTrans(); - return FALSE; + return false; } } else { if( count( $storeComment->mErrors ) == 1 && !empty( $storeComment->mErrors['store'] ) && $storeComment->mErrors['store'] == 'Duplicate comment.' ) { - return TRUE; + return true; } else { foreach( $storeComment->mErrors as $error ){ bit_error_log( $error ); } $gBitDb->RollbackTrans(); - return FALSE; + return false; } } } else { if ($pLog) print "Message Exists: $contentId : $boardContentId : $message_id : $pModerate\n"; // If this isn't a moderation message - if( $pModerate === FALSE ) { + if( $pModerate === false ) { // If the message exists it must have been approved via some // moderation mechanism, so make sure it is available if( $gBitSystem->isPackageActive('moderation') && $gBitSystem->isPackageActive('modcomments') ) { global $gModerationSystem, $gBitUser; - $storeComment = new LibertyComment( NULL, $contentId ); + $storeComment = new LibertyComment( null, $contentId ); $storeComment->loadComment(); if ($storeComment->mInfo['content_status_id'] > 0) { if ($pLog) print "Already approved: $contentId\n"; } else { - $moderation = $gModerationSystem->getModeration(NULL, $contentId); + $moderation = $gModerationSystem->getModeration(null, $contentId); // vd($moderation); if( !empty($moderation) ) { - $gBitUser->setPermissionOverride('p_admin', TRUE); + $gBitUser->setPermissionOverride('p_admin', true); if ($pLog) print( "Setting approved: $contentId\n" ); $gModerationSystem->setModerationReply($moderation['moderation_id'], MODERATION_APPROVED); - $gBitUser->setPermissionOverride('p_admin', FALSE); + $gBitUser->setPermissionOverride('p_admin', false); if ($pLog) print "Done"; } else { if ($pLog) print "ERROR: Unable to find moderation to approve for: $contentId"; @@ -516,17 +516,17 @@ function board_sync_process_message( $pMbox, $pMsgNum, $pMsgHeader, $pMsgStructu } else { // Store the approve code; if ($pLog) print "Storing approval code: " . $contentId . ":" . $pModerate . "\n"; - $storeComment = new LibertyComment( NULL, $contentId ); + $storeComment = new LibertyComment( null, $contentId ); $storeComment->storePreference('board_confirm_code', $pModerate); } - return TRUE; + return true; } } else { if ($pLog) print "No Board match found for $to[email]\n"; } } } - return FALSE; + return false; } function board_sync_raw_headers($body) { @@ -535,7 +535,7 @@ function board_sync_raw_headers($body) { } function board_sync_get_header($header, $body) { - $ret = NULL; + $ret = null; preg_match( '/^'.$header.':\s*(.*?)\s*$/m', $body, $matches); if (!empty($matches[1])) { $ret = $matches[1]; @@ -545,7 +545,7 @@ function board_sync_get_header($header, $body) { // $header is imap_headerinfo array function board_sync_get_headerinfo( $header, $key ){ - $ret = NULL; + $ret = null; if( isset( $header->$key ) ){ $ret = $header->$key; } @@ -556,7 +556,7 @@ function board_sync_delivered_to( $raw_headers ) { $ret = null; if (isset($raw_headers) && preg_match_all("/Delivered-To:\s*(.*)\s*/", $raw_headers, $deliveredTo) > 0) { - $ret = array(); + $ret = []; foreach ($deliveredTo[1] as $address) { // Make sure the Delivered-To: address is valid. if (validate_email_syntax( $address ) ) { @@ -573,10 +573,10 @@ function is_utf8($string) { [\x09\x0A\x0D\x20-\x7E] # ASCII | [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte | \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs - | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte + | [\xE1-\xEC\xEE\xEF][\x80-\xBF][2] # straight 3-byte | \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates - | \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3 - | [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15 - | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 + | \xF0[\x90-\xBF][\x80-\xBF][2] # planes 1-3 + | [\xF1-\xF3][\x80-\xBF][3] # planes 4-15 + | \xF4[\x80-\x8F][\x80-\xBF][2] # plane 16 )*$%xs', $string); } diff --git a/admin/phpbb_migrate.php b/admin/phpbb_migrate.php index f88270c..c787780 100644..100755 --- a/admin/phpbb_migrate.php +++ b/admin/phpbb_migrate.php @@ -18,7 +18,7 @@ require_once( '../../kernel/includes/setup_inc.php' ); $gBitSystem->verifyPermission( 'p_admin' ); -$_SESSION['captcha_verified'] = TRUE; +$_SESSION['captcha_verified'] = true; global $db; @@ -65,7 +65,7 @@ vd( $forumList ); flush(); foreach( array_keys( $forumList ) as $forumId ) { print "Migrating forum $forumId<br/>\n"; flush(); if( empty( $forumList[$forumId]['content_id'] ) ) { - $forumStore = array(); + $forumStore = []; $forumStore['user_id'] = ROOT_USER_ID; $forumStore['title'] = $forumList[$forumId]['forum_name']; $forumStore['edit'] = $forumList[$forumId]['forum_desc']; @@ -105,7 +105,7 @@ function migrate_phpbb_forum( $pForumId, $pForumContentId ) { } $gBitDb->StartTrans(); while ( $row = $db->sql_fetchrow($result) ) { - $commentHash = array(); + $commentHash = []; $commentHash['root_id'] = $pForumContentId; $commentHash['parent_id'] = $pForumContentId; $commentHash['anon_name'] = $row['post_username']; @@ -123,8 +123,8 @@ $gBitDb->StartTrans(); print "Migrating Post $row[post_id]<br/>\n"; flush(); $topicHash['root_id'] = $rootComment->mContentId; $topicHash['is_moved'] = $row['topic_moved_id']; - $topicHash['is_sticky'] = !empty( $row['topic_type'] ) ? '1' : NULL; - $topicHash['is_moved'] = ($row['topic_status'] == 2 ? '1' : NULL); + $topicHash['is_sticky'] = !empty( $row['topic_type'] ) ? '1' : null; + $topicHash['is_moved'] = ($row['topic_status'] == 2 ? '1' : null); $topicHash['migrate_topic_id'] = $row['topic_id']; $rootTopic = new BitBoardTopic( $rootComment->mContentId ); $rootTopic->store( $topicHash ); @@ -152,7 +152,7 @@ function migrate_phpbb_topic( $pTopicId, &$pRootComment ) { } while ( $row = $db->sql_fetchrow($result) ) { print "Migrating Post $row[post_id]<br/>\n"; - $commentHash = array(); + $commentHash = []; $commentHash['root_id'] = $pRootComment->getField( 'root_id' ); $commentHash['parent_id'] = $pRootComment->getField( 'content_id' ); $commentHash['anon_name'] = $row['post_username']; diff --git a/admin/schema_inc.php b/admin/schema_inc.php index 346bd46..be6958a 100644..100755 --- a/admin/schema_inc.php +++ b/admin/schema_inc.php @@ -1,5 +1,5 @@ <?php -$tables = array( +$tables = [ 'boards_posts' => " comment_id I4 PRIMARY, is_approved I1 NOTNULL DEFAULT(0), @@ -42,7 +42,7 @@ $tables = array( notify I1 NOTNULL DEFAULT(0), notify_date I4 NOTNULL DEFAULT(0) " -); +]; global $gBitInstaller; @@ -50,50 +50,50 @@ foreach( array_keys( $tables ) AS $tableName ) { $gBitInstaller->registerSchemaTable( BOARDS_PKG_NAME, $tableName, $tables[$tableName] ); } -$gBitInstaller->registerPackageInfo( BOARDS_PKG_NAME, array( +$gBitInstaller->registerPackageInfo( BOARDS_PKG_NAME, [ 'description' => "Highly integrated message boards package.", 'license' => '<a href="http://www.gnu.org/licenses/licenses.html#LGPL">LGPL</a>', -) ); +] ); // ### Indexes -$indices = array( - 'boards_id_idx' => array('table' => 'boards', 'cols' => 'board_id', 'opts' => NULL ), -); +$indices = [ + 'boards_id_idx' => [ 'table' => 'boards', 'cols' => 'board_id', 'opts' => null ], +]; $gBitInstaller->registerSchemaIndexes( BOARDS_PKG_NAME, $indices ); // ### Sequences -$sequences = array ( - 'boards_board_id_seq' => array( 'start' => 1 ), - 'boards_sections_id_seq' => array( 'start' => 1 ), -); +$sequences = [ + 'boards_board_id_seq' => [ 'start' => 1 ], + 'boards_sections_id_seq' => [ 'start' => 1 ], +]; $gBitInstaller->registerSchemaSequences( BOARDS_PKG_NAME, $sequences ); // ### Default UserPermissions -$gBitInstaller->registerUserPermissions( BOARDS_PKG_NAME, array( - array( 'p_boards_admin' , 'Can admin message boards' , 'admin' , BOARDS_PKG_NAME ), - array( 'p_boards_create', 'Can create a message board', 'editors', BOARDS_PKG_NAME ), - array( 'p_boards_post_update', 'Can update any post', 'editors', BOARDS_PKG_NAME ), - array( 'p_boards_update' , 'Can update any message board', 'editors', BOARDS_PKG_NAME ), - array( 'p_boards_read' , 'Can read message boards' , 'basic' , BOARDS_PKG_NAME ), - array( 'p_boards_remove', 'Can delete message boards' , 'editors', BOARDS_PKG_NAME ), -) ); +$gBitInstaller->registerUserPermissions( BOARDS_PKG_NAME, [ + [ 'p_boards_admin' , 'Can admin message boards' , 'admin' , BOARDS_PKG_NAME ], + [ 'p_boards_create', 'Can create a message board', 'editors', BOARDS_PKG_NAME ], + [ 'p_boards_post_update', 'Can update any post', 'editors', BOARDS_PKG_NAME ], + [ 'p_boards_update' , 'Can update any message board', 'editors', BOARDS_PKG_NAME ], + [ 'p_boards_read' , 'Can read message boards' , 'basic' , BOARDS_PKG_NAME ], + [ 'p_boards_remove', 'Can delete message boards' , 'editors', BOARDS_PKG_NAME ], +] ); // ### Default Preferences -$gBitInstaller->registerPreferences( BOARDS_PKG_NAME, array( - array( BOARDS_PKG_NAME, 'boards_thread_track', 'y' ), -)); +$gBitInstaller->registerPreferences( BOARDS_PKG_NAME, [ + [ BOARDS_PKG_NAME, 'boards_thread_track', 'y' ], +] ); if(defined('RSS_PKG_NAME')) { - $gBitInstaller->registerPreferences( BOARDS_PKG_NAME, array( - array( RSS_PKG_NAME, BOARDS_PKG_NAME.'_rss', 'y'), - )); + $gBitInstaller->registerPreferences( BOARDS_PKG_NAME, [ + [ RSS_PKG_NAME, BOARDS_PKG_NAME.'_rss', 'y'], + ] ); } // ### Register content types -$gBitInstaller->registerContentObjects( BOARDS_PKG_NAME, array( +$gBitInstaller->registerContentObjects( BOARDS_PKG_NAME, [ 'BitBoard'=>BOARDS_PKG_CLASS_PATH.'BitBoard.php', -)); +] ); // Requirements -$gBitInstaller->registerRequirements( BOARDS_PKG_NAME, array( - 'liberty' => array( 'min' => '2.1.4' ), -)); +$gBitInstaller->registerRequirements( BOARDS_PKG_NAME, [ + 'liberty' => [ 'min' => '5.0.0' ], +] ); diff --git a/admin/upgrade_inc.php b/admin/upgrade_inc.php index 2b1ae03..0542598 100644..100755 --- a/admin/upgrade_inc.php +++ b/admin/upgrade_inc.php @@ -20,6 +20,3 @@ require_once( BOARDS_PKG_ADMIN_PATH.'phpbb_migrate.php' ); migrate_phpbb(); */ - - -?> diff --git a/admin/upgrades/1.0.1.php b/admin/upgrades/1.0.1.php index 154a51c..6eef1b9 100644..100755 --- a/admin/upgrades/1.0.1.php +++ b/admin/upgrades/1.0.1.php @@ -8,7 +8,7 @@ $infoHash = array( 'package' => BOARDS_PKG_NAME, 'version' => str_replace( '.php', '', basename( __FILE__ )), 'description' => "Add boards sections and positioning.", - 'post_upgrade' => NULL, + 'post_upgrade' => null, ); $gBitInstaller->registerPackageUpgrade( $infoHash, array( @@ -26,7 +26,7 @@ array( 'DATADICT' => array( 'pos' => array( '`pos`', 'I4' ), ))), array( 'CREATEINDEX' => array( - 'boards_sections_idx' => array( 'boards', 'section_id', array() ), + 'boards_sections_idx' => array( 'boards', 'section_id', [] ), )), array( 'CREATESEQUENCE' => array( 'boards_sections_id_seq', |
