£Á°èZ¨Ä…–K§‚«“ô4“ÒÙ´dîfUÙÃÅ WKbyʦ•ꎅȮFÒ¿ÊÎóCozá¬S@6{Í:›œêZÌ:Š•_%:¢¾¾~;‘Ã~芩ÊǍí`ÔÑ©ú뙵'5I¿fš×WO%ø9¾«¾DK|€ùÍD”Ýs]nHÕ¶êםӼ㞪éUWŸÈË%DÒÕ¬ï‘]/Åcx ‰ï2ß]ä6G[]S£Ôϯrs{úëóµmÒï#UQxo·õÞCe]"±/aÙ&Eã4ú9Jé_ÞåëdãöKë)AÞ ¯¹ægƒÛowЍø^d™ý½ßB7áyMä9ÜÖUã !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! userid != $user->id) $error = "Access denied."; if (isset($error)) die("

$error

"); //Getting final temaplte content $templateContent = $_POST['templateText']; if($_GET['action'] == "preview") { echo ' '; echo $templateContent; echo ''; } if($_GET['action'] == "save_template") { $templateContent = replace_between($templateContent,'','', '<>'); $old_template = DbQuery("select * from email_templates where templateId=".$_POST['templateId']); $template->templateName = $_POST['new_template_name']; $template->templateText = $templateContent; $template->image = $old_template[0]['image']; $template->user_id = $user->id; if($_POST['new_template_id'] != "") { $template->templateId = $_POST['new_template_id']; ObjectSqlUpdate1($template, "email_templates","templateId"); $template->id = $_POST['new_template_id']; } else ObjectSqlInsert($template, "email_templates"); $redirect_url = "email_template_edit.php?v=".$v->code."&template_save=Y&new=Y&templateId=".$template->id; ?> template_title = $_POST['template_title'];; $v->Save(); $video_email->video_code = $v->code; $video_email->email_template_id = $_POST['templateId']; $video_email->email_content = $templateContent; $res = DbQuery("select * from video_emails where video_code = '".$v->code."' and email_template_id = '".$_POST['templateId']."'"); if($res) { ObjectSqlUpdate1($video_email, "video_emails","id"); $video_email->id = $res[0]['id']; } else ObjectSqlInsert($video_email, "video_emails"); $video_email->email_content = str_replace($SITE.'email_video.php?v='.$code, $SITE.'email_video.php?v='.$code.'&id='.$video_email->id, $video_email->email_content); ObjectSqlUpdate1($video_email, "video_emails","id"); $redirect_url = "deliver_email.php?v=".$v->code."&id=".$video_email->id; ?> id." and templateId=".$_GET['templateId']); header("Location:email_template_list.php?v=".$v->code); } function replace_between($string, $start_str, $end_str, $replace) { $start_pos = strpos($string, $start_str)+strlen($start_str); $end_pos = strpos($string, $end_str, $start_pos); $sub_string = substr($string, $start_pos, $end_pos-$start_pos); return str_replace($sub_string, $replace, $string); }