require_once "include/db.inc.php";
require_once "include/video.inc.php";
$video_email_id = $_GET['id'];
$v = Video::LoadByCode($_GET["v"]);
$res = DbQuery("SELECT * from videos where code='".$_GET["v"]."'");
$video_width = $v->width;
$video_height = $v->height;
//here is redirection array
// first = old value second is new value
$redirectArr = array('ae871228' => '87415a2e',
'adae9124' => '816103bf',
'0a22d79c' => '370df456',
'8a04c5d4' => 'a0f57a93',
'af6935f0' => '64a70dad',
'8a04c5d4' => 'a0f57a93',
'971f1097' => '94164511',
'fadf512d' => 'adacd1f0',
);
foreach($redirectArr as $key=>$val)
{
if($key == $_GET['v'])
{
$vidId = $val;
break;
}
else
$vidId = $_GET['v'];
}
$embedCode = '';
$email_content = DbQuery("SELECT email_content FROM video_emails WHERE video_code = '".$_GET["v"]."' and id='".$video_email_id."'");
if($v && $email_content)
{
$template = $email_content;
$videoPage = replace_between($template,'','', $embedCode);
echo $videoPage;
$title = $res[0]['title'];
if($v->template_title != "")
$title = $v->template_title;
echo '';
}
else
{
$content = html_entity_decode(stripcslashes($res[0]['videoHeader']));
if(trim($res[0]['background'])!= '')
$bg = explode('||',$res[0]['background']);
$backgroundFrom = ($bg[0])?$bg[0]:'111111';
$backgroundTo = ($bg[1])?$bg[1]:'333333';
include "header-video.inc.php";
echo $embedCode;
echo "