// All rights reserved.
This script is part of PHPWCMS. The PHPWCMS web content management system 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 of the License, or (at your option) any later version.
The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html
A copy is found in the textfile GPL.txt and important notices to the license
from the author is found in LICENSE.txt distributed with these scripts.
This script 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.
This copyright notice MUST APPEAR in all copies of the script!
*************************************************************************************/
// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
die("You Cannot Access This Script Directly, Have a Nice Day.");
}
// ----------------------------------------------------------------
if(isset($_GET["s"])) {
include_once(PHPWCMS_ROOT.'/include/inc_lib/newsletter.form.inc.php');
if(isset($_GET['edit'])) {
include_once(PHPWCMS_ROOT.'/include/inc_tmpl/newsletter.form.tmpl.php');
}
if(isset($_GET['send']) && $show_nl_send) {
include_once(PHPWCMS_ROOT.'/include/inc_tmpl/newsletter.send.tmpl.php');
}
} else {
if(isset($_GET['duplicate_nl'])) {
@_dbDuplicateRow( 'phpwcms_newsletter', 'newsletter_id', intval($_GET['duplicate_nl']),
array('newsletter_active' => 0, 'newsletter_changed' => 'SQL:NOW()',
'newsletter_lastsending' => '0000-00-00 00:00:00', 'newsletter_created' => 'SQL:NOW()',
'newsletter_subject' => '--SELF-- (copy)'));
}
// check if subscription should be edited
// create paginating for newsletter
if(isset($_GET['c'])) {
$_SESSION['list_newsletter_count'] = $_GET['c'] == 'all' ? '99999' : intval($_GET['c']);
}
// set default values for paginating
if(empty($_SESSION['list_newsletter_count'])) {
$_SESSION['list_newsletter_count'] = 10;
}
// set page
if(isset($_GET['page'])) {
$_SESSION['newsletter_page'] = intval($_GET['page']);
}
// start at page 1
if(empty($_SESSION['newsletter_page']) || $_SESSION['newsletter_page'] < 1) {
$_SESSION['newsletter_page'] = 1;
}
$_newsletter['count_total'] = _dbQuery("SELECT COUNT(*) FROM ".DB_PREPEND."phpwcms_newsletter WHERE newsletter_trashed=0", 'COUNT');
$_newsletter['pages_total'] = ceil($_newsletter['count_total'] / $_SESSION['list_newsletter_count']);
if($_SESSION['newsletter_page'] > $_newsletter['pages_total']) {
$_SESSION['newsletter_page'] = $_newsletter['pages_total'];
}
?>
1) {
echo '';
} else {
echo ' ';
}
?>
|
5
10
25
50
100
|
|
|
|
', $BL['be_last_sending']) ?> |
'.$BL['be_cnt_queued'].'/ '.$BL['be_msg_senttop'] ?> |
|
|
'.LF;
echo '';
// sent/queue status
$count_sent = _dbQuery('SELECT COUNT(*) FROM '.DB_PREPEND.'phpwcms_newsletterqueue WHERE queue_status=1 AND queue_pid='.$row["newsletter_id"], 'COUNT');
$count_queue = _dbQuery('SELECT COUNT(*) FROM '.DB_PREPEND.'phpwcms_newsletterqueue WHERE queue_status=0 AND queue_pid='.$row["newsletter_id"], 'COUNT');
$count_recipient = countNewsletterRecipients($row['newsletter_vars']['subscription']);
if(empty($row["newsletter_active"]) || !$count_queue) {
echo '';
} else {
echo '';
}
echo ' | '.LF;
echo ''.html_specialchars($row["newsletter_subject"])." | \n";
// create date
echo ' ';
if($row['cdate']) {
echo @date($BL['be_shortdatetime'], $row['cdate']);
}
echo ' | ';
// last sending
echo ' ';
if($row['lastsend']) {
@date($BL['be_shortdatetime'], $row['lastsend']);
}
echo ' | ';
echo ''.$count_recipient.'/'.$count_queue.'/'.$count_sent;
if($count_sent && !$count_queue && $row["newsletter_active"]) {
echo '';
}
echo ' | ';
// buttons
echo '';
// duplicate
echo '';
// edit
echo '';
// delete
echo '';
echo '';
echo " | \n\n";
$row_count++;
}
} else {
echo ' no newsletter available |
';
}
?>
|
|