summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--BitNewsletterMailer.php10
-rw-r--r--admin/schema_inc.php2
-rw-r--r--admin/upgrades/1.0.2.php26
3 files changed, 32 insertions, 6 deletions
diff --git a/BitNewsletterMailer.php b/BitNewsletterMailer.php
index b0e5128..e66c76e 100644
--- a/BitNewsletterMailer.php
+++ b/BitNewsletterMailer.php
@@ -1,12 +1,12 @@
<?php
/**
- * $Header: /cvsroot/bitweaver/_bit_newsletters/BitNewsletterMailer.php,v 1.8 2009/10/01 14:17:02 wjames5 Exp $
+ * $Header: /cvsroot/bitweaver/_bit_newsletters/BitNewsletterMailer.php,v 1.9 2009/11/11 22:47:03 lsces Exp $
*
* Copyright (c) 2004 bitweaver.org
* 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
*
- * $Id: BitNewsletterMailer.php,v 1.8 2009/10/01 14:17:02 wjames5 Exp $
+ * $Id: BitNewsletterMailer.php,v 1.9 2009/11/11 22:47:03 lsces Exp $
*
* Class that handles editions of newsletters
* @package newsletters
@@ -15,7 +15,7 @@
*
* @author spiderr <spider@steelsun.com>
*
- * @version $Revision: 1.8 $ $Date: 2009/10/01 14:17:02 $ $Author: wjames5 $
+ * @version $Revision: 1.9 $ $Date: 2009/11/11 22:47:03 $ $Author: lsces $
*/
/**
@@ -85,7 +85,7 @@ class BitNewsletterMailer {
$lookupCol = 'email';
$bindVars[] = $email;
}
- $rs = $this->mDb->query( "UPDATE `".BIT_DB_PREFIX."mail_queue` SET `queue_date`=?, `begin_date`=NULL, `sent_date`=NULL, `last_read_date`=NULL, `mail_error`=NULL, `reads`=0 WHERE `content_id`=? AND `$lookupCol`=?", array( $bindVars ) );
+ $rs = $this->mDb->query( "UPDATE `".BIT_DB_PREFIX."mail_queue` SET `queue_date`=?, `begin_date`=NULL, `sent_date`=NULL, `last_read_date`=NULL, `mail_error`=NULL, `hits`=0 WHERE `content_id`=? AND `$lookupCol`=?", array( $bindVars ) );
$ret++;
}
}
@@ -206,7 +206,7 @@ class BitNewsletterMailer {
function trackMail( $pUrlCode ) {
global $gBitDb;
- $query = "UPDATE `".BIT_DB_PREFIX."mail_queue` SET `reads`=`reads`+1, `last_read_date`=?, `last_read_ip`=? WHERE `url_code`=? ";
+ $query = "UPDATE `".BIT_DB_PREFIX."mail_queue` SET `hits`=`hits`+1, `last_read_date`=?, `last_read_ip`=? WHERE `url_code`=? ";
$gBitDb->query( $query, array( time(), $_SERVER['REMOTE_ADDR'], $pUrlCode ) );
}
diff --git a/admin/schema_inc.php b/admin/schema_inc.php
index a91987d..aadc5ce 100644
--- a/admin/schema_inc.php
+++ b/admin/schema_inc.php
@@ -68,7 +68,7 @@ $tables = array(
sent_date I8,
last_read_date I8,
last_read_ip C(39),
- `reads` I2 NOTNULL DEFAULT '0',
+ hits I2 NOTNULL DEFAULT '0',
mail_error X
CONSTRAINT ', CONSTRAINT `mailq_content_ref` FOREIGN KEY (`nl_content_id`) REFERENCES `".BIT_DB_PREFIX."liberty_content`( `content_id` )
, CONSTRAINT `mailq_user_ref` FOREIGN KEY (`user_id`) REFERENCES `".BIT_DB_PREFIX."users_users`( `user_id` )'
diff --git a/admin/upgrades/1.0.2.php b/admin/upgrades/1.0.2.php
new file mode 100644
index 0000000..9b564e8
--- /dev/null
+++ b/admin/upgrades/1.0.2.php
@@ -0,0 +1,26 @@
+<?php
+/**
+ * @version $Header: /cvsroot/bitweaver/_bit_newsletters/admin/upgrades/1.0.2.php,v 1.1 2009/11/11 22:47:03 lsces Exp $
+ */
+global $gBitInstaller;
+
+$infoHash = array(
+ '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(
+
+array( 'DATADICT' => array(
+ array( 'RENAMECOLUMN' => array(
+ 'mail_queue' => array(
+ '`reads`' => '`hits` I2 NOTNULL DEFAULT 0'
+ ),
+ )),
+)),
+
+));
+?>