get_row("SELECT * FROM ".$icdb->prefix."sessions WHERE session_id = '".$session_id."' AND registered + valid_period > '".time()."'");
if ($session_details) {
$icdb->query("UPDATE ".$icdb->prefix."sessions SET registered = '".time()."', ip = '".$_SERVER['REMOTE_ADDR']."' WHERE session_id = '".$session_id."'");
$is_logged = true;
}
}
get_options();
handle_version();
$currency_list = array_unique(array_merge($paypal_currency_list, $payza_currency_list, $interkassa_currency_list, $egopay_currency_list, $perfect_currency_list, $skrill_currency_list, $bitpay_currency_list));
sort($currency_list);
$currency_list = array_unique(array_merge(array("USD"), $currency_list));
$url_base = ((empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] == 'off') ? 'http://' : 'https://').$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"];
$filename = basename(__FILE__);
if (($pos = strpos($url_base, $filename)) !== false) $url_base = substr($url_base, 0, $pos);
if (isset($_SESSION['error'])) {
$error_message = $_SESSION['error'];
unset($_SESSION['error']);
} else $error_message = '';
if (isset($_SESSION['ok'])) {
$ok_message = $_SESSION['ok'];
unset($_SESSION['ok']);
} else $ok_message = '';
$pages = array (
'settings' => array('title' => 'Settings', 'menu' => true),
'types' => array('title' => 'Banner Types', 'menu' => true),
'banners' => array('title' => 'Banners', 'menu' => true),
'embed' => array('title' => 'Embedding', 'menu' => true),
'edit' => array('title' => 'Edit Banner', 'menu' => false),
'edittype' => array('title' => 'Edit Banner Type', 'menu' => false)
);
$deafult_page = 'types';
if ($is_logged) {
if (isset($_GET['action'])) {
switch ($_GET['action']) {
case 'logout':
if (!empty($session_id)) {
$icdb->query("UPDATE ".$icdb->prefix."sessions SET valid_period = '0' WHERE session_id = '".$session_id."'");
}
header('Location: admin.php');
exit;
break;
case 'update-options':
if (DEMO_MODE) {
$_SESSION['error'] = 'Demo mode. This operation is disabled.';
header('Location: admin.php?page=settings');
exit;
}
if (empty($_POST["login"])) {
$_SESSION['error'] = 'Invalid login value. Empty admin login value is not allowed.';
header('Location: admin.php?page=settings');
exit;
}
if (isset($_POST['action']) && $_POST['action'] == 'update-options') {
populate_options();
if (isset($_POST["enable_approval"])) $options['enable_approval'] = "on";
else $options['enable_approval'] = "off";
if (isset($_POST["enable_paypal"])) $options['enable_paypal'] = "on";
else $options['enable_paypal'] = "off";
if (isset($_POST["enable_payza"])) $options['enable_payza'] = "on";
else $options['enable_payza'] = "off";
if (isset($_POST["payza_sandbox"])) $options['payza_sandbox'] = "on";
else $options['payza_sandbox'] = "off";
if (isset($_POST["enable_skrill"])) $options['enable_skrill'] = "on";
else $options['enable_skrill'] = "off";
if (isset($_POST["enable_interkassa"])) $options['enable_interkassa'] = "on";
else $options['enable_interkassa'] = "off";
if (isset($_POST["enable_authnet"])) $options['enable_authnet'] = "on";
else $options['enable_authnet'] = "off";
if (isset($_POST["authnet_sandbox"])) $options['authnet_sandbox'] = "on";
else $options['authnet_sandbox'] = "off";
if (isset($_POST["enable_egopay"])) $options['enable_egopay'] = "on";
else $options['enable_egopay'] = "off";
if (isset($_POST["enable_perfect"])) $options['enable_perfect'] = "on";
else $options['enable_perfect'] = "off";
if (isset($_POST["enable_bitpay"])) $options['enable_bitpay'] = "on";
else $options['enable_bitpay'] = "off";
if (isset($_POST["enable_stripe"])) $options['enable_stripe'] = "on";
else $options['enable_stripe'] = "off";
$errors = check_options();
if (isset($_POST['password'])) $password = trim(stripslashes($_POST['password']));
else $password = '';
if (isset($_POST['confirm_password'])) $confirm_password = trim(stripslashes($_POST['confirm_password']));
else $confirm_password = '';
if (!empty($password)) {
if ($password == $confirm_password) {
$options['password'] = md5($password);
} else {
if ($errors === true) $errors = array('Password and its confirmation are not equal');
else $errors[] = 'Password and its confirmation are not equal';
}
}
update_options();
if (is_array($errors)) {
$_SESSION['error'] = 'The following error(s) exists:
'.implode('
', $errors).'
';
} else {
$_SESSION['ok'] = 'Settings successfully saved!';
}
}
header('Location: admin.php?page=settings');
exit;
break;
case 'update-type':
if (DEMO_MODE) {
$_SESSION['error'] = 'Demo mode. This operation is disabled.';
header('Location: admin.php?page=types');
exit;
}
if (isset($_POST['action']) && $_POST['action'] == 'update-type') {
unset($id);
if (isset($_POST["id"]) && !empty($_POST["id"])) {
$id = intval($_POST["id"]);
$type_details = $icdb->get_row("SELECT t1.*, t2.total_banners, t2.total_amount FROM ".$icdb->prefix."types t1 LEFT JOIN (SELECT type_id, SUM(amount) AS total_amount, COUNT(*) AS total_banners FROM ".$icdb->prefix."banners WHERE status != '".STATUS_DRAFT."' AND deleted = '0' GROUP BY type_id) t2 ON t2.type_id = t1.id WHERE t1.id = '".$id."' AND t1.deleted = '0'");
if (!$type_details) unset($id);
}
$title = trim(stripslashes($_POST['title']));
$type = intval(trim($_POST["type"]));
$slots = intval(trim($_POST["slots"]));
if ($type != 0) {
foreach($types as $type_tmp) {
if ($type_tmp["id"] == $type) {
$width = $type_tmp["width"];
$height = $type_tmp["height"];
break;
}
}
} else {
$width = intval(trim($_POST["width"]));
$height = intval(trim($_POST["height"]));
}
$error = array();
if (empty($title)) $errors[] = 'Title is too short';
else if (strlen($title) > 128) $errors[] = 'Title is too long';
if ($slots <= 0) $errors[] = 'Number of slots must be higher then zero';
if ($width < 20) $errors[] = 'Width must be 20 or higher';
if ($height < 20) $errors[] = 'Height must be 20 or higher';
if (!empty($id) && $type_details["total_banners"] > 0 && ($width != $type_details["width"] || $height != $type_details["height"])) $errors[] = 'Banner size must be the same, because you have banners of this type';
if (!empty($errors)) {
$_SESSION['error'] = 'The following error(s) exists:
'.implode('
', $errors).'
';
$_SESSION['title'] = $title;
$_SESSION['width'] = $width;
$_SESSION['height'] = $height;
$_SESSION['slots'] = $slots;
header('Location: admin.php?page=edittype'.(empty($id) ? '' : '&id='.$id));
exit;
} else {
if (!empty($id)) {
$icdb->query("UPDATE ".$icdb->prefix."types SET
title = '".$icdb->escape_string($title)."',
width = '".$width."',
height = '".$height."',
slots = '".$slots."'
WHERE id = '".$id."'");
$_SESSION['ok'] = 'Banner Type details successfully updated!';
} else {
$icdb->query("INSERT INTO ".$icdb->prefix."types
(title, width, height, slots, status, details, registered, deleted) VALUES (
'".$icdb->escape_string($title)."',
'".$width."',
'".$height."',
'".$slots."',
'".STATUS_ACTIVE."', '',
'".time()."', '0')");
$_SESSION['ok'] = 'New Banner Type successfully added!';
}
}
}
header('Location: admin.php?page=types');
exit;
break;
case 'delete-type':
if (DEMO_MODE) {
$_SESSION['error'] = 'Demo mode. This operation is disabled.';
header('Location: admin.php?page=types');
exit;
}
$id = intval($_GET["id"]);
$type_details = $icdb->get_row("SELECT * FROM ".$icdb->prefix."types WHERE id = '".$id."' AND deleted = '0'");
if (intval($type_details["id"]) == 0) {
$_SESSION['error'] = 'Record not found!';
header('Location: admin.php?page=types');
exit;
}
$sql = "UPDATE ".$icdb->prefix."types SET deleted = '1' WHERE id = '".$id."'";
if ($icdb->query($sql) !== false) {
$_SESSION['ok'] = 'Record successfully deleted!';
} else {
$_SESSION['error'] = 'Record can not be deleted!';
}
header('Location: admin.php?page=types');
exit;
break;
case 'delete-all-types':
if (DEMO_MODE) {
$_SESSION['error'] = 'Demo mode. This operation is disabled.';
header('Location: admin.php?page=types');
exit;
}
$sql = "UPDATE ".$icdb->prefix."types SET deleted = '1' WHERE deleted != '1'";
if ($icdb->query($sql) !== false) {
$_SESSION['ok'] = 'Records successfully deleted!';
} else {
$_SESSION['error'] = 'Records can not be deleted!';
}
header('Location: admin.php?page=types');
exit;
break;
case 'block-type':
if (DEMO_MODE) {
$_SESSION['error'] = 'Demo mode. This operation is disabled.';
header('Location: admin.php?page=types');
exit;
}
$id = intval($_GET["id"]);
$type_details = $icdb->get_row("SELECT * FROM ".$icdb->prefix."types WHERE id = '".$id."' AND deleted = '0'");
if (intval($type_details["id"]) == 0) {
$_SESSION['error'] = 'Record not found!';
header('Location: admin.php?page=types');
exit;
}
$sql = "UPDATE ".$icdb->prefix."types SET status = '".STATUS_PENDING."' WHERE id = '".$id."'";
if ($icdb->query($sql) !== false) {
$_SESSION['ok'] = 'Banner Type successfully blocked!';
} else {
$_SESSION['error'] = 'Banner Type can not be blocked!';
}
header('Location: admin.php?page=types');
exit;
break;
case 'unblock-type':
if (DEMO_MODE) {
$_SESSION['error'] = 'Demo mode. This operation is disabled.';
header('Location: admin.php?page=types');
exit;
}
$id = intval($_GET["id"]);
$type_details = $icdb->get_row("SELECT * FROM ".$icdb->prefix."types WHERE id = '".$id."' AND deleted = '0'");
if (intval($type_details["id"]) == 0) {
$_SESSION['error'] = 'Record not found!';
header('Location: admin.php?page=types');
exit;
}
$sql = "UPDATE ".$icdb->prefix."types SET status = '".STATUS_ACTIVE."' WHERE id = '".$id."'";
if ($icdb->query($sql) !== false) {
$_SESSION['ok'] = 'Banner Type successfully unblocked!';
} else {
$_SESSION['error'] = 'Banner Type can not be unblocked!';
}
header('Location: admin.php?page=types');
exit;
break;
case 'update-banner':
if (DEMO_MODE) {
$_SESSION['error'] = 'Demo mode. This operation is disabled.';
header('Location: admin.php?page=banners');
exit;
}
if (isset($_POST['action']) && $_POST['action'] == 'update-banner') {
if (isset($_POST["cid"])) $cid = intval(trim(stripslashes($_POST["cid"])));
else $cid = 0;
unset($id);
if (isset($_POST["id"]) && !empty($_POST["id"])) {
$id = intval($_POST["id"]);
$banner_details = $icdb->get_row("SELECT * FROM ".$icdb->prefix."banners WHERE id = '".$id."' AND deleted = '0'");
if (!$banner_details) unset($id);
}
$type_id = intval($_POST['type_id']);
$type_details = $icdb->get_row("SELECT * FROM ".$icdb->prefix."types WHERE id = '".$type_id."' AND deleted = '0'");
if (!$type_details) {
if (isset($id)) {
$type_id = $banner_details['type_id'];
} else {
$_SESSION['error'] = 'Banner Type not found!';
header('Location: admin.php?page=edit'.($cid == 0 ? '' : '&cid='.$cid));
exit;
}
}
$title = trim(stripslashes($_POST['title']));
$email = trim(stripslashes($_POST['email']));
$url = trim(stripslashes($_POST['url']));
$days_purchased = trim(stripslashes($_POST['days_purchased']));
$source = intval($_POST['source']);
$content = trim(stripslashes($_POST['content']));
$errors = array();
if (!preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/i", $email) && strlen($email) > 0) $errors[] = 'E-mail must be valid e-mail address';
if (!preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url) && strlen($url) > 0) $errors[] = 'URL must be valid URL';
if (!is_numeric($days_purchased) || intval($days_purchased) <= 0) $errors[] = 'Invalid rotation period';
if (isset($_POST['filename'])) $file = trim($_POST['filename']);
else if (!empty($id)) $file = $banner_details["file"];
else $file = '';
if ($source == SOURCE2_IMAGE) {
if (is_uploaded_file($_FILES["file"]["tmp_name"])) {
$ext = "";
if (($pos = strrpos($_FILES["file"]["name"], ".")) !== false) {
$ext = strtolower(substr($_FILES["file"]["name"], $pos));
}
if ($ext != ".jpg" && $ext != ".jpeg" && $ext != ".gif" && $ext != ".png") $errors[] = 'Banner image must be JPEG, GIF or PNG file';
else {
list($width, $height, $imagetype, $attr) = getimagesize($_FILES["file"]["tmp_name"]);
if ($width != $type_details["width"] || $height != $type_details["height"]) $errors[] = 'Banner image size must be '.$type_details["width"].'x'.$type_details["height"];
else {
$file = "banner_".random_string(16).$ext;
if (!move_uploaded_file($_FILES["file"]["tmp_name"], ABSPATH."/files/".$file)) {
$errors[] = 'Can not save uploaded banner image';
$file = "";
} else {
if (!empty($banner_details["file"]) && empty($errors)) {
if (file_exists(ABSPATH."/files/".$banner_details["file"]) && is_file(ABSPATH."/files/".$banner_details["file"]))
unlink(ABSPATH."/files/".$banner_details["file"]);
}
}
}
}
} else if (!file_exists(ABSPATH."/files/".$file) || !is_file(ABSPATH."/files/".$file)) $errors[] = 'Banner image must be uploaded';
} else if ($source == SOURCE2_CONTENT) {
} else $errors[] = 'Invalid banner source';
if (!empty($errors)) {
$_SESSION['error'] = 'The following error(s) exists:
'.implode('
', $errors).'
';
$_SESSION['title'] = $title;
$_SESSION['email'] = $email;
$_SESSION['url'] = $url;
$_SESSION['days_purchased'] = $days_purchased;
$_SESSION['type_id'] = $type_id;
$_SESSION['file'] = $file;
$_SESSION['source'] = $source;
$_SESSION['content'] = $content;
header('Location: admin.php?page=edit'.(empty($id) ? '' : '&id='.$id).($cid == 0 ? '' : '&cid='.$cid));
exit;
} else {
if (!empty($id)) {
$status = $banner_details['status'];
if ($status == STATUS_EXPIRED) {
if ($banner_details['registered']+24*3600*intval($days_purchased) >= time()) $status = STATUS_ACTIVE;
}
$icdb->query("UPDATE ".$icdb->prefix."banners SET
type_id = '".$type_id."',
title = '".$icdb->escape_string($title)."',
email = '".$icdb->escape_string($email)."',
url = '".$icdb->escape_string($url)."',
days_purchased = '".intval($days_purchased)."',
status = '".$status."',
source = '".$source."',
content = '".$icdb->escape_string($content)."',
file = '".$icdb->escape_string($file)."'
WHERE id = '".$id."'");
$_SESSION['ok'] = 'Banner details successfully updated!';
} else {
$icdb->query("INSERT INTO ".$icdb->prefix."banners (
type_id,
title,
email,
url,
file,
days_purchased,
amount,
currency,
shows_displayed,
clicks,
id_str,
status,
details,
echo,
source,
content,
registered,
blocked,
deleted
) VALUES (
'".$type_id."',
'".$icdb->escape_string($title)."',
'".$icdb->escape_string($email)."',
'".$icdb->escape_string($url)."',
'".$icdb->escape_string($file)."',
'".$icdb->escape_string($days_purchased)."',
'0.00', 'USD', '0', '0', '".random_string(16)."',
'".STATUS_ACTIVE."', '', '',
'".$source."',
'".$icdb->escape_string($content)."',
'".time()."', '0', '0')");
$_SESSION['ok'] = 'New banner successfully added!';
}
}
}
header('Location: admin.php?page=banners'.($cid == 0 ? '' : '&cid='.$type_id));
exit;
break;
case 'delete-banner':
if (DEMO_MODE) {
$_SESSION['error'] = 'Demo mode. This operation is disabled.';
header('Location: admin.php?page=banners');
exit;
}
if (isset($_GET["cid"])) $cid = intval($_GET["cid"]);
else $cid = 0;
$id = intval($_GET["id"]);
$banner_details = $icdb->get_row("SELECT * FROM ".$icdb->prefix."banners WHERE id = '".$id."' AND deleted = '0'");
if (intval($banner_details["id"]) == 0) {
$_SESSION['error'] = 'Record not found!';
header('Location: admin.php?page=banners'.($cid == 0 ? '' : '&cid='.$cid));
exit;
}
$sql = "UPDATE ".$icdb->prefix."banners SET deleted = '1' WHERE id = '".$id."'";
if ($icdb->query($sql) !== false) {
$_SESSION['ok'] = 'Record successfully deleted!';
if ($banner_details["blocked"] == $banner_details["registered"] && !empty($banner_details["email"]) && $options['enable_approval'] == 'on') {
$tags = array("{banner_title}");
$vals = array($banner_details["title"]);
$body = str_replace($tags, $vals, $options['rejected_email_body']);
$mail_headers = "Content-Type: text/plain; charset=utf-8\r\n";
$mail_headers .= "From: ".$options['from_name']." <".$options['from_email'].">\r\n";
$mail_headers .= "X-Mailer: PHP/".phpversion()."\r\n";
mail($banner_details["email"], $banner_details["title"], $body, $mail_headers);
$_SESSION['ok'] = 'Record successfully deleted and advertiser notified about rejection!';
}
} else {
$_SESSION['error'] = 'Record can not be deleted!';
}
header('Location: admin.php?page=banners'.($cid == 0 ? '' : '&cid='.$cid));
exit;
break;
case 'delete-all-banners':
if (DEMO_MODE) {
$_SESSION['error'] = 'Demo mode. This operation is disabled.';
header('Location: admin.php?page=banners');
exit;
}
if (isset($_GET["cid"])) $cid = intval($_GET["cid"]);
else $cid = 0;
$sql = "UPDATE ".$icdb->prefix."banners SET deleted = '1' WHERE deleted != '1'".($cid == 0 ? '' : " AND type_id = '".$cid."'");
if ($icdb->query($sql) !== false) {
$_SESSION['ok'] = 'Records successfully deleted!';
} else {
$_SESSION['error'] = 'Records can not be deleted!';
}
header('Location: admin.php?page=banners'.($cid == 0 ? '' : '&cid='.$cid));
exit;
break;
case 'block-banner':
if (DEMO_MODE) {
$_SESSION['error'] = 'Demo mode. This operation is disabled.';
header('Location: admin.php?page=banners');
exit;
}
if (isset($_GET["cid"])) $cid = intval($_GET["cid"]);
else $cid = 0;
$id = intval($_GET["id"]);
$banner_details = $icdb->get_row("SELECT * FROM ".$icdb->prefix."banners WHERE id = '".$id."' AND deleted = '0'");
if (intval($banner_details["id"]) == 0) {
$_SESSION['error'] = 'Record not found!';
header('Location: admin.php?page=banners'.($cid == 0 ? '' : '&cid='.$cid));
exit;
}
if ($banner_details['status'] != STATUS_ACTIVE) {
$_SESSION['error'] = 'Banner can not be blocked!';
header('Location: admin.php?page=banners'.($cid == 0 ? '' : '&cid='.$cid));
exit;
}
$sql = "UPDATE ".$icdb->prefix."banners SET status = '".STATUS_PENDING."', blocked = '".time()."' WHERE id = '".$id."'";
if ($icdb->query($sql) !== false) {
$_SESSION['ok'] = 'Banner successfully blocked!';
} else {
$_SESSION['error'] = 'Banner can not be blocked!';
}
header('Location: admin.php?page=banners'.($cid == 0 ? '' : '&cid='.$cid));
exit;
break;
case 'unblock-banner':
if (DEMO_MODE) {
$_SESSION['error'] = 'Demo mode. This operation is disabled.';
header('Location: admin.php?page=banners');
exit;
}
if (isset($_GET["cid"])) $cid = intval($_GET["cid"]);
else $cid = 0;
$id = intval($_GET["id"]);
$banner_details = $icdb->get_row("SELECT * FROM ".$icdb->prefix."banners WHERE id = '".$id."' AND deleted = '0'");
if (intval($banner_details["id"]) == 0) {
$_SESSION['error'] = 'Record not found!';
header('Location: admin.php?page=banners'.($cid == 0 ? '' : '&cid='.$cid));
exit;
}
if ($banner_details['status'] != STATUS_PENDING) {
$_SESSION['error'] = 'Banner is already unblocked!';
header('Location: admin.php?page=banners'.($cid == 0 ? '' : '&cid='.$cid));
exit;
}
if (intval($banner_details["blocked"]) >= $banner_details["registered"]) {
$registered = time() - $banner_details["blocked"] + $banner_details["registered"];
} else $registered = $banner_details["registered"];
$sql = "UPDATE ".$icdb->prefix."banners SET status = '".STATUS_ACTIVE."', registered = '".$registered."' WHERE id = '".$id."'";
if ($icdb->query($sql) !== false) {
$_SESSION['ok'] = 'Banner successfully unblocked!';
if ($banner_details["blocked"] == $banner_details["registered"] && !empty($banner_details["email"]) && $options['enable_approval'] == 'on') {
$tags = array("{banner_title}");
$vals = array($banner_details["title"]);
$body = str_replace($tags, $vals, $options['approved_email_body']);
$mail_headers = "Content-Type: text/plain; charset=utf-8\r\n";
$mail_headers .= "From: ".$options['from_name']." <".$options['from_email'].">\r\n";
$mail_headers .= "X-Mailer: PHP/".phpversion()."\r\n";
mail($banner_details["email"], $banner_details["title"], $body, $mail_headers);
$_SESSION['ok'] = 'Banner successfully unblocked and advertiser notified about approval!';
}
} else {
$_SESSION['error'] = 'Banner can not be unblocked!';
}
header('Location: admin.php?page=banners'.($cid == 0 ? '' : '&cid='.$cid));
exit;
break;
case 'delete-transaction':
if (DEMO_MODE) {
$_SESSION['error'] = 'Demo mode. This operation is disabled.';
header('Location: admin.php?page=transactions');
exit;
}
$id = intval($_GET["id"]);
$transaction_details = $icdb->get_row("SELECT * FROM ".$icdb->prefix."transactions WHERE id = '".$id."' AND deleted = '0'");
if (intval($transaction_details["id"]) == 0) {
$_SESSION['error'] = 'Record not found!';
header('Location: admin.php?page=transactions');
exit;
}
$sql = "UPDATE ".$icdb->prefix."transactions SET deleted = '1' WHERE id = '".$id."'";
if ($icdb->query($sql) !== false) {
$_SESSION['ok'] = 'Record successfully deleted!';
} else {
$_SESSION['error'] = 'Record can not be deleted!';
}
header('Location: admin.php?page=transactions');
exit;
break;
default:
break;
}
header('Location: admin.php');
exit;
}
if (isset($_GET['page'])) {
$page = preg_replace('/[^a-zA-Z0-9]/', '', $_GET['page']);
if (!array_key_exists($_GET['page'], $pages)) $page = $deafult_page;
} else $page = $deafult_page;
} else {
if (isset($_GET['action'])) {
switch ($_GET['action']) {
case 'login':
if (isset($_POST['password'])) $password = trim(stripslashes($_POST['password']));
else $password = '';
if (isset($_POST['login'])) $login = trim(stripslashes($_POST['login']));
else $login = '';
if ($login == $options['login'] && md5($password) == $options['password']) {
$session_id = random_string(16);
$icdb->query("INSERT INTO ".$icdb->prefix."sessions (ip, session_id, registered, valid_period) VALUES ('".$_SERVER['REMOTE_ADDR']."', '".$session_id."', '".time()."', '900')");
setcookie('ubm-auth', $session_id, time()+3600*24*180);
$_SESSION['ok'] = 'Welcome to admin panel!'.(DEMO_MODE ? ' Admin Panel operates in demo mode for security reasons.' : '');
} else $_SESSION['error'] = 'Invalid login or password!';
header('Location: admin.php');
exit;
break;
default:
break;
}
header('Location: admin.php');
exit;
}
$page = 'login';
}
?>
Ads Manager
Make sure that your website loads jQuery. If it doesn't, just add this line into head section:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
Add these lines into head section (before </head> tag):
<link href="css/ubm.css" rel="stylesheet"> <script src="js/ubm-jsonp.js"></script>
Add banner shortcode (from Banner Types page) in the place where you want to see appropriate banner. Example:
<a class="ubm-banner" data-id="X"></a>