diff options
| author | Christian Fowler <spider@viovio.com> | 2005-12-28 15:23:33 +0000 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2005-12-28 15:23:33 +0000 |
| commit | 24f652cebb911f360f463ac8bb3d4dbf99a19bc8 (patch) | |
| tree | 55093146b23a5e6437da79e9d539a62822ab14a6 | |
| parent | c37f0b2fcd77e746b8e8a358d8d6679f8b43e0e0 (diff) | |
| download | newsletters-24f652cebb911f360f463ac8bb3d4dbf99a19bc8.tar.gz newsletters-24f652cebb911f360f463ac8bb3d4dbf99a19bc8.tar.bz2 newsletters-24f652cebb911f360f463ac8bb3d4dbf99a19bc8.zip | |
clean up unsubscribe, getting closer
| -rw-r--r-- | BitMailer.php | 9 | ||||
| -rw-r--r-- | index.php | 13 | ||||
| -rw-r--r-- | 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 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_newsletters/Attic/BitMailer.php,v 1.4 2005/12/25 02:23:44 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_newsletters/Attic/BitMailer.php,v 1.5 2005/12/28 15:23:32 spiderr Exp $ * * Copyright (c) 2004 bitweaver.org * 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 * - * $Id: BitMailer.php,v 1.4 2005/12/25 02:23:44 spiderr Exp $ + * $Id: BitMailer.php,v 1.5 2005/12/28 15:23:32 spiderr Exp $ * * Class that handles editions of newsletters * @package newsletters @@ -15,7 +15,7 @@ * * @author spiderr <spider@steelsun.com> * - * @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 ) ) { @@ -1,6 +1,6 @@ <?php -// $Header: /cvsroot/bitweaver/_bit_newsletters/index.php,v 1.8 2005/12/25 02:23:44 spiderr Exp $ +// $Header: /cvsroot/bitweaver/_bit_newsletters/index.php,v 1.9 2005/12/28 15:23:32 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. @@ -26,11 +26,16 @@ if( isset( $_REQUEST["sub"] ) ) { $gBitSmarty->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 @@ <div class="body"> {if $subInfo} + {formfeedback success=$success error=$gContent->mErrors} + {form enctype="multipart/form-data" id="editpageform"} + <div class="row"> + {formlabel label="User Information"} + {forminput} + {displayname hash=$subInfo}<br/> + {$subInfo.email} + {/forminput} + </div> <div class="row"> {formlabel label="Subscriptions"} {forminput} @@ -15,9 +24,13 @@ <div class="row"> {formlabel label="Permanent Unsubscribe"} {forminput} - <input type="checkbox" name="unsubscribe_all" value="{$subInfo.nl_content_id}" {if subInfo.unsubscribe_all}{/if} /> {tr}Remove myself from all lists, and receive no further mailings from{/tr} {$gBitSystem->getPreference('siteTitle','this site')}.</br> + <input type="checkbox" name="unsubscribe_all" value="{$subInfo.nl_content_id}" {if $subInfo.unsubscribe_all}checked="checked"{/if} /> {tr}Remove myself from all lists, and receive no further mailings from{/tr} {$gBitSystem->getPreference('siteTitle','this site')}.</br> {/forminput} </div> + <div class="row submit"> + <input type="submit" name="update" value="{tr}Update Subscriptions{/tr}" /> + </div> + {/form} {else} <div class="row"> {tr}The subscription URL is no longer valid.{/tr} |
