prepareForSubscribeForm() public method

Loads field data into template, as well as _POST (or a saved subscribeForm).
Example #1
0
 * poMMo is free software; you can redistribute it and/or modify 
 * it under the terms of the GNU General Public License as published 
 * by the Free Software Foundation; either version 2, or any later version.
 * 
 * poMMo is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
 * the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with program; see the file docs/LICENSE. If not, write to the
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 */
/**********************************
	INITIALIZATION METHODS
 *********************************/
define('_poMMo_embed', TRUE);
require dirname(__FILE__) . '/bootstrap.php';
Pommo::init(array('authLevel' => 0, 'noSession' => TRUE));
$logger =& Pommo::$_logger;
$dbo =& Pommo::$_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$smarty = new Pommo_Template();
// subscription forms will be activated from this template
$smarty->prepareForSubscribeForm();
// assign referer since this is an embedded form
$smarty->assign('referer', htmlspecialchars($_SERVER['PHP_SELF']));
$smarty->display('subscribe/form.mini.tpl');
Example #2
0
	INITIALIZATION METHODS
 *********************************/
require 'bootstrap.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Validate.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Subscribers.php';
require_once Pommo::$_baseDir . 'classes/Pommo_Pending.php';
Pommo::init(array('authLevel' => 0, 'noSession' => true));
$logger =& Pommo::$_logger;
$dbo =& Pommo::$_dbo;
/**********************************
	SETUP TEMPLATE, PAGE
 *********************************/
require_once Pommo::$_baseDir . 'classes/Pommo_Template.php';
$view = new Pommo_Template();
// Prepare for subscriber form -- load in fields + POST/Saved Subscribe Form
$view->prepareForSubscribeForm();
// fetch the subscriber, validate code
$subscriber = current(Pommo_Subscribers::get(array('email' => empty($_REQUEST['email']) ? '0' : $_REQUEST['email'], 'status' => 1)));
if (empty($subscriber)) {
    Pommo::redirect('login.php');
}
if ($_REQUEST['code'] != Pommo_Subscribers::getActCode($subscriber)) {
    Pommo::kill(Pommo::_T('Invalid activation code.'));
}
// check if we have pending request
if (Pommo_Pending::isPending($subscriber['id'])) {
    $input = urlencode(serialize(array('Email' => $_POST['Email'])));
    Pommo::redirect('pending.php?input=' . $input);
}
$config = Pommo_Api::configGet(array('notices'));
$notices = unserialize($config['notices']);