Files
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

298 lines
9.6 KiB
PHP

<?php
require_once('/home/thebate/public_html/include/analytics/adrotation/includes/Mobile_Detect.php');
$detect = new Mobile_Detect;
if ( $detect->isMobile() ) {
echo "mobile";
}
// Any tablet device.
if( $detect->isTablet() ){
echo "tablet";
}
// Exclude tablets.
if( $detect->isMobile() && !$detect->isTablet() ){
}
// Check for a specific platform with the help of the magic methods:
if( $detect->isiOS() ){
}
if( $detect->isAndroidOS() ){
}
?>
<!doctype html>
<html lang="en-US" prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article#" class="no-js">
<head>
<meta charset="utf-8">
<meta name="robots" content="noindex,follow"/>
<title>Bateworld Ad Rotation</title>
<meta name="description" content="Bateworld Ad Rotation"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="Squarespace" />
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="" />
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="" />
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="" />
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="" />
<meta property="og:title" content="Bateworld Ad Rotation" />
<meta property="og:locale" content="en_US">
<meta property="og:type" content="article" />
<meta property="og:url" content="http://bateworld.com/include/analytics/adrotation/index.php" />
<meta property="og:site_name" content="bateworld" />
<meta property="article:section" content="Front page">
<meta property="article:published_time" content="2014-06-26T01:23:45Z">
<meta property="og:image" content="">
<meta property="og:image:secure_url" content="">
<meta property="og:image:width" content="">
<meta property="og:image:height" content="">
<meta property="og:image:type" content="">
<meta property="og:description" content="home page index" />
<link rel='stylesheet' id='myers-reset' href='http://bateworld.com/include/analytics/adrotation/css/reset.css?ver=2.0' type='text/css' media='all' />
<link rel='stylesheet' id='pdp-base' href='http://bateworld.com/include/analytics/adrotation/css/base.css?ver=1.0' type='text/css' media='all' />
<!--[if lt IE 9]><script src="http://bateworld.com//include/analytics/adrotation/js/html5shiv.js"></script><![endif]-->
<script src="/include/analytics/adrotation/js/modernizr.js"></script>
</head>
<body>
<header role="banner">
<nav>
<ul style="display:inline-block;">
<li style="display:inline-block;padding:0 0.5em 0 0;min-width:50px;">Ad</li>
<li style="display:inline-block;padding:0 0.5em 0 0.5em;min-width:50px;">Zone</li>
<li style="display:inline-block;padding:0 0.5em 0 0.5em;min-width:50px;">Group</li>
<li style="display:inline-block;padding:0 0 0 0.5em;min-width:50px;">Tag</li>
</ul>
</nav>
</header>
<main id="content" class="group" role="main">
<video id="remoteVideo" autoplay="" muted="" src="blob:http%3A//bateworld.com/b17ee297-b1be-4112-8186-b33e5144029e"></video>
<section>
<form>
<fieldset>
<legend>Insert Banner Ad</legend>
<label for="ad_title">Title
<input type="text" name="ad_title" id="ad_title" value="" maxlength="64" required pattern="^[\S+]{6,64}$" />
</label>
<label for="ad_description">Description
<textarea name="ad_description" id="ad_description" pattern="^\S+$"></textarea>
</label>
<label for="ad_link">Ad Link (http://example.com)
<input type="text" name="ad_link" id="ad_link" value="" maxlength="255" required pattern="^[\S+]{6,255}$" />
</label>
<label for="ad_zone" required>Zone</label required>
<select name="ad_zone" id="ad_zone">
<option value="zone">zone</option>
</select >
<label for="ad_group">Group
<select name="ad_group" required>
<option value="">group</option>
<option value="01">group</option>
</select>
</label>
<label for="ad_tag">Tag
<select name="ad_tag">
<option>tag</option>
</select>
</label>
<div id="upload_button"><a class="redbutton" style="display:block;">Upload Image / Submit</a></div>
<div id="upload_error" style="display:none;clear:both;">&nbsp;</div>
<div id="ad_preview"></div>
</fieldset>
</form>
<form style="clear:both;" name="upload" id="upload" method="post" action="/include/analytics/adrotation/upload_ad.php" enctype="multipart/form-data">
<input type="text" name="adlink" id="adlink" value="" style="display:none;">
<input type="file" name="upl" id="upl" style="display:none;" />
</form>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="/js/jquery-migrate-1.2.1.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<!--<script type="text/javascript">!window.jQuery && document.write('<script src="/include/analytics/adrotation/js/jquery.min.js"><\/script>')</script>//-->
<!--<script type="text/javascript">!window.jQuery.ui && document.write('<script src="/include/analytics/adrotation/js/jquery-ui.min.js"><\/script>'//-->
<script src="/mini-upload-form/assets/js/jquery.knob.js"></script>
<script src="/mini-upload-form/assets/js/jquery.ui.widget.js"></script>
<script src="/mini-upload-form/assets/js/jquery.iframe-transport.js"></script>
<script src="/mini-upload-form/assets/js/jquery.fileupload.js"></script>
<script src="/mini-upload-form/assets/js/script.js"></script>
</section>
</main>
<script>
jQuery(function(){
jQuery('#upload_button a').click(function(){
// Simulate a click on the file input button
// to show the file browser dialog
jQuery('#upload').find('#upl').click();
jQuery('#upload_error').css( "display", "none" );
jQuery('#upload_error').html('&nbsp;');
});
jQuery('#upload').fileupload({
///This element will accept file drag/drop uploading
dropZone: jQuery(''),
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
maxFileSize: 5000000, // 5 MB
// This function is called when a file is added to the queue;
// either via the browse button, or via drag/drop:
add: function (e, data) {
// kill any error messages
jQuery('#upload_error').css( "display", "none" );
jQuery('#upload_error').html('&nbsp;');
// kill display of previously uploaded ad
jQuery("#ad_preview").fadeOut(10, function() { jQuery("#ad_preview").html(); });
// tplerror not used
// regex for gif png jpe?g
var thefile=data.files[0].name.match(/(\.|\/)(gif|jpe?g|png)$/i);
var doerror=false;
// not gif jpg or png file
if(null == thefile)
{
doerror=true;
jQuery('#upload_error').fadeIn('slow',function(){
jQuery(this).html('Error: image must be png, jpg, or gif ');
});
return false;
}
// file exceeds 5MB
if(parseFloat(data.files[0].size) > 5000000) // file too big
{
doerror=true;
jQuery('#upload_error').fadeIn('slow',function(){
jQuery(this).html('Error: file too big!');
});
return false;
}
if(doerror) // should not be called any longer
{
return false;
}
// Append the file name and file size
// Add the HTML to the UL element
// Initialize the knob plugin
// Listen for clicks on the cancel icon
// Automatically upload the file once it is added to the queue
var jqXHR = data.submit();
jQuery('#adlink').val("");
},
progress: function(e, data){
},
fail:function(e, data){
// Something has gone wrong!
},
complete: function(e,data){
//alert(data);
},
done: function (e, data) {
//alert(data.result);
var is_json = true;try {var obj = jQuery.parseJSON(data.result);} catch(err) {is_json = false;}
if(is_json){
var obj = jQuery.parseJSON(data.result);
if(obj.status=="success")
{
if(obj.badurl==1)
{
}
} //end status eq success
else
{
jQuery('#upload_error').fadeIn('slow',function(){
jQuery(this).html(obj.status);
});
}//end of status not eq success
} //end of is_json;
else
{
jQuery('#upload_error').fadeIn('slow',function(){
jQuery(this).html('Error processing request. Please try again. If the error persists, please contact <a href="http://bateworld.com/help_contact.php" target="_blank">bateworld customer satisfaction</a> !');
});
}
data.jqXHR;
} // end of done
});
// Prevent the default action when a file is dropped on the window
jQuery(document).on('drop dragover', function (e) {
e.preventDefault();
});
// Helper function that formats the file sizes
function formatFileSize(bytes) {
if (typeof bytes !== 'number') {
return '';
}
if (bytes >= 1000000000) {
return (bytes / 1000000000).toFixed(2) + ' GB';
}
if (bytes >= 1000000) {
return (bytes / 1000000).toFixed(2) + ' MB';
}
return (bytes / 1000).toFixed(2) + ' KB';
}
});
</script>
<footer role="contentinfo">copyright</footer>
</body>
</html>