Location: PHPKode > projects > ADbNewsSender > ADbNewsSender 2.1.0/protected/admin/global/global_config.php.inc
<?php
//Copyright (c) Florian Grannemann
//Last change in version: 2.1 Alpha 3
/*
    ******************************************************************************
    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! 

include "$path_to_languagefolder/lang_admin_global_config.php.inc";
$Var_map=array();
$Var_map["URL"]=$MyCFG->get_config_value("URL");
$Var_map["Email"]=$MyCFG->get_config_value("Email");
$Var_map["SubscribeURL"]=$MyCFG->get_config_value("SubscribeURL");
$Var_map["RenewalURL"]=$MyCFG->get_config_value("RenewalURL");
$Var_map["ConfirmationURL"]=$MyCFG->get_config_value("ConfirmationURL");
$Var_map["Language"]=$MyCFG->get_config_value("Language");
$Var_map["EnableTinyMCE"]=$MyCFG->get_config_value("EnableTinyMCE");
$Var_map["ArchiveURL"]=$MyCFG->get_config_value("ArchiveURL");
$Var_map["UseTimeZone"]=$MyCFG->get_config_value("UseTimeZone");
$Var_map["PauseNLSendProcessEvery"]=$MyCFG->get_config_value("PauseNLSendProcessEvery");
$Var_map["PauseNLSendProcessTime"]=$MyCFG->get_config_value("PauseNLSendProcessTime");
$timeZones=file("$path_to_protected/admin/includes/timezones.txt");

$timeZones=array_unique($timeZones);
sort($timeZones);
if($MyRequestHandler->getKeyValue("GlobalCFoption") =="GlobalCFGchange")
{
    $error="";

    foreach($Var_map as $key=>$val)
    {
	
	if($val != $MyRequestHandler->getKeyValue($key))
	{
	    $Var_map[$key]=$MyRequestHandler->getKeyValue($key);
	}
	
	if(!$Var_map[$key])
	{
	    $error=$error.$MSG_Map[$key]."<br>";
	
	   
	}
	

    }
    if($Var_map["PauseNLSendProcessEvery"]<1){
	$Var_map["PauseNLSendProcessEvery"]=-1;
    }
    if($Var_map["PauseNLSendProcessEvery"]>5000){
	$Var_map["PauseNLSendProcessEvery"]=5000;
    }

    if($Var_map["PauseNLSendProcessTime"]<10){
	$Var_map["PauseNLSendProcessTime"]=10;
    }
    if($Var_map["PauseNLSendProcessTime"]>5000){
	$Var_map["PauseNLSendProcessTime"]=5000;
    }

    
    if(!$error)
    {
	$Var_map["Language"]=addslashes($MyRequestHandler->getKeyValue("Language"));
	$Var_map["Language"]=preg_replace("/\.\./", "",$Var_map["Language"]);
	//saving configuration:
	foreach($Var_map as $key=>$val)
	{
	    $MyCFG->replace_setting($key,"$val");
	}
	print "<b>$MSG_Success</b><br>";
    }
    else
    {
	print $ErrorMSG."<br>".$error;
    }
    print "<br><br>";
}


$Var_map["UseTimeZone"]=trim($Var_map["UseTimeZone"]);
print $MSG1."<br><br>";
print "<form action=\"".$_SERVER["PHP_SELF"]."\" method=\"post\">";
print "<table border=0>";
print "<tr><td>".$MSG_Map["URL"]."</td><td><input type=\"text\" name=\"URL\" value=\"".$Var_map["URL"]."\" size=\"40\"></td></tr>";
print "<tr><td>".$MSG_Map["Email"]."</td><td><input type=\"text\" name=\"Email\" value=\"".$Var_map["Email"]."\" size=\"40\"></td></tr>";
print "<tr><td>".$MSG_Map["SubscribeURL"]."</td><td><input type=\"text\" name=\"SubscribeURL\" value=\"".$Var_map["SubscribeURL"]."\" size=\"40\"></td></tr>";
print "<tr><td>".$MSG_Map["RenewalURL"]."</td><td><input type=\"text\" name=\"RenewalURL\" value=\"".$Var_map["RenewalURL"]."\" size=\"40\"></td></tr>";
print "<tr><td>".$MSG_Map["ConfirmationURL"]."</td><td><input type=\"text\" name=\"ConfirmationURL\" value=\"".$Var_map["ConfirmationURL"]."\" size=\"40\"></td></tr>";
print "<tr><td>".$MSG_Map["ArchiveURL"]."</td><td><input type=\"text\" name=\"ArchiveURL\" value=\"".$Var_map["ArchiveURL"]."\" size=\"40\"></td></tr>";
print "<tr><td>".$MSG_Map["EnableTinyMCE"]."</td><td>$MSG_yes <input type=\"radio\" name=\"EnableTinyMCE\" value=\"yes\"";
if($Var_map["EnableTinyMCE"]=="yes")
{
    print " checked ";
}

print "> | $MSG_no <input type=\"radio\" name=\"EnableTinyMCE\" value=\"no\"";
if($Var_map["EnableTinyMCE"] !="yes")
{
    print " checked ";
}
print "></td></tr>";

include "$path_to_protected/localization/Language_Reg.php.inc";
print "<tr><td>".$MSG_Map["Language"]."</td><td><select name=\"Language\"><option value=\"\">$MSG_Language_Select</option>";
$i=0;
while($i <count($Lang_pack_name))
{
    print "<option value=\"".$Lang_pack_dir[$i]."\""; 
    if($Lang_pack_dir[$i]==$Var_map["Language"])
    {
	print " selected ";
    }

    print ">".$Lang_pack_name[$i]."</option>";
    $i++;
}

print "</select></td></tr>";

print "<tr><td>".$MSG_Map["UseTimeZone"]."</td><td><select name=\"UseTimeZone\"><option value=\"default\"";
    if($Var_map["UseTimeZone"]=="" || $Var_map["UseTimeZone"]=="default")
    {
	print " selected ";
    }

print ">$MSG_UseTimeZoneDefault</option>";
$i=0;
while($i <count($timeZones))
{	
    $timeZones[$i]=trim($timeZones[$i]);
    print "<option value=\"".$timeZones[$i]."\""; 
    if($timeZones[$i]==$Var_map["UseTimeZone"])
    {
	print " selected ";
    }

    print ">".$timeZones[$i]."</option>";
    $i++;
}

print "</select></td></tr>";

print "<tr><td>".$MSG_Map["PauseNLSendProcessEvery"]."</td><td><select name=\"PauseNLSendProcessEvery\"><option value=\"-1\"";
if($Var_map["PauseNLSendProcessEvery"]<1){
    print " selected";
}    
print ">$MSG_Disabled</option>";
$i=10;
while($i <5001)
{	
  
    print "<option value=\"$i\""; 
    if($i==$Var_map["PauseNLSendProcessEvery"])
    {
	print " selected ";
    }

    print ">".$i."</option>";
    if($i <100){
	$i= $i+5;
    }
    else if($i <500){
	$i=$i+10;
    }
    else if($i <1000){
	$i=$i+50;
    }
    else{
	 $i =$i+100;   
    }
}

print "</select></td></tr>";

print "<tr><td>".$MSG_Map["PauseNLSendProcessTime"]."</td><td><select name=\"PauseNLSendProcessTime\">";
print ">$MSG_Disabled</option>";
$i=10;
while($i <5001)
{	
  
    print "<option value=\"$i\""; 
    if($i==$Var_map["PauseNLSendProcessTime"])
    {
	print " selected ";
    }

    print ">".$i."</option>";
    if($i <100){
	$i= $i+5;
    }
    else if($i <500){
	$i=$i+10;
    }
    else if($i <1000){
	$i=$i+50;
    }
    else{
	 $i =$i+100;   
    }
}

print "</select>$MSG_ms</td></tr>";


print "</table>";
print "<input type=\"hidden\" name=\"GlobalCFoption\" value=\"GlobalCFGchange\"><input type=\"submit\" value=\"$MSG_Submit\"></form>";

?> 


Return current item: ADbNewsSender