本文整理匯總了PHP中Pommo_Template::prepareForSubscribeForm方法的典型用法代碼示例。如果您正苦於以下問題:PHP Pommo_Template::prepareForSubscribeForm方法的具體用法?PHP Pommo_Template::prepareForSubscribeForm怎麽用?PHP Pommo_Template::prepareForSubscribeForm使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Pommo_Template
的用法示例。
在下文中一共展示了Pommo_Template::prepareForSubscribeForm方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: dirname
* 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');
示例2: current
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']);