summaryrefslogtreecommitdiff
path: root/track.php
diff options
context:
space:
mode:
authorChristian Fowler <spider@viovio.com>2005-12-29 17:23:05 +0000
committerChristian Fowler <spider@viovio.com>2005-12-29 17:23:05 +0000
commit4918af1a903bac5765cbf8709cfe2ce7f41ff082 (patch)
treebf3e229faa3fb3e6209aac40e15f2804c9a527af /track.php
parent4ef765eb33d8121228668bb4124a52c40ab5b980 (diff)
downloadnewsletters-4918af1a903bac5765cbf8709cfe2ce7f41ff082.tar.gz
newsletters-4918af1a903bac5765cbf8709cfe2ce7f41ff082.tar.bz2
newsletters-4918af1a903bac5765cbf8709cfe2ce7f41ff082.zip
add newsletter email read tracking
Diffstat (limited to 'track.php')
-rw-r--r--track.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/track.php b/track.php
new file mode 100644
index 0000000..ae213e1
--- /dev/null
+++ b/track.php
@@ -0,0 +1,31 @@
+<?php
+// $Header: /cvsroot/bitweaver/_bit_newsletters/track.php,v 1.1 2005/12/29 17:22:47 spiderr Exp $
+
+// Copyright (c) 2006 - bitweaver.org - Christian Fowler, Max Kremmel, et. al
+// All Rights Reserved. See copyright.txt for details and a complete list of authors.
+// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
+
+require_once( '../bit_setup_inc.php' );
+include_once( NEWSLETTERS_PKG_PATH.'BitMailer.php' );
+
+if( isset( $_REQUEST["sub"] ) || $gBitUser->isRegistered() ) {
+ if( isset( $_REQUEST["sub"] ) && strlen( $_REQUEST["sub"] ) == 32 && ($subInfo = BitMailer::lookupSubscription( array( 'url_code' => $_REQUEST["sub"] ) )) ) {
+ BitMailer::trackMail( $subInfo['url_code'] );
+ }
+}
+
+// open the file in a binary mode
+$trackImage = $gBitSystem->getPreference( 'newsletter_tracking_image', NEWSLETTERS_PKG_PATH.'images/track.gif' );
+
+if( $fp = fopen( $trackImage, 'rb') ) {
+ // send the right headers
+ header( "Content-Type: image/png" );
+ header( "Content-Length: " . filesize( $trackImage ) );
+
+ // dump the picture and stop the script
+ fpassthru( $fp );
+}
+
+exit;
+
+?> \ No newline at end of file