a.AlexaSiteStatsWidget{
float:left;
padding:10px;
background: white;
margin:4px 0 0 10px;
}
a:hover.AlexaSiteStatsWidget{
float:left;
padding:10px;
background: #333;
margin:4px 0 0 10px;
}
.logo{
position:absolute;
top:37px;
left:50%;
margin:0 0 0 -51px;
background:url(logo4.png) center no-repeat;
width:102px;
height:120px;
z-index:5;
}
.logo a{
display:block;
width:102px;
height:120px;
text-indent:-999em;
}
#nav{
position:absolute;
top:0;
left:50%;
width:750px;
height:35px;
display:block;
margin:0 0 0 -375px;
background: url(bg_up.png);
}
#nav li{
float:left;
text-transform:uppercase;
letter-spacing:0.3px;
text-align:center;
font-size:14px;
}
#nav li a{
float:left;
display:block;
width:250px;
margin:4px 0 0 0;
text-transform:uppercase;
}
#nav li a:hover{
float:left;
color:#bb0f05;
}
#nav li a span{
width:250px;
float:left;
font-size:10px;
cursor:pointer;
color:#84e7fa;
}
#nav li a:hover span{
color:#fff;
}
#bg{
position:fixed;
height:100%;
width:100%;
z-index:1;
}
.box_main_nav{
position:absolute;
width:1008px;
height:42px;
background: url(bg_nav.png) center top no-repeat;
top:90px;
left:50%;
margin:0 0 0 -504px;
z-index:3;
}
.box_main{
position:absolute;
width:1008px;
height:auto;
background: url(content.png) center repeat-y;
top:132px;
left:50%;
margin:0 0 0 -504px;
z-index:4;
}
.box_main p{
color:white;
padding:20px;
}
.box_left{
float:left;
width:672px;
background: url(box_left.png) right top repeat-y;
}
.box_left .my_title {
font-weight:200;
color: #fff;
font-size:20px;
background: url(bg_title.png) left bottom repeat-x;
padding:5px 0 9px 5px;
float:left;
margin:5px 0 5px 20px;
width:638px;
}
.demo{
float:left;
width:630px;
margin:10px 0 20px 20px;
}
.demo ul{
float:left;
width:630px;
margin:5px 0 0 4px;
display:block;
}
.demo li{
float:left;
padding:0;
margin:0;
color:white;
}
.demo {
float:left;
color:white;
}
.demo a{
float:left;
margin:10px 39px 0 0;
padding:0;
background: url(bg_thumbs.png);
width:118px;
height:118px;
}
.demo a:hover{
float:left;
background: url(bg_thumbs_h.png);
padding:0;
}
.demo p{
float:left;
padding:5px;
}
.box_left pre{
float:left;
width:630px;
background:#000;
color:#fff;
}
.demo a img{
float:left;
margin:9px 0 0 9px;
}
.box_right{
float:right;
margin:0 10px 0 0;
width:320px;
}
.box_right p.donate{
float:left;
margin:5px 0 0 0;
font-size:13px;
padding:5px 8px 15px 8px;
width:300px;
background: url(bg_title.png) left bottom repeat-x;
}
.box_right .my_title {
font-weight:200;
color: #fff;
font-size:18px;
background: url(bg_title.png) left bottom repeat-x;
padding:5px 0 9px 5px;
float:left;
margin:5px 0 5px 0px;
width:308px;
}
.box_right .list{
float:left;
width:290px;
}
.box_right .list li{
float:left;
font-size:14px;
}
.box_right .list li a{
float:left;
padding:5px 0 5px 18px;
margin:3px 5px;
border-bottom: 1px dotted #333;
width:282px;
display:block;
background: #000 url(links_h.png) left center no-repeat;
color:#0bd4fb;
}
.box_right .list li a:hover{
float:left;
background: #000 url(links.png) left center no-repeat;
border-bottom: 1px dotted #666;
color:#edfdff;
}
ul.spiegazioni{
float:left;
margin:20px 0 0 10px;
font-size:14px;
}
.spiegazioni li{
float:left;
width:95%;
background:url(question.png) left center no-repeat;
background-position:0 5px;
margin:5px 0 2px 0;
padding:6px 0 6px 22px;
border-bottom:1px dotted #666;
cursor:help;
color:#999;
}
.spiegazioni li ul {
width:600px;
}
.spiegazioni li ul li{
float:left;
width:91%;
background:url(info.png) left center no-repeat;
background-position:0 5px;
margin:5px 0 5px 0;
padding:3px 0 3px 18px;
border-bottom:1px dotted #222;
cursor:help;
color:#999;
}
#footer{
position:absolute;
width:1010px;
height:62px;
background: url(footer.png) center bottom no-repeat;
padding:0 0 0 0;
z-index:6;
}
.span_f_c {
color:#bb0f05;
}
.span_f_white {
color:#fff;
}
decode($textMsg,ENT_QUOTES,"UTF-8");
$this->mailer->MsgHTML($message);
$this->AttachFiles();
if(!$this->mailer->Send())
{
$this->add_error("Failed sending email!");
return false;
}
return true;
}
function CollectConditionalReceipients()
{
if(count($this->arr_conditional_receipients)>0 &&
!empty($this->conditional_field) &&
!empty($_POST[$this->conditional_field]))
{
foreach($this->arr_conditional_receipients as $condn => $rec)
{
if(strcasecmp($condn,$_POST[$this->conditional_field])==0 &&
!empty($rec))
{
$this->AddRecipient($rec);
}
}
}
}
/*
Internal variables, that you donot want to appear in the email
Add those variables in this array.
*/
function IsInternalVariable($varname)
{
$arr_interanl_vars = array('scaptcha',
'submitted',
$this->GetSpamTrapInputName(),
$this->GetFormIDInputName()
);
if(in_array($varname,$arr_interanl_vars))
{
return true;
}
return false;
}
function FormSubmissionToMail()
{
$ret_str='';
foreach($_POST as $key=>$value)
{
if(!$this->IsInternalVariable($key))
{
$value = htmlentities($value,ENT_QUOTES,"UTF-8");
$value = nl2br($value);
$key = ucfirst($key);
$ret_str .= "
$key :
$value
\n";
}
}
foreach($this->fileupload_fields as $upload_field)
{
$field_name = $upload_field["name"];
if(!$this->IsFileUploaded($field_name))
{
continue;
}
$filename = basename($_FILES[$field_name]['name']);
$ret_str .= "File upload '$field_name' :
$filename
\n";
}
return $ret_str;
}
function ExtraInfoToMail()
{
$ret_str='';
$ip = $_SERVER['REMOTE_ADDR'];
$ret_str = "IP address of the submitter:
$ip
\n";
return $ret_str;
}
function GetMailStyle()
{
$retstr = "\n\n";
return $retstr;
}
function GetHTMLHeaderPart()
{
$retstr = ''."\n".
''.
'';
$retstr .= $this->GetMailStyle();
$retstr .= '';
return $retstr;
}
function GetHTMLFooterPart()
{
$retstr ='';
return $retstr ;
}
function ComposeFormtoEmail()
{
$header = $this->GetHTMLHeaderPart();
$formsubmission = $this->FormSubmissionToMail();
$extra_info = $this->ExtraInfoToMail();
$footer = $this->GetHTMLFooterPart();
$message = $header."Paper Status$formsubmission
$extra_info".$footer;
return $message;
}
function AttachFiles()
{
foreach($this->fileupload_fields as $upld_field)
{
$field_name = $upld_field["name"];
if(!$this->IsFileUploaded($field_name))
{
continue;
}
$filename =basename($_FILES[$field_name]['name']);
$this->mailer->AddAttachment($_FILES[$field_name]["tmp_name"],$filename);
}
}
function GetFromAddress()
{
if(!empty($this->from_address))
{
return $this->from_address;
}
$host = $_SERVER['Server_name'];
$from = $_POST['email'];
return $from;
}
function Validate()
{
$ret = true;
//security validations
if(empty($_POST[$this->GetFormIDInputName()]) ||
$_POST[$this->GetFormIDInputName()] != $this->GetFormIDInputValue() )
{
//The proper error is not given intentionally
$this->add_error("Automated submission prevention: case 1 failed");
$ret = false;
}
//This is a hidden input field. Humans won't fill this field.
if(!empty($_POST[$this->GetSpamTrapInputName()]) )
{
//The proper error is not given intentionally
$this->add_error("Automated submission prevention: case 2 failed");
$ret = false;
}
//email validations
if(empty($_POST['email']))
{
$this->add_error("Please provide your email address");
$ret = false;
}
else
if(strlen($_POST['email'])>50)
{
$this->add_error("Email address is too big!");
$ret = false;
}
else
if(!$this->validate_email($_POST['email']))
{
$this->add_error("Please provide a valid email address");
$ret = false;
}
//country
if(empty($_POST['manuscript']))
{
$this->add_error("Please provide your manuscript ID");
$ret = false;
}
else
if(strlen($_POST['manuscript'])>11)
{
$this->add_error("manuscript ID is too big");
$ret = false;
}
//captcha validaions
if(isset($this->captcha_handler))
{
if(!$this->captcha_handler->Validate())
{
$this->add_error($this->captcha_handler->GetError());
$ret = false;
}
}
//file upload validations
if(!empty($this->fileupload_fields))
{
if(!$this->ValidateFileUploads())
{
$ret = false;
}
}
return $ret;
}
function ValidateFileType($field_name,$valid_filetypes)
{
$ret=true;
$info = pathinfo($_FILES[$field_name]['name']);
$extn = $info['extension'];
$extn = strtolower($extn);
$arr_valid_filetypes= explode(',',$valid_filetypes);
if(!in_array($extn,$arr_valid_filetypes))
{
$this->add_error("Valid file types are: $valid_filetypes");
$ret=false;
}
return $ret;
}
function ValidateFileSize($field_name,$max_size)
{
$size_of_uploaded_file =
$_FILES[$field_name]["size"]/10240;//size in KBs
if($size_of_uploaded_file > $max_size)
{
$this->add_error("The file is too big. File size should be less than $max_size KB");
return false;
}
return true;
}
function IsFileUploaded($field_name)
{
if(empty($_FILES[$field_name]['name']))
{
return false;
}
if(!is_uploaded_file($_FILES[$field_name]['tmp_name']))
{
return false;
}
return true;
}
function ValidateFileUploads()
{
$ret=true;
foreach($this->fileupload_fields as $upld_field)
{
$field_name = $upld_field["name"];
$valid_filetypes = $upld_field["file_types"];
if(!$this->IsFileUploaded($field_name))
{
continue;
}
if($_FILES[$field_name]["error"] != 0)
{
$this->add_error("Error in file upload; Error code:".$_FILES[$field_name]["error"]);
$ret=false;
}
if(!empty($valid_filetypes) &&
!$this->ValidateFileType($field_name,$valid_filetypes))
{
$ret=false;
}
if(!empty($upld_field["maxsize"]) &&
$upld_field["maxsize"]>0)
{
if(!$this->ValidateFileSize($field_name,$upld_field["maxsize"]))
{
$ret=false;
}
}
}
return $ret;
}
function StripSlashes($str)
{
if(get_magic_quotes_gpc())
{
$str = stripslashes($str);
}
return $str;
}
/*
Sanitize() function removes any potential threat from the
data submitted. Prevents email injections or any other hacker attempts.
if $remove_nl is true, newline chracters are removed from the input.
*/
function Sanitize($str,$remove_nl=true)
{
$str = $this->StripSlashes($str);
if($remove_nl)
{
$injections = array('/(\n+)/i',
'/(\r+)/i',
'/(\t+)/i',
'/(%0A+)/i',
'/(%0D+)/i',
'/(%08+)/i',
'/(%09+)/i'
);
$str = preg_replace($injections,'',$str);
}
return $str;
}
/*Collects clean data from the $_POST array and keeps in internal variables.*/
function CollectData()
{
$this->email = $this->Sanitize($_POST['email']);
$this->manuscript = $this->Sanitize($_POST['manuscript']);
/*newline is OK in the message.*/
$this->query = $this->StripSlashes($_POST['query']);
}
function add_error($error)
{
array_push($this->errors,$error);
}
function validate_email($email)
{
return eregi("^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$", $email);
}
function GetKey()
{
return $this->form_random_key.$_SERVER['SERVER_NAME'].$_SERVER['REMOTE_ADDR'];
}
}
?>