newsletters
[ class tree: newsletters ] [ index: newsletters ] [ all elements ]

Source for file track.php

Documentation is available at track.php

  1. <?php
  2. /**
  3.  * Copyright (c) 2005 bitweaver.org
  4.  * All Rights Reserved. See below for details and a complete list of authors.
  5.  * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details
  6.  *
  7.  * created 2005/12/10
  8.  *
  9.  * @package newsletters
  10.  * @author spider <spider@steelsun.com>
  11.  */
  12.  
  13. /** 
  14.  * Initialization
  15.  */
  16. require_once( '../kernel/setup_inc.php' );
  17. include_once( NEWSLETTERS_PKG_PATH.'BitNewsletterMailer.php' );
  18.  
  19. if( isset( $_REQUEST["sub"] ) || $gBitUser->isRegistered() ) {
  20.     if( isset( $_REQUEST["sub"] ) && strlen( $_REQUEST["sub"] ) == 32 && ($subInfo = BitNewsletterMailer::lookupSubscription( array( 'url_code' => $_REQUEST["sub"] ) )) ) {
  21.         BitNewsletterMailer::trackMail( $subInfo['url_code'] );
  22.     }
  23. }
  24.  
  25. // open the file in a binary mode
  26. $trackImage = $gBitSystem->getConfig( 'newsletter_tracking_image', NEWSLETTERS_PKG_PATH.'images/track.gif' );
  27.  
  28. if( $fp = fopen( $trackImage, 'rb') ) {
  29.     // send the right headers
  30.     header( "Content-Type: image/png" );
  31.     header( "Content-Length: " . filesize( $trackImage ) );
  32.  
  33.     // dump the picture and stop the script
  34.     fpassthru( $fp );
  35. }
  36.  
  37. exit;
  38.  
  39. ?>

Documentation generated on Wed, 29 Jul 2015 13:57:30 +0000 by phpDocumentor 1.5.0-lsces