summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorChristian Fowler <spider@viovio.com>2005-12-28 23:21:25 +0000
committerChristian Fowler <spider@viovio.com>2005-12-28 23:21:25 +0000
commitc07dc79add21f2677680fcc9736b82276d2f8a72 (patch)
tree0b432d8fdf68098f0f2e783457fd646fabb09a73 /index.php
parent2149b17e33d9905d16986ce86757343fabfa8211 (diff)
downloadnewsletters-c07dc79add21f2677680fcc9736b82276d2f8a72.tar.gz
newsletters-c07dc79add21f2677680fcc9736b82276d2f8a72.tar.bz2
newsletters-c07dc79add21f2677680fcc9736b82276d2f8a72.zip
lots and lots of subscription fixes, still not 100%
Diffstat (limited to 'index.php')
-rw-r--r--index.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/index.php b/index.php
index cc212db..13ffafc 100644
--- a/index.php
+++ b/index.php
@@ -1,6 +1,6 @@
<?php
-// $Header: /cvsroot/bitweaver/_bit_newsletters/index.php,v 1.11 2005/12/28 20:12:46 spiderr Exp $
+// $Header: /cvsroot/bitweaver/_bit_newsletters/index.php,v 1.12 2005/12/28 23:21:24 spiderr Exp $
// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
@@ -34,7 +34,7 @@ $newsletters = $gContent->getList( $listHash );
$gBitSmarty->assign_by_ref('newsletters', $newsletters );
if( isset( $_REQUEST["sub"] ) ) {
- if( strlen( $_REQUEST["sub"] ) == 32 && ($subInfo = BitMailer::lookupUrlCode( $_REQUEST["sub"] )) ) {
+ if( strlen( $_REQUEST["sub"] ) == 32 && ($subInfo = BitMailer::lookupSubscription( array( 'url_code' => $_REQUEST["sub"] ) )) ) {
$gBitSmarty->assign( 'subInfo', $subInfo );
$lookup['email'] = $subInfo['email'];
$unsubs = BitMailer::getUnsubscriptions( $lookup );
@@ -55,6 +55,15 @@ if( isset( $_REQUEST["sub"] ) ) {
}
}
$mid = 'bitpackage:newsletters/user_subscriptions.tpl';
+} elseif( $gBitUser->isRegistered() ) {
+ if( !$subInfo = BitMailer::lookupSubscription( array( 'user_id' => $gBitUser->mUserId ) ) ) {
+ $subInfo = $gBitUser->mInfo;
+ }
+ $gBitSmarty->assign( 'subInfo', $subInfo );
+ $lookup['user_id'] = $gBitUser->mUserId;
+ $unsubs = BitMailer::getUnsubscriptions( $lookup );
+ $gBitSmarty->assign( 'unsubs', $unsubs );
+ $mid = 'bitpackage:newsletters/user_subscriptions.tpl';
}
$foo = parse_url($_SERVER["REQUEST_URI"]);