Пример #1
0
 * @copyright This source is distributed under the GPL
 * @file The integration page
 * @modifications Cyril Maguire
 */
/* Gutama plugin package
 * @version 1.6
 * @date	01/10/2013
 * @author	Cyril MAGUIRE
*/
include 'inc/gutuma.php';
if ($_SESSION['profil'] != PROFIL_ADMIN) {
    header('Location:compose.php');
    exit;
}
gu_init();
gu_theme_start();
$lists = gu_list::get_all(FALSE, FALSE);
$script_import = '<script type="text/javascript" src="' . absolute_url('js/gadgets.js.php') . '"></script>';
$gadget_type = is_post_var('gadget_type') ? get_post_var('gadget_type') : '';
$generate = is_post_var('gadget_generate') && $gadget_type != '';
// Default to first list if one exists
$example_list_id = count($lists) > 0 ? $lists[0]->get_id() : 0;
if ($generate) {
    $gadget_list = is_post_var('gadget_list') ? get_post_var('gadget_list') : $example_list_id;
    switch ($gadget_type) {
        case 'basic_link':
            $gadget_text = is_post_var('gadget_text') ? get_post_var('gadget_text') : t('Subscribe to my newsletter');
            $script_create = 'gu_gadgets_create_basic_link(' . $gadget_list . ', "' . $gadget_text . '")';
            $script_write = '<script type="text/javascript">gu_gadgets_write_basic_link(' . $gadget_list . ', "' . $gadget_text . '")</script>';
            $gadget_params = array('list', 'text');
            $gadget_requires_import = FALSE;
Пример #2
0
 * @project Gutuma Newsletter Managment
 * @author Rowan Seymour
 * @copyright This source is distributed under the GPL
 * @file The subscribe page
 * @modifications Cyril Maguire
 */
/* Gutama plugin package
 * @version 1.6
 * @date	01/10/2013
 * @author	Cyril MAGUIRE
*/
include_once 'inc/gutuma.php';
include_once 'inc/subscription.php';
// Initialize Gutuma without validation or redirection
gu_init(FALSE, FALSE);
gu_theme_start('ok');
// If variables have been posted then they may have prefixes
$posted_address = '';
$posted_lists = array();
$posted_action = '';
foreach (array_keys($_POST) as $var) {
    $val = get_post_var($var);
    if (strpos($var, 'subscribe_address') !== FALSE) {
        $posted_address = trim($val);
    } elseif (strpos($var, 'subscribe_list') !== FALSE) {
        $posted_lists = is_array($val) ? $val : ((int) $val != 0 ? array((int) $val) : array());
    } elseif (strpos($var, 'unsubscribe_submit') !== FALSE) {
        $posted_action = 'unsubscribe';
    } elseif (strpos($var, 'subscribe_submit') !== FALSE) {
        $posted_action = 'subscribe';
    }