diff options
| author | Lester Caine <lester@lsces.co.uk> | 2026-05-14 09:51:41 +0100 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2026-05-14 09:51:41 +0100 |
| commit | b3ad3ad85eb5a910c191a3966e5c01f2fb88a4d3 (patch) | |
| tree | f4595f230baa2eaa7dff6f49c0d197b931fee673 | |
| parent | 7a21da41db5ab3bdb5777b6ff501fc210fbb02ad (diff) | |
| download | newsletters-b3ad3ad85eb5a910c191a3966e5c01f2fb88a4d3.tar.gz newsletters-b3ad3ad85eb5a910c191a3966e5c01f2fb88a4d3.tar.bz2 newsletters-b3ad3ad85eb5a910c191a3966e5c01f2fb88a4d3.zip | |
php-cs-fixer tidies to php8.5 standards
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
45 files changed, 220 insertions, 224 deletions
diff --git a/.htaccess b/.htaccess index 1d7030b..1d7030b 100644..100755 --- a/.htaccess +++ b/.htaccess diff --git a/admin/admin_newsletter_subscriptions.php b/admin/admin_newsletter_subscriptions.php index b39293a..b25682d 100644 --- a/admin/admin_newsletter_subscriptions.php +++ b/admin/admin_newsletter_subscriptions.php @@ -35,11 +35,11 @@ if( $gContent->isValid() ) { foreach( $_REQUEST["checked"] as $del ) { $formHash['input'][] = '<input type="hidden" name="checked[]" value="'.$del.'"/>'; } - $gBitSystem->confirmDialog( $formHash, - array( + $gBitSystem->confirmDialog( $formHash, + [ 'warning' => tra('Are you sure you want to delete these subscriptions?') . ' (' . tra('Count: ') . count( $_REQUEST["checked"] ) . ')', 'error' => tra('This cannot be undone!'), - ) + ], ); } else { foreach ($_REQUEST["checked"] as $delete) { @@ -56,11 +56,11 @@ if( $gContent->isValid() ) { foreach( $_REQUEST["checked"] as $del ) { $formHash['input'][] = '<input type="hidden" name="checked[]" value="'.$del.'"/>'; } - $gBitSystem->confirmDialog( $formHash, - array( + $gBitSystem->confirmDialog( $formHash, + [ 'warning' => tra('Are you sure you want to unsubcsribe these subscriptions?') . ' (' . tra('Count: ') . count( $_REQUEST["checked"] ) . ')', 'error' => tra('This cannot be undone!'), - ) + ], ); } else { foreach ($_REQUEST["checked"] as $delete) { @@ -77,11 +77,11 @@ if( $gContent->isValid() ) { foreach( $_REQUEST["checked"] as $del ) { $formHash['input'][] = '<input type="hidden" name="checked[]" value="'.$del.'"/>'; } - $gBitSystem->confirmDialog( $formHash, - array( - 'warning' => tra('Are you sure you want to resubscribe these subscriptions?') . ' (' . tra('Count: ') . count( $_REQUEST["checked"] ) . ')', + $gBitSystem->confirmDialog( $formHash, + [ + 'warning' => tra('Are you sure you want to resubscribe these subscriptions?') . ' (' . tra('Count: ') . count( $_REQUEST["checked"] ) . ')', 'error' => tra('This cannot be undone!'), - ) + ], ); } else { foreach ($_REQUEST["checked"] as $delete) { @@ -108,6 +108,6 @@ include_once( CATEGORIES_PKG_INCLUDE_PATH.'categorize_list_inc.php' ); */ // Display the template -$gBitSystem->display( 'bitpackage:newsletters/admin_newsletter_subscriptions.tpl' , NULL, array( 'display_mode' => 'admin' )); +$gBitSystem->display( 'bitpackage:newsletters/admin_newsletter_subscriptions.tpl' , NULL, [ 'display_mode' => 'admin' ]); ?> diff --git a/admin/admin_newsletters.php b/admin/admin_newsletters.php index 05dbd9d..05812ab 100755 --- a/admin/admin_newsletters.php +++ b/admin/admin_newsletters.php @@ -19,10 +19,10 @@ if( isset( $_REQUEST["remove"] ) && $gContent->isValid() ) { } elseif( empty( $_REQUEST['confirm'] ) ) { $formHash['remove'] = TRUE; $formHash['nl_id'] = $gContent->mNewsletterId; - $gBitSystem->confirmDialog( $formHash, - array( - 'warning' => tra('Are you sure you want to delete this newsletter?') . ' ' . $gContent->getTitle() - ) + $gBitSystem->confirmDialog( $formHash, + [ + 'warning' => tra('Are you sure you want to delete this newsletter?') . ' ' . $gContent->getTitle(), + ], ); } else { if( $gContent->expunge() ) { @@ -62,5 +62,5 @@ include_once( CATEGORIES_PKG_INCLUDE_PATH.'categorize_list_inc.php' ); */ // Display the template -$gBitSystem->display( 'bitpackage:newsletters/list_newsletters.tpl', NULL, array( 'display_mode' => 'admin' )); +$gBitSystem->display( 'bitpackage:newsletters/list_newsletters.tpl', NULL, [ 'display_mode' => 'admin' ]); diff --git a/admin/admin_newsletters_inc.php b/admin/admin_newsletters_inc.php index ca0801b..f8824f8 100644 --- a/admin/admin_newsletters_inc.php +++ b/admin/admin_newsletters_inc.php @@ -1,50 +1,50 @@ <?php // $Header$ -$formNewsletterFeatures = array( - "bitmailer_sender_email" => array( +$formNewsletterFeatures = [ + "bitmailer_sender_email" => [ 'label' => 'From Email', 'note' => 'If empty, it will default to the site Sender Email', 'default' => $gBitSystem->getConfig( 'site_sender_email', $_SERVER['SERVER_ADMIN'] ), - ), - "bitmailer_from" => array( + ], + "bitmailer_from" => [ 'label' => 'From Name', 'note' => '', 'default' => $gBitSystem->getConfig( 'siteTitle' ), - ), - "bitmailer_servers" => array( + ], + "bitmailer_servers" => [ 'label' => 'Mail Servers', 'note' => '', 'default' => $gBitSystem->getConfig( 'kernel_server_name', '127.0.0.1' ), - ), - "bitmailer_smtp_username" => array( + ], + "bitmailer_smtp_username" => [ 'label' => 'SMTP Username', 'note' => 'Only required for authenticated outbound mail servers.', 'default' => $gBitSystem->getConfig( 'bitmailer_smtp_username' ), - ), - "bitmailer_smtp_password" => array( + ], + "bitmailer_smtp_password" => [ 'label' => 'SMTP Password', 'note' => 'Password for the above SMTP Username', 'default' => $gBitSystem->getConfig( 'bitmailer_smtp_password' ), - ), - "bitmailer_protocol" => array( + ], + "bitmailer_protocol" => [ 'label' => 'Protocol', 'note' => '', 'default' => 'smtp', - ), - "bitmailer_word_wrap" => array( + ], + "bitmailer_word_wrap" => [ 'label' => 'Word wrap', 'note' => '', 'default' => '75', - ), -); + ], +]; $gBitSmarty->assign( 'formNewsletterFeatures',$formNewsletterFeatures ); if( !empty( $_POST ) ) { foreach( array_keys( $formNewsletterFeatures ) as $key ) { if( empty( $_REQUEST[$key] ) || $_REQUEST[$key] != $formNewsletterFeatures[$key]['default'] ) { - $gBitSystem->storeConfig( $key, isset( $_REQUEST[$key] ) ? $_REQUEST[$key] : NULL ); + $gBitSystem->storeConfig( $key, $_REQUEST[$key] ?? NULL ); } } } diff --git a/admin/mail_queue.php b/admin/mail_queue.php index 0d79434..05f5eac 100755 --- a/admin/mail_queue.php +++ b/admin/mail_queue.php @@ -15,7 +15,7 @@ $gBitNewsletterMailer = new BitNewsletterMailer(); if( !empty( $_REQUEST['batch_command'] ) && !empty( $_REQUEST['queue_id'] ) ) { if( $_REQUEST['batch_command'] == 'delete' ) { - foreach( $_REQUEST['queue_id'] as $qId ) { + foreach( $_REQUEST['queue_id'] as $qId ) { $gBitNewsletterMailer->expungeQueueRow( $qId ); } } elseif( $_REQUEST['batch_command'] == 'send' && !empty( $_REQUEST['queue_id'] ) ) { @@ -26,9 +26,9 @@ if( !empty( $_REQUEST['batch_command'] ) && !empty( $_REQUEST['queue_id'] ) ) { } if( empty( $_REQUEST['batch_command'] ) || $_REQUEST['batch_command'] != 'send' ) { - $listHash = array(); + $listHash = []; $queue = $gBitNewsletterMailer->getQueue( $listHash ); $gBitSmarty->assign( 'queue', $queue ); - $gBitSystem->display( 'bitpackage:newsletters/mail_queue.tpl' , NULL, array( 'display_mode' => 'admin' )); + $gBitSystem->display( 'bitpackage:newsletters/mail_queue.tpl' , NULL, [ 'display_mode' => 'admin' ]); } diff --git a/admin/schema_inc.php b/admin/schema_inc.php index 9f7c05d..08f199a 100644 --- a/admin/schema_inc.php +++ b/admin/schema_inc.php @@ -1,6 +1,6 @@ <?php -$tables = array( +$tables = [ 'newsletters' => " nl_id I4 AUTO PRIMARY, @@ -81,9 +81,9 @@ $tables = array( clicks I4 CONSTRAINT ', CONSTRAINT `mail_clickthrough_user_ref` FOREIGN KEY (`user_id`) REFERENCES `".BIT_DB_PREFIX."users_users` (`user_id`), CONSTRAINT `mail_clickthrough_content_ref` FOREIGN KEY (`content_id`) REFERENCES `".BIT_DB_PREFIX."liberty_content` (`content_id`)' -" +", -); +]; global $gBitInstaller; @@ -91,36 +91,36 @@ foreach( array_keys( $tables ) AS $tableName ) { $gBitInstaller->registerSchemaTable( NEWSLETTERS_PKG_DIR, $tableName, $tables[$tableName] ); } -$gBitInstaller->registerPackageInfo( NEWSLETTERS_PKG_NAME, array( +$gBitInstaller->registerPackageInfo( NEWSLETTERS_PKG_NAME, [ 'description' => "Newsletters is for emailing users updates about your site.", 'license' => '<a href="http://www.gnu.org/licenses/licenses.html#LGPL">LGPL</a>', -) ); +] ); // ### Indexes -$indices = array ( - 'mail_sub_nl_idx' => array( 'table' => 'mail_subscriptions', 'cols' => 'content_id', 'opts' => NULL ), - 'mail_sub_user_idx' => array( 'table' => 'mail_subscriptions', 'cols' => 'user_id', 'opts' => NULL ), - 'mail_sub_email_idx' => array( 'table' => 'mail_subscriptions', 'cols' => 'email', 'opts' => NULL ), - 'nl_ed_nl_idx' => array( 'table' => 'newsletters_editions', 'cols' => 'nl_content_id', 'opts' => NULL ), - 'nl_ed_content_idx' => array( 'table' => 'newsletters_editions', 'cols' => 'content_id', 'opts' => NULL ), - 'mailq_email_idx' => array( 'table' => 'mail_queue', 'cols' => 'email', 'opts' => NULL ), - 'mailq_user_idx' => array( 'table' => 'mail_queue', 'cols' => 'user_id', 'opts' => NULL ), - 'mailq_content_idx' => array( 'table' => 'mail_queue', 'cols' => 'content_id', 'opts' => NULL ), - 'mailq_user_content_idx' => array( 'table' => 'mail_queue', 'cols' => array('content_id','user_id'), 'opts' => array( 'UNIQUE' ) ), - 'mailq_sent_idx' => array( 'table' => 'mail_queue', 'cols' => 'sent_date', 'opts' => NULL ), -); +$indices = [ + 'mail_sub_nl_idx' => [ 'table' => 'mail_subscriptions', 'cols' => 'content_id', 'opts' => NULL ], + 'mail_sub_user_idx' => [ 'table' => 'mail_subscriptions', 'cols' => 'user_id', 'opts' => NULL ], + 'mail_sub_email_idx' => [ 'table' => 'mail_subscriptions', 'cols' => 'email', 'opts' => NULL ], + 'nl_ed_nl_idx' => [ 'table' => 'newsletters_editions', 'cols' => 'nl_content_id', 'opts' => NULL ], + 'nl_ed_content_idx' => [ 'table' => 'newsletters_editions', 'cols' => 'content_id', 'opts' => NULL ], + 'mailq_email_idx' => [ 'table' => 'mail_queue', 'cols' => 'email', 'opts' => NULL ], + 'mailq_user_idx' => [ 'table' => 'mail_queue', 'cols' => 'user_id', 'opts' => NULL ], + 'mailq_content_idx' => [ 'table' => 'mail_queue', 'cols' => 'content_id', 'opts' => NULL ], + 'mailq_user_content_idx' => [ 'table' => 'mail_queue', 'cols' => ['content_id','user_id'], 'opts' => [ 'UNIQUE' ] ], + 'mailq_sent_idx' => [ 'table' => 'mail_queue', 'cols' => 'sent_date', 'opts' => NULL ], +]; $gBitInstaller->registerSchemaIndexes( NEWSLETTERS_PKG_NAME, $indices ); // ### Default UserPermissions -$gBitInstaller->registerUserPermissions( NEWSLETTERS_PKG_NAME, array( - array('p_newsletters_admin', 'Can admin and send newsletters', 'editors', 'newsletters'), - array('p_newsletters_create', 'Can create newsletters', 'editors', 'newsletters'), - array('p_newsletters_create_editions', 'Can create editions', 'editors', 'newsletters'), - array('p_newsletters_subscribe', 'Can subscribe to newsletters', 'registered', 'newsletters'), - array('p_newsletters_subscribe_email', 'Can subscribe any email to newsletters', 'editors', 'newsletters'), -) ); +$gBitInstaller->registerUserPermissions( NEWSLETTERS_PKG_NAME, [ + ['p_newsletters_admin', 'Can admin and send newsletters', 'editors', 'newsletters'], + ['p_newsletters_create', 'Can create newsletters', 'editors', 'newsletters'], + ['p_newsletters_create_editions', 'Can create editions', 'editors', 'newsletters'], + ['p_newsletters_subscribe', 'Can subscribe to newsletters', 'registered', 'newsletters'], + ['p_newsletters_subscribe_email', 'Can subscribe any email to newsletters', 'editors', 'newsletters'], +] ); // Requirements -$gBitInstaller->registerRequirements( NEWSLETTERS_PKG_NAME, array( - 'liberty' => array( 'min' => '2.1.4' ), -)); +$gBitInstaller->registerRequirements( NEWSLETTERS_PKG_NAME, [ + 'liberty' => [ 'min' => '2.1.4' ], +]); diff --git a/admin/send.php b/admin/send.php index 77f46ae..f2d13cd 100755 --- a/admin/send.php +++ b/admin/send.php @@ -16,7 +16,7 @@ $gBitSystem->verifyPermission( 'p_send_newsletters' ); require_once( NEWSLETTERS_PKG_INCLUDE_PATH.'lookup_newsletter_edition_inc.php' ); -$feedback = array(); +$feedback = []; if( @BitBase::verifyId( $_REQUEST["edition_id"] ) ) { $gContent->mEditionId = $_REQUEST["edition_id"]; @@ -49,12 +49,12 @@ if( $gContent->isValid() && isset( $_REQUEST['preview'] ) && isset( $_REQUEST['s } if( $gContent->isValid() ) { - $groupListHash = array(); + $groupListHash = []; $groups = $gBitUser->getAllGroups( $groupListHash ); $groups['send_subs']['group_name'] = 'Send to subscribers'; $gBitSmarty->assign( 'groupList', $groups ); } else { - $listHash = array(); + $listHash = []; $editions = $gContent->getList( $listHash ); $gBitSmarty->assign( 'editionList', $editions ); @@ -66,5 +66,5 @@ if( $gContent->isValid() ) { $gBitSmarty->assign( 'feedback', $feedback ); // Display the template -$gBitSystem->display( 'bitpackage:newsletters/send_newsletters.tpl' , tra( "Send Newsletter" ).': '.$gContent->getTitle() , array( 'display_mode' => 'admin' )); +$gBitSystem->display( 'bitpackage:newsletters/send_newsletters.tpl' , tra( "Send Newsletter" ).': '.$gContent->getTitle() , [ 'display_mode' => 'admin' ]); diff --git a/admin/upgrade_inc.php b/admin/upgrade_inc.php index 5581855..243723b 100644 --- a/admin/upgrade_inc.php +++ b/admin/upgrade_inc.php @@ -1,78 +1,78 @@ <?php global $gBitSystem, $gUpgradeFrom, $gUpgradeTo; -$upgrades = array( +$upgrades = [ -'BONNIE' => array( - 'CLYDE' => array( -array( 'RENAMETABLE' => array( - 'tiki_sent_newsletters' => 'tiki_newsletters_editions', - 'tiki_newsletter_subscriptions' => 'tiki_mail_subscriptions', -)), +'BONNIE' => [ + 'CLYDE' => [ +[ 'RENAMETABLE' => [ + 'tiki_sent_newsletters' => 'tiki_newsletters_editions', + 'tiki_newsletter_subscriptions' => 'tiki_mail_subscriptions', +]], // STEP 1 -array( 'DATADICT' => array( - array( 'RENAMECOLUMN' => array( - 'tiki_newsletters' => array( '`nlId`' => '`nl_id` I4 AUTO' ), - 'tiki_newsletters' => array( '`allowUserSub`' => "`allow_user_sub` C(1) default 'y'" ), - 'tiki_newsletters' => array( '`allowAnySub`' => '`allow_any_sub` C(1)' ), - 'tiki_newsletters' => array( '`unsubMsg`' => "`unsub_msg` C(1) default 'y'" ), - 'tiki_newsletters' => array( '`validateAddr`' => "`validate_addr` C(1) default 'y'" ), - 'tiki_newsletters' => array( '`lastSent`' => '`last_sent` I8' ), - 'tiki_newsletters_editions' => array( '`editionId`' => '`edition_id` I4 AUTO' ), - 'tiki_newsletter_subscriptions' => array( '`code`' => "`sub_code` C(36)" ), - 'tiki_newsletter_subscriptions' => array( '`valid`' => "`is_valid` C(1)" ), - 'tiki_newsletter_subscriptions' => array( '`subscribed`' => "`subscribed_date` I8" ), - )), +[ 'DATADICT' => [ + [ 'RENAMECOLUMN' => [ + 'tiki_newsletters' => [ '`nlId`' => '`nl_id` I4 AUTO' ], + 'tiki_newsletters' => [ '`allowUserSub`' => "`allow_user_sub` C(1) default 'y'" ], + 'tiki_newsletters' => [ '`allowAnySub`' => '`allow_any_sub` C(1)' ], + 'tiki_newsletters' => [ '`unsubMsg`' => "`unsub_msg` C(1) default 'y'" ], + 'tiki_newsletters' => [ '`validateAddr`' => "`validate_addr` C(1) default 'y'" ], + 'tiki_newsletters' => [ '`lastSent`' => '`last_sent` I8' ], + 'tiki_newsletters_editions' => [ '`editionId`' => '`edition_id` I4 AUTO' ], + 'tiki_newsletter_subscriptions' => [ '`code`' => "`sub_code` C(36)" ], + 'tiki_newsletter_subscriptions' => [ '`valid`' => "`is_valid` C(1)" ], + 'tiki_newsletter_subscriptions' => [ '`subscribed`' => "`subscribed_date` I8" ], + ]], // ALTER - array( 'ALTER' => array( - 'tiki_newsletters' => array( - 'content_id' => array( '`content_id`', 'I4' ), - ), - 'tiki_newsletters_editions' => array( - 'content_id' => array( '`content_id`', 'I4' ), - 'nl_content_id' => array( '`nl_content_id`', 'I4' ), - 'is_draft' => array( '`is_draft`', 'C(1)' ), - ), - 'tiki_newsletter_subscriptions' => array( - 'nl_content_id' => array( '`nl_content_id`', 'I4' ), - 'response_content_id' => array( '`response_content_id`', 'I4' ), - 'unsubscribe_all' => array( '`unsubscribe_all`', 'C(1)' ), - 'unsubscribe_date' => array( '`unsubscribe_date`', 'I8' ), - ), - )), + [ 'ALTER' => [ + 'tiki_newsletters' => [ + 'content_id' => [ '`content_id`', 'I4' ], + ], + 'tiki_newsletters_editions' => [ + 'content_id' => [ '`content_id`', 'I4' ], + 'nl_content_id' => [ '`nl_content_id`', 'I4' ], + 'is_draft' => [ '`is_draft`', 'C(1)' ], + ], + 'tiki_newsletter_subscriptions' => [ + 'nl_content_id' => [ '`nl_content_id`', 'I4' ], + 'response_content_id' => [ '`response_content_id`', 'I4' ], + 'unsubscribe_all' => [ '`unsubscribe_all`', 'C(1)' ], + 'unsubscribe_date' => [ '`unsubscribe_date`', 'I8' ], + ], + ]], // CREATE - array( 'CREATE' => array ( - )), -)), + [ 'CREATE' => [ + ]], +]], // STEP 3 -array( 'QUERY' => - array( 'SQL92' => array( - ), -)), +[ 'QUERY' => + [ 'SQL92' => [ + ], +], ], // STEP 6 -array( 'DATADICT' => array( - array( 'DROPCOLUMN' => array( - 'tiki_newsletters' => array( '`name`', '`description`', '`created`', '`users`', '`editions`' ), - )), -)), - ) -), +[ 'DATADICT' => [ + [ 'DROPCOLUMN' => [ + 'tiki_newsletters' => [ '`name`', '`description`', '`created`', '`users`', '`editions`' ], + ]], +]], + ], +], - 'BWR1' => array( - 'BWR2' => array( + 'BWR1' => [ + 'BWR2' => [ // de-tikify tables -array( 'DATADICT' => array( - array( 'RENAMETABLE' => array( +[ 'DATADICT' => [ + [ 'RENAMETABLE' => [ 'tiki_newsletters' => 'newsletters', 'tiki_newsletters_editions' => 'newsletters_editions', 'tiki_mail_subscriptions' => 'mail_subscriptions', 'tiki_mail_errors' => 'mail_errors', 'tiki_mail_mailings' => 'mail_mailings', 'tiki_mail_queue' => 'mail_queue', - )), - array( 'CREATE' => array ( + ]], + [ 'CREATE' => [ 'mail_clickthrough' => " user_id I4 NOTNULL, content_id I4 NOTNULL, @@ -80,21 +80,20 @@ array( 'DATADICT' => array( clicks I4 CONSTRAINT ', CONSTRAINT `mail_clickthrough_user_ref` FOREIGN KEY (`user_id`) REFERENCES `".BIT_DB_PREFIX."users_users` (`user_id`), CONSTRAINT `mail_clickthrough_content_ref` FOREIGN KEY (`content_id`) REFERENCES `".BIT_DB_PREFIX."liberty_content` (`content_id`)' - " - )), - array( 'ALTER' => array( - 'mail_queue' => array( - 'last_read_ip' => array( '`last_read_ip`', 'VARCHAR(40)' ), - ), - )), -)), - ) - ), -); + ", + ]], + [ 'ALTER' => [ + 'mail_queue' => [ + 'last_read_ip' => [ '`last_read_ip`', 'VARCHAR(40)' ], + ], + ]], +]], + ], + ], +]; if( isset( $upgrades[$gUpgradeFrom][$gUpgradeTo] ) ) { $gBitSystem->registerUpgrade( NEWSLETTERS_PKG_NAME, $upgrades[$gUpgradeFrom][$gUpgradeTo] ); } - ?> diff --git a/admin/upgrades/1.0.1.php b/admin/upgrades/1.0.1.php index 11428d6..cb0c1be 100644 --- a/admin/upgrades/1.0.1.php +++ b/admin/upgrades/1.0.1.php @@ -4,23 +4,23 @@ */ global $gBitInstaller; -$infoHash = array( +$infoHash = [ 'package' => NEWSLETTERS_PKG_NAME, 'version' => str_replace( '.php', '', basename( __FILE__ )), 'description' => "Minor fix to ip columns to support IPv6", 'post_upgrade' => NULL, -); +]; // Increase the size of the IP column to cope with IPv6 -$gBitInstaller->registerPackageUpgrade( $infoHash, array( +$gBitInstaller->registerPackageUpgrade( $infoHash, [ -array( 'QUERY' => - array( - 'PGSQL' => array( "ALTER TABLE `".BIT_DB_PREFIX."mail_queue` ALTER `last_read_ip` TYPE VARCHAR(39)" ,), - 'OCI' => array( "ALTER TABLE `".BIT_DB_PREFIX."mail_queue` MODIFY (`last_read_ip` TYPE VARCHAR2(39))" ,), - 'MYSQL' => array( "ALTER TABLE `".BIT_DB_PREFIX."mail_queue` MODIFY `last_read_ip` VARCHAR(39)" ,), - ), -), +[ 'QUERY' => + [ + 'PGSQL' => [ "ALTER TABLE `".BIT_DB_PREFIX."mail_queue` ALTER `last_read_ip` TYPE VARCHAR(39)" ,], + 'OCI' => [ "ALTER TABLE `".BIT_DB_PREFIX."mail_queue` MODIFY (`last_read_ip` TYPE VARCHAR2(39))" ,], + 'MYSQL' => [ "ALTER TABLE `".BIT_DB_PREFIX."mail_queue` MODIFY `last_read_ip` VARCHAR(39)" ,], + ], +], -)); +]); ?> diff --git a/admin/upgrades/1.0.2.php b/admin/upgrades/1.0.2.php index 28eea19..5a0f36d 100644 --- a/admin/upgrades/1.0.2.php +++ b/admin/upgrades/1.0.2.php @@ -4,23 +4,23 @@ */ global $gBitInstaller; -$infoHash = array( +$infoHash = [ 'package' => NEWSLETTERS_PKG_NAME, 'version' => str_replace( '.php', '', basename( __FILE__ )), 'description' => "Replace reserved name reads with hits", 'post_upgrade' => NULL, -); +]; // Increase the size of the IP column to cope with IPv6 -$gBitInstaller->registerPackageUpgrade( $infoHash, array( +$gBitInstaller->registerPackageUpgrade( $infoHash, [ -array( 'DATADICT' => array( - array( 'RENAMECOLUMN' => array( - 'mail_queue' => array( - '`reads`' => '`hits` I2 NOTNULL DEFAULT 0' - ), - )), -)), +[ 'DATADICT' => [ + [ 'RENAMECOLUMN' => [ + 'mail_queue' => [ + '`reads`' => '`hits` I2 NOTNULL DEFAULT 0', + ], + ]], +]], -)); +]); ?> diff --git a/edition.php b/edition.php index b07c788..ade0c7c 100755 --- a/edition.php +++ b/edition.php @@ -19,7 +19,7 @@ $gBitSystem->verifyPackage( 'newsletters' ); require_once( NEWSLETTERS_PKG_INCLUDE_PATH.'lookup_newsletter_edition_inc.php' ); -$listHash = array(); +$listHash = []; $newsletters = $gContent->mNewsletter->getList( $listHash ); $gBitSmarty->assign( 'newsletters', $newsletters ); @@ -29,10 +29,10 @@ if (isset($_REQUEST["remove"] ) && $gContent->isValid() ) { } elseif( empty( $_REQUEST['confirm'] ) ) { $formHash['remove'] = TRUE; $formHash['edition_id'] = $gContent->mEditionId; - $gBitSystem->confirmDialog( $formHash, - array( - 'warning' => tra('Are you sure you want to delete this newsletter edition?'). ' ' . $gContent->getTitle() - ) + $gBitSystem->confirmDialog( $formHash, + [ + 'warning' => tra('Are you sure you want to delete this newsletter edition?'). ' ' . $gContent->getTitle(), + ], ); } else { if( $gContent->expunge() ) { @@ -46,7 +46,7 @@ if( $gContent->isValid() ) { $title = $gContent->mInfo['title']; $mid = 'bitpackage:newsletters/view_edition.tpl'; } else { - $listHash = array(); + $listHash = []; $editions = $gContent->getList( $listHash ); $gBitSmarty->assign( 'editionList', $editions ); $gBitSmarty->assign( 'listInfo', $listHash ); @@ -55,5 +55,5 @@ if( $gContent->isValid() ) { } // Display the template -$gBitSystem->display( $mid, $title , array( 'display_mode' => 'edit' )); +$gBitSystem->display( $mid, $title , [ 'display_mode' => 'edit' ]); diff --git a/edition_edit.php b/edition_edit.php index 2d87faf..4188036 100755 --- a/edition_edit.php +++ b/edition_edit.php @@ -20,7 +20,7 @@ $gBitSystem->verifyPermission( 'p_newsletters_create_editions' ); require_once( NEWSLETTERS_PKG_INCLUDE_PATH.'lookup_newsletter_edition_inc.php' ); -$listHash = array(); +$listHash = []; $newsletters = $gContent->mNewsletter->getList( $listHash ); if( empty( $newsletters ) ) { @@ -42,7 +42,7 @@ if( !empty( $gContent->mInfo ) ) { if( isset( $_REQUEST["edit"] ) ) { $formInfo['data'] = $_REQUEST["edit"]; - $formInfo['format_guid'] = ( !empty( $_REQUEST['format_guid'] ) ? $_REQUEST['format_guid'] : ( isset( $gContent->mInfo['format_guid'] ) ? $gContent->mInfo['format_guid'] : 'tikiwiki' ) ); + $formInfo['format_guid'] = ( !empty( $_REQUEST['format_guid'] ) ? $_REQUEST['format_guid'] : ( $gContent->mInfo['format_guid'] ?? 'tikiwiki' ) ); } if( isset( $_REQUEST['title'] ) ) { $formInfo['title'] = $_REQUEST['title']; @@ -74,10 +74,10 @@ if (isset($_REQUEST["preview"])) { // } header( 'Location: '.$gContent->getDisplayUrl() ); die; - } else { + } $formInfo = $_REQUEST; $formInfo['data'] = &$_REQUEST['edit']; - } + } else { $gContent->invokeServices( 'content_edit_function' ); } @@ -94,4 +94,4 @@ $gBitSmarty->assign( 'pageInfo', $formInfo ); $gBitSmarty->assign( 'errors', $gContent->mErrors ); // Display the template -$gBitSystem->display( 'bitpackage:newsletters/edit_edition.tpl', ($gContent->isValid() ? tra( 'Edit Edition' ).': '.$gContent->getTitle() : tra( 'Create New Edition' )) , array( 'display_mode' => 'edit' )); +$gBitSystem->display( 'bitpackage:newsletters/edit_edition.tpl', ($gContent->isValid() ? tra( 'Edit Edition' ).': '.$gContent->getTitle() : tra( 'Create New Edition' )) , [ 'display_mode' => 'edit' ]); diff --git a/icons/pkg_newsletters.gif b/icons/pkg_newsletters.gif Binary files differindex 9b122cd..9b122cd 100644..100755 --- a/icons/pkg_newsletters.gif +++ b/icons/pkg_newsletters.gif diff --git a/icons/pkg_newsletters.png b/icons/pkg_newsletters.png Binary files differindex 5b8c836..5b8c836 100644..100755 --- a/icons/pkg_newsletters.png +++ b/icons/pkg_newsletters.png diff --git a/images/track.gif b/images/track.gif Binary files differindex e7749f2..e7749f2 100644..100755 --- a/images/track.gif +++ b/images/track.gif diff --git a/includes/bit_setup_inc.php b/includes/bit_setup_inc.php index f024dea..8c193f2 100644 --- a/includes/bit_setup_inc.php +++ b/includes/bit_setup_inc.php @@ -14,9 +14,9 @@ $pRegisterHash = [ define( 'NEWSLETTERS_PKG_NAME', $pRegisterHash['package_name'] ); define( 'NEWSLETTERS_PKG_URL', BIT_ROOT_URL . basename( $pRegisterHash['package_path'] ) . '/' ); define( 'NEWSLETTERS_PKG_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/' ); -define( 'NEWSLETTERS_PKG_INCLUDE_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/'); +define( 'NEWSLETTERS_PKG_INCLUDE_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/'); define( 'NEWSLETTERS_PKG_CLASS_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/classes/'); -define( 'NEWSLETTERS_PKG_ADMIN_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/admin/'); +define( 'NEWSLETTERS_PKG_ADMIN_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/admin/'); $gBitSystem->registerPackage( $pRegisterHash ); @@ -46,7 +46,7 @@ if( $gBitSystem->isPackageActive( NEWSLETTERS_PKG_NAME ) ) { $pObject->mDb->CompleteTrans(); } } - + function newsletters_user_register( &$pObject ) { if( !empty( $_REQUEST['newsletter_optin'] ) ) { // hidden flag to indicate at least one newsletter was displayed diff --git a/includes/classes/BitNewsletter.php b/includes/classes/BitNewsletter.php index 1e6ca2d..42a6bf8 100755 --- a/includes/classes/BitNewsletter.php +++ b/includes/classes/BitNewsletter.php @@ -23,6 +23,7 @@ * required setup */ namespace Bitweaver\Newsletters; + use Bitweaver\BitBase; use Bitweaver\KernelTools; use Bitweaver\Liberty\LibertyContent; @@ -99,7 +100,7 @@ class BitNewsletter extends LibertyContent { $this->mDb->StartTrans(); if( parent::store( $pParamHash ) ) { if( $this->mNewsletterId ) { - $result = $this->mDb->associateUpdate( BIT_DB_PREFIX."newsletters", $pParamHash['newsletter_store'], array ( "nl_id" => $this->mNewsletterId ) ); + $result = $this->mDb->associateUpdate( BIT_DB_PREFIX."newsletters", $pParamHash['newsletter_store'], [ "nl_id" => $this->mNewsletterId ] ); } else { $pParamHash['newsletter_store']['content_id'] = $pParamHash['content_id']; $result = $this->mDb->associateInsert( BIT_DB_PREFIX."newsletters", $pParamHash['newsletter_store'] ); @@ -207,7 +208,7 @@ class BitNewsletter extends LibertyContent { $gBitSmarty->assign( 'sub_code', $urlCode ); $mail_data = $gBitSmarty->fetch('bitpackage:newsletters/confirm_newsletter_subscription.tpl'); @mail($subEmail, KernelTools::tra('Newsletter subscription information at') . ' ' . $gBitSystem->getConfig( "bitmailer_from" ), $mail_data, - "From: " . $gBitSystem->getConfig( "sender_email" ) . "\r\nContent-type: text/plain;charset=utf-8\r\n"); + "From: " . $gBitSystem->getConfig( "sender_email" ) . "\r\nContent-type: text/plain;charset=utf-8\r\n", ); } $ret = TRUE; } @@ -246,7 +247,7 @@ class BitNewsletter extends LibertyContent { $gBitSmarty->assign( 'sub_code', $subRow["sub_code"] ); $mail_data = $gBitSmarty->fetch( 'bitpackage:newsletters/newsletter_byebye.tpl' ); @mail( $subRow["email"], KernelTools::tra( 'Thank you from' ) . ' ' . $gBitSystem->getConfig( "bitmailer_from" ), $mail_data, - "From: " . $gBitSystem->getConfig( "sender_email" ) . "\r\nContent-type: text/plain;charset=utf-8\r\n" ); + "From: " . $gBitSystem->getConfig( "sender_email" ) . "\r\nContent-type: text/plain;charset=utf-8\r\n", ); } $ret = true; } @@ -396,7 +397,6 @@ class BitNewsletter extends LibertyContent { return $ret; } - public function getEditions( $pNewsletterId = NULL ) { $ret = []; if( empty( $pNewsletterId ) ) { @@ -410,7 +410,7 @@ class BitNewsletter extends LibertyContent { } return $ret; } - + public function getUserSubscriptions( $pUserId, $pEmail ) { global $gBitDb; $query = "SELECT `content_id` AS hash_key, ms.* FROM `".BIT_DB_PREFIX."mail_subscriptions` ms WHERE `user_id`=? OR `email`=?"; @@ -418,6 +418,5 @@ class BitNewsletter extends LibertyContent { return $ret; } - } diff --git a/includes/classes/BitNewsletterEdition.php b/includes/classes/BitNewsletterEdition.php index 348533c..81f80d3 100755 --- a/includes/classes/BitNewsletterEdition.php +++ b/includes/classes/BitNewsletterEdition.php @@ -22,6 +22,7 @@ * required setup */ namespace Bitweaver\Newsletters; + use Bitweaver\BitBase; use Bitweaver\KernelTools; use Bitweaver\Liberty\LibertyMime; @@ -75,7 +76,7 @@ class BitNewsletterEdition extends LibertyMime { $this->mDb->StartTrans(); if( parent::store( $pParamHash ) ) { if( $this->mEditionId ) { - $result = $this->mDb->associateUpdate( BIT_DB_PREFIX."newsletters_editions", $pParamHash['edition_store'], array ( "edition_id" => $this->mEditionId ) ); + $result = $this->mDb->associateUpdate( BIT_DB_PREFIX."newsletters_editions", $pParamHash['edition_store'], [ "edition_id" => $this->mEditionId ] ); } else { $pParamHash['edition_store']['content_id'] = $pParamHash['content_id']; $result = $this->mDb->associateInsert( BIT_DB_PREFIX."newsletters_editions", $pParamHash['edition_store'] ); @@ -140,7 +141,6 @@ class BitNewsletterEdition extends LibertyMime { return $ret; } - public static function getList( &$pListHash ) { global $gBitDb; @@ -173,7 +173,7 @@ class BitNewsletterEdition extends LibertyMime { // remove formating tags $data = preg_replace( '/{[^{}]*}/', '', $ret[$k]['data'] ); } - $pListHash['total_records'] = $gBitDb->getOne( $query_cant, $bindVars ); + $pListHash['total_records'] = $gBitDb->getOne( $query_cant, $bindVars ); $pListHash['block_pages'] = 5; $pListHash['total_pages'] = ceil( $pListHash['total_records'] / $pListHash['max_records'] ); $pListHash['current_page'] = (!empty( $pListHash['offset'] ) ? floor( $pListHash['offset'] / $pListHash['max_records'] ) + 1 : 1 ); diff --git a/includes/classes/BitNewsletterMailer.php b/includes/classes/BitNewsletterMailer.php index fcea035..e7a060a 100644 --- a/includes/classes/BitNewsletterMailer.php +++ b/includes/classes/BitNewsletterMailer.php @@ -22,6 +22,7 @@ * required setup */ namespace Bitweaver\Newsletters; + use Bitweaver\BitBase; use Bitweaver\Liberty\LibertyContent; use Bitweaver\Users\RoleUser; @@ -32,28 +33,28 @@ require_once( UTIL_PKG_INCLUDE_PATH.'phpmailer/class.phpmailer.php' ); * @package newsletters */ class BitNewsletterMailer { - // Set default variables for all new objects - public $From; - public $FromName; - public $Host; - public $Mailer; // Alternative to IsSMTP() - public $WordWrap; + // Set default variables for all new objects + public $From; + public $FromName; + public $Host; + public $Mailer; // Alternative to IsSMTP() + public $WordWrap; public $mDb; public function BitNewsletterMailer () { global $gBitDb, $gBitSystem, $gBitLanguage; $this->mDb = $gBitDb; } - // Replace the default error_handler - public function error_handler( $msg ) { - global $gBitDb; + // Replace the default error_handler + public function error_handler( $msg ) { + global $gBitDb; - \Bitweaver\bit_error_handler( NULL, NULL, NULL, "FULFILLMENT ERROR: MISSSING PDF for ORDER" ); // $pOrderId CID ".$prod->mInfo['related_content_id'], $pdfInfo['pdf_file'] , '', $prod->mDb ); - print "My Site Error"; - print "Description:"; - printf("%s", $msg); - exit; - } + \Bitweaver\bit_error_handler( NULL, NULL, NULL, "FULFILLMENT ERROR: MISSSING PDF for ORDER" ); // $pOrderId CID ".$prod->mInfo['related_content_id'], $pdfInfo['pdf_file'] , '', $prod->mDb ); + print "My Site Error"; + print "Description:"; + printf("%s", $msg); + exit; + } public function isRecipientQueued( $pRecipientMixed, $pContentId ) { $lookupCol = BitBase::verifyId( $pRecipientMixed ) ? 'user_id' : 'email'; @@ -95,7 +96,6 @@ class BitNewsletterMailer { return $ret; } - public function tendQueue() { $this->mDb->StartTrans(); $query = "SELECT * @@ -121,7 +121,7 @@ class BitNewsletterMailer { $pick = $this->mDb->GetRow( "SELECT * FROM `".BIT_DB_PREFIX."mail_queue` mq WHERE `mail_queue_id` = ? ".$this->mDb->SQLForUpdate(), [ $pQueueMixed ] ); } - if( !empty( $pick ) ) { + if( !empty( $pick ) ) { $startTime = microtime( TRUE ); $this->mDb->query( "UPDATE `".BIT_DB_PREFIX."mail_queue` SET `begin_date`=? WHERE `mail_queue_id` = ? ", [ time(), $pick['mail_queue_id'] ] ); if( !empty( $pick['user_id'] ) ) { @@ -298,9 +298,9 @@ class BitNewsletterMailer { public function getQueue( &$pListHash ) { $ret = []; - + LibertyContent::prepGetList( $pListHash ); - + $query = "SELECT mq.`mail_queue_id` AS `hash_key`, mq.*, lc.`title`, lc2.`title` AS newsletter_title FROM `".BIT_DB_PREFIX."mail_queue` mq INNER JOIN `".BIT_DB_PREFIX."liberty_content` lc ON (lc.content_id=mq.content_id) @@ -310,7 +310,7 @@ class BitNewsletterMailer { if( $rs = $this->mDb->query( $query ) ) { $ret = $rs->getAssoc(); } - + return $ret; } @@ -353,7 +353,6 @@ function bit_add_clickthrough( $pSource, $pUrlCode ) { } - function process_clickthrough_match( $matches ) { global $gUrlCode; $ret = $matches[0]; @@ -362,5 +361,5 @@ function process_clickthrough_match( $matches ) { } else { $ret .= '?ct='.$gUrlCode; } - return $ret; + return $ret; } @@ -7,7 +7,7 @@ // Initialization require_once( '../kernel/includes/setup_inc.php' ); -$feedback = array(); +$feedback = []; $gDefaultCenter = 'bitpackage:newsletters/center_list_newsletters.tpl'; $gBitSmarty->assign( 'gDefaultCenter', $gDefaultCenter ); @@ -15,4 +15,4 @@ $gBitSmarty->assign( 'gDefaultCenter', $gDefaultCenter ); $gBitSmarty->assign( 'feedback', $feedback ); // Display the template -$gBitSystem->display( 'bitpackage:kernel/dynamic.tpl', tra( 'Newsletters' ) , array( 'display_mode' => 'display' )); +$gBitSystem->display( 'bitpackage:kernel/dynamic.tpl', tra( 'Newsletters' ) , [ 'display_mode' => 'display' ]); diff --git a/lookup_newsletter_edition_inc.php b/lookup_newsletter_edition_inc.php index 69f2a34..eec195f 100755 --- a/lookup_newsletter_edition_inc.php +++ b/lookup_newsletter_edition_inc.php @@ -24,4 +24,3 @@ if( empty( $gContent ) || !is_object( $gContent ) || !$gContent->isValid() ) { $gBitSmarty->assign( 'gContent', $gContent ); } - diff --git a/newsletters.php b/newsletters.php index 419e861..229cc44 100755 --- a/newsletters.php +++ b/newsletters.php @@ -27,10 +27,10 @@ if( isset( $_REQUEST["remove"] ) && $gContent->isValid() ) { } elseif( empty( $_REQUEST['confirm'] ) ) { $formHash['remove'] = TRUE; $formHash['nl_id'] = $gContent->mNewsletterId; - $gBitSystem->confirmDialog( $formHash, - array( - 'warning' => tra('Are you sure you want to delete this newsletter?') . ' ' . $gContent->getTitle() - ) + $gBitSystem->confirmDialog( $formHash, + [ + 'warning' => tra('Are you sure you want to delete this newsletter?') . ' ' . $gContent->getTitle(), + ], ); } else { if( $gContent->expunge() ) { @@ -73,5 +73,5 @@ include_once( CATEGORIES_PKG_INCLUDE_PATH.'categorize_list_inc.php' ); */ // Display the template -$gBitSystem->display( 'bitpackage:newsletters/list_newsletters.tpl', NULL, array( 'display_mode' => 'display' )); +$gBitSystem->display( 'bitpackage:newsletters/list_newsletters.tpl', NULL, [ 'display_mode' => 'display' ]); @@ -25,10 +25,10 @@ if( !$gBitUser->isRegistered() && !$gBitUser->hasPermission( 'p_newsletters_subs require_once( NEWSLETTERS_PKG_INCLUDE_PATH.'lookup_newsletter_inc.php' ); -$feedback = array(); +$feedback = []; /* List newsletters */ -$listHash = array(); +$listHash = []; $newsletters = $gContent->getList( $listHash ); $gBitSmarty->assign( 'subs', BitNewsletter::getUserSubscriptions( $gBitUser->getField( 'user_id' ), $gBitUser->getField( 'email' ) ) ); $gBitSmarty->assign('newsletters', $newsletters ); @@ -36,13 +36,13 @@ $gBitSmarty->assign('newsletters', $newsletters ); $foo = parse_url($_SERVER["REQUEST_URI"]); $gBitSmarty->assign('url_subscribe', httpPrefix(). $foo["path"]); -$subinfo = array(); -$unsubs = array(); +$subinfo = []; +$unsubs = []; // We have a url_code from a clicked link in an email -if( isset( $_REQUEST['c'] ) && strlen( $_REQUEST['c'] ) == 32 && ($subInfo = BitNewsletterMailer::lookupSubscription( array( 'url_code' => $_REQUEST['c'] ) )) ) { +if( isset( $_REQUEST['c'] ) && strlen( $_REQUEST['c'] ) == 32 && ($subInfo = BitNewsletterMailer::lookupSubscription( [ 'url_code' => $_REQUEST['c'] ] )) ) { } elseif( $gBitUser->isRegistered() ) { - if( !$subInfo = BitNewsletterMailer::lookupSubscription( array( 'user_id' => $gBitUser->mUserId ) ) ) { + if( !$subInfo = BitNewsletterMailer::lookupSubscription( [ 'user_id' => $gBitUser->mUserId ] ) ) { $subInfo = $gBitUser->mInfo; } } @@ -57,7 +57,7 @@ $unsubs = BitNewsletterMailer::getUnsubscriptions( $lookup ); // Update subscriptions if( isset( $_REQUEST["update"] ) ) { $subHash['response_content_id'] = $_REQUEST['response_content_id']; - $subHash['sub_lookup'] = !empty( $subInfo['user_id'] ) ? array( 'user_id' => $subInfo['user_id'] ) : array( 'email' => $subInfo['email'] ); + $subHash['sub_lookup'] = !empty( $subInfo['user_id'] ) ? [ 'user_id' => $subInfo['user_id'] ] : [ 'email' => $subInfo['email'] ]; if( !empty( $_REQUEST['unsubscribe_all'] ) ) { $subHash['unsubscribe_all'] = 'y'; @@ -106,5 +106,5 @@ $title = "Newsletter Subscriptions"; $gBitSmarty->assign( 'feedback', $feedback ); // Display the template -$gBitSystem->display( $mid, $title , array( 'display_mode' => 'display' )); +$gBitSystem->display( $mid, $title , [ 'display_mode' => 'display' ]); diff --git a/templates/admin_newsletter_subscriptions.tpl b/templates/admin_newsletter_subscriptions.tpl index b0de9ef..b0de9ef 100644..100755 --- a/templates/admin_newsletter_subscriptions.tpl +++ b/templates/admin_newsletter_subscriptions.tpl diff --git a/templates/admin_newsletters.tpl b/templates/admin_newsletters.tpl index c7824a1..c7824a1 100644..100755 --- a/templates/admin_newsletters.tpl +++ b/templates/admin_newsletters.tpl diff --git a/templates/center_list_newsletters.php b/templates/center_list_newsletters.php index f6a8a50..169f789 100755 --- a/templates/center_list_newsletters.php +++ b/templates/center_list_newsletters.php @@ -10,11 +10,11 @@ if( !$gBitUser->isRegistered() && !$gBitUser->hasPermission( 'p_newsletters_subs require_once( NEWSLETTERS_PKG_INCLUDE_PATH.'lookup_newsletter_inc.php' ); /* List newsletters */ - $listHash = array(); + $listHash = []; $newsletters = BitNewsletter::getList( $listHash ); foreach( array_keys( $newsletters ) as $contentId ) { - $listHash = array( 'nl_id' => $newsletters[$contentId]['nl_id'] ); + $listHash = [ 'nl_id' => $newsletters[$contentId]['nl_id'] ]; $newsletters[$contentId]['editions'] = BitNewsletterEdition::getList( $listHash ); } diff --git a/templates/confirm_newsletter_subscription.tpl b/templates/confirm_newsletter_subscription.tpl index 6b1f848..6b1f848 100644..100755 --- a/templates/confirm_newsletter_subscription.tpl +++ b/templates/confirm_newsletter_subscription.tpl diff --git a/templates/html_head_inc.tpl b/templates/html_head_inc.tpl index 25999eb..25999eb 100644..100755 --- a/templates/html_head_inc.tpl +++ b/templates/html_head_inc.tpl diff --git a/templates/index.php b/templates/index.php index 3e305fe..c0437d0 100644 --- a/templates/index.php +++ b/templates/index.php @@ -1,4 +1,4 @@ -<?php +<?php // This is not a package. header ("location: ../index.php"); diff --git a/templates/list_editions.tpl b/templates/list_editions.tpl index 51c4557..51c4557 100644..100755 --- a/templates/list_editions.tpl +++ b/templates/list_editions.tpl diff --git a/templates/list_editions_inc.tpl b/templates/list_editions_inc.tpl index de9f4b5..de9f4b5 100644..100755 --- a/templates/list_editions_inc.tpl +++ b/templates/list_editions_inc.tpl diff --git a/templates/mail_edition.tpl b/templates/mail_edition.tpl index 5955267..5955267 100644..100755 --- a/templates/mail_edition.tpl +++ b/templates/mail_edition.tpl diff --git a/templates/mail_edition_body.tpl b/templates/mail_edition_body.tpl index 187f2af..187f2af 100644..100755 --- a/templates/mail_edition_body.tpl +++ b/templates/mail_edition_body.tpl diff --git a/templates/mail_edition_footer.tpl b/templates/mail_edition_footer.tpl index 0bc63d2..0bc63d2 100644..100755 --- a/templates/mail_edition_footer.tpl +++ b/templates/mail_edition_footer.tpl diff --git a/templates/mail_edition_header.tpl b/templates/mail_edition_header.tpl index eaf6d5a..eaf6d5a 100644..100755 --- a/templates/mail_edition_header.tpl +++ b/templates/mail_edition_header.tpl diff --git a/templates/mail_queue.tpl b/templates/mail_queue.tpl index 786283d..786283d 100644..100755 --- a/templates/mail_queue.tpl +++ b/templates/mail_queue.tpl diff --git a/templates/menu_newsletters.tpl b/templates/menu_newsletters.tpl index 6c965b2..6c965b2 100644..100755 --- a/templates/menu_newsletters.tpl +++ b/templates/menu_newsletters.tpl diff --git a/templates/menu_newsletters_admin.tpl b/templates/menu_newsletters_admin.tpl index b0d704b..b0d704b 100644..100755 --- a/templates/menu_newsletters_admin.tpl +++ b/templates/menu_newsletters_admin.tpl diff --git a/templates/newsletter_byebye.tpl b/templates/newsletter_byebye.tpl index 845ccb1..845ccb1 100644..100755 --- a/templates/newsletter_byebye.tpl +++ b/templates/newsletter_byebye.tpl diff --git a/templates/newsletter_welcome.tpl b/templates/newsletter_welcome.tpl index f379e09..f379e09 100644..100755 --- a/templates/newsletter_welcome.tpl +++ b/templates/newsletter_welcome.tpl diff --git a/templates/send_newsletters.tpl b/templates/send_newsletters.tpl index bb1d0c3..bb1d0c3 100644..100755 --- a/templates/send_newsletters.tpl +++ b/templates/send_newsletters.tpl diff --git a/templates/unsubscribe_inc.tpl b/templates/unsubscribe_inc.tpl index 4678a08..4678a08 100644..100755 --- a/templates/unsubscribe_inc.tpl +++ b/templates/unsubscribe_inc.tpl diff --git a/templates/user_register_inc.tpl b/templates/user_register_inc.tpl index 6e42ccf..6e42ccf 100644..100755 --- a/templates/user_register_inc.tpl +++ b/templates/user_register_inc.tpl @@ -17,7 +17,7 @@ require_once( '../kernel/includes/setup_inc.php' ); include_once( NEWSLETTERS_PKG_CLASS_PATH.'BitNewsletterMailer.php' ); if( isset( $_REQUEST["sub"] ) || $gBitUser->isRegistered() ) { - if( isset( $_REQUEST["sub"] ) && strlen( $_REQUEST["sub"] ) == 32 && ($subInfo = BitNewsletterMailer::lookupSubscription( array( 'url_code' => $_REQUEST["sub"] ) )) ) { + if( isset( $_REQUEST["sub"] ) && strlen( $_REQUEST["sub"] ) == 32 && ($subInfo = BitNewsletterMailer::lookupSubscription( [ 'url_code' => $_REQUEST["sub"] ] )) ) { BitNewsletterMailer::trackMail( $subInfo['url_code'] ); } } diff --git a/user_register_inc.php b/user_register_inc.php index c93f273..baf5592 100644 --- a/user_register_inc.php +++ b/user_register_inc.php @@ -15,7 +15,7 @@ */ require_once NEWSLETTERS_PKG_CLASS_PATH.'BitNewsletter.php'; -$listHash = array( 'registration_optin' => TRUE ); +$listHash = [ 'registration_optin' => TRUE ]; $newsletters = BitNewsletter::getList( $listHash ); |
