<?php session_start();
//Copyright (c) Florian Grannemann
//Last change in version: 2.1 Alpha 2
/*
******************************************************************************
ADbNewsSender 2
Copyright (C) 2010 Florian Grannemann (hide@address.com)
Website: http://adbnewssender.sf.net
This program 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 3 of the License, or
any later version.
This program 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 this program. If not, see http://www.gnu.org/licenses/
******************************************************************************
*/
//Do not edit anything unless you realy REALY know what you are doing!
//to avoid problems on some servers:
//if that makes problems, use
//$path_to_protected=".."; instead
//But this should work on all UNIX-like systems:
$path_to_protected=dirname(__FILE__)."/..";
include "$path_to_protected/skeleton/public_apis.class.php.inc";
include "$path_to_protected/skeleton/private_apis.class.php.inc";
include "$path_to_protected/skeleton/sessionhandler.class.php.inc";
$path_to_db_conf="$path_to_protected/database/DBconf.php.inc";
$path_to_db_defs="$path_to_protected/skeleton/includes/db_defs";
$MyDB = new ADBNS_DB($path_to_db_defs,$path_to_db_conf);
$MyCFG= new global_config_rw($MyDB);
//creating session handler object
$MySessionHandler = new ADBNS_SessionHandler();
include "$path_to_protected/localization/lang/".$MyCFG->get_config_value("Language")."/lang_admin_sendNL.php.inc";
if($MySessionHandler->getNLID() !=0 && $MyCFG->NL_exists($MySessionHandler->getNLID()))
{
$Body=$MySessionHandler->getNLModuleKeyValue("body");
if(!$Body)
{
//Message body not yet in session. Try to reload
print "<HTML><HEAD><META HTTP-EQUIV=\"refresh\" CONTENT=\"1\"></HEAD><BODY></BODY></HTML>";
}
else
{
$Newsletter=stripslashes($Body);
//$Newsletter=$_REQUEST["Body"];
$Newsletter=preg_replace("/\[ArchiveEntryURL\]/",$TXT_RepArchiveURL,$Newsletter);
if(preg_match("/\[UnsubscribeLink\]/",$Newsletter))
{
print preg_replace("/\[UnsubscribeLink\]/",$TXT_RepUnsubscribeLink,$Newsletter);
}
else
{
$Newsletter=preg_replace("/<\/body>/i","",$Newsletter);
$Newsletter=preg_replace("/<\/html>/i","",$Newsletter);
print $Newsletter."<br>$TXT_RepUnsubscribeLink </body></html>";
}
}
}
else
{
print "<h1>$ErrorNLdoesnotExist</h1>";
}
?>