summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--].htaccess4
-rwxr-xr-x[-rw-r--r--]admin/admin_boards_inc.php77
-rwxr-xr-x[-rw-r--r--]admin/boardsync_cron.php10
-rwxr-xr-x[-rw-r--r--]admin/boardsync_inc.php86
-rwxr-xr-x[-rw-r--r--]admin/phpbb_migrate.php12
-rwxr-xr-x[-rw-r--r--]admin/schema_inc.php60
-rwxr-xr-x[-rw-r--r--]admin/upgrade_inc.php3
-rwxr-xr-x[-rw-r--r--]admin/upgrades/1.0.1.php4
-rwxr-xr-x[-rw-r--r--]ajax.php2
-rwxr-xr-x[-rw-r--r--]assign.php6
-rwxr-xr-x[-rw-r--r--]boards_rss.php8
-rwxr-xr-x[-rw-r--r--]css/boards.css15
-rwxr-xr-x[-rw-r--r--]edit.php12
-rwxr-xr-x[-rw-r--r--]edit_topic.php7
-rwxr-xr-x[-rw-r--r--]includes/bit_setup_inc.php48
-rwxr-xr-x[-rw-r--r--]includes/classes/BitBoard.php143
-rwxr-xr-x[-rw-r--r--]includes/classes/BitBoardPost.php130
-rwxr-xr-x[-rw-r--r--]includes/classes/BitBoardTopic.php188
-rwxr-xr-x[-rw-r--r--]includes/edit_topic_inc.php6
-rwxr-xr-x[-rw-r--r--]includes/list_boards_inc.php24
-rwxr-xr-x[-rw-r--r--]includes/lookup_inc.php8
-rwxr-xr-x[-rw-r--r--]includes/user_preferences_inc.php22
-rwxr-xr-x[-rw-r--r--]includes/view_board_inc.php29
-rwxr-xr-x[-rw-r--r--]includes/view_topic_inc.php37
-rwxr-xr-x[-rw-r--r--]index.php2
-rwxr-xr-x[-rw-r--r--]mailing_list.php16
-rwxr-xr-x[-rw-r--r--]modules/help_mod_recent_posts.tpl6
-rwxr-xr-x[-rw-r--r--]modules/mod_recent_posts.php4
-rwxr-xr-x[-rw-r--r--]modules/mod_recent_posts.tpl6
-rwxr-xr-x[-rw-r--r--]rss.php4
-rwxr-xr-x[-rw-r--r--]styles/boards.css101
-rwxr-xr-x[-rw-r--r--]templates/admin_boards.tpl18
-rwxr-xr-x[-rw-r--r--]templates/board_assign.tpl22
-rwxr-xr-x[-rw-r--r--]templates/board_cat.tpl6
-rwxr-xr-x[-rw-r--r--]templates/board_edit.tpl6
-rwxr-xr-x[-rw-r--r--]templates/board_table.tpl8
-rwxr-xr-x[-rw-r--r--]templates/boards_edit_mini_inc.tpl4
-rwxr-xr-x[-rw-r--r--]templates/boards_rss_form.tpl4
-rwxr-xr-x[-rw-r--r--]templates/boards_service_icons.tpl4
-rwxr-xr-x[-rw-r--r--]templates/comment_post.tpl14
-rwxr-xr-x[-rw-r--r--]templates/flipswitch.tpl6
-rwxr-xr-x[-rw-r--r--]templates/html_head_inc.tpl12
-rwxr-xr-x[-rw-r--r--]templates/legend_inc.tpl6
-rwxr-xr-x[-rw-r--r--]templates/list_boards.tpl4
-rwxr-xr-x[-rw-r--r--]templates/list_posts.tpl34
-rwxr-xr-x[-rw-r--r--]templates/list_topics.tpl68
-rwxr-xr-x[-rw-r--r--]templates/mailing_list.tpl24
-rwxr-xr-x[-rw-r--r--]templates/menu_boards.tpl8
-rwxr-xr-x[-rw-r--r--]templates/menu_boards_admin.tpl9
-rwxr-xr-x[-rw-r--r--]templates/post_display.tpl52
-rwxr-xr-x[-rw-r--r--]templates/topic_move.tpl6
-rwxr-xr-x[-rw-r--r--]templates/user_preferences_inc.tpl4
-rwxr-xr-x[-rw-r--r--]topic_move.php4
53 files changed, 736 insertions, 667 deletions
diff --git a/.htaccess b/.htaccess
index 477cf65..94957e0 100644..100755
--- a/.htaccess
+++ b/.htaccess
@@ -1,8 +1,5 @@
<IfModule mod_rewrite.c>
RewriteEngine on
-
- RewriteRule .*index.php/.*php$ /forums/ [L,R=404]
-
# Uncomment this if mod_rewrites are not working for you. some hosting services have cranky mod_rewrite
# RewriteBase /boards/
RewriteCond %{SCRIPT_FILENAME} -f [OR]
@@ -16,6 +13,7 @@
RewriteRule ^view/topic/(\d+.*)$ index.php?t=$1 [L,QSA]
+
# fake out phpBB user profile page
RewriteCond %{REQUEST_URI} profile.php
RewriteCond %{QUERY_STRING} .*mode=viewprofile.*u=([0-9]*)
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',
diff --git a/ajax.php b/ajax.php
index 486d933..9097f3d 100644..100755
--- a/ajax.php
+++ b/ajax.php
@@ -13,7 +13,7 @@
/**
* required setup
*/
-require_once( '../kernel/includes/setup_inc.php' );
+require_once '../kernel/includes/setup_inc.php';
// Is package installed and enabled
$gBitSystem->verifyPackage( 'boards' );
diff --git a/assign.php b/assign.php
index 274e9bc..4741d42 100644..100755
--- a/assign.php
+++ b/assign.php
@@ -11,7 +11,7 @@
/**
* required setup
*/
-require_once( '../kernel/includes/setup_inc.php' );
+require_once '../kernel/includes/setup_inc.php';
// Is package installed and enabled
$gBitSystem->verifyPackage( 'boards' );
@@ -37,7 +37,7 @@ if (!empty($_REQUEST['remove'])) {
}
}
-if( !empty( $_REQUEST['assign'] ) && @BitBase::verifyId( $_REQUEST['to_board_id'] ) ) {
+if( !empty( $_REQUEST['assign'] ) && BitBase::verifyId( $_REQUEST['to_board_id'] ?? 0 ) ) {
$b = new BitBoard( $_REQUEST['to_board_id'] );
$b->load();
if ( $b->verifyUpdatePermission() ){
@@ -57,7 +57,7 @@ if (!empty($_REQUEST['integrity'])) {
}
$data = BitBoard::getAllMap();
-$gBitSmarty->assignByRef('data',$data);
+$gBitSmarty->assign('data',$data);
// Display the template
$gBitSystem->display( 'bitpackage:boards/board_assign.tpl', tra('Assign content to Board') , array( 'display_mode' => 'display' ));
diff --git a/boards_rss.php b/boards_rss.php
index 68a352c..ce8d038 100644..100755
--- a/boards_rss.php
+++ b/boards_rss.php
@@ -24,7 +24,7 @@ if( !empty( $_REQUEST['t'] ) || !empty($_REQUEST['b'] ) ){
$gContent->load();
}
else{
- $gBitSystem->fatalError(tra("Unknown discussion"), NULL, NULL, HttpStatusCodes::HTTP_GONE );
+ $gBitSystem->fatalError(tra("Unknown discussion"), null, null, HttpStatusCodes::HTTP_GONE );
}
}
$gContent->verifyViewPermission();
@@ -73,7 +73,7 @@ switch( $gContent->getField('content_type_guid') ){
case 'bitboard':
default:
$topic = new BitBoardTopic();
- $pParamHash = array();
+ $pParamHash = [];
if( !empty( $_REQUEST['b'] ) ) {
$pParamHash['b'] = $_REQUEST['b'];
}
@@ -128,10 +128,10 @@ foreach( $feeds as $feed ) {
}
$user->load();
- $item->author = $user->getDisplayName();//$gBitUser->getDisplayName( FALSE, array( 'user_id' => $feed['modifier_user_id'] ) );
+ $item->author = $user->getDisplayName();//$gBitUser->getDisplayName( false, array( 'user_id' => $feed['modifier_user_id'] ) );
$item->authorEmail = $user->mInfo['email'];
$item->descriptionTruncSize = $gBitSystem->getConfig( 'rssfeed_truncate', 1000 );
- $item->descriptionHtmlSyndicated = FALSE;
+ $item->descriptionHtmlSyndicated = false;
/*
var_dump($item);
echo "</pre>";
diff --git a/css/boards.css b/css/boards.css
index c1de790..bb19e36 100644..100755
--- a/css/boards.css
+++ b/css/boards.css
@@ -1,4 +1,13 @@
-.bitboard .title h3 {margin: 0px; font-size: 1.2em}
-.bitboard .desc {font-size: .9em; clear:both;}
-.bitboard .topic {font-size: .9em;}
+.bitboard .title h3 {
+ margin: 0px;
+ font-size: 1.2em
+}
+.bitboard .desc {
+ font-size: .9em;
+ clear: both;
+}
+
+.bitboard .topic {
+ font-size: .9em;
+} \ No newline at end of file
diff --git a/edit.php b/edit.php
index 2d35079..563413b 100644..100755
--- a/edit.php
+++ b/edit.php
@@ -11,7 +11,7 @@
/**
* required setup
*/
-require_once( '../kernel/includes/setup_inc.php' );
+require_once '../kernel/includes/setup_inc.php';
// Is package installed and enabled
$gBitSystem->verifyPackage( 'boards' );
@@ -32,13 +32,13 @@ if( $gContent->isValid() ) {
// Handle delete request
if( isset( $_REQUEST['remove'] ) ) {
// @TODO: Change to verifyExpungePermission when that exists in LibertyContent
- if ( $gContent->isValid() && $gContent->hasUserPermission( 'p_boards_remove', TRUE, TRUE ) ) {
+ if ( $gContent->isValid() && $gContent->hasUserPermission( 'p_boards_remove', true, true ) ) {
if( empty( $_REQUEST['confirm'] ) ) {
$formHash['b'] = $_REQUEST['b'];
- $formHash['remove'] = TRUE;
+ $formHash['remove'] = true;
$gBitSystem->confirmDialog( $formHash, array( 'warning' => tra( 'Are you sure you want to remove the entire message board' ).' "'.$gContent->getTitle().'" ?', 'error' => 'This cannot be undone!' ) );
} elseif( !$gContent->expunge() ) {
- $gBitSmarty->assignByRef( 'errors', $deleteComment->mErrors );
+ $gBitSmarty->assign( 'errors', $deleteComment->mErrors );
} else {
bit_redirect( BOARDS_PKG_URL.'index.php' );
}
@@ -66,10 +66,10 @@ if( !empty( $_REQUEST["save_bitboard"] ) ) {
// to avoid error messages. This can happen if some features are
// disabled
if( $gContent->store( $storeHash ) ) {
- $gContent->storePreference( 'board_sync_list_address', (!empty( $_REQUEST['bitboardconfig']['board_sync_list_address'] ) ? $_REQUEST['bitboardconfig']['board_sync_list_address'] : NULL) );
+ $gContent->storePreference( 'board_sync_list_address', (!empty( $_REQUEST['bitboardconfig']['board_sync_list_address'] ) ? $_REQUEST['bitboardconfig']['board_sync_list_address'] : null) );
bit_redirect( $gContent->getDisplayUrl() );
} else {
- $gBitSmarty->assignByRef( 'errors', $gContent->mErrors );
+ $gBitSmarty->assign( 'errors', $gContent->mErrors );
}
}
diff --git a/edit_topic.php b/edit_topic.php
index 38c31b0..47f448e 100644..100755
--- a/edit_topic.php
+++ b/edit_topic.php
@@ -11,7 +11,8 @@
/**
* required setup
*/
-require_once( '../kernel/includes/setup_inc.php' );
+use \Bitweaver\Boards\BitBoard;
+require_once '../kernel/includes/setup_inc.php';
// Is package installed and enabled
$gBitSystem->verifyPackage( 'boards' );
@@ -54,7 +55,7 @@ if( isset($_REQUEST['is_locked']) || isset($_REQUEST['is_sticky']) ){
if( !empty( $_REQUEST['cancel'] ) ) {
// user cancelled - just continue on, doing nothing
} elseif( empty( $_REQUEST['confirm'] ) ) {
- $formHash['remove'] = TRUE;
+ $formHash['remove'] = true;
$formHash['t'] = $_REQUEST['t'];
$gBitSystem->confirmDialog( $formHash,
array(
@@ -66,7 +67,7 @@ if( isset($_REQUEST['is_locked']) || isset($_REQUEST['is_sticky']) ){
// @TODO Topic should extend LibertyComment - but until that day we load it up a second time
$topicAsComment = new LibertyComment( $_REQUEST['t'] );
if( !$topicAsComment->expunge() ) {
- $gBitSmarty->assignByRef( 'errors', $topicAsComment->mErrors );
+ $gBitSmarty->assign( 'errors', $topicAsComment->mErrors );
}
// send us back to the baord - http_referer won't work with confirm process
bit_redirect( BOARDS_PKG_URL.'index.php?b='. $gContent->mInfo['board_id'] );
diff --git a/includes/bit_setup_inc.php b/includes/bit_setup_inc.php
index 978e245..10c46e6 100644..100755
--- a/includes/bit_setup_inc.php
+++ b/includes/bit_setup_inc.php
@@ -1,25 +1,34 @@
<?php
+use \Bitweaver\Boards\BitBoard;
+use \Bitweaver\Liberty\LibertyComment;
+use \Bitweaver\BitMailer;
+
global $gBitSystem, $gBitThemes;
-$registerHash = array(
+$pRegisterHash = [
'package_name' => 'boards',
'package_path' => dirname( dirname( __FILE__ ) ).'/',
- 'homeable' => TRUE,
-);
-$gBitSystem->registerPackage( $registerHash );
+ 'homeable' => true,
+];
+
+// fix to quieten down VS Code which can't see the dynamic creation of these ...
+define( 'BOARDS_PKG_NAME', $pRegisterHash['package_name'] );
+define( 'BOARDS_PKG_URL', BIT_ROOT_URL . basename( $pRegisterHash['package_path'] ) . '/' );
+define( 'BOARDS_PKG_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/' );
+define( 'BOARDS_PKG_INCLUDE_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/');
+define( 'BOARDS_PKG_CLASS_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/classes/');
+define( 'BOARDS_PKG_ADMIN_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/admin/');
+$gBitSystem->registerPackage( $pRegisterHash );
if( $gBitSystem->isPackageActive( 'boards' ) && $gBitUser->hasPermission( 'p_boards_read' )) {
- $menuHash = array(
+ $menuHash = [
'package_name' => BOARDS_PKG_NAME,
'index_url' => BOARDS_PKG_URL.'index.php',
'menu_template' => 'bitpackage:boards/menu_boards.tpl',
- );
+ ];
$gBitSystem->registerAppMenu( $menuHash );
- require_once( BOARDS_PKG_CLASS_PATH.'BitBoard.php' );
- require_once( BOARDS_PKG_CLASS_PATH.'BitBoardTopic.php' );
-
- $registerArray = array(
+ $registerArray = [
'content_display_function' => 'boards_content_display',
'content_preview_function' => 'boards_content_edit',
'content_edit_function' => 'boards_content_edit',
@@ -30,7 +39,7 @@ if( $gBitSystem->isPackageActive( 'boards' ) && $gBitUser->hasPermission( 'p_boa
// 'content_view_tpl' => 'bitpackage:boards/service_view_boards.tpl',
'content_icon_tpl' => 'bitpackage:boards/boards_service_icons.tpl',
'content_list_sql_function' => 'boards_content_list_sql',
- );
+ ];
if ( !$gBitSystem->isFeatureActive( 'boards_hide_edit_tpl' ) &&
!$gBitSystem->isFeatureActive( 'boards_link_by_pigeonholes' ) ) {
@@ -40,7 +49,7 @@ if( $gBitSystem->isPackageActive( 'boards' ) && $gBitUser->hasPermission( 'p_boa
$gLibertySystem->registerService( LIBERTY_SERVICE_FORUMS, BOARDS_PKG_NAME, $registerArray );
function boards_get_topic_comment( $pThreadForwardSequence ) {
- return( intval( substr( $pThreadForwardSequence, 0, 9 ) ) );
+ return intval( substr( $pThreadForwardSequence, 0, 9 ) );
}
$gBitThemes->loadCss(BOARDS_PKG_PATH.'styles/boards.css');
@@ -50,7 +59,7 @@ if( $gBitSystem->isPackageActive( 'boards' ) && $gBitUser->hasPermission( 'p_boa
* we need to include its bit_setup_inc incase comments gets loaded first
*/
if( file_exists(BIT_ROOT_PATH.'moderation/bit_setup_inc.php') ) {
- require_once( BIT_ROOT_PATH.'moderation/bit_setup_inc.php' );
+ require_once BIT_ROOT_PATH.'moderation/bit_setup_inc.php';
global $gModerationSystem;
if( $gBitSystem->isPackageActive( 'moderation' ) ) {
@@ -62,26 +71,26 @@ if( $gBitSystem->isPackageActive( 'boards' ) && $gBitUser->hasPermission( 'p_boa
// And define the function we use to handle the observation.
function board_comments_moderation($pModerationInfo) {
if( $pModerationInfo['type'] == 'comment_post' ) {
- $storeComment = new LibertyComment( NULL, $pModerationInfo['content_id'] );
+ $storeComment = new LibertyComment( null, $pModerationInfo['content_id'] );
$storeComment->load();
$comments_return_url = '';
$root_id = $storeComment->mInfo['root_id'];
global $gContent;
- $board = new BitBoard(NULL, $root_id);
+ $board = new BitBoard(null, $root_id);
$board->load();
$boardSync = $board->getPreference('board_sync_list_address');
$code = $storeComment->getPreference('board_confirm_code');
$approved = $board->getPreference('boards_mailing_list_password');
// Possible race. Did we beat the cron?
if( empty($code) ) {
- require_once(BOARDS_PKG_INCLUDE_PATH.'admin/boardsync_inc.php');
+ require_once BOARDS_PKG_INCLUDE_PATH.'admin/boardsync_inc.php';
// Try to pick up the message!
- board_sync_run(TRUE);
+ board_sync_run(true);
}
if( !empty($code) && !empty($boardSync) && !empty($approved) ) {
$boardSync = str_replace('@', '-request@', $boardSync);
$code = 'confirm '.$code;
-uire_once(KERNEL_PKG_CLASS_PATH.'BitMailer.php');
+ require_once KERNEL_PKG_CLASS_PATH.'BitMailer.php';
$mailer = new BitMailer();
if( $pModerationInfo['last_status'] == MODERATION_DELETE ) {
@@ -103,5 +112,4 @@ uire_once(KERNEL_PKG_CLASS_PATH.'BitMailer.php');
}
}
}
-}
-?>
+} \ No newline at end of file
diff --git a/includes/classes/BitBoard.php b/includes/classes/BitBoard.php
index c0a296f..6104a00 100644..100755
--- a/includes/classes/BitBoard.php
+++ b/includes/classes/BitBoard.php
@@ -14,7 +14,13 @@
/**
* required setup
*/
-require_once( LIBERTY_PKG_CLASS_PATH.'LibertyMime.php' );
+namespace Bitweaver\Boards;
+use Bitweaver\BitBase;
+use Bitweaver\KernelTools;
+use Bitweaver\Pigeonholes\Pigeonholes;
+use Bitweaver\Liberty\LibertyContent;
+use Bitweaver\Liberty\LibertyMime;
+use function intval;
/**
* This is used to uniquely identify the object
@@ -34,7 +40,7 @@ class BitBoard extends LibertyMime {
/**
* During initialisation, be sure to call our base constructors
**/
- function __construct( $pBitBoardId=NULL, $pContentId=NULL ) {
+ function __construct( $pBitBoardId=null, $pContentId=null ) {
parent::__construct();
$this->mBitBoardId = (int)$pBitBoardId;
$this->mContentId = (int)$pContentId;
@@ -58,16 +64,16 @@ class BitBoard extends LibertyMime {
/**
* Load the data from the database
- * @param pParamHash be sure to pass by reference in case we need to make modifcations to the hash
+ * @param array pParamHash be sure to pass by reference in case we need to make modifcations to the hash
**/
- function load( $pContentId = NULL, $pPluginParams = NULL ) {
+ public function load( $pContentId = null, $pPluginParams = null ) {
if( $this->verifyId( $this->mBitBoardId ) || $this->verifyId( $this->mContentId ) ) {
// LibertyContent::load()assumes you have joined already, and will not execute any sql!
// This is a significant performance optimization
$lookupColumn = $this->verifyId( $this->mBitBoardId ) ? 'board_id' : 'content_id';
- $bindVars = array();
+ $bindVars = [];
$selectSql = $joinSql = $whereSql = '';
- array_push( $bindVars, (int)($lookupId = @BitBase::verifyId( $this->mBitBoardId ) ? $this->mBitBoardId : $this->mContentId) );
+ array_push( $bindVars, (int)($lookupId = BitBase::verifyId( $this->mBitBoardId ) ? $this->mBitBoardId : $this->mContentId) );
$this->getServicesSql( 'content_load_sql_function', $selectSql, $joinSql, $whereSql, $bindVars );
$query = "SELECT s.*, lc.*, " .
@@ -86,20 +92,20 @@ class BitBoard extends LibertyMime {
$this->mContentId = $result->fields['content_id'];
$this->mBitBoardId = $result->fields['board_id'];
- $this->mInfo['creator'] =( isset( $result->fields['creator_real_name'] )? $result->fields['creator_real_name'] : $result->fields['creator_user'] );
- $this->mInfo['editor'] =( isset( $result->fields['modifier_real_name'] )? $result->fields['modifier_real_name'] : $result->fields['modifier_user'] );
+ $this->mInfo['creator'] =( $result->fields['creator_real_name'] ?? $result->fields['creator_user'] );
+ $this->mInfo['editor'] =( $result->fields['modifier_real_name'] ?? $result->fields['modifier_user'] );
$this->mInfo['display_url'] = $this->getDisplayUrl();
$this->parseData();
LibertyMime::load();
}
}
- return( count( $this->mInfo ) );
+ return count( $this->mInfo );
}
public static function lookupByMigrateBoard( $pMigrateBoardId ) {
global $gBitDb;
- $ret = NULL;
+ $ret = null;
if( BitBase::verifyId( $pMigrateBoardId ) ) {
$ret = $gBitDb->getOne( "SELECT `board_id` FROM `".BIT_DB_PREFIX."boards` bb WHERE `migrate_board_id`=?", array( $pMigrateBoardId ) );
}
@@ -108,31 +114,26 @@ class BitBoard extends LibertyMime {
/**
* Any method named Store inherently implies data will be written to the database
- * @param pParamHash be sure to pass by reference in case we need to make modifcations to the hash
+ * @param array pParamHash be sure to pass by reference in case we need to make modifcations to the hash
* This is the ONLY method that should be called in order to store( create or update )an bitboard!
* It is very smart and will figure out what to do for you. It should be considered a black box.
*
* @param array pParams hash of values that will be used to store the page
*
- * @return bool TRUE on success, FALSE if store could not occur. If FALSE, $this->mErrors will have reason why
+ * @return bool true on success, false if store could not occur. If false, $this->mErrors will have reason why
*
* @access public
**/
- function store( &$pParamHash ) {
+ public function store( array &$pParamHash ): bool {
if( $this->verify( $pParamHash )&& LibertyMime::store( $pParamHash ) ) {
$table = BIT_DB_PREFIX."boards";
$this->StartTrans();
if( $this->mBitBoardId ) {
- $locId = array( "board_id" => $pParamHash['board_id'] );
+ $locId = [ "board_id" => $pParamHash['board_id'] ];
$result = $this->mDb->associateUpdate( $table, $pParamHash['board_store'], $locId );
} else {
$pParamHash['board_store']['content_id'] = $pParamHash['content_id'];
- if( @$this->verifyId( $pParamHash['board_id'] ) ) {
- // if pParamHash['board_id'] is set, some is requesting a particular board_id. Use with caution!
- $pParamHash['board_store']['board_id'] = $pParamHash['board_id'];
- } else {
- $pParamHash['board_store']['board_id'] = $this->mDb->GenID( 'boards_board_id_seq' );
- }
+ $pParamHash['board_store']['board_id'] = ( @$this->verifyId( $pParamHash['board_id'] ) ) ? $pParamHash['board_id'] : $this->mDb->GenID( 'boards_board_id_seq' );
$this->mBitBoardId = $pParamHash['board_store']['board_id'];
$result = $this->mDb->associateInsert( $table, $pParamHash['board_store'] );
@@ -142,7 +143,7 @@ class BitBoard extends LibertyMime {
require_once( UTIL_PKG_INCLUDE_PATH.'mailman_lib.php' );
if( $gBitSystem->getConfig( 'boards_sync_mail_server' ) ) {
if( !($error = mailman_newlist( array( 'listname' => $pParamHash['boards_mailing_list'], 'listhost' => $gBitSystem->getConfig( 'boards_email_host', $gBitSystem->getConfig( 'kernel_server_name' ) ), 'admin-password'=>$pParamHash['boards_mailing_list_password'], 'listadmin-addr'=>$gBitUser->getField( 'email' ) ) )) ) {
- $this->storePreference( 'boards_mailing_list', !empty( $pParamHash['boards_mailing_list'] ) ? $pParamHash['boards_mailing_list'] : NULL );
+ $this->storePreference( 'boards_mailing_list', !empty( $pParamHash['boards_mailing_list'] ) ? $pParamHash['boards_mailing_list'] : null );
$this->storePreference( 'boards_mailing_list_password', $pParamHash['boards_mailing_list_password'] );
// Subscribe the owner
mailman_addmember( $this->getPreference( 'boards_mailing_list'), $gBitUser->getField('email') );
@@ -164,8 +165,8 @@ class BitBoard extends LibertyMime {
$this->load();
} else {
$this->mDb->RollbackTrans();
- $this->mContentId = NULL;
- $this->mBitBoardId = NULL;
+ $this->mContentId = null;
+ $this->mBitBoardId = null;
}
}
return( count( $this->mErrors )== 0 );
@@ -173,17 +174,16 @@ class BitBoard extends LibertyMime {
/**
* Make sure the data is safe to store
- * @param pParamHash be sure to pass by reference in case we need to make modifcations to the hash
+ * @param array pParamHash be sure to pass by reference in case we need to make modifcations to the hash
* This function is responsible for data integrity and validation before any operations are performed with the $pParamHash
* NOTE: This is a PRIVATE METHOD!!!! do not call outside this class, under penalty of death!
*
* @param array pParams reference to hash of values that will be used to store the page, they will be modified where necessary
- *
- * @return bool TRUE on success, FALSE if verify failed. If FALSE, $this->mErrors will have reason why
+ * @return bool true on success, false if verify failed. If false, $this->mErrors will have reason why
*
* @access private
**/
- function verify( &$pParamHash ) {
+ public function verify( array &$pParamHash ): bool {
// make sure we're all loaded up of we have a mBitBoardId
if( $this->verifyId( $this->mBitBoardId ) && empty( $this->mInfo ) ) {
$this->load();
@@ -272,8 +272,7 @@ class BitBoard extends LibertyMime {
/**
* This function removes a bitboard entry
**/
- function expunge() {
- $ret = FALSE;
+ public function expunge(): bool {
if( $this->isValid() ) {
$this->StartTrans();
$mailingList = $this->getPreference( 'boards_mailing_list' );
@@ -283,18 +282,17 @@ class BitBoard extends LibertyMime {
$result = $this->mDb->query( $query, array( $this->mContentId ) );
if( LibertyMime::expunge() ) {
if( $mailingList ) {
- require_once( UTIL_PKG_INCLUDE_PATH.'mailman_lib.php' );
+ require_once UTIL_PKG_INCLUDE_PATH.'mailman_lib.php';
if( $error = mailman_rmlist( $mailingList ) ) {
$this->mErrors['mailing_list'] = $error;
}
}
- $ret = TRUE;
$this->CompleteTrans();
} else {
$this->mDb->RollbackTrans();
}
}
- return $ret;
+ return true;
}
/**
@@ -306,9 +304,9 @@ class BitBoard extends LibertyMime {
function getAllMap() {
$b = new BitBoard();
- $listHash = array();
+ $listHash = [];
$l = $b->getList($listHash);
- $ret = array();
+ $ret = [];
foreach ($l as $k => $boardd) {
$board = new BitBoard($boardd['board_id']);
$board->mInfo=$boardd;
@@ -327,7 +325,7 @@ class BitBoard extends LibertyMime {
function getUnMapped() {
global $gBitSystem;
- $ret = NULL;
+ $ret = null;
$sql = "SELECT
lc.`title`,
lc.`content_id`,
@@ -359,7 +357,7 @@ class BitBoard extends LibertyMime {
}
function addContent($content_id) {
- if (@BitBase::verifyId($content_id)) {
+ if (BitBase::verifyId($content_id)) {
$data = array(
'board_content_id'=>$this->mContentId,
'topic_content_id'=>$content_id,
@@ -369,7 +367,7 @@ class BitBoard extends LibertyMime {
}
function removeContent($content_id) {
- if (@BitBase::verifyId($content_id) && @BitBase::verifyId($this->mContentId)) {
+ if (BitBase::verifyId($content_id) && BitBase::verifyId($this->mContentId)) {
$sql = "DELETE FROM `".BIT_DB_PREFIX."boards_map` WHERE `board_content_id` = ? AND `topic_content_id` = ?";
$result = $this->mDb->query( $sql, array( $this->mContentId,$content_id ) );
}
@@ -392,7 +390,7 @@ class BitBoard extends LibertyMime {
}
function fixContentMap() {
- if( $this->isValid() && @BitBase::verifyId($this->mContentId)) {
+ if( $this->isValid() && BitBase::verifyId($this->mContentId)) {
$this->removeContent($this->mContentId);
$this->addContent($this->mContentId);
}
@@ -400,8 +398,8 @@ class BitBoard extends LibertyMime {
function lookupMapRev($content_id) {
global $gBitDb;
- $ret = NULL;
- if (@BitBase::verifyId($content_id)) {
+ $ret = null;
+ if (BitBase::verifyId($content_id)) {
$sql = "SELECT `board_content_id` FROM `".BIT_DB_PREFIX."boards_map` map WHERE map.`topic_content_id`=?";
$ret = $gBitDb->getOne( $sql, array( $content_id ));
}
@@ -410,7 +408,7 @@ class BitBoard extends LibertyMime {
function getMap() {
global $gBitSystem;
- $ret = NULL;
+ $ret = null;
if( $this->isValid() ) {
$sql = "SELECT
lc.`title` AS t_title,
@@ -440,7 +438,7 @@ class BitBoard extends LibertyMime {
return $ret;
}
- public static function prepGetList( &$pParamHash ) {
+ public static function prepGetList( array &$pParamHash ): void {
if( empty( $pParamHash['sort_mode'] ) ) {
// default sort_mode for boards is alphabetical
$pParamHash['sort_mode'] = 'title_asc';
@@ -457,7 +455,7 @@ class BitBoard extends LibertyMime {
$this->prepGetList( $pParamHash );
$selectSql = $joinSql = $whereSql = '';
- $bindVars = array();
+ $bindVars = [];
array_push( $bindVars, $this->mContentTypeGuid );
$this->getServicesSql( 'content_list_sql_function', $selectSql, $joinSql, $whereSql, $bindVars );
@@ -510,7 +508,7 @@ class BitBoard extends LibertyMime {
INNER JOIN `".BIT_DB_PREFIX."liberty_comments` s_lcom ON (map.`topic_content_id` = s_lcom.`root_id`)
INNER JOIN `".BIT_DB_PREFIX."liberty_content` s_lc ON (s_lcom.`content_id` = s_lc.`content_id`)
LEFT JOIN `".BIT_DB_PREFIX."boards_posts` s ON( s_lcom.`comment_id` = s.`comment_id` )
-WHERE map.`board_content_id`=lc.`content_id` AND ((s_lc.`user_id` < 0) AND (s.`is_approved` = 0 OR s.`is_approved` IS NULL) )
+WHERE map.`board_content_id`=lc.`content_id` AND ((s_lc.`user_id` < 0) AND (s.`is_approved` = 0 OR s.`is_approved` IS null) )
) AS unreg";
} else {
$selectSql .= ", 0 AS unreg";
@@ -542,7 +540,7 @@ WHERE map.`board_content_id`=lc.`content_id` AND ((s_lc.`user_id` < 0) AND (s.`i
$result = $this->mDb->query( $query, $bindVars );
- $ret = array();
+ $ret = [];
while( $res = $result->fetchRow() ) {
$res['url']= BOARDS_PKG_URL."index.php?b={$res['board_id']}";
@@ -551,23 +549,19 @@ WHERE map.`board_content_id`=lc.`content_id` AND ((s_lc.`user_id` < 0) AND (s.`i
INNER JOIN `".BIT_DB_PREFIX."liberty_comments` lcom ON (map.`topic_content_id` = lcom.`root_id`)
INNER JOIN `".BIT_DB_PREFIX."liberty_content` slc ON( slc.`content_id` = lcom.`content_id` )
LEFT JOIN `".BIT_DB_PREFIX."boards_posts` fp ON (fp.`comment_id` = lcom.`comment_id`)
- WHERE lcom.`root_id`=lcom.`parent_id` AND map.`board_content_id`=? AND ((fp.`is_approved` = 1) OR (fp.`is_approved` IS NULL))", array( $res['content_id'] ) );
+ WHERE lcom.`root_id`=lcom.`parent_id` AND map.`board_content_id`=? AND ((fp.`is_approved` = 1) OR (fp.`is_approved` IS null))", array( $res['content_id'] ) );
$res['post_count'] = $this->mDb->getOne( "SELECT count(*)
FROM `".BIT_DB_PREFIX."liberty_comments` lcom
INNER JOIN `".BIT_DB_PREFIX."liberty_content` slc ON( slc.`content_id` = lcom.`content_id` )
INNER JOIN `".BIT_DB_PREFIX."boards_map` map ON (lcom.`root_id`=map.`topic_content_id`)
LEFT JOIN `".BIT_DB_PREFIX."boards_posts` fp ON (fp.`comment_id` = lcom.`comment_id`)
- WHERE map.`board_content_id`=? AND ((fp.`is_approved` = 1) OR (fp.`is_approved` IS NULL))", array( $res['content_id'] ) );
+ WHERE map.`board_content_id`=? AND ((fp.`is_approved` = 1) OR (fp.`is_approved` IS null))", array( $res['content_id'] ) );
if($track) {
if ($gBitUser->isRegistered()) {
$res['track']['on'] = true;
$res['track']['count'] = $res['track_count'];
- if ($res['post_count']>$res['track_count']) {
- $res['track']['mod'] = true;
- } else {
- $res['track']['mod'] = false;
- }
+ $res['track']['mod'] = ( $res['post_count'] > $res['track_count'] ) ? true : false;
} else {
$res['track']['on'] = false;
}
@@ -592,7 +586,7 @@ WHERE map.`board_content_id`=lc.`content_id` AND ((s_lc.`user_id` < 0) AND (s.`i
INNER JOIN `".BIT_DB_PREFIX."liberty_comments` lcom ON (map.`topic_content_id` = lcom.`root_id`)
INNER JOIN `".BIT_DB_PREFIX."liberty_content` slc ON( slc.`content_id` = lcom.`content_id` )
LEFT JOIN `".BIT_DB_PREFIX."boards_posts` fp ON (fp.`comment_id` = lcom.`comment_id`)
- WHERE lcom.`root_id`=lcom.`parent_id` AND map.`board_content_id`=? AND ((fp.`is_approved` IS NULL OR fp.`is_approved` = 1) OR (slc.`user_id` >= 0))
+ WHERE lcom.`root_id`=lcom.`parent_id` AND map.`board_content_id`=? AND ((fp.`is_approved` IS null OR fp.`is_approved` = 1) OR (slc.`user_id` >= 0))
ORDER BY slc.`last_modified` DESC
";
$result = $this->mDb->getRow( $query, array( $data['content_id'] ) );
@@ -608,19 +602,18 @@ WHERE map.`board_content_id`=lc.`content_id` AND ((s_lc.`user_id` < 0) AND (s.`i
/**
* Generates the URL to the bitboard page
- * @return the link to display the page.
+ * @return string link to display the page.
*/
public static function getDisplayUrlFromHash( &$pParamHash ) {
global $gBitSystem;
- $ret = NULL;
+ $ret = null;
if( !empty( $pParamHash['comment'] ) && !empty( $pParamHash['comment']['thread_forward_sequence'] ) ){
- // look up base of comment sequece which is BitBoardTopic
+ // look up base of comment sequence which is BitBoardTopic
$seq = explode( ".", $pParamHash['comment']['thread_forward_sequence'] );
$topicRootId = (int)$seq[0];
if( BitBase::verifyId( $topicRootId )) {
- require_once( BOARDS_PKG_CLASS_PATH.'BitBoardTopic.php' );
- $hash = array( 'topic_id' => $topicRootId );
+ $hash = [ 'topic_id' => $topicRootId ];
$ret = BitBoardTopic::getDisplayUrlFromHash( $hash );
// we're out of here with our topic url
return $ret;
@@ -641,12 +634,12 @@ WHERE map.`board_content_id`=lc.`content_id` AND ((s_lc.`user_id` < 0) AND (s.`i
return $ret;
}
- function getBoardSelectList( $pBlankFirst=FALSE ) {
+ public function getBoardSelectList( $pBlankFirst=false ) {
global $gBitSystem, $gBitUser;
// invoke list sql principly to enforce permission services
$selectSql = $joinSql = $whereSql = '';
- $bindVars = array();
+ $bindVars = [];
$this->getServicesSql( 'content_list_sql_function', $selectSql, $joinSql, $whereSql, $bindVars );
@@ -670,7 +663,7 @@ WHERE map.`board_content_id`=lc.`content_id` AND ((s_lc.`user_id` < 0) AND (s.`i
WHERE lc.`content_id` = b.`content_id` $whereSql
ORDER BY lc.`title` ASC";
- $ret = array();
+ $ret = [];
if( $rslt = $this->mDb->query( $query, $bindVars ) ){
if( $pBlankFirst ) {
@@ -691,7 +684,7 @@ WHERE map.`board_content_id`=lc.`content_id` AND ((s_lc.`user_id` < 0) AND (s.`i
if( LibertyContent::verifyId( $contentId ) ) {
// LibertyContent::load()assumes you have joined already, and will not execute any sql!
// This is a significant performance optimization
- $bindVars = array();
+ $bindVars = [];
$selectSql = $joinSql = $whereSql = '';
array_push( $bindVars, $contentId );
$gBitUser->getServicesSql( 'content_load_sql_function', $selectSql, $joinSql, $whereSql, $bindVars );
@@ -703,7 +696,7 @@ WHERE map.`board_content_id`=lc.`content_id` AND ((s_lc.`user_id` < 0) AND (s.`i
WHERE lc.`content_id`=? $whereSql";
$result = $gBitDb->query( $query, $bindVars );
- $ret = array();
+ $ret = [];
if( $result && $result->numRows() ) {
$ret = $result->fields;
@@ -712,12 +705,12 @@ WHERE map.`board_content_id`=lc.`content_id` AND ((s_lc.`user_id` < 0) AND (s.`i
$ret['display_url'] = BIT_ROOT_URL."index.php?content_id=$contentId";
}
}
- return( $ret );
+ return $ret;
}
public static function getLinkedBoard( $pContentId ) {
global $gBitDb;
- $ret = NULL;
+ $ret = null;
if( BitBase::verifyId( $pContentId ) ) {
$sql = "SELECT b.`board_id`, b.`content_id` AS `board_content_id`, COUNT(lcom.`comment_id`) AS `post_count`
FROM `".BIT_DB_PREFIX."boards_map` bm
@@ -743,7 +736,7 @@ WHERE map.`board_content_id`=lc.`content_id` AND ((s_lc.`user_id` < 0) AND (s.`i
function getBoardMailingList() {
global $gBitSystem;
- $ret = NULL;
+ $ret = null;
if( $this->isValid() && $gBitSystem->getConfig( 'boards_sync_mail_server' ) && $this->getPreference( 'boards_mailing_list' ) ) {
$ret = $this->getPreference( 'boards_mailing_list' ).'@'.$gBitSystem->getConfig( 'boards_email_host', $gBitSystem->getConfig( 'kernel_server_name' ) );
}
@@ -770,16 +763,15 @@ function boards_content_edit ( $pContent, $pParamHash ) {
}
require_once( BOARDS_PKG_CLASS_PATH.'BitBoard.php' );
$board = new BitBoard();
- $boardList = $board->getBoardSelectList( TRUE );
+ $boardList = $board->getBoardSelectList( true );
$gBitSmarty->assign( 'boardList', $boardList );
}
}
-// store services for boads
+// store services for boards
function boards_content_store( $pContent, $pParamHash ) {
global $gBitDb, $gBitSmarty, $gBitSystem;
- require_once( BOARDS_PKG_CLASS_PATH.'BitBoardTopic.php' );
// do not allow unassigning topics. the UI should prevent this, but just to make sure...
if( $pContent->isValid() && !$pContent->isContentType( BITBOARDTOPIC_CONTENT_TYPE_GUID ) && !$pContent->isContentType( BITBOARD_CONTENT_TYPE_GUID ) ) {
// wipe out all previous assignments for good measure. Not the sanest thing to do, but edits are infrequent - at least for now
@@ -791,7 +783,6 @@ function boards_content_store( $pContent, $pParamHash ) {
$p = null;
if ( ! empty( $pParamHash['pigoneholes'] ) ) {
foreach( $pParamHash['pigeonholes']['pigeonhole'] as $p_id ) {
- require_once(PIGEONHOLES_PKG_CLASS_PATH.'Pigeonholes.php');
if (empty($p)) {
$p = new Pigeonholes();
}
@@ -804,7 +795,7 @@ function boards_content_store( $pContent, $pParamHash ) {
// Insert into these boards
foreach ($boards as $board) {
- if( @BitBase::verifyId( $board['content_id'] ) ) {
+ if( BitBase::verifyId( $board['content_id'] ) ) {
$pContent->mDb->query( "INSERT INTO `".BIT_DB_PREFIX."boards_map` (`board_content_id`,`topic_content_id`) VALUES (?,?)", array( $board['content_id'], $pContent->mContentId ) );
}
}
@@ -813,13 +804,13 @@ function boards_content_store( $pContent, $pParamHash ) {
}
else {
$pContent->mDb->query( "DELETE FROM `".BIT_DB_PREFIX."boards_map` WHERE `topic_content_id`=?", array( $pContent->mContentId ) );
- if( @BitBase::verifyId( $pParamHash['linked_board_cid'] ) ) {
+ if( BitBase::verifyId( $pParamHash['linked_board_cid'] ?? 0 ) ) {
$pContent->mDb->query( "INSERT INTO `".BIT_DB_PREFIX."boards_map` (`board_content_id`,`topic_content_id`) VALUES (?,?)", array( $pParamHash['linked_board_cid'], $pContent->mContentId ) );
}
}
$gBitSmarty->assign( 'boardInfo', BitBoard::getLinkedBoard( $pContent->mContentId ) );
} else {
- if( @BitBase::verifyId( $pParamHash['content_id'] ) && @BitBase::verifyId( $pParamHash['linked_board_cid'] ) ) {
+ if( BitBase::verifyId( $pParamHash['content_id'] ?? 0 ) && BitBase::verifyId( $pParamHash['linked_board_cid'] ?? 0 ) ) {
$pContent->mDb->query( "INSERT INTO `".BIT_DB_PREFIX."boards_map` (`board_content_id`,`topic_content_id`) VALUES (?,?)", array( $pParamHash['linked_board_cid'], $pParamHash['content_id'] ) );
}
}
@@ -845,13 +836,13 @@ function boards_comment_store( &$pObject, &$pParamHash ) {
}
}
-function boards_content_verify( $pObject, &$pParamHash ){
+function boards_content_verify( &$pObject, &$pParamHash ){
// board posts ( e.g. liberty comments ) service
global $gBitSystem, $gBitUser;
// use is_a instead of isContentType( BITCOMMENT_CONTENT_TYPE_GUID ) as isContentType() checks isValid(), and this service method will not properly handle new object stores
if( $gBitSystem->isPackageActive( 'boards' ) && is_a( $pObject , 'LibertyComment' ) ) {
if( BitBoardTopic::isLockedMsg( $pParamHash['parent_id'] )) {
- $pObject->mErrors['warning']=tra("The selected Topic is Locked posting is disabled");
+ $pObject->mErrors['warning'] = KernelTools::tra("The selected Topic is Locked posting is disabled");
}
}
}
@@ -862,5 +853,3 @@ function boards_content_expunge( $pContent ) {
$pContent->mDb->query( "DELETE FROM `".BIT_DB_PREFIX."boards_map` WHERE `topic_content_id`=?", array( $pContent->mContentId ) );
}
}
-
-?>
diff --git a/includes/classes/BitBoardPost.php b/includes/classes/BitBoardPost.php
index 63bb3f4..e77e947 100644..100755
--- a/includes/classes/BitBoardPost.php
+++ b/includes/classes/BitBoardPost.php
@@ -14,8 +14,12 @@
/**
* required setup
*/
-require_once( LIBERTY_PKG_CLASS_PATH.'LibertyMime.php' );
-require_once( BOARDS_PKG_CLASS_PATH.'BitBoardTopic.php' );
+namespace Bitweaver\Boards;
+use Bitweaver\BitBase;
+use Bitweaver\KernelTools;
+use Bitweaver\Liberty\LibertyComment;
+use Bitweaver\Users\RoleUser;
+use Messages;
/**
* @package boards
@@ -24,7 +28,7 @@ class BitBoardPost extends LibertyComment {
/**
* During initialisation, be sure to call our base constructors
*/
- function __construct($pCommentId = NULL, $pContentId = NULL, $pInfo = NULL) {
+ function __construct($pCommentId = null, $pContentId = null, $pInfo = null) {
parent::__construct($pCommentId,$pContentId,$pInfo);
// Permission setup
@@ -36,17 +40,17 @@ class BitBoardPost extends LibertyComment {
/**
* This function verifies the data for a post
*/
- function verify( &$pParamHash ) {
+ public function verify( array &$pParamHash ): bool {
if( isset( $pParamHash['is_approved'] ) ) {
if( !is_numeric( $pParamHash['is_approved'] ) || $pParamHash['is_approved'] > 1 || $pParamHash['is_approved'] < 0 ) {
- $this->mErrors[]=("Invalid post approved state");
+ $this->mErrors[]= "Invalid post approved state";
} else {
$pParamHash['post_store']['is_approved'] = $pParamHash['is_approved'];
}
}
if( isset( $pParamHash['is_warned'] ) ) {
if( !is_numeric( $pParamHash['warned'] ) || $pParamHash['is_warned'] > 1 || $pParamHash['is_warned'] < 0 ) {
- $this->mErrors[]=("Invalid warned state");
+ $this->mErrors[]= "Invalid warned state";
} else {
$pParamHash['post_store']['is_warned'] = $pParamHash['is_warned'];
}
@@ -61,15 +65,15 @@ class BitBoardPost extends LibertyComment {
$pParamHash['post_store']['migrate_post_id'] = $pParamHash['migrate_post_id'];
}
- return( count( $this->mErrors ) == 0 && !empty( $pParamHash['post_store'] ) );
+ return count( $this->mErrors ) == 0 && !empty( $pParamHash['post_store'] );
}
/**
* This function stores a post
*/
- function store( &$pParamHash ) {
+ public function store( array &$pParamHash ): bool {
global $gBitSystem;
- $ret = FALSE;
+ $ret = false;
if( $this->mCommentId && $this->verify( $pParamHash ) ) {
//$gBitSystem->verifyPermission('p_boards_update');
//$pParamHash = (($pParamHash + 1)%2);
@@ -81,7 +85,7 @@ class BitBoardPost extends LibertyComment {
$pParamHash['post_store']['comment_id'] = $this->mCommentId;
$result = $this->mDb->associateInsert( 'boards_posts', $pParamHash['post_store'] );
}
- $ret = TRUE;
+ $ret = true;
}
return $ret;
}
@@ -89,7 +93,7 @@ class BitBoardPost extends LibertyComment {
/**
* This function gets the meta data relating to a post
*/
- function loadMetaData() {
+ public function loadMetaData(): void {
if ($this->isValid()) {
if (!isset($this->mInfo['accepted'])) {
$key = array('comment_id' => $this->mCommentId);
@@ -112,30 +116,28 @@ class BitBoardPost extends LibertyComment {
/**
* This function removes a bitboard entry
**/
- function expunge() {
- $ret = FALSE;
+ public function expunge(): bool {
if( $this->isValid() ) {
$this->StartTrans();
// parent actually has deletion of rows in boards for constraint reasons
if( parent::expunge() ) {
$this->CompleteTrans();
- $ret = TRUE;
} else {
$this->mDb->RollbackTrans();
}
}
- return $ret;
+ return true;
}
/**
* This function gets all the post relating to a topic
*/
- function getComments( $pContentId = NULL, $pMaxComments = NULL, $pOffset = NULL, $pSortOrder = NULL, $pDisplayMode = NULL ) {
+ public function getComments( $pContentId = null, $pMaxComments = null, $pOffset = null, $pSortOrder = null, $pDisplayMode = null ) {
global $gBitUser, $gBitSystem;
$joinSql = $selectSql = $whereSql = '';
- $ret = array();
+ $ret = [];
$contentId = $this->mCommentId;
$mid = 'thread_forward_sequence ASC';
@@ -155,7 +157,7 @@ class BitBoardPost extends LibertyComment {
}
$mid = 'order by ' . $mid;
- $bindVars = array();
+ $bindVars = [];
if (is_array( $contentId ) ) {
$mid2 = 'in ('.implode(',', array_fill(0, count( $pContentId ), '?')).')';
$bindVars = $contentId;
@@ -171,7 +173,7 @@ class BitBoardPost extends LibertyComment {
$whereSql .= " AND ((post.`is_approved` = 1) OR (lc.`user_id` >= 0))";
}
- $pListHash = array( 'content_id' => $contentId, 'max_records' => $pMaxComments, 'offset'=>$pOffset, 'sort_mode'=> $pSortOrder, 'display_mode' => $pDisplayMode, 'has_comment_view_perm' => TRUE );
+ $pListHash = array( 'content_id' => $contentId, 'max_records' => $pMaxComments, 'offset'=>$pOffset, 'sort_mode'=> $pSortOrder, 'display_mode' => $pDisplayMode, 'has_comment_view_perm' => true );
$this->getServicesSql( 'content_list_sql_function', $selectSql, $joinSql, $whereSql, $bindVars, $this, $pListHash );
if ($pContentId) {
@@ -192,26 +194,22 @@ class BitBoardPost extends LibertyComment {
LEFT JOIN `".BIT_DB_PREFIX."boards_posts` post ON (post.`comment_id` = lcom.`comment_id`)
WHERE $mid2 $whereSql $mid";
- $flat_comments = array();
+ $flat_comments = [];
if( $result = $this->mDb->query( $sql, $bindVars, $pMaxComments, $pOffset ) ) {
while( $row = $result->FetchRow() ) {
if (empty($row['anon_name'])) {
$row['anon_name'] = "Anonymous";
}
- if( $row['avatar_file_name'] ) {
- $row['user_avatar_url'] = liberty_fetch_thumbnail_url( array(
- 'source_file' => liberty_mime_get_source_file( array( 'user_id'=>$row['avatar_user_id'], 'file_name'=>$row['avatar_file_name'], 'mime_type'=>$row['avatar_mime_type'], 'attachment_id'=>$row['avatar_attachment_id'] ) ),
- 'size' => 'avatar'
- ));
- } else {
- $row['user_avatar_url'] = FALSE;
- }
+ $row['user_avatar_url'] = ( $row['avatar_file_name'] ) ? \Bitweaver\Liberty\liberty_fetch_thumbnail_url( array(
+ 'source_file' => \Bitweaver\Liberty\liberty_mime_get_source_file( array( 'user_id' => $row['avatar_user_id'], 'file_name' => $row['avatar_file_name'], 'mime_type' => $row['avatar_mime_type'], 'attachment_id' => $row['avatar_attachment_id'] ) ),
+ 'size' => 'avatar',
+ ) ) : false;
if (!empty($row['warned_message'])) {
$row['warned_message'] = str_replace("\n","<br />\n",$row['warned_message']);
}
$row['data'] = trim( $row['data'] );
- $row['user_url'] = BitUser::getDisplayUrlFromHash( $row );
+ $row['user_url'] = RoleUser::getDisplayUrlFromHash( $row );
$row['parsed_data'] = self::parseDataHash( $row );
$row['level'] = substr_count ( $row['thread_forward_sequence'], '.' ) - 1;
$c = new LibertyComment();
@@ -227,7 +225,7 @@ class BitBoardPost extends LibertyComment {
if( $func = $gLibertySystem->getPluginFunction( $row2['attachment_plugin_guid'], 'load_function', 'mime' )) {
// we will pass the preferences by reference that the plugin can easily update them
if( empty( $row['storage'][$row2['attachment_id']] )) {
- $row['storage'][$row2['attachment_id']] = array();
+ $row['storage'][$row2['attachment_id']] = [];
}
$row['storage'][$row2['attachment_id']] = $func( $row2, $row['storage'][$row2['attachment_id']] );
} else {
@@ -253,19 +251,19 @@ class BitBoardPost extends LibertyComment {
/**
* This function gets a list of posts
*/
- function getList( &$pListHash ) {
+ public function getList( &$pListHash ) {
global $gBitUser, $gBitSystem;
$this->prepGetList( $pListHash );
$joinSql = $selectSql = $whereSql = '';
- $ret = array();
+ $ret = [];
$contentId = $this->mCommentId;
// $mid = 'ORDER BY `thread_forward_sequence` ASC';
- $bindVars = array();
+ $bindVars = [];
if( !empty( $pListHash['content_id'] ) ) {
if (is_array( $contentId ) ) {
$mid2 = 'in ('.implode(',', array_fill(0, count( $pListHash['content_id'] ), '?')).')';
@@ -289,7 +287,7 @@ class BitBoardPost extends LibertyComment {
array_push( $bindVars, (int)$pListHash['board_id'] );
}
- if( BitBase::verifyId( $pListHash['user_id'] ) ) {
+ if( BitBase::verifyId( $pListHash['user_id'] ?? 0 ) ) {
$whereSql .= ' AND lc.`user_id`=? ';
array_push( $bindVars, $pListHash['user_id'] );
}
@@ -311,25 +309,21 @@ class BitBoardPost extends LibertyComment {
LEFT JOIN `".BIT_DB_PREFIX."boards_posts` post ON (post.`comment_id` = lcom.`comment_id`)
$whereSql ORDER BY ".$this->mDb->convertSortmode( $pListHash['sort_mode'] );
- $ret = array();
+ $ret = [];
if( $result = $this->mDb->query( $sql, $bindVars, $pListHash['max_records'], $pListHash['offset'] ) ) {
while( $row = $result->FetchRow() ) {
if (empty($row['anon_name'])) $row['anon_name'] = "Anonymous";
- if( !empty( $row['avatar_file_name'] )) {
- $row['user_avatar_url'] = liberty_fetch_thumbnail_url( array(
- 'source_file' => liberty_mime_get_source_file( array( 'user_id'=>$row['avatar_user_id'], 'file_name'=>$row['avatar_file_name'], 'mime_type'=>$row['avatar_mime_type'], 'attachment_id'=>$row['avatar_attachment_id'] ) ),
- 'size' => 'avatar'
- ));
- } else {
- $row['user_avatar_url'] = FALSE;
- }
+ $row['user_avatar_url'] = ( !empty( $row['avatar_file_name'] ) ) ? \Bitweaver\Liberty\liberty_fetch_thumbnail_url( array(
+ 'source_file' => \Bitweaver\Liberty\liberty_mime_get_source_file( array( 'user_id' => $row['avatar_user_id'], 'file_name' => $row['avatar_file_name'], 'mime_type' => $row['avatar_mime_type'], 'attachment_id' => $row['avatar_attachment_id'] ) ),
+ 'size' => 'avatar',
+ ) ) : false;
unset($row['avatar_file_name']);
if (!empty($row['warned_message'])) {
$row['warned_message'] = str_replace("\n","<br />\n",$row['warned_message']);
}
$row['data'] = trim($row['data']);
- $row['user_url']=BitUser::getDisplayUrlFromHash($row);
+ $row['user_url']=RoleUser::getDisplayUrlFromHash($row);
$row['parsed_data'] = self::parseDataHash( $row );
$row['level'] = substr_count ( $row['thread_forward_sequence'], '.' ) - 1;
$row['topic_id'] = boards_get_topic_comment( $row['thread_forward_sequence'] );
@@ -348,15 +342,15 @@ class BitBoardPost extends LibertyComment {
/**
* This function counts the posts relating to a topic
*/
- function getNumComments($pContentId = NULL) {
+ public function getNumComments($pContentId = null) {
$ret = 0;
$contentId = $this->mCommentId;
- $bindVars = array();
+ $bindVars = [];
$joinSql = $selectSql = $whereSql = '';
- $paramHash = array( 'include_comments' => TRUE );
+ $paramHash = array( 'include_comments' => true );
$this->getServicesSql( 'content_list_sql_function', $selectSql, $joinSql, $whereSql, $bindVars, $this, $paramHash );
if ($pContentId) {
@@ -375,8 +369,8 @@ class BitBoardPost extends LibertyComment {
/**
* This function generates a valid lookup URL
*/
- function getDisplayUrl() {
- $ret = NULL;
+ public function getDisplayUrl() {
+ $ret = null;
if( $this->isValid() ) {
$urlHash['comment_id'] = $this->mCommentId;
$urlHash['topic_id'] = $this->getTopicId();
@@ -387,12 +381,12 @@ class BitBoardPost extends LibertyComment {
/**
* Generates the URL to the bitboard page
- * @return the link to display the page.
+ * @return string link to display the page.
*/
public static function getDisplayUrlFromHash( &$pParamHash ) {
global $gBitSystem;
- $ret = NULL;
+ $ret = null;
if( static::verifyId( $pParamHash['comment_id'] ) ) {
if( $gBitSystem->isFeatureActive( 'pretty_urls' ) || $gBitSystem->isFeatureActive( 'pretty_urls_extended' ) ) {
$rewrite_tag = $gBitSystem->isFeatureActive( 'pretty_urls_extended' ) ? 'view/' : '';
@@ -408,20 +402,31 @@ class BitBoardPost extends LibertyComment {
return $ret;
}
- function getTopicId() {
+ /**
+ * Summary of getContactUrl
+ * @return string
+ */
+ public function getContactUrl(): string {
+ return '';
+ }
+ /**
+ * Summary of getTopicId
+ * @return int
+ */
+ public function getTopicId() {
return boards_get_topic_comment( $this->getField( 'thread_forward_sequence') );
}
- function modApprove() {
+ public function modApprove() {
$data['is_approved'] = 1;
$this->setMetaData($data);
}
- function modReject() {
+ public function modReject() {
$this->deleteComment();
}
- function modWarn($message) {
+ public function modWarn($message) {
global $gBitSystem, $gBitUser;
if (empty($message)) {
@@ -432,27 +437,25 @@ class BitBoardPost extends LibertyComment {
$this->setMetaData($data);
if ($gBitSystem->isPackageActive('messages')) {
- require_once(MESSAGES_PKG_CLASS_PATH.'Messages.php');
-
- $u = new BitUser($this->mInfo['user_id']);
+ $u = new RoleUser($this->mInfo['user_id']);
$u->load();
$userInfo = $u->mInfo;
$pm = new Messages();
$message = "Your post \"".$this->mInfo['title']."\" [http://".$_SERVER['HTTP_HOST'].$this->getContactUrl()."] has been warned with the following message:\n$message\n";
- $msgHash = array(
+ $msgHash = [
'to_login' => $userInfo['login'],
'to' => $userInfo['real_name'],
- 'subject' => tra( 'Warned Post' ).': '.$this->mInfo['title'],
+ 'subject' => KernelTools::tra( 'Warned Post' ) . ': ' . $this->mInfo['title'],
'priority' => 4,
- );
+ ];
$pm->postMessage( $msgHash );
}
}
- function setMetaData($data) {
+ public function setMetaData($data) {
if ($this->isValid()) {
- $key = array('comment_id' => $this->mCommentId);
+ $key = [ 'comment_id' => $this->mCommentId ];
$query_sel = "SELECT COUNT(*) FROM `".BIT_DB_PREFIX."boards_posts` WHERE comment_id=?";
$c = $this->mDb->getOne( $query_sel , array_values($key));
if ($c == 0) {
@@ -465,4 +468,3 @@ class BitBoardPost extends LibertyComment {
}
}
}
-?>
diff --git a/includes/classes/BitBoardTopic.php b/includes/classes/BitBoardTopic.php
index 1f12a89..68e52bd 100644..100755
--- a/includes/classes/BitBoardTopic.php
+++ b/includes/classes/BitBoardTopic.php
@@ -14,8 +14,13 @@
/**
* required setup
*/
-require_once( LIBERTY_PKG_CLASS_PATH.'LibertyComment.php' );
-require_once( BOARDS_PKG_CLASS_PATH.'BitBoardPost.php' );
+namespace Bitweaver\Boards;
+use Bitweaver\BitBase;
+use Bitweaver\KernelTools;
+use Bitweaver\Liberty\LibertyBase;
+use Bitweaver\Liberty\LibertyComment;
+use Bitweaver\Liberty\LibertyMime;
+use function sprintf;
/**
* This is used to uniquely identify the object
@@ -32,6 +37,7 @@ class BitBoardTopic extends LibertyMime {
* @public
*/
public $mRootId;
+ public $mRootObj;
/**
* the content id of the topic comment object
@@ -42,7 +48,7 @@ class BitBoardTopic extends LibertyMime {
/**
* During initialisation, be sure to call our base constructors
**/
- function __construct( $pRootId=NULL ) {
+ function __construct( $pRootId=null ) {
parent::__construct();
$this->mRootId = (int)$pRootId;
@@ -51,22 +57,22 @@ class BitBoardTopic extends LibertyMime {
$this->mUpdateContentPerm = 'p_boards_update';
$this->mAdminContentPerm = 'p_boards_admin';
- $this->mRootObj = NULL; //a reference to the root obj
+ $this->mRootObj = null; //a reference to the root obj
}
/**
* Load the data from the database
- * @param pParamHash be sure to pass by reference in case we need to make modifcations to the hash
+ * @param array pParamHash be sure to pass by reference in case we need to make modifcations to the hash
**/
- function load( $pContentId = NULL, $pPluginParams = NULL ) {
+ function load( $pContentId = null, $pPluginParams = null ) {
global $gBitUser, $gBitSystem;
if( $this->verifyId( $this->mRootId ) || $this->verifyId( $this->mContentId ) ) {
// This is a significant performance optimization
$lookupColumn = $this->verifyId( $this->mRootId ) ? 'lcom.`comment_id`' : 'lc.`content_id`';
- $bindVars = array();
+ $bindVars = [];
$selectSql = $joinSql = $whereSql = '';
- array_push( $bindVars, $lookupId = @BitBase::verifyId( $this->mRootId ) ? $this->mRootId : $this->mContentId );
- $paramHash = array( array( 'include_comments' => TRUE ) );
+ array_push( $bindVars, $lookupId = BitBase::verifyId( $this->mRootId ) ? $this->mRootId : $this->mContentId );
+ $paramHash = array( array( 'include_comments' => true ) );
$this->getServicesSql( 'content_load_sql_function', $selectSql, $joinSql, $whereSql, $bindVars, $this, $paramHash );
if (!($gBitUser->hasPermission('p_boards_update') || $gBitUser->hasPermission('p_boards_posts_update'))) {
@@ -140,7 +146,7 @@ class BitBoardTopic extends LibertyMime {
public static function lookupByMigratePost( $pMigratePostId ) {
global $gBitDb;
- $ret = NULL;
+ $ret = null;
if( BitBase::verifyId( $pMigratePostId ) ) {
$path = $gBitDb->getOne( "SELECT lcom.`thread_forward_sequence` FROM `".BIT_DB_PREFIX."boards_posts` bp INNER JOIN `".BIT_DB_PREFIX."liberty_comments` lcom ON(bp.`comment_id`=lcom.`comment_id`) WHERE bp.`migrate_post_id`=?", array( $pMigratePostId ) );
if( $path ) {
@@ -152,14 +158,14 @@ class BitBoardTopic extends LibertyMime {
public static function lookupByMigrateTopic( $pMigrateTopicId ) {
global $gBitDb;
- $ret = NULL;
+ $ret = null;
if( BitBase::verifyId( $pMigrateTopicId ) ) {
$ret = $gBitDb->getOne( "SELECT lcom.`comment_id` FROM `".BIT_DB_PREFIX."boards_topics` bt INNER JOIN `".BIT_DB_PREFIX."liberty_comments` lcom ON(bt.`parent_id`=lcom.`content_id`) WHERE `migrate_topic_id`=?", array( $pMigrateTopicId ) );
}
return $ret;
}
- function verify( &$pParamHash ) {
+ public function verify( array &$pParamHash ): bool {
if( isset( $pParamHash['is_locked'] ) ) {
if( !is_numeric( $pParamHash['is_locked'] ) || $pParamHash['is_locked'] > 1 || $pParamHash['is_locked'] < 0 ) {
$this->mErrors[]=("Invalid topic state");
@@ -191,9 +197,9 @@ class BitBoardTopic extends LibertyMime {
/**
* This function stickies a topic
*/
- function store( &$pParamHash ) {
+ public function store( array &$pParamHash ): bool {
global $gBitSystem;
- $ret = FALSE;
+ $ret = false;
if( $this->mCommentContentId && $this->verify( $pParamHash ) ) {
//$pParamHash = (($pParamHash + 1)%2);
$query_sel = "SELECT * FROM `".BIT_DB_PREFIX."boards_topics` WHERE `parent_id` = ?";
@@ -204,7 +210,7 @@ class BitBoardTopic extends LibertyMime {
$pParamHash['topic_store']['parent_id'] = $this->mCommentContentId;
$result = $this->mDb->associateInsert( 'boards_topics', $pParamHash['topic_store'] );
}
- $ret = TRUE;
+ $ret = true;
}
return $ret;
}
@@ -214,7 +220,7 @@ class BitBoardTopic extends LibertyMime {
*/
function lock($state) {
global $gBitSystem;
- $ret = FALSE;
+ $ret = false;
if ($state==null || !is_numeric($state) || $state > 1 || $state<0) {
$this->mErrors[]=("Invalid current state");
} else {
@@ -238,7 +244,7 @@ class BitBoardTopic extends LibertyMime {
*/
function sticky($state) {
global $gBitSystem;
- $ret = FALSE;
+ $ret = false;
if ($state==null || !is_numeric($state) || $state > 1 || $state<0) {
$this->mErrors[]=("Invalid current state");
} else {
@@ -252,7 +258,7 @@ class BitBoardTopic extends LibertyMime {
$query_up = "UPDATE `".BIT_DB_PREFIX."boards_topics` SET `is_sticky` = ? WHERE `parent_id` = ?";
$result = $this->mDb->query( $query_up, array( $state, $this->mCommentContentId) );
}
- $ret = TRUE;
+ $ret = true;
}
return $ret;
}
@@ -276,7 +282,7 @@ class BitBoardTopic extends LibertyMime {
$lcom->storeComment($lcom_hash);
// map the move to the topic table
- $data = array();
+ $data = [];
$data['parent_id']=$lcom->mContentId;
$data['is_moved']=$this->mRootId;
$this->mDb->associateInsert( BIT_DB_PREFIX."boards_topics", $data );
@@ -293,7 +299,7 @@ class BitBoardTopic extends LibertyMime {
// end transaction
$this->CompleteTrans();
- return TRUE;
+ return true;
}
/**
@@ -306,9 +312,9 @@ class BitBoardTopic extends LibertyMime {
LibertyMime::prepGetList( $pParamHash );
$selectSql = $joinSql = $whereSql = '';
- $bindVars = array();
+ $bindVars = [];
$pParamHash['include_comments'] = 'y';
- $this->getServicesSql( 'content_list_sql_function', $selectSql, $joinSql, $whereSql, $bindVars, NULL, $pParamHash );
+ $this->getServicesSql( 'content_list_sql_function', $selectSql, $joinSql, $whereSql, $bindVars, null, $pParamHash );
// this will set $find, $sort_mode, $max_records and $offset
extract( $pParamHash );
@@ -327,8 +333,8 @@ class BitBoardTopic extends LibertyMime {
// if we have the board's board_id (b) we use that, or if we have its content_id we can use that
if( (!empty( $pParamHash['b'] ) && $this->verifyId( $pParamHash['b'] ))
|| (!empty( $pParamHash['content_id'] ) && $this->verifyId( $pParamHash['content_id'] )) ) {
- $joinSql .= " INNER JOIN `${BIT_DB_PREFIX}boards_map` map ON (map.`topic_content_id` = lcom.`root_id`)";
- $joinSql .= " INNER JOIN `${BIT_DB_PREFIX}boards` b ON (b.`content_id` = map.`board_content_id`)";
+ $joinSql .= " INNER JOIN `{$BIT_DB_PREFIX}boards_map` map ON (map.`topic_content_id` = lcom.`root_id`)";
+ $joinSql .= " INNER JOIN `{$BIT_DB_PREFIX}boards` b ON (b.`content_id` = map.`board_content_id`)";
if(!empty($pParamHash['b'])) {
$whereSql .= " AND b.`board_id` = ?";
$bindVars[] = (int)$pParamHash['b'];
@@ -343,21 +349,19 @@ class BitBoardTopic extends LibertyMime {
// use adodb's substr property
$substr = $this->mDb->substr();
- if ( $this->mDb->mType == 'firebird' ) {
- $substrSql = "SUBSTRING(s_lcom.`thread_forward_sequence` FROM 1 FOR 10) LIKE SUBSTRING(lcom.`thread_forward_sequence` FROM 1 FOR 10)";
- } else {
- $substrSql = "$substr(s_lcom.`thread_forward_sequence`, 1, 10) LIKE $substr(lcom.`thread_forward_sequence`, 1, 10)";
- }
+ $substrSql = $this->mDb->mType == 'firebird' || $this->mDb->mType == 'pdo'
+ ? "SUBSTRING(s_lcom.`thread_forward_sequence` FROM 1 FOR 10) LIKE SUBSTRING(lcom.`thread_forward_sequence` FROM 1 FOR 10)"
+ : "$substr(s_lcom.`thread_forward_sequence`, 1, 10) LIKE $substr(lcom.`thread_forward_sequence`, 1, 10)";
if ($gBitSystem->isFeatureActive('boards_posts_anon_moderation') && !($gBitUser->hasPermission('p_boards_update') || $gBitUser->hasPermission('p_boards_post_update'))) {
$whereSql .= " AND ((post.`is_approved` = 1) OR (lc.`user_id` >= 0))";
}
if ($gBitSystem->isFeatureActive('boards_posts_anon_moderation') && ($gBitUser->hasPermission('p_boards_update') || $gBitUser->hasPermission('p_boards_post_update'))) {
$selectSql .= ", ( SELECT COUNT(*)
- FROM `${BIT_DB_PREFIX}liberty_comments` AS s_lcom
+ FROM `{$BIT_DB_PREFIX}liberty_comments` AS s_lcom
INNER JOIN `".BIT_DB_PREFIX."liberty_content` s_lc ON (s_lcom.`content_id` = s_lc.`content_id`)
- LEFT JOIN `${BIT_DB_PREFIX}boards_posts` s ON( s_lcom.`comment_id` = s.`comment_id` )
- WHERE (".$substrSql.") AND ((s_lc.`user_id` < 0) AND (s.`is_approved` = 0 OR s.`is_approved` IS NULL))) AS unreg";
+ LEFT JOIN `{$BIT_DB_PREFIX}boards_posts` s ON( s_lcom.`comment_id` = s.`comment_id` )
+ WHERE (".$substrSql.") AND ((s_lc.`user_id` < 0) AND (s.`is_approved` = 0 OR s.`is_approved` IS null))) AS unreg";
} else {
$selectSql .= ", 0 AS unreg";
}
@@ -401,10 +405,10 @@ class BitBoardTopic extends LibertyMime {
) AS last_post
$selectSql
- FROM `${BIT_DB_PREFIX}liberty_comments` lcom
- INNER JOIN `${BIT_DB_PREFIX}liberty_content` lc ON( lc.`content_id` = lcom.`content_id` )
- LEFT JOIN `${BIT_DB_PREFIX}boards_topics` th ON (th.`parent_id`=lcom.`content_id`)
- LEFT JOIN `${BIT_DB_PREFIX}boards_posts` post ON (post.`comment_id` = lcom.`comment_id`)
+ FROM `{$BIT_DB_PREFIX}liberty_comments` lcom
+ INNER JOIN `{$BIT_DB_PREFIX}liberty_content` lc ON( lc.`content_id` = lcom.`content_id` )
+ LEFT JOIN `{$BIT_DB_PREFIX}boards_topics` th ON (th.`parent_id`=lcom.`content_id`)
+ LEFT JOIN `{$BIT_DB_PREFIX}boards_posts` post ON (post.`comment_id` = lcom.`comment_id`)
$joinSql
WHERE
lcom.`root_id`=lcom.`parent_id`
@@ -417,24 +421,20 @@ class BitBoardTopic extends LibertyMime {
";
$query_cant = "SELECT count(*)
- FROM `${BIT_DB_PREFIX}liberty_comments` lcom
- INNER JOIN `${BIT_DB_PREFIX}liberty_content` lc ON( lc.`content_id` = lcom.`content_id` )
- LEFT JOIN `${BIT_DB_PREFIX}boards_topics` th ON (th.`parent_id`=lcom.`content_id`)
- LEFT JOIN `${BIT_DB_PREFIX}boards_posts` post ON (post.`comment_id` = lcom.`comment_id`)
+ FROM `{$BIT_DB_PREFIX}liberty_comments` lcom
+ INNER JOIN `{$BIT_DB_PREFIX}liberty_content` lc ON( lc.`content_id` = lcom.`content_id` )
+ LEFT JOIN `{$BIT_DB_PREFIX}boards_topics` th ON (th.`parent_id`=lcom.`content_id`)
+ LEFT JOIN `{$BIT_DB_PREFIX}boards_posts` post ON (post.`comment_id` = lcom.`comment_id`)
$joinSql
WHERE
lcom.`root_id`=lcom.`parent_id`
$whereSql";
$result = $this->mDb->query( $query, $bindVars, $max_records, $offset );
- $ret = array();
+ $ret = [];
while( $res = $result->fetchRow() ) {
if (empty($res['anon_name'])) $res['anon_name'] = "Anonymous";
- if ($res['th_is_moved']>0) {
- $res['url']=BOARDS_PKG_URL."index.php?t=".$res['th_is_moved'];
- } else {
- $res['url']=BOARDS_PKG_URL."index.php?t=".$res['th_thread_id'];
- }
+ $res['url'] = ( $res['th_is_moved'] > 0 ) ? BOARDS_PKG_URL . "index.php?t=" . $res['th_is_moved'] : BOARDS_PKG_URL . "index.php?t=" . $res['th_thread_id'];
$llc_data = BitBoardTopic::getLastPost($res);
$res = array_merge($res,$llc_data);
BitBoardTopic::track($res);
@@ -452,11 +452,10 @@ class BitBoardTopic extends LibertyMime {
function getLastPost($data) {
global $gBitSystem;
- if ( $this->mDb->mType == 'firebird' ) {
- $substrSql = "SUBSTRING(lcom.`thread_forward_sequence` FROM 1 FOR 10)";
- } else {
- $substrSql = "".$this->mDb->substr()."(lcom.`thread_forward_sequence`, 1, 10)";
- }
+ $substrSql = $this->mDb->mType == 'firebird' || $this->mDb->mType == 'pdo'
+ ? "SUBSTRING(lcom.`thread_forward_sequence` FROM 1 FOR 10)"
+ : "".$this->mDb->substr()."(lcom.`thread_forward_sequence`, 1, 10)";
+
$whereSql = '';
if ($gBitSystem->isFeatureActive('boards_posts_anon_moderation')) {
$whereSql = " AND ((post.`is_approved` = 1) OR (lc.`user_id` >= 0))";
@@ -465,7 +464,7 @@ class BitBoardTopic extends LibertyMime {
$query="SELECT lc.`last_modified` AS llc_last_modified, lc.`user_id` AS llc_user_id, lc.`content_id` AS llc_content_id, lcom.`anon_name` AS l_anon_name
FROM `".BIT_DB_PREFIX."liberty_comments` lcom
INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON (lcom.`content_id` = lc.`content_id`)
- LEFT JOIN `${BIT_DB_PREFIX}boards_posts` post ON (post.`comment_id` = lcom.`comment_id`)
+ LEFT JOIN `{$BIT_DB_PREFIX}boards_posts` post ON (post.`comment_id` = lcom.`comment_id`)
WHERE (".$substrSql.") LIKE '".sprintf("%09d.",$data['th_thread_id'])."%' $whereSql
ORDER BY lc.`last_modified` DESC
";
@@ -476,11 +475,11 @@ class BitBoardTopic extends LibertyMime {
/**
* Generates the URL to the bitboard page
- * @return the link to display the page.
+ * @return string the link to display the page.
*/
public static function getDisplayUrlFromHash( &$pParamHash ) {
global $gBitSystem;
- $ret = NULL;
+ $ret = null;
if( !empty( $pParamHash['topic_id'] ) && static::verifyId( $pParamHash['topic_id'] ) ) {
$topicId = $pParamHash['topic_id'];
@@ -499,7 +498,7 @@ class BitBoardTopic extends LibertyMime {
return $ret;
}
- public static function isLocked( $pThreadId ) {
+ public static function isThreadLocked( $pThreadId ) {
global $gBitSystem;
/*
// remove mixed static / dynamic function invocation
@@ -514,10 +513,10 @@ class BitBoardTopic extends LibertyMime {
}
public static function isLockedMsg( $parent_id ) {
- // $parentComment = new LibertyComment(NULL,$parent_id);
+ // $parentComment = new LibertyComment(null,$parent_id);
// $topicId = $parentComment->mInfo['thread_forward_sequence'];
if (!empty($parent_id)) {
- return BitBoardTopic::isLocked($parent_id);
+ return BitBoardTopic::isThreadLocked($parent_id);
}
return false;
}
@@ -530,42 +529,48 @@ class BitBoardTopic extends LibertyMime {
if (!$pThreadId) {
$pThreadId = $this->mRootId;
}
- if (is_numeric($pThreadId)) {
- $topicId = sprintf("%09d.",$pThreadId);
- }
*/
- return $gBitSystem->mDb->getOne("SELECT SUM(`notify`) FROM `".BIT_DB_PREFIX."boards_tracking` WHERE topic_id=?", array( (int)$topicId ) );
+ $topicId = ( is_numeric( $pThreadId ) ) ? sprintf( "%09d.", $pThreadId ) : 0;
+
+ return $gBitSystem->mDb->getOne("SELECT SUM(`notify`) FROM `".BIT_DB_PREFIX."boards_tracking` WHERE topic_id=?", [ (int) $topicId ] );
}
return false;
}
- function getNotificationData($pThreadId) {
- global $gBitSystem, $gBitUser;
+ public function getNotification($pThreadId) {
+ global $gBitSystem;
if ($gBitSystem->isPackageActive('boards') && $gBitSystem->isFeatureActive('boards_thread_track')) {
if (!$pThreadId) {
$pThreadId = $this->mRootId;
}
+ BitBoardTopic::getNotificationData($pThreadId);
+ }
+ }
+ public static function getNotificationData($pThreadId) {
+ global $gBitSystem, $gBitUser;
+ if ($gBitSystem->isPackageActive('boards') && $gBitSystem->isFeatureActive('boards_thread_track')) {
if (is_numeric($pThreadId)) {
- $topicId = sprintf("%09d.",$pThreadId);
+ $topicId = \sprintf("%09d.",$pThreadId);
}
+
$query = "SELECT uu.user_id, uu.email, uu.login, uu.real_name, trk.`track_date`, trk.`notify` AS track_notify, trk.`notify_date` AS track_notify_date
FROM `".BIT_DB_PREFIX."boards_tracking` trk
LEFT JOIN `".BIT_DB_PREFIX."users_users` uu ON( uu.`user_id` = trk.`user_id` )
WHERE topic_id=?";
- $result = $gBitSystem->mDb->query( $query, array( $topicId ) );
- $ret = array();
- $ret['users']=array();
+ $result = $gBitSystem->mDb->query( $query, [ $topicId ] );
+ $ret = [];
+ $ret['users']=[];
while( $res = $result->fetchRow() ) {
- $res['user'] =( isset( $res['real_name'] )? $res['real_name'] : $res['login'] );
+ $res['user'] =( $res['real_name'] ?? $res['login'] );
$ret['users'][$res['login']] = $res;
}
- $ret['topic'] = new BitBoardTopic(intval($topicId));
+ $ret['topic'] = new BitBoardTopic(\intval($topicId));
$ret['topic']->load();
return $ret;
}
- return array();
+ return [];
}
function sendNotification($user) {
@@ -610,20 +615,20 @@ class BitBoardTopic extends LibertyMime {
$flip['is_locked']['req']=2;
$flip['is_locked']['id']=$arr['th_thread_id'];
$flip['is_locked']['idname']='t';
- $flip['is_locked']['up']='fa-lock';
- $flip['is_locked']['upname']=tra('Thread Locked');
- $flip['is_locked']['down']='fa-unlock';
- $flip['is_locked']['downname']=tra('Thread Unlocked');
+ $flip['is_locked']['up']='icon-lock';
+ $flip['is_locked']['upname']= KernelTools::tra('Thread Locked');
+ $flip['is_locked']['down']='icon-unlock';
+ $flip['is_locked']['downname']= KernelTools::tra('Thread Unlocked');
$flip['is_locked']['perm']='p_boards_update';
$flip['is_sticky']['state']=$arr['th_is_sticky'];
$flip['is_sticky']['req'] = 3;
$flip['is_sticky']['id']=$arr['th_thread_id'];
$flip['is_sticky']['idname']='t';
- $flip['is_sticky']['up']='fa-circle-exclamation';
- $flip['is_sticky']['upname']=tra('Sticky Thread');
- $flip['is_sticky']['down']='fa-list-ul';
- $flip['is_sticky']['downname']=tra('Non Sticky Thread');
+ $flip['is_sticky']['up']='icon-exclamation-sign';
+ $flip['is_sticky']['upname']= KernelTools::tra('Sticky Thread');
+ $flip['is_sticky']['down']='icon-list';
+ $flip['is_sticky']['downname']= KernelTools::tra('Non Sticky Thread');
$flip['is_sticky']['perm']='p_boards_update';
if ($gBitSystem->isFeatureActive('boards_thread_notification') && $gBitUser->isRegistered()) {
@@ -631,10 +636,10 @@ class BitBoardTopic extends LibertyMime {
$flip['notify']['req']=5;
$flip['notify']['id']=$arr['th_thread_id'];
$flip['notify']['idname']='t';
- $flip['notify']['up']='fa-bell';
- $flip['notify']['upname']=tra('Reply Notification');
+ $flip['notify']['up']='icon-bell-alt';
+ $flip['notify']['upname']= KernelTools::tra('Reply Notification');
$flip['notify']['down']='icon-bell';
- $flip['notify']['downname']=tra('Reply Notification Disabled');
+ $flip['notify']['downname']= KernelTools::tra('Reply Notification Disabled');
$flip['notify']['perm']='p_boards_read';
}
if ($gBitSystem->isFeatureActive('boards_thread_track') && $gBitUser->isRegistered()) {
@@ -642,10 +647,10 @@ class BitBoardTopic extends LibertyMime {
$flip['new']['req']=4;
$flip['new']['id']=$arr['th_thread_id'];
$flip['new']['idname']='t';
- $flip['new']['up']='fa-asterisk';
- $flip['new']['upname']=tra('New Posts');
-// $flip['new']['down']='fa-comment';
-// $flip['new']['downname']=tra('No new posts');
+ $flip['new']['up']='icon-asterisk';
+ $flip['new']['upname']= KernelTools::tra('New Posts');
+// $flip['new']['down']='icon-comment-alt';
+// $flip['new']['downname']= KernelTools::tra('No new posts');
$flip['new']['perm']='p_boards_read';
}
@@ -682,7 +687,7 @@ class BitBoardTopic extends LibertyMime {
global $gBitUser, $gBitSystem;
if ($gBitSystem->isFeatureActive('boards_thread_track') && $gBitUser->isRegistered()) {
$topicId = sprintf("%09d.",$this->mRootId);
- $ret = FALSE;
+ $ret = false;
if ($pState==null || !is_numeric($pState) || $pState > 1 || $pState<0) {
$this->mErrors[]=("Invalid current state");
} else {
@@ -702,7 +707,7 @@ class BitBoardTopic extends LibertyMime {
global $gBitUser, $gBitSystem;
if ($gBitSystem->isFeatureActive('boards_thread_track') && $gBitUser->isRegistered()) {
$topicId = sprintf("%09d.",$this->mRootId);
- $ret = FALSE;
+ $ret = false;
if ($pState==null || !is_numeric($pState) || $pState > 1 || $pState<0) {
$this->mErrors[]=("Invalid current state");
} else {
@@ -733,7 +738,7 @@ class BitBoardTopic extends LibertyMime {
global $gBitUser, $gBitSystem;
if($gBitUser->isRegistered() && ($gBitSystem->isFeatureActive('boards_thread_track') || $gBitSystem->isFeatureActive('boards_thread_notify'))) {
$selectSql .= ", trk.`track_date`, trk.`notify` AS track_notify, trk.`notify_date` AS track_notify_date ";
- $joinSql .= " LEFT JOIN `".BIT_DB_PREFIX."boards_tracking` trk ON (trk.`topic_id`=lcom.`thread_forward_sequence` AND ( trk.`user_id` = ".$gBitUser->mUserId." OR trk.`user_id` IS NULL ) ) ";
+ $joinSql .= " LEFT JOIN `".BIT_DB_PREFIX."boards_tracking` trk ON (trk.`topic_id`=lcom.`thread_forward_sequence` AND ( trk.`user_id` = ".$gBitUser->mUserId." OR trk.`user_id` IS null ) ) ";
}
}
@@ -745,11 +750,7 @@ class BitBoardTopic extends LibertyMime {
if (empty($res['llc_last_modified'])) {
$res['llc_last_modified']=0;
}
- if ($res['llc_last_modified']>$res['track_date']) {
- $res['track']['mod'] = true;
- } else {
- $res['track']['mod'] = false;
- }
+ $res['track']['mod'] = ( $res['llc_last_modified'] > $res['track_date'] ) ? true : false;
} else {
$res['track']['on'] = false;
}
@@ -775,4 +776,3 @@ class BitBoardTopic extends LibertyMime {
return $this->mRootObj;
}
}
-?>
diff --git a/includes/edit_topic_inc.php b/includes/edit_topic_inc.php
index c1cbbf2..952d7af 100644..100755
--- a/includes/edit_topic_inc.php
+++ b/includes/edit_topic_inc.php
@@ -24,7 +24,7 @@ if( isset( $_REQUEST["submit_mult"] ) && isset( $_REQUEST["checked"] ) && $_REQU
// user cancelled - just continue on, doing nothing
} elseif( empty( $_REQUEST['confirm'] ) ) {
$formHash['b'] = $_REQUEST['b'];
- $formHash['delete'] = TRUE;
+ $formHash['delete'] = true;
$formHash['submit_mult'] = 'remove_boards';
foreach( $_REQUEST["checked"] as $del ) {
$formHash['input'][] = '<input type="hidden" name="checked[]" value="'.$del.'"/>';
@@ -40,12 +40,12 @@ if( isset( $_REQUEST["submit_mult"] ) && isset( $_REQUEST["checked"] ) && $_REQU
$deleteComment = new LibertyComment( $deleteId );
if( $deleteComment->isValid() && $gBitUser->hasPermission('p_liberty_admin_comments') ) {
if( !$deleteComment->expunge() ) {
- $gBitSmarty->assignByRef( 'errors', $deleteComment->mErrors );
+ $gBitSmarty->assign( 'errors', $deleteComment->mErrors );
}
}
}
if( !empty( $errors ) ) {
- $gBitSmarty->assignByRef( 'errors', $errors );
+ $gBitSmarty->assign( 'errors', $errors );
}
}
}
diff --git a/includes/list_boards_inc.php b/includes/list_boards_inc.php
index c269de1..f368e0c 100644..100755
--- a/includes/list_boards_inc.php
+++ b/includes/list_boards_inc.php
@@ -23,8 +23,8 @@ $gBitSystem->verifyPackage( 'boards' );
$gBitSystem->verifyPermission( 'p_boards_read' );
// Get a list of boards
-$ns = array();
-$board_all_cids =array();
+$ns = [];
+$board_all_cids =[];
// @TODO move pigeonholes to its own file library or something
if($gBitSystem->isPackageActive('pigeonholes')) {
@@ -33,11 +33,11 @@ if($gBitSystem->isPackageActive('pigeonholes')) {
$p = new Pigeonholes();
$s = new LibertyStructure();
- $listHash = array('load_only_root'=> TRUE);
+ $listHash = array('load_only_root'=> true);
$l = $p->getList($listHash);
foreach ($l as $e) {
$d = $s->getSubTree( $e['structure_id'] );
- $d_o = array();
+ $d_o = [];
foreach ($d as $c) {
$pos_var = &$d_o;
if($c['level']!=0) {
@@ -45,22 +45,22 @@ if($gBitSystem->isPackageActive('pigeonholes')) {
$pos_var = &$d_o;
foreach ($pos as $pos_v) {
if (!isset($pos_var['children'])) {
- $pos_var['children']=array();
+ $pos_var['children']=[];
}
if (!isset($pos_var['children'][$pos_v-1])) {
- $pos_var['children'][$pos_v-1]=array();
+ $pos_var['children'][$pos_v-1]=[];
}
$pos_var = &$pos_var['children'][$pos_v-1];
}
}
if (empty($pos_var['data'])) {
- $pos_var['children']=array();
+ $pos_var['children']=[];
$pos_var['data']=$c;
- $mlHash=array();
+ $mlHash=[];
$mlHash['content_id']=$c['content_id'];
$mlHash['content_type_guid']=BITBOARD_CONTENT_TYPE_GUID;
$pos_var['members']=$p->getMemberList($mlHash);
- $board_cids =array();
+ $board_cids =[];
foreach ($pos_var['members'] as $boardKey) {
$board_cids[] = $boardKey['content_id'];
}
@@ -79,13 +79,13 @@ if($gBitSystem->isPackageActive('pigeonholes')) {
}
// get our boards list
-$ret =array();
+$ret =[];
if($gBitSystem->isPackageActive('pigeonholes')) {
// $ret['data']['title']="Uncategorised Boards";
} else {
// $ret['data']['title']="Board List";
}
-$ret['children']=array();
+$ret['children']=[];
$listHash = array('nboards'=>$board_all_cids,'paginationOff'=>'y');
$board = new BitBoard();
$ret['members'] = $board->getList($listHash);
@@ -97,7 +97,7 @@ if (count($ret['members']) == 1) {
$ns[] = $ret;
}
-$gBitSmarty->assignByRef('ns',$ns);
+$gBitSmarty->assign('ns',$ns);
// this might be for getting a count of nested boards - not entirely sure, if you figure it out please clarify this comment.
function countBoards(&$a) {
diff --git a/includes/lookup_inc.php b/includes/lookup_inc.php
index 68a7937..69b33d2 100644..100755
--- a/includes/lookup_inc.php
+++ b/includes/lookup_inc.php
@@ -11,12 +11,12 @@ require_once( BOARDS_PKG_CLASS_PATH.'BitBoardTopic.php');
require_once( BOARDS_PKG_CLASS_PATH.'BitBoardPost.php' );
require_once( BOARDS_PKG_CLASS_PATH.'BitBoard.php' );
// if t supplied, use that
-if( @BitBase::verifyId( $_REQUEST['t'] ) ) {
+if( BitBase::verifyId( $_REQUEST['t'] ?? 0 ) ) {
$gContent = new BitBoardTopic( $_REQUEST['t'] );
// if p supplied, use that
-} elseif( @BitBase::verifyId( $_REQUEST['p'] ) ) {
+} elseif( BitBase::verifyId( $_REQUEST['p'] ?? 0 ) ) {
$gContent = new BitBoardPost( $_REQUEST['p'] );
-} elseif( @BitBase::verifyId( $_REQUEST['b'] ) ) {
+} elseif( BitBase::verifyId( $_REQUEST['b'] ?? 0 ) ) {
$gContent = new BitBoard( $_REQUEST['b'] );
} elseif (isset($_REQUEST['p'])) {
$gContent = new BitBoardPost();
@@ -28,6 +28,6 @@ if( @BitBase::verifyId( $_REQUEST['t'] ) ) {
}
$gContent->load();
-$gBitSmarty->assignByRef( "gContent", $gContent );
+$gBitSmarty->assign( "gContent", $gContent );
?>
diff --git a/includes/user_preferences_inc.php b/includes/user_preferences_inc.php
index 201acd9..27a56bd 100644..100755
--- a/includes/user_preferences_inc.php
+++ b/includes/user_preferences_inc.php
@@ -1,26 +1,28 @@
<?php
+
+use Bitweaver\Liberty\LibertyContent;
/**
* @package boards
* @subpackage functions
*/
-$boardsSettings = array(
+$boardsSettings = [
/*
- 'boards_show_avatars' => array(
+ 'boards_show_avatars' => [
'pref' => 'boards_show_avatars',
'label' => "Show Avatars",
'type' => "checkbox",
'default' => 'y',
'note' => "",
- ),
+ ],
*/
-);
+];
if (!empty( $_REQUEST['boards'] ) ) {
foreach( $boardsSettings as $option => $op) {
if ($op['type']=="checkbox") {
- $editUser->storePreference($op['pref'], !empty( $_REQUEST['boards'][$option]) ? 'y' : 'n', 'users');
+ $editUser->storePreference($op['pref'], !empty( $_REQUEST['boards'][$option]) ? 'y' : 'n');
} else {
- $editUser->storePreference($op['pref'], !empty( $_REQUEST['boards'][$option]) ? $_REQUEST['boards'][$option] : '', 'users');
+ $editUser->storePreference($op['pref'], !empty( $_REQUEST['boards'][$option]) ? $_REQUEST['boards'][$option] : '');
}
}
}
@@ -38,7 +40,7 @@ if (!empty($content_type) && !empty($content_data)) {
$signatureContent->mInfo['format_guid']=$editUser->getPreference('signature_content_type');
$signatureContent->mInfo['data']=$content_data;
}
-$gBitSmarty->assignByRef( 'signatureContent', $signatureContent );
+$gBitSmarty->assign( 'signatureContent', $signatureContent );
if( isset( $_REQUEST["format_guid"] ) ) {
@@ -60,8 +62,6 @@ if( !empty( $_REQUEST["save_bitboarduprefs"] ) ) {
// Check if all Request values are delivered, and if not, set them
// to avoid error messages. This can happen if some features are
// disabled
- $editUser->storePreference('signature_content_type',$signatureContent->mInfo['format_guid'], 'users');
- $editUser->storePreference('signature_content_data',$signatureContent->mInfo['data'], 'users');
+ $editUser->storePreference('signature_content_type',$signatureContent->mInfo['format_guid']);
+ $editUser->storePreference('signature_content_data',$signatureContent->mInfo['data']);
}
-
-?>
diff --git a/includes/view_board_inc.php b/includes/view_board_inc.php
index 98a26a0..6b6fa33 100644..100755
--- a/includes/view_board_inc.php
+++ b/includes/view_board_inc.php
@@ -11,14 +11,16 @@
/**
* required setup
*/
-require_once( '../kernel/includes/setup_inc.php' );
+namespace Bitweaver\Boards;
+require_once '../kernel/includes/setup_inc.php';
+use Bitweaver\BitBase;
+use Bitweaver\HttpStatusCodes;
// Is package installed and enabled
$gBitSystem->verifyPackage( 'boards' );
// if we're getting a migrate id then lets move on right away
-if ( @BitBase::verifyId( $_REQUEST['migrate_board_id'] ) ) {
- require_once( BOARDS_PKG_CLASS_PATH.'BitBoard.php' );
+if ( BitBase::verifyId( $_REQUEST['migrate_board_id'] ?? 0 ) ) {
if( $_REQUEST['b'] = BitBoard::lookupByMigrateBoard( $_REQUEST['migrate_board_id'] ) ) {
bit_redirect( BOARDS_PKG_URL.'index.php?b='. $_REQUEST['b'] );
@@ -28,10 +30,10 @@ if ( @BitBase::verifyId( $_REQUEST['migrate_board_id'] ) ) {
$_REQUEST['board_id'] = BitBase::getParameter( $_REQUEST, 'b' );
// Load up the board
-require_once( BOARDS_PKG_INCLUDE_PATH.'lookup_inc.php' );
+require_once BOARDS_PKG_INCLUDE_PATH.'lookup_inc.php';
if( !$gContent->isValid() ) {
- $gBitSystem->fatalError( "The board you requested could not be found. <a href='".BOARDS_PKG_URL."'>View all boards</a>", NULL, NULL, HttpStatusCodes::HTTP_GONE );
+ $gBitSystem->fatalError( "The board you requested could not be found. <a href='".BOARDS_PKG_URL."'>View all boards</a>", null, null, HttpStatusCodes::HTTP_GONE );
}
// approve or reject ananymous comments
@@ -43,7 +45,7 @@ if (!empty($_REQUEST['action'])) {
$gBitUser->verifyTicket();
// Load up the comment as a board post
- require_once( BOARDS_PKG_CLASS_PATH.'BitBoardPost.php' );
+ require_once BOARDS_PKG_CLASS_PATH.'BitBoardPost.php';
$comment = new BitBoardPost($_REQUEST['comment_id']);
$comment->loadComment();
@@ -75,7 +77,7 @@ if (!empty($_REQUEST['action'])) {
*
* @TODO perhaps move this into the action process above
*/
-require_once( BOARDS_PKG_INCLUDE_PATH.'edit_topic_inc.php' );
+require_once BOARDS_PKG_INCLUDE_PATH.'edit_topic_inc.php';
// Ok finally we can get on with viewing our board
@@ -89,10 +91,10 @@ $commentsParentId=$gContent->mContentId;
$comments_return_url= BOARDS_PKG_URL."index.php?b=".urlencode($gContent->mBitBoardId);
// @TODO not clear why we load up comments and topics after this when its likely to get both. If someone figures it out please clarify.
-require_once( BOARDS_PKG_INCLUDE_PATH.'boards_comments_inc.php' );
+require_once BOARDS_PKG_INCLUDE_PATH.'boards_comments_inc.php';
// get the topics for this board
-require_once( BOARDS_PKG_CLASS_PATH.'BitBoardTopic.php' );
+require_once BOARDS_PKG_CLASS_PATH.'BitBoardTopic.php';
$threads = new BitBoardTopic( $gContent->mContentId );
@@ -101,16 +103,15 @@ $threads->mRootObj = $gContent;
$threadsListHash = $_REQUEST;
$threadList = $threads->getList( $threadsListHash );
-$gBitSmarty->assignByRef( 'threadList', $threadList );
+$gBitSmarty->assign( 'threadList', $threadList );
// getList() has now placed all the pagination information in $_REQUEST['listInfo']
-$gBitSmarty->assignByRef( 'listInfo', $threadsListHash['listInfo'] );
+$gBitSmarty->assign( 'listInfo', $threadsListHash['listInfo'] );
-$gBitSmarty->assignByRef( 'board', $gContent );
+$gBitSmarty->assign( 'board', $gContent );
$gBitSmarty->assign( 'cat_url', BOARDS_PKG_URL."index.php"); //?ct=".urlencode($gContent->mInfo['content_type_guid']));
$gBitThemes->loadAjax( 'mochikit' );
// Display the template
-$gBitSystem->display( 'bitpackage:boards/list_topics.tpl', tra( 'Message Board Threads: ' . $gContent->getField('title') ) , array( 'display_mode' => 'display' ));
-?>
+$gBitSystem->display( 'bitpackage:boards/list_topics.tpl', tra( 'Message Board Threads: ' . $gContent->getField('title') ) , array( 'display_mode' => 'display' )); \ No newline at end of file
diff --git a/includes/view_topic_inc.php b/includes/view_topic_inc.php
index efee35e..ceec213 100644..100755
--- a/includes/view_topic_inc.php
+++ b/includes/view_topic_inc.php
@@ -7,19 +7,19 @@
/**
* required setup
*/
-require_once( '../kernel/includes/setup_inc.php' );
-
-// we need all three
-require_once( BOARDS_PKG_CLASS_PATH.'BitBoard.php' );
-require_once( BOARDS_PKG_CLASS_PATH.'BitBoardTopic.php' );
-require_once( BOARDS_PKG_CLASS_PATH.'BitBoardPost.php' );
+use Bitweaver\BitBase;
+use Bitweaver\HttpStatusCodes;
+use Bitweaver\Boards\BitBoard;
+use Bitweaver\Boards\BitBoardTopic;
+use Bitweaver\Boards\BitBoardPost;
+require_once '../kernel/includes/setup_inc.php';
// if we're getting a migrate id then lets move on right away
-if( @BitBase::verifyId( $_REQUEST['migrate_topic_id'] ) ) {
+if( BitBase::verifyId( $_REQUEST['migrate_topic_id'] ?? 0 ) ) {
if( $_REQUEST['t'] = BitBoardTopic::lookupByMigrateTopic( $_REQUEST['migrate_topic_id'] ) ) {
bit_redirect( BOARDS_PKG_URL.'index.php?t='. $_REQUEST['t'] );
}
-} elseif( @BitBase::verifyId( $_REQUEST['migrate_post_id'] ) ) {
+} elseif( BitBase::verifyId( $_REQUEST['migrate_post_id'] ?? 0 ) ) {
if( $_REQUEST['t'] = BitBoardTopic::lookupByMigratePost( $_REQUEST['migrate_post_id'] ) ) {
bit_redirect( BOARDS_PKG_URL.'index.php?t='. $_REQUEST['t'] );
}
@@ -34,7 +34,7 @@ if (!empty($_REQUEST['action'])) {
$comment = new BitBoardPost($_REQUEST['comment_id']);
$comment->loadComment();
if (!$comment->isValid()) {
- $gBitSystem->fatalError( tra("Invalid Comment"), NULL, NULL, HttpStatusCodes::HTTP_GONE );
+ $gBitSystem->fatalError( tra("Invalid Comment"), null, null, HttpStatusCodes::HTTP_GONE );
}
switch ($_REQUEST['action']) {
case 1:
@@ -59,7 +59,7 @@ $thread = new BitBoardTopic($_REQUEST['t']);
$thread->load();
if( !$thread->isValid() ) {
- $gBitSystem->fatalError( tra("Unknown discussion"), NULL, NULL, HttpStatusCodes::HTTP_GONE );
+ $gBitSystem->fatalError( tra("Unknown discussion"), null, null, HttpStatusCodes::HTTP_GONE );
}
$thread->verifyViewPermission();
@@ -67,10 +67,10 @@ $thread->verifyViewPermission();
// load up the root board we need it
$gBoard = new BitBoard(null,$thread->mInfo['board_content_id']);
$gBoard->load();
-$gBitSmarty->assignByRef( 'board', $gBoard );
+$gBitSmarty->assign( 'board', $gBoard );
// force root board to be gContent
$gContent = &$gBoard;
-$gBitSmarty->assignByRef('gContent', $gContent);
+$gBitSmarty->assign('gContent', $gContent);
// if you know what this is please comment it
@@ -79,7 +79,7 @@ if (empty($thread->mInfo['th_root_id'])) {
//Invalid as a result of rejecting the post, redirect to the board
bit_redirect( $gBoard->getDisplayUrl() );
} else {
- $gBitSystem->fatalError(tra( "Invalid topic selection." ), NULL, NULL, HttpStatusCodes::HTTP_GONE );
+ $gBitSystem->fatalError(tra( "Invalid topic selection." ), null, null, HttpStatusCodes::HTTP_GONE );
}
}
@@ -90,8 +90,8 @@ $thread->invokeServices( 'content_display_function', $displayHash );
$thread->readTopic();
-$gBitSmarty->assignByRef( 'thread', $thread );
-$gBitSmarty->assign( 'topic_locked', BitBoardTopic::isLocked( $thread->mCommentContentId ) );
+$gBitSmarty->assign( 'thread', $thread );
+$gBitSmarty->assign( 'topic_locked', BitBoardTopic::isThreadLocked( $thread->mCommentContentId ) );
// Get the thread of comments
@@ -106,7 +106,7 @@ if( empty( $_REQUEST["comments_style"] ) ) {
$_REQUEST["comments_style"] = "flat";
}
-require_once( BOARDS_PKG_INCLUDE_PATH.'boards_comments_inc.php' );
+require_once BOARDS_PKG_INCLUDE_PATH.'boards_comments_inc.php';
if( $gBitUser->isRegistered() ) {
$postComment['registration_date']=$gBitUser->mInfo['registration_date'];
@@ -116,7 +116,7 @@ if( $gBitUser->isRegistered() ) {
// display warnings - might be for edit processes - if you know please comment
-$warnings = array();
+$warnings = [];
if (!empty($_REQUEST['warning'])) {
foreach ($_REQUEST['warning'] as $id => $state) {
if (strcasecmp($state,'show')==0) {
@@ -124,11 +124,10 @@ if (!empty($_REQUEST['warning'])) {
}
}
}
-$gBitSmarty->assignByRef('warnings',$warnings);
+$gBitSmarty->assign('warnings',$warnings);
// ajax support
$gBitThemes->loadAjax( 'mochikit' );
$gBitSystem->display('bitpackage:boards/list_posts.tpl', "Show Thread: " . $thread->getField('title') , array( 'display_mode' => 'display' ));
-?>
diff --git a/index.php b/index.php
index 0783f2e..3b4c578 100644..100755
--- a/index.php
+++ b/index.php
@@ -4,7 +4,7 @@
// All Rights Reserved. See below for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details.
// Initialization
-require_once( '../kernel/includes/setup_inc.php' );
+require_once '../kernel/includes/setup_inc.php';
$gBitSystem->verifyPackage( 'boards' );
if( !empty( $_REQUEST['t'] ) || !empty( $_REQUEST['migrate_topic_id'] ) || !empty( $_REQUEST['migrate_post_id'] ) ) {
diff --git a/mailing_list.php b/mailing_list.php
index d6c5ee0..4f2e0c4 100644..100755
--- a/mailing_list.php
+++ b/mailing_list.php
@@ -12,7 +12,7 @@
/**
* required setup
*/
-require_once( '../kernel/includes/setup_inc.php' );
+require_once '../kernel/includes/setup_inc.php';
require_once( BOARDS_PKG_CLASS_PATH.'BitBoardTopic.php' );
require_once( BOARDS_PKG_CLASS_PATH.'BitBoardPost.php' );
require_once( BOARDS_PKG_CLASS_PATH.'BitBoard.php' );
@@ -37,7 +37,7 @@ if( $boardSyncInbox = BitBoard::getBoardSyncInbox() ) {
if( !empty( $_REQUEST['create_list'] ) ) {
//------ Email List ------//
if( !($error = mailman_newlist( array( 'listname' => $_REQUEST['boards_mailing_list'], 'admin-password'=>$_REQUEST['boards_mailing_list_password'], 'listadmin-addr'=>$gBitUser->getField( 'email' ) ) )) ) {
- $gContent->storePreference( 'boards_mailing_list', !empty( $_REQUEST['boards_mailing_list'] ) ? $_REQUEST['boards_mailing_list'] : NULL );
+ $gContent->storePreference( 'boards_mailing_list', !empty( $_REQUEST['boards_mailing_list'] ) ? $_REQUEST['boards_mailing_list'] : null );
$gContent->storePreference( 'boards_mailing_list_password', $_REQUEST['boards_mailing_list_password'] );
} else {
$gBitSmarty->assign( 'errorMsg', $error );
@@ -51,7 +51,7 @@ if( !empty( $_REQUEST['create_list'] ) ) {
} elseif( !empty( $_REQUEST['delete_list'] ) ) {
if( $gContent->getPreference( 'boards_mailing_list' ) ) {
if( empty( $_REQUEST['confirm'] ) ) {
- $formHash['delete_list'] = TRUE;
+ $formHash['delete_list'] = true;
$formHash['b'] = $gContent->getField( 'board_id' );
$gBitSystem->confirmDialog( $formHash,
array(
@@ -61,8 +61,8 @@ if( !empty( $_REQUEST['create_list'] ) ) {
);
} else {
if( !($error = mailman_rmlist( $gContent->getPreference( 'boards_mailing_list' ) )) ) {
- $gContent->storePreference( 'boards_mailing_list', NULL );
- $gContent->storePreference( 'boards_mailing_list_password', NULL );
+ $gContent->storePreference( 'boards_mailing_list', null );
+ $gContent->storePreference( 'boards_mailing_list_password', null );
bit_redirect( BOARDS_PKG_URL."mailing_list.php?b=".$gContent->getField( 'board_id' ) );
} else {
$gBitSmarty->assign( 'errorMsg', $error );
@@ -70,7 +70,7 @@ if( !empty( $_REQUEST['create_list'] ) ) {
}
}
} elseif( !empty( $_REQUEST['save_list_address'] ) ) {
- $gContent->storePreference( 'board_sync_list_address', (!empty( $_REQUEST['board_sync_list_address'] ) ? $_REQUEST['board_sync_list_address'] : NULL ) );
+ $gContent->storePreference( 'board_sync_list_address', (!empty( $_REQUEST['board_sync_list_address'] ) ? $_REQUEST['board_sync_list_address'] : null ) );
} elseif( $gContent->getPreference( 'boards_mailing_list' ) ) {
// check for submits that need boards_mailing_list
if( !empty( $_REQUEST['subscribe_boardsync'] ) ) {
@@ -93,13 +93,13 @@ if( $gContent->getBoardMailingList() ) {
$gBitSmarty->assign( 'boardsMailingList', $gContent->getBoardMailingList() );
if ( $gContent->hasUserPermission( 'p_boards_boards_members_view' ) ){
$members = mailman_list_members( $gContent->getPreference( 'boards_mailing_list' ) );
- $gBitSmarty->assignByRef( 'listMembers', $members );
+ $gBitSmarty->assign( 'listMembers', $members );
}
} else {
$gBitSmarty->assign( 'suggestedListName', preg_replace( '/[^a-z0-9]/', '', strtolower( $gContent->getTitle() ) ) );
}
// display
-$gBitSmarty->assignByRef( 'board', $gContent );
+$gBitSmarty->assign( 'board', $gContent );
$gBitSystem->display( "bitpackage:boards/mailing_list.tpl", $gContent->getTitle() ." ". tra( 'Message Board Mailing List' ) , array( 'display_mode' => 'list' ));
?>
diff --git a/modules/help_mod_recent_posts.tpl b/modules/help_mod_recent_posts.tpl
index 0c34f39..b0d4272 100644..100755
--- a/modules/help_mod_recent_posts.tpl
+++ b/modules/help_mod_recent_posts.tpl
@@ -1,10 +1,10 @@
<p class="note">
- {tr}Recent board postings. If set, the parameter <kbd>b</kbd> specifies a board to display.{/tr}
+ Recent board postings. If set, the parameter <kbd>b</kbd> specifies a board to display.
<br />
- <span class="example">{tr}Example:{/tr} <kbd>b=5</kbd></span>
+ <span class="example">Example: <kbd>b=5</kbd></span>
</p>
<dl>
<dt class="param"><kbd>b</kbd></dt>
- <dd><em>{tr}Numeric{/tr}</em></dd>
+ <dd><em>Numeric</em></dd>
</dl> \ No newline at end of file
diff --git a/modules/mod_recent_posts.php b/modules/mod_recent_posts.php
index b677497..99af120 100644..100755
--- a/modules/mod_recent_posts.php
+++ b/modules/mod_recent_posts.php
@@ -32,7 +32,7 @@ if( !empty( $module_params['b'] ) ) {
} elseif( !empty( $_REQUEST['b'] ) && empty( $module_params['all_boards'] ) ) {
$listHash['board_id'] = $_REQUEST['b'];
}
-$_template->tpl_vars['modRecentPostsBoardId'] = new Smarty_variable( !empty( $listHash['board_id'] ) );
+$gBitSmarty->assign( 'modRecentPostsBoardId', !empty( $listHash['board_id'] ) );
if( BitBase::verifyId( $gQueryUserId ) ) {
$listHash['user_id'] = $gQueryUserId;
@@ -40,7 +40,7 @@ if( BitBase::verifyId( $gQueryUserId ) ) {
$post = new BitBoardPost();
if( $postList = $post->getList( $listHash ) ) {
- $_template->tpl_vars['modLastBoardPosts'] = new Smarty_variable( $postList );
+ $gBitSmarty->assign( 'modLastBoardPosts', $postList );
}
?>
diff --git a/modules/mod_recent_posts.tpl b/modules/mod_recent_posts.tpl
index 8981422..ae3970c 100644..100755
--- a/modules/mod_recent_posts.tpl
+++ b/modules/mod_recent_posts.tpl
@@ -1,16 +1,16 @@
{strip}
-{if $gBitSystem->isPackageActive('boards') && $modLastBoardPosts}
+{if $gBitSystem->isPackageActive('boards') and $modLastBoardPosts}
{bitmodule title=$moduleTitle name="last_board_posts"}
<ul class="list-unstyled">
{section name=ix loop=$modLastBoardPosts}
<li class="{cycle values="odd,even"}">
- <a title="{tr}Author:{/tr} {displayname nolink=1 hash=$modLastBoardPosts[ix]}" href="{$modLastBoardPosts[ix].display_url}">{$modLastBoardPosts[ix].title|default:"Comment"|escape:html}</a>
+ <a title="Author: {displayname nolink=1 hash=$modLastBoardPosts[ix]}" href="{$modLastBoardPosts[ix].display_url}">{$modLastBoardPosts[ix].title|default:"Comment"|escape:html}</a>
<div class="date">
{displayname hash=$modLastBoardPosts[ix]}, {$modLastBoardPosts[ix].created|bit_short_date}
</div>
</li>
{/section}
- <li class="more"><a class="more" href="{$smarty.const.BOARDS_PKG_URL}{if $modRecentPostsBoardId}index.php?b={$modRecentPostsBoardId}{/if}">{tr}Show more{/tr} &hellip;</a></li>
+ <li class="more"><a class="more" href="{$smarty.const.BOARDS_PKG_URL}{if $modRecentPostsBoardId}index.php?b={$modRecentPostsBoardId}{/if}">Show more &hellip;</a></li>
</ul>
{/bitmodule}
{/if}
diff --git a/rss.php b/rss.php
index ca6b13e..432fabb 100644..100755
--- a/rss.php
+++ b/rss.php
@@ -9,7 +9,7 @@
/**
* required setup
*/
-require_once( '../kernel/includes/setup_inc.php' );
+require_once '../kernel/includes/setup_inc.php';
$gBitSystem->verifyPackage( 'boards' );
$gBitSystem->verifyPackage( 'rss' );
@@ -41,7 +41,7 @@ if( !empty( $_REQUEST['get_feed'] ) ) {
}
}
$feedlink['url'] .= 'version='.$_REQUEST['format'].( $gBitSystem->getConfig( 'rssfeed_httpauth' ) && $gBitUser->isRegistered()?'&httpauth=y':'');
- $feedlink['title'] = ( $gContent->getField('title') != NULL ?$gContent->getField('title'):tra('Boards')).' - '.$feedFormat[$_REQUEST['format']];
+ $feedlink['title'] = ( $gContent->getField('title') != null ?$gContent->getField('title'):tra('Boards')).' - '.$feedFormat[$_REQUEST['format']];
$feedlink['format'] = $_REQUEST['format'];
} else {
$feedlink['format'] = $gBitSystem->getConfig( 'rssfeed_default_version' );
diff --git a/styles/boards.css b/styles/boards.css
index 9453b67..9f478bf 100644..100755
--- a/styles/boards.css
+++ b/styles/boards.css
@@ -1,25 +1,82 @@
-form.mb-threading div {display:inline;}
-.boards .mb-threading {}
+form.mb-threading div {
+ display: inline;
+}
-.boards tr.odd.unapproved {background:#faa;}
-.boards tr.even.unapproved {background:#fac;}
-.boards tr.odd.moved {background:#aaf;}
-.boards tr.even.moved {background:#acf;}
-.boards div.indent .indent {margin-left:2em;}
-.boards tr.highlight {background:#fca;}
-.boards .mb-post .warning {}
+.boards .mb-threading {}
-.boards .mb-post .indent1 {margin-left:20px;}
-.boards .mb-post .indent2 {margin-left:35px;}
-.boards .mb-post .indent3 {margin-left:50px;}
-.boards .mb-post .indent4 {margin-left:60px;}
-.boards .mb-post .indent5 {margin-left:70px;}
-.boards .mb-post .indent6 {margin-left:80px;}
-.boards .mb-post .indent7 {margin-left:90px;}
+.boards tr.odd.unapproved {
+ background: #faa;
+}
-.boards .mb-post {clear:both;}
-.boards .mb-post .content {width:auto}
-.boards .mb-post .header {}
-.boards .mb-post .userinfo {float:left;width:140px;}
-.boards .mb-post .showavatar {margin-left:145px;}
-.boards .mb-post .signature {clear:both;}
+.boards tr.even.unapproved {
+ background: #fac;
+}
+
+.boards tr.odd.moved {
+ background: #aaf;
+}
+
+.boards tr.even.moved {
+ background: #acf;
+}
+
+.boards div.indent .indent {
+ margin-left: 2em;
+}
+
+.boards tr.highlight {
+ background: #fca;
+}
+
+.boards .mb-post .warning {}
+
+.boards .mb-post .indent1 {
+ margin-left: 20px;
+}
+
+.boards .mb-post .indent2 {
+ margin-left: 35px;
+}
+
+.boards .mb-post .indent3 {
+ margin-left: 50px;
+}
+
+.boards .mb-post .indent4 {
+ margin-left: 60px;
+}
+
+.boards .mb-post .indent5 {
+ margin-left: 70px;
+}
+
+.boards .mb-post .indent6 {
+ margin-left: 80px;
+}
+
+.boards .mb-post .indent7 {
+ margin-left: 90px;
+}
+
+.boards .mb-post {
+ clear: both;
+}
+
+.boards .mb-post .content {
+ width: auto
+}
+
+.boards .mb-post .header {}
+
+.boards .mb-post .userinfo {
+ float: left;
+ width: 140px;
+}
+
+.boards .mb-post .showavatar {
+ margin-left: 145px;
+}
+
+.boards .mb-post .signature {
+ clear: both;
+} \ No newline at end of file
diff --git a/templates/admin_boards.tpl b/templates/admin_boards.tpl
index c6f3ca8..e320d8e 100644..100755
--- a/templates/admin_boards.tpl
+++ b/templates/admin_boards.tpl
@@ -10,25 +10,25 @@
{section name=ix loop=$boards}
<option value="{$boards[ix].boards_id|escape}" {if $boards[ix].boards_id eq $home_bitboard}selected="selected"{/if}>{$boards[ix].title|escape|truncate:20:"...":true}</option>
{sectionelse}
- <option>{tr}No records found{/tr}</option>
+ <option>No records found</option>
{/section}
</select>
{/forminput}
</div>
<div class="form-group submit">
- <input type="submit" class="btn btn-default" name="homeTabSubmit" value="{tr}Change preferences{/tr}" />
+ <input type="submit" class="btn btn-default" name="homeTabSubmit" value="Change preferences" />
</div>
{/legend}
*}
{legend legend="List Settings"}
- <input type="hidden" name="page" value="{$page}" />
+ <input type="hidden" name="page" value="{$page|default:''}" />
{foreach from=$formBitBoardsLists key=item item=output}
<div class="form-group">
{formlabel label=$output.label for=$item}
{forminput label="checkbox"}
{html_checkboxes name="$item" values="y" checked=$gBitSystem->getConfig($item) labels=false id=$item}
- {formhelp note=$output.note page=$output.page}
+ {formhelp note=$output.note page=$output.page|default:''}
{/forminput}
</div>
{/foreach}
@@ -38,7 +38,7 @@
<div class="form-group">
{forminput}
<h2>List to Board Sync</h2>
- <p>{tr}List to Board Sync allows a bitweaver board to mirror messages that are posted to a mailing list. A single, master email inbox entered below is used for *all* email list subscriptions. Then, configure individual boards to indicate which mailing list to which it is subscribed. The Board Sync cron script will import messages from the master email inbox.{/tr}</p>
+ <p>List to Board Sync allows a bitweaver board to mirror messages that are posted to a mailing list. A single, master email inbox entered below is used for *all* email list subscriptions. Then, configure individual boards to indicate which mailing list to which it is subscribed. The Board Sync cron script will import messages from the master email inbox.</p>
{/forminput}
</div>
{foreach from=$formBitBoardsSync key=item item=output}
@@ -46,7 +46,7 @@
{formlabel label=$output.label for=$item}
{forminput}
<input type="text" class="form-control" name="{$item}" value="{$gBitSystem->getConfig($item)}" id={$item}" />
- {formhelp note=$output.note page=$output.page}
+ {formhelp note=$output.note page=$output.page|default:''}
{/forminput}
</div>
{/foreach}
@@ -54,7 +54,7 @@
<div class="form-group">
{forminput}
<h2>Board to List Sync</h2>
- <p>{tr}Board to List Sync is the opposite of the above. It allows a bitweaver board to send a message to mailing list. You must complete the "List to Board Sync" configuration above for this feature to work.{/tr} {tr}Please see <a href="http://www.bitweaver.org/wiki/BoardsEmailListConfig">configuration requirements</a> prior to utilizing this feature.{/tr}</p>
+ <p>Board to List Sync is the opposite of the above. It allows a bitweaver board to send a message to mailing list. You must complete the "List to Board Sync" configuration above for this feature to work. Please see <a href="http://www.bitweaver.org/wiki/BoardsEmailListConfig">configuration requirements</a> prior to utilizing this feature.</p>
{/forminput}
</div>
@@ -69,7 +69,7 @@
{formlabel label=$output.label for=$item}
{forminput label="checkbox"}
{html_checkboxes name="$item" values="y" checked=$gBitSystem->getConfig($item) labels=false id=$item}
- {formhelp note=$output.note page=$output.page}
+ {formhelp note=$output.note page=$output.page|default:''}
{/forminput}
</div>
{/foreach}
@@ -122,7 +122,7 @@
</div>
{/legend}
<div class="form-group submit">
- <input type="submit" class="btn btn-default" name="listTabSubmit" value="{tr}Change preferences{/tr}" />
+ <input type="submit" class="btn btn-default" name="listTabSubmit" value="Change preferences" />
</div>
{/form}
{/strip}
diff --git a/templates/board_assign.tpl b/templates/board_assign.tpl
index 4867e38..90cd151 100644..100755
--- a/templates/board_assign.tpl
+++ b/templates/board_assign.tpl
@@ -1,7 +1,7 @@
{strip}
<div class="admin boards">
<div class="header">
- <h1>{tr}Assign Content to Boards{/tr}</h1>
+ <h1>Assign Content to Boards</h1>
</div>
<div class="body">
@@ -36,7 +36,7 @@
</div>
<div class="form-group submit">
- <input type="submit" class="btn btn-default" value="{tr}Assign Content to Board{/tr}" name="action" />
+ <input type="submit" class="btn btn-default" value="Assign Content to Board" name="action" />
</div>
{/form}
{else}
@@ -47,7 +47,7 @@
{if $board.map}
{capture assign=title}
{if ! $board.integrity}
- {booticon iname="fa-triangle-exclamation" iexplain="Integrity Check Failed"}
+ {booticon iname="icon-warning-sign" iexplain="Integrity Check Failed"}
{/if}
{$board.title|escape}
{/capture}
@@ -56,19 +56,19 @@
{if ! $board.integrity}
<div class="floaticon">
<a href="{$smarty.const.BOARDS_PKG_URL}assign.php?integrity={$board.board_id}#board{$smarty.foreach.board_loop.iteration}">
- {booticon iname="fa-triangle-exclamation" iexplain="Fix Integrity"}
+ {booticon iname="icon-warning-sign" ipackage="icons" ipath="large" iexplain="Fix Integrity"}
</a>
</div>
{formfeedback warning="Integrity Check Failed"}
{/if}
<table class="table data">
- <caption>{tr}Assigned Content{/tr}</caption>
+ <caption>Assigned Content</caption>
<tr>
- <th style="width:15%;">{tr}Content Type{/tr}</th>
- <th style="width:55%;">{tr}Content Title{/tr}</th>
- <th style="width:15%;">{tr}Posts{/tr}</th>
- <th style="width:15%;">{tr}Action{/tr}</th>
+ <th style="width:15%;">Content Type</th>
+ <th style="width:55%;">Content Title</th>
+ <th style="width:15%;">Posts</th>
+ <th style="width:15%;">Action</th>
</tr>
{foreach item=mapping from=$board.map}
@@ -78,14 +78,14 @@
<td style="text-align:right">{$mapping.thread_count}</td>
<td class="actionicon">
<input type="checkbox" name="remove[{$board.board_id}][{$mapping.t_content_id}]" value="1" />
- <a title="{tr}Remove from board{/tr}" href="{$smarty.const.BOARDS_PKG_URL}assign.php?remove[{$board.board_id}][{$mapping.t_content_id}]=1#board{$smarty.foreach.board_loop.iteration}">{booticon iname="fa-trash" iexplain="Remove from board"}</a>
+ <a title="Remove from board" href="{$smarty.const.BOARDS_PKG_URL}assign.php?remove[{$board.board_id}][{$mapping.t_content_id}]=1#board{$smarty.foreach.board_loop.iteration}">{booticon iname="icon-trash" ipackage="icons" iexplain="Remove from board"}</a>
</td>
</tr>
{/foreach}
</table>
<div class="form-group submit">
- <input type="submit" class="btn btn-default" value="{tr}Remove{/tr}" name="action" />
+ <input type="submit" class="btn btn-default" value="Remove" name="action" />
</div>
{/form}
{/if}
diff --git a/templates/board_cat.tpl b/templates/board_cat.tpl
index e9ee0cb..c311ffc 100644..100755
--- a/templates/board_cat.tpl
+++ b/templates/board_cat.tpl
@@ -2,15 +2,15 @@
<div class="indent">
{if $child.data.title}
<a href="javascript:BitBase.toggle('bcat{$child.data.content_id|escape}','block',true);"><h{$heading|default:2}>{$child.data.title|escape}</h{$heading|default:2}></a>
- {elseif $gBitSystem->isPackageActive('pigeonholes') && count($ns) > 1}
- <a href="javascript:BitBase.toggle('bcatnone','block',true);"><h{$heading|default:2}>{tr}Uncategorized{/tr}</h{$heading|default:2}></a>
+ {elseif $gBitSystem->isPackageActive('pigeonholes') and count($ns) > 1}
+ <a href="javascript:BitBase.toggle('bcatnone','block',true);"><h{$heading|default:2}>Uncategorized</h{$heading|default:2}></a>
{/if}
<div id="bcat{$child.data.content_id|default:none}">
{if count($child.members) > 0}
{include file="bitpackage:boards/board_table.tpl" boardsList=$child.members heading=$heading}
{/if}
- {if !empty($child.sub_count) && count($child.children)>0}
+ {if !empty($child.sub_count) and count($child.children)>0}
{foreach from=$child.children item=schild}
{include file="bitpackage:boards/board_cat.tpl" child=$schild color=$color}
{/foreach}
diff --git a/templates/board_edit.tpl b/templates/board_edit.tpl
index b64af5b..eb53d98 100644..100755
--- a/templates/board_edit.tpl
+++ b/templates/board_edit.tpl
@@ -25,9 +25,9 @@
<div class="header">
<h1>
{if $gContent->isValid()}
- {tr}{tr}Edit{/tr} {$gContent->getTitle()|escape}{/tr}
+ Edit {$gContent->getTitle()|escape}
{else}
- {tr}Create New Board{/tr}
+ Create New Board
{/if}
</h1>
</div>
@@ -55,7 +55,7 @@
{/jstabs}
<div class="form-group submit">
- <input type="submit" class="btn btn-primary" name="save_bitboard" value="{tr}Save{/tr}" /> <input type="submit" class="btn btn-default" name="preview" value="{tr}Preview{/tr}" />
+ <input type="submit" class="btn btn-primary" name="save_bitboard" value="Save" /> <input type="submit" class="btn btn-default" name="preview" value="Preview" />
</div>
{/form}
</div><!-- end .body -->
diff --git a/templates/board_table.tpl b/templates/board_table.tpl
index 6f425a6..3f346c3 100644..100755
--- a/templates/board_table.tpl
+++ b/templates/board_table.tpl
@@ -17,10 +17,10 @@
<tr class="{cycle values="even,odd"}{if $board.unreg > 0} unapproved{/if}">
{* topic tracking icons *}
<td>
- {if $board.track.on && $board.track.mod}
- {booticon iname="fa-asterisk" iexplain="New Posts"}
+ {if $board.track.on and $board.track.mod}
+ {booticon iname="icon-asterisk" ipackage="icons" ipath="large" iexplain="New Posts" iforce="icon"}
{else}
- {booticon iname="fa-asterisk" iexplain="New Posts"}
+ {booticon iname="icon-asterisk" ipackage="icons" ipath="large" iexplain="New Posts" iforce="icon"}
{/if} <strong><a href="{$board.url}" title="{$board_title}">{$board_title}</a></strong>
<div class="desc">
{$board.parsed_data}
@@ -38,7 +38,7 @@
<br/> by {if $board.last.user_id < 0}{$board.last.l_anon_name|escape}{else}{displayname user_id=$board.last.user_id}{/if}
<br/> <small>{if $board.last.last_modified > 0}{$board.last.last_modified|reltime}{/if}</small>
{/if}
- {if $gBitUser->hasPermission('p_boards_update') || $gBitUser->hasPermission('p_boards_post_update')}
+ {if $gBitUser->hasPermission('p_boards_update') or $gBitUser->hasPermission('p_boards_post_update')}
{if $board.unreg > 0}<a class="highlight" href="{$board.url}" title="{$board.title|escape}">{$board.unreg}</a>{/if}
{/if}
</td>
diff --git a/templates/boards_edit_mini_inc.tpl b/templates/boards_edit_mini_inc.tpl
index 5b0a334..9403a6c 100644..100755
--- a/templates/boards_edit_mini_inc.tpl
+++ b/templates/boards_edit_mini_inc.tpl
@@ -1,4 +1,4 @@
-{if $gBitUser->hasPermission('p_boards_link_content') && $gContent->mContentTypeGuid != $smarty.const.BITBOARD_CONTENT_TYPE_GUID}
+{if $gBitUser->hasPermission('p_boards_link_content') and $gContent->mContentTypeGuid != $smarty.const.BITBOARD_CONTENT_TYPE_GUID}
{* {$gContent->mContentTypeGuid} *}
<div class="form-group">
{formlabel label="Linked Board"}
@@ -10,7 +10,7 @@
{html_options class="form-control" name="linked_board_cid" options=$boardList selected=$boardInfo.board_content_id}
{/if}
{else}
- <em>{tr}No discussion boards have been created.{/tr}</em>
+ <em>No discussion boards have been created.</em>
{/if}
{formhelp note="Comments added will appear on the selected message board."}
{/forminput}
diff --git a/templates/boards_rss_form.tpl b/templates/boards_rss_form.tpl
index 4601f51..ee544eb 100644..100755
--- a/templates/boards_rss_form.tpl
+++ b/templates/boards_rss_form.tpl
@@ -1,7 +1,7 @@
{strip}
<div class="display rss">
<div class="header">
- <h1>{tr}RSS Syndication{/tr}</h1>
+ <h1>RSS Syndication</h1>
</div>
<div class="body">
@@ -34,7 +34,7 @@
<div class="form-group">
{formlabel label="Feed" for="pkg"}
{forminput}
- {if $gContent->isValid()}{tr}{$gContent->getField('title')} Feed{/tr}{else}{tr}Recent Discussions{/tr}{/if}
+ {if $gContent->isValid()}{$gContent->getField('title')} Feed{else}Recent Discussions{/if}
{formhelp note=""}
{/forminput}
</div>
diff --git a/templates/boards_service_icons.tpl b/templates/boards_service_icons.tpl
index de8c7b0..fd79aae 100644..100755
--- a/templates/boards_service_icons.tpl
+++ b/templates/boards_service_icons.tpl
@@ -1,3 +1,3 @@
-{if $boardInfo.board_id}
- <a title="{tr}Discussion{/tr}" href="{$smarty.const.BOARDS_PKG_URL}?b={$boardInfo.board_id}&amp;filter_id={$gContent->mContentId}">{booticon ipackage="boards" iname="fa-comments" iexplain="Discuss"} [<strong>{$boardInfo.post_count}</strong>]</a>
+{if !empty($boardInfo.board_id)}
+ <a title="Discussion" href="{$smarty.const.BOARDS_PKG_URL}?b={$boardInfo.board_id}&amp;filter_id={$gContent->mContentId}">{booticon ipackage="boards" iname="icon-comments" iexplain="Discuss"} [<strong>{$boardInfo.post_count}</strong>]</a>
{/if}
diff --git a/templates/comment_post.tpl b/templates/comment_post.tpl
index 072fb61..6bec11a 100644..100755
--- a/templates/comment_post.tpl
+++ b/templates/comment_post.tpl
@@ -2,11 +2,11 @@
{strip}
<br />
<div class="edit comment">
- <div class="body"{if ( $smarty.request.post_comment_request || $post_comment_preview )} id="editcomments"{/if}>
+ <div class="body"{if ( $smarty.request.post_comment_request or $post_comment_preview )} id="editcomments"{/if}>
{formfeedback hash=$formfeedback}
{if $post_comment_preview}
- <h2>{tr}Comments Preview{/tr}</h2>
+ <h2>Comments Preview</h2>
<div class="preview">
{include file='bitpackage:liberty/display_comment.tpl' comment=$postComment}
</div><!-- end .preview -->
@@ -17,7 +17,7 @@
<input type="hidden" name="comments_style" value="{$comments_style}" />
<input type="hidden" name="comments_sort_mode" value="{$comments_sort_mode}" />
- {if $smarty.request.post_comment_request || $smarty.request.post_comment_preview}
+ {if $smarty.request.post_comment_request or $smarty.request.post_comment_preview}
{legend legend="Post"}
<input type="hidden" name="post_comment_reply_id" value="{$post_comment_reply_id}" />
<input type="hidden" name="post_comment_id" value="{$post_comment_id}" />
@@ -31,14 +31,14 @@
</div>
{capture assign="textarea_help"}
- {tr}Use [http://www.foo.com] or [http://www.foo.com|description] for links.<br />HTML tags are not allowed inside comments.{/tr}
+ Use [http://www.foo.com] or [http://www.foo.com|description] for links.<br />HTML tags are not allowed inside comments.
{/capture}
{textarea noformat=1 label="Comment" id="commentpost" name="comment_data" rows="6" edit=$postComment.data}
<div class="form-group submit">
- <input type="submit" class="btn btn-default" name="post_comment_preview" value="{tr}Preview{/tr}"/>&nbsp;
- <input type="submit" class="btn btn-default" name="post_comment_submit" value="{tr}Post{/tr}"/>&nbsp;
- <input type="submit" class="btn btn-default" name="post_comment_cancel" value="{tr}Cancel{/tr}"/>
+ <input type="submit" class="btn btn-default" name="post_comment_preview" value="Preview"/>&nbsp;
+ <input type="submit" class="btn btn-default" name="post_comment_submit" value="Post"/>&nbsp;
+ <input type="submit" class="btn btn-default" name="post_comment_cancel" value="Cancel"/>
</div>
{/legend}
{/if}
diff --git a/templates/flipswitch.tpl b/templates/flipswitch.tpl
index 2331fcc..922eab2 100644..100755
--- a/templates/flipswitch.tpl
+++ b/templates/flipswitch.tpl
@@ -14,13 +14,13 @@ $flip_downname=>$flip.$flip_name.downname
{if $gContent->hasUserPermission( $flip.$flip_name.perm )}
<a href="{$smarty.const.BOARDS_PKG_URL}edit_topic.php?{$flip.$flip_name.idname}={$flip.$flip_name.id|escape:"url"}&amp;{$flip_name}={$flip.$flip_name.state|escape:"url"}" />
{if $flip.$flip_name.state==1}
- {booticon ipackage=icons iname=$flip.$flip_name.up iexplain=$flip.$flip_name.upname}
+ {booticon ipackage=icons iname=$flip.$flip_name.up iexplain=$flip.$flip_name.upname iforce="icon"}
{else}
- {booticon ipackage=icons iname=$flip.$flip_name.down iexplain=$flip.$flip_name.downname}
+ {booticon ipackage=icons iname=$flip.$flip_name.down iexplain=$flip.$flip_name.downname iforce="icon"}
{/if}
</a>
{elseif $flip.$flip_name.state==1}
- {booticon iname=$flip.$flip_name.up iexplain=$flip.$flip_name.upname}
+ {booticon ipackage=icons iname=$flip.$flip_name.up iexplain=$flip.$flip_name.upname iforce="icon"}
{/if}
</span>
{/strip}
diff --git a/templates/html_head_inc.tpl b/templates/html_head_inc.tpl
index 7b6066d..1cac695 100644..100755
--- a/templates/html_head_inc.tpl
+++ b/templates/html_head_inc.tpl
@@ -46,12 +46,12 @@
/* ]]> */</script>
{if $gBitSystem->isPackageActive( 'rss' )}
- {if $board && $smarty.request.b}
- <link rel="alternate" type="application/rss+xml" title="Board {$board->mInfo.title|escape} RSS" href="{$smarty.const.BOARDS_PKG_URL}boards_rss.php?version=rss20&amp;b={$smarty.request.b}{if $gBitSystem->getConfig( 'rssfeed_httpauth' ) && $gBitUser->isRegistered()}&httpauth=y{/if}" />
- <link rel="alternate" type="application/rss+xml" title="Board {$board->mInfo.title|escape} ATOM" href="{$smarty.const.BOARDS_PKG_URL}boards_rss.php?version=atom&amp;b={$smarty.request.b}{if $gBitSystem->getConfig( 'rssfeed_httpauth' ) && $gBitUser->isRegistered()}&httpauth=y{/if}" />
- {elseif $thread && $smarty.request.t}
- <link rel="alternate" type="application/rss+xml" title="Topic {$thread->getTitle()|escape} RSS" href="{$smarty.const.BOARDS_PKG_URL}boards_rss.php?version=rss20&amp;t={$smarty.request.t}{if $gBitSystem->getConfig( 'rssfeed_httpauth' ) && $gBitUser->isRegistered()}&httpauth=y{/if}" />
- <link rel="alternate" type="application/rss+xml" title="Topic {$thread->getTitle()|escape} ATOM" href="{$smarty.const.BOARDS_PKG_URL}boards_rss.php?version=atom&amp;t={$smarty.request.t}{if $gBitSystem->getConfig( 'rssfeed_httpauth' ) && $gBitUser->isRegistered()}&httpauth=y{/if}" />
+ {if $board and $smarty.request.b}
+ <link rel="alternate" type="application/rss+xml" title="Board {$board->mInfo.title|escape} RSS" href="{$smarty.const.BOARDS_PKG_URL}boards_rss.php?version=rss20&amp;b={$smarty.request.b}{if $gBitSystem->getConfig( 'rssfeed_httpauth' ) and $gBitUser->isRegistered()}&httpauth=y{/if}" />
+ <link rel="alternate" type="application/rss+xml" title="Board {$board->mInfo.title|escape} ATOM" href="{$smarty.const.BOARDS_PKG_URL}boards_rss.php?version=atom&amp;b={$smarty.request.b}{if $gBitSystem->getConfig( 'rssfeed_httpauth' ) and $gBitUser->isRegistered()}&httpauth=y{/if}" />
+ {elseif $thread and $smarty.request.t}
+ <link rel="alternate" type="application/rss+xml" title="Topic {$thread->getTitle()|escape} RSS" href="{$smarty.const.BOARDS_PKG_URL}boards_rss.php?version=rss20&amp;t={$smarty.request.t}{if $gBitSystem->getConfig( 'rssfeed_httpauth' ) and $gBitUser->isRegistered()}&httpauth=y{/if}" />
+ <link rel="alternate" type="application/rss+xml" title="Topic {$thread->getTitle()|escape} ATOM" href="{$smarty.const.BOARDS_PKG_URL}boards_rss.php?version=atom&amp;t={$smarty.request.t}{if $gBitSystem->getConfig( 'rssfeed_httpauth' ) and $gBitUser->isRegistered()}&httpauth=y{/if}" />
{/if}
{/if}
{/if}
diff --git a/templates/legend_inc.tpl b/templates/legend_inc.tpl
index 9d90f71..541ad79 100644..100755
--- a/templates/legend_inc.tpl
+++ b/templates/legend_inc.tpl
@@ -2,9 +2,9 @@
{if $topicicons}
<div class="alert alert-info">
<ul class="list-inline list-unstyled">
- <li>{booticon iname="fa-lock" iexplain="Thread Closed"} {tr}Thread Closed{/tr}</li>
- <li>{booticon iname="fa-circle-exclamation" iexplain="Sticky"} {tr}Sticky{/tr}</li>
- <li>{booticon iname="fa-asterisk" iexplain="New Posts"} {tr}New Posts{/tr}</li>
+ <li>{booticon iname="icon-lock" ipackage="icons" ipath=large iexplain="Thread Closed" iforce="icon"} Thread Closed</li>
+ <li>{booticon iname="icon-exclamation-sign" ipackage="icons" ipath=large iexplain="Sticky" iforce="icon"} Sticky</li>
+ <li>{booticon iname="icon-asterisk" ipackage="icons" ipath=large iexplain="New Posts" iforce="icon"} New Posts</li>
</ul>
</div>
{/if}
diff --git a/templates/list_boards.tpl b/templates/list_boards.tpl
index 0cde976..552a221 100644..100755
--- a/templates/list_boards.tpl
+++ b/templates/list_boards.tpl
@@ -2,7 +2,7 @@
{strip}
<div class="listing boards">
<div class="header">
- <h1>{tr}{if $smarty.const.BOARDS_PKG_DIR != 'boards'}{$smarty.const.BOARDS_PKG_DIR|ucfirst}{else}Message Boards{/if}{/tr}</h1>
+ <h1>{if $smarty.const.BOARDS_PKG_DIR != 'boards'}{$smarty.const.BOARDS_PKG_DIR|ucfirst}{else}Message Boards{/if}</h1>
</div>
<div class="body">
@@ -12,7 +12,7 @@
{include file="bitpackage:boards/board_cat.tpl" child=$child color=$color}
{/if}
{foreachelse}
- {tr}No message boards found{/tr}
+ No message boards found
{/foreach}
{include file="bitpackage:boards/legend_inc.tpl" boardicons=1}
diff --git a/templates/list_posts.tpl b/templates/list_posts.tpl
index e65857c..42e92ab 100644..100755
--- a/templates/list_posts.tpl
+++ b/templates/list_posts.tpl
@@ -4,7 +4,7 @@
<div class="navbar">
<div class="boards breadcrumb">
- <a href="{$smarty.const.BOARDS_PKG_URL}">{tr}Message Boards{/tr}</a> &raquo; <a href="{$board->mInfo.display_url}">{$board->getTitle()|escape}</a>
+ <a href="{$smarty.const.BOARDS_PKG_URL}">Message Boards</a> &raquo; <a href="{$board->mInfo.display_url}">{$board->getTitle()|escape}</a>
</div>
</div>
@@ -15,13 +15,13 @@
{* always go back to page 1 since changing any of these values
repaginates and makes the current page number meaningless *}
<input type="hidden" name="comment_page" value="1" />
- <i class="fa fal fa-sort"></i> <select name="comments_sort_mode" id="comments-sort">
- <option value="commentDate_desc" {if $comments_sort_mode eq "commentDate_desc"}selected="selected"{/if}>{tr}Newest{/tr}</option>
- <option value="commentDate_asc" {if $comments_sort_mode eq "commentDate_asc"}selected="selected"{/if}>{tr}Oldest{/tr}</option>
+ <i class="icon-sort"></i> <select name="comments_sort_mode" id="comments-sort">
+ <option value="commentDate_desc" {if $comments_sort_mode eq "commentDate_desc"}selected="selected"{/if}>Newest</option>
+ <option value="commentDate_asc" {if $comments_sort_mode eq "commentDate_asc"}selected="selected"{/if}>Oldest</option>
</select>
&nbsp;&nbsp;
<label>
- <input type="checkbox" name="comments_style" id="comments-style" value="threaded" {if $comments_style eq "threaded"}checked="checked"{/if} onchange="this.form.submit()"/> {tr}Threaded{/tr}
+ <input type="checkbox" name="comments_style" id="comments-style" value="threaded" {if $comments_style eq "threaded"}checked="checked"{/if} onchange="this.form.submit()"/> Threaded
</label>
&nbsp; &nbsp;
<label>
@@ -32,11 +32,11 @@
<option value="50" {if $maxComments eq 50}selected="selected"{/if}>50</option>
<option value="100" {if $maxComments eq 100}selected="selected"{/if}>100</option>
<option value="999999" {if $maxComments eq 999999}selected="selected"{/if}>All</option>
- </select> {tr}Messages{/tr}
+ </select> Messages
</label>
{/form}
{if $gBitSystem->isPackageActive( 'rss' )}
- <a title="{tr}Get RSS Feed{/tr}" href="{$smarty.const.BOARDS_PKG_URL}rss.php?t={$smarty.request.t}">{booticon iname="fa-rss" iexplain="Get RSS Feed"}</a>
+ <a title="Get RSS Feed" href="{$smarty.const.BOARDS_PKG_URL}rss.php?t={$smarty.request.t}">{booticon iname="icon-rss" ipackage=rss iexplain="Get RSS Feed"}</a>
{/if}
{assign var=flip value=$thread->getFlipFlop()}
{foreach from=$flip item=flip_s key=flip_name}
@@ -47,32 +47,32 @@
<div class="header">
<h1>{$thread->getTitle()|escape}</h1>
{if $thread->getField('root_content_type_guid') != $smarty.const.BITBOARD_CONTENT_TYPE_GUID}
- {tr}Comment on{/tr} <a href="{$smarty.const.BIT_ROOT_URL}index.php?content_id={$thread->getField('root_content_id')}">{$thread->getField('root_title')|default:$thread->getField('root_content_id')|escape}</a>
+ Comment on <a href="{$smarty.const.BIT_ROOT_URL}index.php?content_id={$thread->getField('root_content_id')}">{$thread->getField('root_title')|default:$thread->getField('root_content_id')|escape}</a>
{/if}
</div>
<div class="body">
- {if !$topic_locked && $board->hasPostCommentsPermission()}
+ {if !$topic_locked and $board->hasPostCommentsPermission()}
<div class="form-group submit">
- <a title="{tr}Post Reply{/tr}" class="btn btn-default" href="{$comments_return_url}&amp;post_comment_reply_id={$thread->mInfo.flc_content_id}&amp;post_comment_request=1#editcomments">{booticon iname="fa-comment" iexplain="Post Reply"} {tr}Post Reply{/tr}</a>
+ <a title="Post Reply" class="btn btn-default" href="{$comments_return_url}&amp;post_comment_reply_id={$thread->mInfo.flc_content_id}&amp;post_comment_request=1#editcomments">{booticon iname="icon-comment-alt" ipackage="icons" iexplain="Post Reply" iforce="icon"} Post Reply</a>
</div>
{/if}
{formfeedback hash=$formfeedback}
{foreach item=comment from=$comments}
- <div class="mb-post {if $gBitSystem->isFeatureActive('boards_post_anon_moderation') && $comment.user_id<0 and $comment.is_approved==0} unapproved{/if}">
+ <div class="mb-post {if $gBitSystem->isFeatureActive('boards_post_anon_moderation') and $comment.user_id<0 and $comment.is_approved==0} unapproved{/if}">
{assign var=thread_mInfo value=$thread->mInfo}
{displaycomment comment=$comment template=$comment_template}
</div>
{foreachelse}
<p class="norecords">
- {tr}No posts found{/tr}
+ No posts found
</p>
{/foreach}
{if $post_comment_preview}
- <h2>{tr}Preview{/tr}</h2>
+ <h2>Preview</h2>
<div class="preview mb-post">
{assign var=post_is_preview value=1}
{displaycomment comment=$postComment template=$comment_template}
@@ -80,17 +80,17 @@
</div><!-- end .preview -->
{/if}
- {if !$topic_locked && $board->hasPostCommentsPermission()}
+ {if !$topic_locked and $board->hasPostCommentsPermission()}
<div class="form-group submit">
- <a title="{tr}Post Reply{/tr}" class="btn btn-default" href="{$comments_return_url}&amp;post_comment_reply_id={$thread->mInfo.flc_content_id}&amp;post_comment_request=1#editcomments">{booticon iname="fa-comment" iexplain="Post Reply"} {tr}Post Reply{/tr}</a>
+ <a title="Post Reply" class="btn btn-default" href="{$comments_return_url}&amp;post_comment_reply_id={$thread->mInfo.flc_content_id}&amp;post_comment_request=1#editcomments">{booticon iname="icon-comment-alt" ipackage="icons" iexplain="Post Reply" iforce="icon"} Post Reply</a>
</div>
{/if}
- {libertypagination ihash=$commentsPgnHash}
+ {pagination ihash=$commentsPgnHash}
</div><!-- end .body -->
</div><!-- end .boards -->
-{if $gBitSystem->isFeatureActive('boards_post_anon_moderation') && ($smarty.request.post_comment_request || !empty($smarty.request.post_comment_submit)) && !$gBitUser->isRegistered()}
+{if $gBitSystem->isFeatureActive('boards_post_anon_moderation') and ($smarty.request.post_comment_request or !empty($smarty.request.post_comment_submit)) and !$gBitUser->isRegistered()}
{formfeedback warning="Your post will not be shown immediately it will have to be approved by a moderator"}
{/if}
diff --git a/templates/list_topics.tpl b/templates/list_topics.tpl
index e22b576..0b05eb8 100644..100755
--- a/templates/list_topics.tpl
+++ b/templates/list_topics.tpl
@@ -1,26 +1,28 @@
{* $Header$ *}
+{if empty($print_page)}{assign var=print_page value=false}{/if}
+
{strip}
<div class="listing boards">
<div class="navbar clear">
<div class="boards breadcrumb">
- <a href="{$smarty.const.BOARDS_PKG_URL}">{tr}Message Boards{/tr}</a>
+ <a href="{$smarty.const.BOARDS_PKG_URL}">Message Boards</a>
</div>
</div>
<div class="floaticon">
- {if $print_page ne 'y'}
+ {if !$print_page}
{include file="bitpackage:liberty/services_inc.tpl" serviceLocation='icon' serviceHash=$board->mInfo}
- {if $board->getPreference('boards_mailing_list') || $board->hasAdminPermission()}
- <a class="item" href="{$smarty.const.BOARDS_PKG_URL}mailing_list.php?b={$board->mInfo.board_id}" title="{tr}Message Board Mailing List{/tr}">{booticon iname="fa-envelope" iexplain="Edit Board Mailing List"}</a>
+ {if $board->getPreference('boards_mailing_list') or $board->hasAdminPermission()}
+ <a class="item" href="{$smarty.const.BOARDS_PKG_URL}mailing_list.php?b={$board->mInfo.board_id}" title="Message Board Mailing List">{booticon ipackage="icons" iname="icon-envelope" iexplain="Edit Board Mailing List"}</a>
{/if}
{if $gBitSystem->isPackageActive( 'rss' )}
- <a title="{tr}Get RSS Feed{/tr}" href="{$smarty.const.BOARDS_PKG_URL}rss.php?b={$smarty.request.b}">{booticon iname="fa-rss" iexplain="Get RSS Feed"}</a>
+ <a title="Get RSS Feed" href="{$smarty.const.BOARDS_PKG_URL}rss.php?b={$smarty.request.b}">{booticon iname="icon-rss" ipackage=rss iexplain="Get RSS Feed"}</a>
{/if}
{if $board->hasUpdatePermission()}
- <a title="{tr}Edit message board{/tr}" href="{$smarty.const.BOARDS_PKG_URL}edit.php?b={$board->mInfo.board_id}">{booticon iname="fa-pen-to-square" iexplain="Edit Message Board"}</a>
+ <a title="Edit message board" href="{$smarty.const.BOARDS_PKG_URL}edit.php?b={$board->mInfo.board_id}">{booticon iname="icon-edit" ipackage="icons" iexplain="Edit Message Board"}</a>
{/if}
- {if $board->hasUserPermission( 'p_boards_remove', TRUE, TRUE )}
- <a title="{tr}Remove message board{/tr}" href="{$smarty.const.BOARDS_PKG_URL}edit.php?remove=1&amp;b={$board->mInfo.board_id}">{booticon iname="fa-trash" iexplain="Remove Message Board"}</a>
+ {if $board->hasUserPermission( 'p_boards_remove', true, true )}
+ <a title="Remove message board" href="{$smarty.const.BOARDS_PKG_URL}edit.php?remove=1&amp;b={$board->mInfo.board_id}">{booticon iname="icon-trash" ipackage="icons" iexplain="Remove Message Board"}</a>
{/if}
{/if}<!-- end print_page -->
{*if $board->hasPostCommentsPermission()}
@@ -48,12 +50,12 @@
{if !$gBitSystem->isFeatureActive('boards_thread_verbrose')}
<tr>
<th colspan="2" style="width:5%;">
- <a href="{$comments_return_url}&amp;post_comment_request=1#editcomments" class="btn btn-primary btn-xs">{tr}New Topic{/tr}</a>
+ <a href="{$comments_return_url}&amp;post_comment_request=1#editcomments" class="btn btn-primary btn-xs">New Topic</a>
</th>
- <th style="width:40%;">{tr}Title{/tr}</th>
- <th style="width:20%;">{tr}Last Reply{/tr}</th>
- {if $board->hasUpdatePermission() || $gBitUser->hasPermission('p_boards_post_update')}
- <th style="width:1%;"><abbr title="{tr}Number of posts by Anonymous users{/tr}">Anon</abbr></th>
+ <th style="width:40%;">Title</th>
+ <th style="width:20%;">Last Reply</th>
+ {if $board->hasUpdatePermission() or $gBitUser->hasPermission('p_boards_post_update')}
+ <th style="width:1%;"><abbr title="Number of posts by Anonymous users">Anon</abbr></th>
{/if}
{if $board->hasUpdatePermission()}
<th style="width:10%;" colspan="2">Actions</th>
@@ -62,11 +64,11 @@
{/if}
{foreach item=thread from=$threadList}
- <tr class="{cycle values="even,odd"} {if $gBitSystem->isFeatureActive('boards_post_anon_moderation') && $thread.unreg > 0}unapproved{elseif $thread.th_moved>0}moved{/if} {if $thread.th_sticky==1} highlight{/if}" >
+ <tr class="{cycle values="even,odd"} {if $gBitSystem->isFeatureActive('boards_post_anon_moderation') and $thread.unreg > 0}unapproved{elseif $thread.th_moved>0}moved{/if} {if $thread.th_sticky==1} highlight{/if}" >
<td style="white-space:nowrap;">{* topic status icons *}
{if $thread.th_moved>0}
- {booticon ipackage="icons" iname="fa-share" iexplain="Moved Topic"}
+ {booticon ipackage="icons" iname="icon-share" iexplain="Moved Topic"}
{else}
{assign var=flip value=$thread.flip}
{foreach from=$flip item=flip_s key=flip_name}
@@ -79,7 +81,7 @@
<td>
<div class="topictitle"><a href="{$thread.url}" title="{$thread.title|escape}">{$thread.title|escape}</a></div>
{include file="bitpackage:liberty/services_inc.tpl" serviceLocation='list' serviceHash=$thread}
- <span class="small">{tr}by{/tr} {if $thread.flc_user_id < 0}{$thread.anon_name|escape}{else}{displayname user_id=$thread.flc_user_id}{/if} {tr}on{/tr} {$thread.flc_created|reltime:short|escape}</span>
+ <span class="small">by {if $thread.flc_user_id < 0}{$thread.anon_name|escape}{else}{displayname user_id=$thread.flc_user_id}{/if} on {$thread.flc_created|reltime:short|escape}</span>
</td>
<td class="topiclastreply">
@@ -87,31 +89,31 @@
{if $thread.post_count > 1}{if $thread.llc_user_id < 0}{$thread.l_anon_name|escape}{else}{displayname user_id=$thread.llc_user_id}{/if}{else}{/if}
</td>
- {if $board->hasUpdatePermission() || $gBitUser->hasPermission('p_boards_post_update')}
+ {if $board->hasUpdatePermission() or $gBitUser->hasPermission('p_boards_post_update')}
<td style="text-align:center;">{if $thread.unreg > 0}<a class="highlight" href="{$thread.url}" title="{$thread.title|escape}">{$thread.unreg}</a>{/if}</td>
{/if}
- {if $board->hasUpdatePermission() || $gBitUser->hasPermission('p_boards_post_update')}
+ {if $board->hasUpdatePermission() or $gBitUser->hasPermission('p_boards_post_update')}
<td class="actionicon">
{* modcomments handles this *}
- {if $thread.flc_user_id<0 && $thread.first_approved==0 && !$gBitSystem->isPackageActive('modcomments')}
- <a title="{tr}Approve First Post{/tr}" href="{$smarty.const.BOARDS_PKG_URL}view_board_inc.php?b={$board->mInfo.board_id}&amp;action=1&amp;comment_id={$thread.th_thread_id}">
- {booticon iname="fa-circle-plus" iexplain="Approve First Post"}
+ {if $thread.flc_user_id<0 and $thread.first_approved==0 and !$gBitSystem->isPackageActive('modcomments')}
+ <a title="Approve First Post" href="{$smarty.const.BOARDS_PKG_URL}view_board_inc.php?b={$board->mInfo.board_id}&amp;action=1&amp;comment_id={$thread.th_thread_id}">
+ {booticon iname="icon-plus-sign" ipackage="icons" iexplain="Approve First Post" iforce="icon"}
</a>
- <a title="{tr}Reject First Post{/tr}" href="{$smarty.const.BOARDS_PKG_URL}view_board_inc.php?b={$board->mInfo.board_id}&amp;action=2&amp;comment_id={$thread.th_thread_id}">
- {booticon iname="fa-circle-minus" iexplain="Reject First Post"}
+ <a title="Reject First Post" href="{$smarty.const.BOARDS_PKG_URL}view_board_inc.php?b={$board->mInfo.board_id}&amp;action=2&amp;comment_id={$thread.th_thread_id}">
+ {booticon iname="icon-minus-sign" ipackage="icons" iexplain="Reject First Post" iforce="icon"}
</a>
{/if}
- {if $thread.th_moved==0 && $board->hasAdminPermission()}
+ {if $thread.th_moved==0 and $board->hasAdminPermission()}
{*smartlink ititle="Edit" ifile="edit.php" ibiticon="liberty/edit" board_id=$thread.board_id*}
<a href="{$smarty.const.BOARDS_PKG_URL}topic_move.php?t={$thread.th_thread_id|escape:"url"}"
- title="{tr}Move Thread{/tr}">{booticon iname="fa-share" iexplain="Move Thread"}
- </a> <a title="{tr}Delete Topic{/tr}" href="{$smarty.const.BOARDS_PKG_URL}edit_topic.php?remove=1&amp;t={$thread.th_thread_id|escape:"url"}">{booticon iname="fa-trash" iexplain="Delete Thread"}</a>
+ title="Move Thread">{booticon ipackage=icons iname="icon-share" iexplain="Move Thread" iforce="icon"}
+ </a> <a title="Delete Topic" href="{$smarty.const.BOARDS_PKG_URL}edit_topic.php?remove=1&amp;t={$thread.th_thread_id|escape:"url"}">{booticon iname="icon-trash" ipackage="icons" iexplain="Delete Thread" iforce="icon"}</a>
{/if}
</td>
- {if $thread.th_moved==0 && $board->hasAdminPermission()}
+ {if $thread.th_moved==0 and $board->hasAdminPermission()}
<td>
<input type="checkbox" name="checked[]" title="{$thread.title|escape}" value="{$thread.th_thread_id}" />
</td>
@@ -120,7 +122,7 @@
</tr>
{foreachelse}
<tr class="norecords"><td colspan="16">
- {tr}No topics have been posted.{/tr}
+ No topics have been posted.
</td></tr>
{/foreach}
</table>
@@ -128,19 +130,19 @@
{if $board->hasAdminPermission()}
<div style="text-align:right;">
<script>/* <![CDATA[ check / uncheck all */
- document.write("<label class='' for='switcher'>{tr}Select All{/tr} <input name='switcher' id='switcher' type='checkbox' onclick='BitBase.switchCheckboxes(this.form.id,'checked[]','switcher')' /></label>");
+ document.write("<label class='' for='switcher'>Select All <input name='switcher' id='switcher' type='checkbox' onclick='BitBase.switchCheckboxes(this.form.id,'checked[]','switcher')' /></label>");
/* ]]> */</script>
<input type="hidden" name="b" value="{$smarty.request.b}" />
<select name="submit_mult" onchange="this.form.submit();">
- <option value="" selected="selected">{tr}with checked{/tr}:</option>
+ <option value="" selected="selected">with checked:</option>
{if $board->hasAdminPermission()}
- <option value="remove_boards">{tr}remove{/tr}</option>
+ <option value="remove_boards">remove</option>
{/if}
</select>
- <noscript><div><input type="submit" class="btn btn-default" value="{tr}Submit{/tr}" /></div></noscript>
+ <noscript><div><input type="submit" class="btn btn-default" value="Submit" /></div></noscript>
</div>
{/if}
{/form}
@@ -149,7 +151,7 @@
</div><!-- end .body -->
</div><!-- end .admin -->
-{if $gBitSystem->isFeatureActive('boards_post_anon_moderation') && $smarty.request.post_comment_request && !$gBitUser->isRegistered()}
+{if $gBitSystem->isFeatureActive('boards_post_anon_moderation') and $smarty.request.post_comment_request and !$gBitUser->isRegistered()}
{formfeedback warning="Your post will not be shown immediately it will have to be approved by a moderator"}
{/if}
diff --git a/templates/mailing_list.tpl b/templates/mailing_list.tpl
index 983f280..1642be2 100644..100755
--- a/templates/mailing_list.tpl
+++ b/templates/mailing_list.tpl
@@ -2,7 +2,7 @@
<div class="listing users">
<div class="header">
- <h1>{tr}Mailing List{/tr}: {$board->getDisplayLink()}</h1>
+ <h1>Mailing List: {$board->getDisplayLink()}</h1>
</div>
<div class="body">
@@ -23,10 +23,10 @@
{formlabel label="Subscribe"}
{forminput}
{if mailman_findmember($board->getPreference('boards_mailing_list'),$gBitUser->getField('email'))}
- <p>{tr}You are currently subscribed to the mailing list using the email:{/tr} {$gBitUser->getField('email')}</p>
+ <p>You are currently subscribed to the mailing list using the email: {$gBitUser->getField('email')}</p>
<input type="submit" class="btn btn-default" name="unsubscribe" value="Unsubscribe" />
{else}
- <p>{tr}You are currently not subscribed to the mailing list.{/tr}</p>
+ <p>You are currently not subscribed to the mailing list.</p>
<input type="submit" class="btn btn-default" name="subscribe" value="Subscribe" />
{/if}
{/forminput}
@@ -45,7 +45,7 @@
{foreach from=$listMembers key=userId item=member}
<li>{displayname email=$member} &lt;{$member}&gt;</li>
{foreachelse}
- <li>{tr}The group has no members.{/tr}</li>
+ <li>The group has no members.</li>
{/foreach}
</ol>
{/jstab}
@@ -67,7 +67,7 @@
{formlabel label="Mailing List Address" for="boardsync"}
{forminput}
<input type="text" size="50" maxlength="200" name="board_sync_list_address" id="board_sync_list_address" value="{$gContent->getPreference('board_sync_list_address')|escape}" />
- {if $boardsMailingList && $boardsMailingList != $gContent->getPreference('board_sync_list_address')}
+ {if $boardsMailingList and $boardsMailingList != $gContent->getPreference('board_sync_list_address')}
{formfeedback warning="The Mailing List Address does not match the configured board mailing list."}
{/if}
{formhelp note="All messages posted to this email address will mirrored on the board. The 'Board Sync Inbox' email account must be subscribed to this list and receive the messages in its INBOX."}
@@ -86,10 +86,10 @@
{formlabel label="Subscribe"}
{forminput}
{if mailman_findmember($board->getPreference('boards_mailing_list'),$boardSyncInbox)}
- <p>{$boardSyncInbox} {tr}is subscribed to{/tr} {$boardsMailingList}</p>
+ <p>{$boardSyncInbox} is subscribed to {$boardsMailingList}</p>
<input type="submit" class="btn btn-default" name="unsubscribe_boardsync" value="Unsubscribe" />
{else}
- <p>{$boardSyncInbox} {tr}is currently not subscribed to the mailing list.{/tr}</p>
+ <p>{$boardSyncInbox} is currently not subscribed to the mailing list.</p>
<input type="submit" class="btn btn-default" name="subscribe_boardsync" value="Subscribe" />
{/if}
{/forminput}
@@ -99,8 +99,8 @@
<div class="form-group">
{formlabel label="Board Sync" for="boardsync"}
{forminput}
- {tr}Board Sync is not available since the Board Sync master email box has not been configured.{/tr} {if !$gBitUser->isAdmin()}{tr}Check with your site administrator.{/tr}{/if}
- {if $gBitUser->isAdmin()}{tr}See the global <a href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=boards">Board Settings</a> for master email box configuration.{/tr}{/if}
+ Board Sync is not available since the Board Sync master email box has not been configured. {if !$gBitUser->isAdmin()}Check with your site administrator.{/if}
+ {if $gBitUser->isAdmin()}See the global <a href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=boards">Board Settings</a> for master email box configuration.{/if}
{/forminput}
</div>
{/if}
@@ -130,7 +130,7 @@
{/forminput}
</div>
{else}
- {if $gBitSystem->getConfig('server_mailman_bin') && $gBitSystem->getConfig('boards_sync_user') && $gBitSystem->getConfig('boards_sync_mail_server')}
+ {if $gBitSystem->getConfig('server_mailman_bin') and $gBitSystem->getConfig('boards_sync_user') and $gBitSystem->getConfig('boards_sync_mail_server')}
{legend legend="Group Mailing List"}
<input type="hidden" name="b" value="{$board->getField('board_id')}"/>
<div class="form-group">
@@ -157,11 +157,11 @@
{if !$gBitSystem->getConfig('server_mailman_bin')}
{formfeedback error="Mailman is not configured."}
{/if}
- {if !$gBitSystem->getConfig('boards_sync_user') || !$gBitSystem->getConfig('boards_sync_user')}
+ {if !$gBitSystem->getConfig('boards_sync_user') or !$gBitSystem->getConfig('boards_sync_user')}
{formfeedback error="List to Board Sync is not configured."}
{/if}
{if $gBitUser->isAdmin()}
- <a href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=boards">{tr}See Boards Administration{/tr}</a>
+ <a href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=boards">See Boards Administration</a>
{/if}
{/if}
{/if}
diff --git a/templates/menu_boards.tpl b/templates/menu_boards.tpl
index 09ca341..d72de90 100644..100755
--- a/templates/menu_boards.tpl
+++ b/templates/menu_boards.tpl
@@ -1,12 +1,12 @@
{strip}
-{if $packageMenuTitle}<a class="dropdown-toggle" data-toggle="dropdown" href="#"> {tr}{$packageMenuTitle}{/tr} <b class="caret"></b></a>{/if}
+{if !empty($packageMenuTitle)}<a class="dropdown-toggle" data-toggle="dropdown" href="#"> {$packageMenuTitle} <b class="caret"></b></a>{/if}
<ul class="{$packageMenuClass}">
{if $gBitUser->hasPermission( 'p_boards_read')}
- <li><a class="item" href="{$smarty.const.BOARDS_PKG_URL}index.php">{booticon iname="fa-house" iexplain="Browse `$smarty.const.BOARDS_PKG_DIR`"}</a></li>
+ <li><a class="item" href="{$smarty.const.BOARDS_PKG_URL}index.php">{booticon iname="icon-home" ipackage="icons" iexplain="Browse `$smarty.const.BOARDS_PKG_DIR`" ilocation=menu}</a></li>
{/if}
{if $gBitUser->hasPermission( 'p_boards_create')}
- <li><a class="item" href="{$smarty.const.BOARDS_PKG_URL}edit.php">{booticon iname="fa-folder-closed" iexplain="Create new `$smarty.const.BOARDS_PKG_DIR`"}</a></li>
- <li><a class="item" href="{$smarty.const.BOARDS_PKG_URL}assign.php">{booticon iname="fa-circle-arrow-right" iexplain="Assign to `$smarty.const.BOARDS_PKG_DIR`"}</a></li>
+ <li><a class="item" href="{$smarty.const.BOARDS_PKG_URL}edit.php">{booticon iname="icon-folder-close" ipackage="icons" iexplain="Create new `$smarty.const.BOARDS_PKG_DIR`" ilocation=menu}</a></li>
+ <li><a class="item" href="{$smarty.const.BOARDS_PKG_URL}assign.php">{booticon iname="icon-circle-arrow-right" ipackage="icons" iexplain="Assign to `$smarty.const.BOARDS_PKG_DIR`" ilocation=menu}</a></li>
{/if}
</ul>
{/strip}
diff --git a/templates/menu_boards_admin.tpl b/templates/menu_boards_admin.tpl
index ec414ed..7826867 100644..100755
--- a/templates/menu_boards_admin.tpl
+++ b/templates/menu_boards_admin.tpl
@@ -1,2 +1,7 @@
-<a class="nosubmenu" href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=boards">{tr}Boards{/tr}</a>
-
+{strip}
+<ul class="{$packageMenuClass}">
+<li>
+<a class="nosubmenu" href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=boards">{$smarty.const.BOARDS_PKG_DIR|capitalize}</a>
+</li>
+</ul>
+{/strip} \ No newline at end of file
diff --git a/templates/post_display.tpl b/templates/post_display.tpl
index aa87944..a5b95aa 100644..100755
--- a/templates/post_display.tpl
+++ b/templates/post_display.tpl
@@ -1,5 +1,5 @@
{strip}
-{if $comments_style eq 'threaded' && $comment.level}
+{if $comments_style eq 'threaded' and $comment.level}
<div style="margin-left:20px">
{else}
<div style="margin-left:0px">
@@ -13,10 +13,10 @@
{else}
<strong>{displayname hash=$comment}</strong>
<br />
- {if $comment.user_id != $smarty.const.ANONYMOUS_USER_ID && !empty($comment.user_avatar_url)}
- <div><a href="{$comment.user_url}"><img src="{$comment.user_avatar_url}" class="img-responsive" alt="{tr}Profile Picture{/tr}" /></a></div>
+ {if $comment.user_id != $smarty.const.ANONYMOUS_USER_ID and !empty($comment.user_avatar_url)}
+ <div><a href="{$comment.user_url}"><img src="{$comment.user_avatar_url}" class="img-responsive" alt="Profile Picture" /></a></div>
{/if}
- <div class="date">{tr}Joined: {/tr}{$comment.registration_date|bit_short_date}</div>
+ <div class="date">Joined: {$comment.registration_date|bit_short_date}</div>
{/if}
</div>
@@ -25,29 +25,31 @@
<div class="wrapper{if $gBitUser->getPreference('boards_show_avatars','y') == 'y'} showavatar{/if}{if $smarty.request.comments_style eq 'threaded'} indent{$comment.level}{/if}">
{if !$post_is_preview}
<div class="floaticon">
- {if $print_page ne 'y' && $comment.deleted==0 }
- {if !$topic_locked && $board->hasPostCommentsPermission()}
- <a href="{$comments_return_url}&amp;post_comment_reply_id={$comment.content_id}&amp;post_comment_request=1#editcomments" rel="nofollow">{booticon iname="fa-comment" iexplain="Reply to this Post"}</a>
- <a href="{$comments_return_url}&amp;post_comment_reply_id={$comment.content_id}&amp;post_comment_request=1&amp;quote=y#editcomments" rel="nofollow">{booticon iname="fa-comment-quote" iexplain="Reply with Quote to this Post"}</a>
+ {if $print_page ne 'y' and $comment.deleted==0 }
+ {if !$topic_locked and $board->hasPostCommentsPermission()}
+ <a href="{$comments_return_url}&amp;post_comment_reply_id={$comment.content_id}&amp;post_comment_request=1#editcomments" rel="nofollow">{booticon iname="icon-comment-alt" ipackage="icons" iexplain="Reply to this Post" iforce="icon"}</a>
{/if}
- {if $comment.is_editable || $gContent->hasUserPermission('p_liberty_edit_comments')}
- <a href="{$comments_return_url}&amp;post_comment_id={$comment.comment_id}&amp;post_comment_request=1#editcomments" rel="nofollow">{booticon iname="fa-pen-to-square" iexplain="Edit"}</a>
+ {if !$topic_locked and $board->hasPostCommentsPermission()}
+ <a href="{$comments_return_url}&amp;post_comment_reply_id={$comment.content_id}&amp;post_comment_request=1&amp;quote=y#editcomments" rel="nofollow">{booticon ipackage="icons" iname="icon-comment" iexplain="Reply with Quote to this Post" iforce="icon"}</a>
+ {/if}
+ {if $comment.is_editable or $gContent->hasUserPermission('p_liberty_edit_comments')}
+ <a href="{$comments_return_url}&amp;post_comment_id={$comment.comment_id}&amp;post_comment_request=1#editcomments" rel="nofollow">{booticon iname="icon-edit" ipackage="icons" iexplain="Edit" iforce="icon"}</a>
{/if}
{if $board->hasUserPermission( 'p_liberty_admin_comments' )}
- <a href="{$comments_return_url}&amp;delete_comment_id={$comment.comment_id}" rel="nofollow">{booticon iname="fa-trash" iexplain="Remove"}</a>
+ <a href="{$comments_return_url}&amp;delete_comment_id={$comment.comment_id}" rel="nofollow">{booticon iname="icon-trash" ipackage="icons" iexplain="Remove" iforce="icon"}</a>
{/if}
- {if $board->hasUpdatePermission() && (($comment.user_id<0 && $comment.is_approved==0)||$comment.user_id>=0) && !$comment.is_warned}
- {if $comment.user_id<0 && $comment.is_approved==0}
- <a title="{tr}Approve this post{/tr}" href="{$smarty.const.BOARDS_PKG_URL}view_topic_inc.php?t={$thread->mRootId}&amp;action=1&amp;comment_id={$comment.comment_id}">
- {booticon iname="fa-circle-plus" iexplain="Approve Post"}
+ {if $board->hasUpdatePermission() and (($comment.user_id<0 and $comment.is_approved==0)or$comment.user_id>=0) and !$comment.is_warned}
+ {if $comment.user_id<0 and $comment.is_approved==0}
+ <a title="Approve this post" href="{$smarty.const.BOARDS_PKG_URL}view_topic_inc.php?t={$thread->mRootId}&amp;action=1&amp;comment_id={$comment.comment_id}">
+ {booticon iname="icon-plus-sign" ipackage="icons" iexplain="Approve Post" iforce="icon"}
</a>
- <a title="{tr}Reject this post{/tr}" href="{$smarty.const.BOARDS_PKG_URL}view_topic_inc.php?t={$thread->mRootId}&amp;action=2&amp;comment_id={$comment.comment_id}">
- {booticon iname="fa-circle-minus" iexplain="Reject Post"}
+ <a title="Reject this post" href="{$smarty.const.BOARDS_PKG_URL}view_topic_inc.php?t={$thread->mRootId}&amp;action=2&amp;comment_id={$comment.comment_id}">
+ {booticon iname="icon-minus-sign" ipackage="icons" iexplain="Reject Post" iforce="icon"}
</a>
- {elseif !$comment.is_warned && $comment.user_id>=0}
- <a onclick="return BitBoards.warn( 'warn_block_{$comment.comment_id|escape:"url"}', this )" title="{tr}Warn the poster about this post{/tr}" href="{$smarty.const.BOARDS_PKG_URL}view_topic_inc.php?t={$thread->mRootId}&amp;action=3&amp;comment_id={$comment.comment_id}">
- {booticon iname="fa-triangle-exclamation" iexplain="Warn Post"}
+ {elseif !$comment.is_warned and $comment.user_id>=0}
+ <a onclick="return BitBoards.warn( 'warn_block_{$comment.comment_id|escape:"url"}', this )" title="Warn the poster about this post" href="{$smarty.const.BOARDS_PKG_URL}view_topic_inc.php?t={$thread->mRootId}&amp;action=3&amp;comment_id={$comment.comment_id}">
+ {booticon iname="icon-warning-sign" ipackage="icons" iexplain="Warn Post" iforce="icon"}
</a>
<div class="warn_block" style="display:none;" id="warn_block_{$comment.comment_id|escape:"url"}">
@@ -70,13 +72,13 @@
{if $comment.title neq ""}<h2>{$comment.title|escape}</h2>{/if}
<span class="date">
{if $gBitUser->getPreference('boards_show_avatars','y') != 'y'}
- {tr}Posted by{/tr}: {if $comment.user_id < 0}{$comment.unreg_uname|escape}{else}{displayname hash=$comment}{/if},
+ Posted by: {if $comment.user_id < 0}{$comment.unreg_uname|escape}{else}{displayname hash=$comment}{/if},
{else}
- {tr}Posted{/tr}:
+ Posted:
{/if}
{$comment.created|reltime}
- {if $board->hasAdminPermission() && $comment.last_modified != $comment.created}
- <em> {tr}Last modified{/tr}:
+ {if $board->hasAdminPermission() and $comment.last_modified != $comment.created}
+ <em> Last modified:
{if $comment.user_id < 0}
{$comment.unreg_uname|escape}
{else}
@@ -111,7 +113,7 @@
');
return false;
" href="{$thread_mInfo.display_url}&amp;warning[{$comment_id}]={if empty($warnings.$comment_id)}show{else}hide{/if}"
- >{booticon iname="fa-triangle-exclamation" iexplain="Warned Post"}</a>
+ >{booticon ipackage="icons" iname="icon-warning-sign" iexplain="Warned Post"}</a>
<div id="warned_message_{$comment.comment_id|escape:"url"}">
{if !empty($warnings.$comment_id)}{$comment.warned_message}{/if}
diff --git a/templates/topic_move.tpl b/templates/topic_move.tpl
index 2d7e2ab..0691e7a 100644..100755
--- a/templates/topic_move.tpl
+++ b/templates/topic_move.tpl
@@ -4,7 +4,7 @@
<div class="admin boards">
<div class="header">
- <h1>{tr}Move Topic{/tr}: {$gContent->mInfo.title|escape}</h1>
+ <h1>Move Topic: {$gContent->mInfo.title|escape}</h1>
</div>
<div class="body">
@@ -21,13 +21,13 @@
<option value="{$content_id|escape}">{$board_title|escape}</option>
{/if}
{foreachelse}
- <option>{tr}No records found{/tr}</option>
+ <option>No records found</option>
{/foreach}
</select>
{/forminput}
</div>
<div class="form-group submit">
- <input type="submit" class="btn btn-default" name="move_thread" value="{tr}Move Topic{/tr}" />
+ <input type="submit" class="btn btn-default" name="move_thread" value="Move Topic" />
</div>
{/form}
</div><!-- end .body -->
diff --git a/templates/user_preferences_inc.tpl b/templates/user_preferences_inc.tpl
index ce3503d..bccc6b7 100644..100755
--- a/templates/user_preferences_inc.tpl
+++ b/templates/user_preferences_inc.tpl
@@ -25,7 +25,7 @@
</div>
{/foreach}
<div class="form-group submit">
- <input type="submit" class="btn btn-default" name="boards[submit]" value="{tr}Change Settings{/tr}" />
+ <input type="submit" class="btn btn-default" name="boards[submit]" value="Change Settings" />
</div>
{/form}
{/if}
@@ -35,7 +35,7 @@
{formfeedback warning=$error}
{textarea gContent=$signatureContent name="bitboarduprefs[edit]" rows=4 edit=$editUser->getPreference('signature_content_data')}
<div class="form-group submit">
- <input type="submit" class="btn btn-default" name="preview" value="{tr}Preview{/tr}" /> <input type="submit" class="btn btn-default" name="save_bitboarduprefs" value="{tr}Save{/tr}" />
+ <input type="submit" class="btn btn-default" name="preview" value="Preview" /> <input type="submit" class="btn btn-default" name="save_bitboarduprefs" value="Save" />
</div>
{/form}
diff --git a/topic_move.php b/topic_move.php
index 4c4fefd..a1a8415 100644..100755
--- a/topic_move.php
+++ b/topic_move.php
@@ -7,7 +7,7 @@
/**
* required setup
*/
-require_once( '../kernel/includes/setup_inc.php' );
+require_once '../kernel/includes/setup_inc.php';
// Is package installed and enabled
$gBitSystem->verifyPackage( 'boards' );
@@ -44,7 +44,7 @@ if( isset( $_REQUEST["target"] ) ) {
// get list of boards we can move the topic to
$boards = $board->getBoardSelectList();
-$gBitSmarty->assignByRef('boards', $boards);
+$gBitSmarty->assign('boards', $boards);
$gBitSmarty->assign('fromBoardId', $board->mContentId);