From 24f652cebb911f360f463ac8bb3d4dbf99a19bc8 Mon Sep 17 00:00:00 2001 From: Christian Fowler Date: Wed, 28 Dec 2005 15:23:33 +0000 Subject: clean up unsubscribe, getting closer --- BitMailer.php | 9 +++++---- index.php | 13 +++++++++---- templates/user_subscriptions.tpl | 15 ++++++++++++++- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/BitMailer.php b/BitMailer.php index e651ab6..253b3c2 100644 --- a/BitMailer.php +++ b/BitMailer.php @@ -1,12 +1,12 @@ * - * @version $Revision: 1.4 $ $Date: 2005/12/25 02:23:44 $ $Author: spiderr $ + * @version $Revision: 1.5 $ $Date: 2005/12/28 15:23:32 $ $Author: spiderr $ */ /** @@ -156,6 +156,7 @@ class BitMailer extends phpmailer { if( !empty( $pUrlCode ) ) { $query = "SELECT * FROM `".BIT_DB_PREFIX."tiki_mail_queue` tmq INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON( tmq.`nl_content_id`=tc.`content_id` ) + LEFT OUTER JOIN `".BIT_DB_PREFIX."users_users` uu ON( tmq.`user_id`=uu.`user_id` ) WHERE `url_code`=? "; $ret = $gBitDb->getRow( $query, array( $pUrlCode ) ); } @@ -164,7 +165,7 @@ class BitMailer extends phpmailer { // Accepts a single row has containing the column of tiki_mail_unsubscriptions as the key to lookup the unsubscription info // Can be statically called - function getUnsubscription( $pMixed ) { + function getUnsubscriptions( $pMixed ) { global $gBitDb; $ret = NULL; if( is_array( $pMixed ) ) { diff --git a/index.php b/index.php index 7a0a32c..466e619 100644 --- a/index.php +++ b/index.php @@ -1,6 +1,6 @@ assign( 'subInfo', BitMailer::lookupUrlCode( $_REQUEST["sub"] ) ); } $mid = 'bitpackage:newsletters/user_subscriptions.tpl'; -} elseif( isset( $_REQUEST["unsubscribe"] ) ) { +} elseif( isset( $_REQUEST["update"] ) ) { + /* List newsletters */ + $listHash = array(); + $newsletters = $gContent->getList( $listHash ); +vd( $newsletters ); +vd( $_REQUEST ); + $feedback['success'] = tra( "Your subscriptions were updated." ); if( $conf = $gContent->unsubscribe( $_REQUEST["unsubscribe"] ) ) { - $feedback['success'] = tra( "Your email address was removed from the list of subscriptors." ); - $gBitSmarty->assign('nl_info', $conf); } + $mid = 'bitpackage:newsletters/user_subscriptions.tpl'; } if( !$gBitUser->isRegistered() && !$gBitUser->hasPermission( 'bit_p_subscribe_newsletters' ) && empty( $_REQUEST["confirm_subscription"] ) ) { diff --git a/templates/user_subscriptions.tpl b/templates/user_subscriptions.tpl index 8adeaef..6f3e617 100644 --- a/templates/user_subscriptions.tpl +++ b/templates/user_subscriptions.tpl @@ -6,6 +6,15 @@
{if $subInfo} + {formfeedback success=$success error=$gContent->mErrors} + {form enctype="multipart/form-data" id="editpageform"} +
+ {formlabel label="User Information"} + {forminput} + {displayname hash=$subInfo}
+ {$subInfo.email} + {/forminput} +
{formlabel label="Subscriptions"} {forminput} @@ -15,9 +24,13 @@
{formlabel label="Permanent Unsubscribe"} {forminput} - {tr}Remove myself from all lists, and receive no further mailings from{/tr} {$gBitSystem->getPreference('siteTitle','this site')}.
+ {tr}Remove myself from all lists, and receive no further mailings from{/tr} {$gBitSystem->getPreference('siteTitle','this site')}.
{/forminput}
+
+ +
+ {/form} {else}
{tr}The subscription URL is no longer valid.{/tr} -- cgit v1.3