Ejemplo n.º 1
0
 */
$module->page_title = _l('Editor');
//print_heading('Newsletter Editor');
$newsletter_id = isset($_REQUEST['newsletter_id']) ? (int) $_REQUEST['newsletter_id'] : false;
$current_newsletter_content_id = isset($_REQUEST['newsletter_content_id']) && (int) $_REQUEST['newsletter_content_id'] > 0 ? (int) $_REQUEST['newsletter_content_id'] : false;
$newsletter = module_newsletter::get_newsletter($newsletter_id);
$newsletter_template = module_newsletter::get_newsletter_template($newsletter['newsletter_template_id']);
// check permissions.
if (class_exists('module_security', false)) {
    if ($newsletter_id > 0 && $newsletter['newsletter_id'] == $newsletter_id) {
        module_security::check_page(array('category' => 'Newsletter', 'page_name' => 'Newsletters', 'module' => 'newsletter', 'feature' => 'edit'));
    } else {
        module_security::check_page(array('category' => 'Newsletter', 'page_name' => 'Newsletters', 'module' => 'newsletter', 'feature' => 'create'));
    }
}
$templates = module_newsletter::get_templates();
//$input_method = 'wysiwyg';
$default_content = isset($newsletter_template['default_inner']) ? $newsletter_template['default_inner'] : '';
if (!$default_content && $newsletter_template['directory'] && is_dir($newsletter_template['directory']) && is_file($newsletter_template['directory'] . 'inside.html')) {
    ob_start();
    include $newsletter_template['directory'] . 'inside.html';
    $default_content = ob_get_clean();
}
if ($newsletter_template['directory'] && is_dir($newsletter_template['directory']) && is_file($newsletter_template['directory'] . 'settings.php')) {
    include $newsletter_template['directory'] . 'settings.php';
}
$sends = $newsletter['sends'];
$sends_warning = array();
foreach ($sends as $send) {
    if ($send['status'] != _NEWSLETTER_STATUS_NEW) {
        // this newsletter has been sent before, or a pending send has been done before.
<?php

/** 
 * Copyright: dtbaker 2012
 * Licence: Please check CodeCanyon.net for licence details. 
 * More licence clarification available here:  http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ 
 * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4
 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca
 * Package Date: 2015-11-25 02:55:20 
 * IP Address: 67.79.165.254
 */
$search = isset($_REQUEST['search']) && is_array($_REQUEST['search']) ? $_REQUEST['search'] : array();
$newsletter_templates = module_newsletter::get_templates($search);
$header = array('title' => _l('Newsletter Templates'), 'type' => 'h2', 'main' => true, 'button' => array());
$header['button'] = array('url' => module_newsletter::link_open_template('new'), 'title' => _l('Add New Template'), 'type' => 'add');
print_heading($header);
$table_manager = module_theme::new_table_manager();
$columns = array();
$columns['newsletter_template_name'] = array('title' => 'Template Name', 'callback' => function ($newsletter_template) {
    echo module_newsletter::link_open_template($newsletter_template['newsletter_template_id'], true);
}, 'cell_class' => 'row_action');
$columns['newsletter_template_action'] = array('title' => 'Action', 'callback' => function ($newsletter_template) {
    ?>
 <a href="<?php 
    echo module_newsletter::link_open_template($newsletter_template['newsletter_template_id']);
    ?>
">Edit</a> <?php 
});
$table_manager->set_columns($columns);
$table_manager->set_rows($newsletter_templates);
$table_manager->pagination = false;
Ejemplo n.º 3
0
/** 
 * Copyright: dtbaker 2012
 * Licence: Please check CodeCanyon.net for licence details. 
 * More licence clarification available here:  http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ 
 * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4
 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca
 * Package Date: 2015-11-25 02:55:20 
 * IP Address: 67.79.165.254
 */
if (!module_config::can_i('view', 'Settings')) {
    redirect_browser(_BASE_HREF);
}
$module->page_title = _l('Newsletter Settings');
$templates = array();
foreach (module_newsletter::get_templates() as $template) {
    $templates[$template['newsletter_template_id']] = $template['newsletter_template_name'];
}
$settings = array('heading' => array('title' => 'Newsletter Settings', 'main' => true, 'type' => 'h2'), 'settings' => array(array('key' => 'newsletter_default_from_name', 'default' => module_config::c('admin_system_name'), 'type' => 'text', 'description' => 'What sender name your newsletters will come from'), array('key' => 'newsletter_default_from_email', 'default' => module_config::c('admin_email_address'), 'type' => 'text', 'description' => 'What email address your newsletters will come from'), array('key' => 'newsletter_default_template', 'default' => 1, 'type' => 'select', 'options' => $templates, 'description' => 'Default template to use'), array('key' => 'newsletter_convert_links', 'default' => 1, 'type' => 'select', 'options' => get_yes_no(), 'description' => 'Convert all links into trackable click links', 'help' => 'When a user clicks a link in your newsletter it will record who, when and which link they clicked'), array('key' => 'newsletter_convert_images', 'default' => 1, 'type' => 'select', 'options' => get_yes_no(), 'description' => 'Convert all images into trackable images', 'help' => 'If this option is enabled you can tell when users see the images in your newsletters'), array('key' => 'newsletter_default_bounce', 'default' => module_config::c('admin_email_address'), 'type' => 'text', 'description' => 'What email address your bounced newsletters will go to (eg: bounce@yourwebsite.com)', 'help' => 'Please setup a NEW email address for bounces. Do not use an existing email address.'), array('key' => 'newsletter_bounce_host', 'default' => $_SERVER['HTTP_HOST'], 'type' => 'text', 'description' => 'POP3 incoming server address to access the bounce email account (eg: mail.yourwebsite.com)', 'help' => 'You can put the port number in like this:  mail.yourwebsite.com'), array('key' => 'newsletter_bounce_port', 'default' => '110', 'type' => 'text', 'description' => 'POP3 incoming server port (eg: 110 or 995)', 'help' => '110 is normal, 995 is ssl'), array('key' => 'newsletter_bounce_ssl', 'default' => '/ssl', 'type' => 'text', 'description' => 'SSL or TLS setting', 'help' => 'Set this to blank, or /ssl, or /tls or other options from php.net/imap_connect'), array('key' => 'newsletter_bounce_username', 'default' => '', 'type' => 'text', 'description' => 'POP3 username to access the bounce email account'), array('key' => 'newsletter_bounce_password', 'default' => '', 'type' => 'text', 'description' => 'POP3 password to access the bounce email account'), array('key' => 'newsletter_bounce_threshold', 'default' => 3, 'type' => 'number', 'description' => 'Bounce Threshold', 'help' => 'How many bounces before we unsubscribe this member'), array('key' => 'newsletter_send_burst_count', 'default' => 40, 'type' => 'number', 'description' => 'Burst Count', 'help' => 'How many emails the server will try to sent at the same time. Setting this too high may get you banned by your hosting provider.'), array('key' => 'newsletter_send_burst_break', 'default' => 2, 'type' => 'number', 'description' => 'Burst Wait', 'help' => 'Seconds to wait between sending batches of newsletters'), array('key' => 'newsletter_subscribe_redirect_double', 'default' => '', 'type' => 'text', 'description' => 'Subscribe Redirect (double opt-in)', 'help' => 'Full URL (including http://) to where the user is taken after confirming their double opt-in'), array('key' => 'newsletter_subscribe_redirect', 'default' => '', 'type' => 'text', 'description' => 'Subscribe Redirect', 'help' => 'Full URL (including http://) to where the user is taken after subscribing'), array('key' => 'newsletter_unsubscribe_redirect', 'default' => '', 'type' => 'text', 'description' => 'Un-Subscribe Redirect URL', 'help' => 'Full URL (including http://) to where the user is taken after confirming their unsubscription')));
module_config::print_settings_form($settings);
print_heading('Subscription Form');
?>
<p><?php 
_e('Here is a link to the newsletter subscription form. When people fill this out they will appear in the "Members" area:');
?>
 <a href="<?php 
echo module_member::link_public_subscribe();
?>
" target="_blank"><?php 
echo module_member::link_public_subscribe();
?>