Skip to content

Instantly share code, notes, and snippets.

@atwellpub
Created August 18, 2015 00:17
Show Gist options
  • Save atwellpub/17a446babc2ecdeaeabb to your computer and use it in GitHub Desktop.
Save atwellpub/17a446babc2ecdeaeabb to your computer and use it in GitHub Desktop.
Countdown pro modification
<?php
/*****************************************/
// Template Title: Countdown Prof
// Plugin: Landing Pages - Inboundnow.com
/*****************************************/
/* Include Shareme Library */
include_once(LANDINGPAGES_PATH.'assets/libraries/shareme/library.shareme.php');
/* Declare Template Key */
$key = lp_get_parent_directory(dirname(__FILE__));
$path = LANDINGPAGES_UPLOADS_URLPATH.$key.'/';
$url = plugins_url();
/* Define Landing Pages's custom pre-load hook for 3rd party plugin integration */
do_action('lp_init');
/* Load $post data */
if (have_posts()) : while (have_posts()) : the_post();
/* Pre-load meta data into variables */
$content = lp_get_value($post, $key, 'main-content');
$conversion_area = lp_get_value($post, $key, 'conversion-area-content');
$body_color = lp_get_value($post, $key, 'body-color');
$headline_color = lp_get_value($post, $key, 'headline-color');
$text_color = lp_get_value($post, $key, 'other-text-color');
$content_color = lp_get_value($post, $key, 'content-background');
$background_on = lp_get_value($post, $key, 'background-on');
$date_picker = lp_get_value($post, $key, 'date-picker');
$social_display = lp_get_value($post, $key, 'display-social');
$countdown_message = lp_get_value($post, $key, 'countdown-message');
$bg_image = lp_get_value($post, $key, 'bg-image');
$submit_button_color = lp_get_value($post, $key, 'submit-button-color');
// Date Formatting
$new_value = str_replace('-',' ', $date_picker);
$js_date = str_replace(':',' ', $new_value);
$res = preg_replace('/[^a-z0-9åäö\s]/ui', '', $js_date);
$arr = preg_split('/\s+/', $res, 6);
$imploded = implode(',', array_slice($arr, 0, 5));
$date_array = explode(",", $imploded);
// Convert Hex to RGB Value for submit button
function lp_Hex_2_RGB($hex) {
$hex = @preg_replace("/#/", "", $hex);
$color = array();
if(strlen($hex) == 3) {
$color['r'] = hexdec(substr($hex, 0, 1) . $r);
$color['g'] = hexdec(substr($hex, 1, 1) . $g);
$color['b'] = hexdec(substr($hex, 2, 1) . $b);
}
else if(strlen($hex) == 6) {
$color['r'] = hexdec(substr($hex, 0, 2));
$color['g'] = hexdec(substr($hex, 2, 2));
$color['b'] = hexdec(substr($hex, 4, 2));
}
return $color;
}
$RBG_array = lp_Hex_2_RGB($submit_button_color);
$red = (isset($RBG_array['r'])) ? $RBG_array['r'] : '0';
$green = (isset($RBG_array['g'])) ? $RBG_array['g'] : '0';
$blue = (isset($RBG_array['b'])) ? $RBG_array['b'] : '0';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title><?php wp_title(''); ?></title>
<?php /* Load all functions hooked to lp_head including global js and global css */
wp_head(); // Load Regular WP Head
do_action('lp_head'); // Load Custom Landing Page Specific Header Items
?>
<script src="<?php echo $path; ?>assets/js/jquery.bpopup.min.js"></script>
<script src="<?php echo $path; ?>assets/js/jquery.easing.1.3.js"></script>
<!-- Our CSS stylesheet file -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300" />
<link rel="stylesheet" href="<?php echo $path; ?>assets/css/styles.css" />
<!-- <link rel="stylesheet" href="<?php echo $path; ?>assets/countdown/jquery.countdown.css" /> -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<style type="text/css">
#content-background{ width: 550px; padding-top: 20px; padding-bottom:20px;border-radius: 6px; margin: auto; }
<?php if ($bg_image != "") { ?>
html { background: none;}
body { background: url(<?php echo $bg_image; ?>) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $bg_image; ?>', sizingMethod='scale');
ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo $bg_image; ?>', sizingMethod='scale')";}
<?php } ?>
div, p, #note, label, #lp_container { color: #<?php echo $text_color; ?>}
.countDiv::before, .countDiv::after {
background-color: #<?php echo $text_color; ?>;
}
<?php if ($headline_color != "") { echo "h1 {color: #$headline_color;}"; } ?>
<?php if ($background_on === "on") { echo "#content-background{background: url('".$path."image.php?hex=$content_color');}"; }?>
<?php if ($submit_button_color != "") {
echo"input[type='submit'] {
background: -moz-linear-gradient(rgba($red,$green,$blue, 0.5), rgba($red,$green,$blue, 0.7));
background: -ms-linear-gradient(rgba($red,$green,$blue, 0.5), rgba($red,$green,$blue, 0.7));
background: -o-linear-gradient(rgba($red,$green,$blue, 0.5), rgba($red,$green,$blue, 0.7));
background: -webkit-gradient(linear, 0 0, 0 100%, from(rgba($red,$green,$blue, 0.5)), to(rgba($red,$green,$blue, 0.7)));
background: -webkit-linear-gradient(rgba($red,$green,$blue, 0.5), rgba($red,$green,$blue, 0.7));
background: linear-gradient(rgba($red,$green,$blue, 0.5), rgba($red,$green,$blue, 0.7));
border: 1px solid #000;}";
}
?>
footer #inbound-social-inbound-social-buttons {
text-align: center;
background: rgba(0,0,0,0);
padding: 0;
margin: auto;
margin-top: 10px;}
.navigation {
width: 100%;
min-width: 720px;
background: transparent none repeat scroll 0 0;
left: 0;
position: fixed;
top: 0;
}
div.navigation-brand {
background: rgba(0, 0, 0, 0) url("http://prof302rf.profosmotr302.ru/wp-content/uploads/sites/2/2015/08/logo.png") no-repeat scroll center center;
width: 50%;
height: 130px;
float: left;
}
.callback {
float:left;
width: 50%;
min-width: 360px;
height:110px;
margin:10px auto;
}
.inbound-horizontal {float: left}
#inbound-form-wrapper {text-align: center}
#callorderhor {display:inline-block; margin: 0 auto}
#callorderhor .inbound-field.inbound-submit-area {clear: none; margin-top: 0}
#callorderhor #inbound_form_submit {margin-top: 0}
#callorderhor #inbound_form_submit {margin-left: 5px; }
#inbound_form_submit {margin:0; font-size:14px!important; width:170px!important;
background: #3cd934!important;
background-image: -webkit-linear-gradient(top, #3cd934, #2ba648)!important;
background-image: -moz-linear-gradient(top, #3cd934, #2ba648)!important;
background-image: -ms-linear-gradient(top, #3cd934, #2ba648)!important;
background-image: -o-linear-gradient(top, #3cd934, #2ba648)!important;
background-image: linear-gradient(to bottom, #3cd934, #2ba648)!important;
-webkit-border-radius: 8px!important;
-moz-border-radius: 8px!important;
border-radius: 8px!important;
padding: 7px 12px 7px 12px!important;
text-decoration: none!important;
border:0!important;
}
#inbound_form_submit:hover {
background: #6fe619!important;
text-decoration: none!important;
}
.inbound-field.inbound-submit-area {padding: 0}
#wpleads_mobile_phone {width: 155px!important;font-size: 14px!important; font-weight: bold!important; text-align: center}
#popup {
background: #fefefe none repeat scroll 0 0;
border: 1px solid #333;
border-radius: 5px;
width: 360px;
}
.modal-header, .modal-footer {
padding: 10px 20px;
}
.modal-header {
border-bottom: 1px solid #eee;
}
.modal-header h2 {
font-size: 20px;
margin: 0;
}
.btn-close span {
color: #aaa;
font-size: 30px;
position: absolute;
right: 5px;
text-decoration: none;
top: 0;
}
.btn-close:hover span {
color: #909090;
}
.modal-body {
padding: 20px;
text-align: center;
}
.modal-footer {
border-top: 1px solid #eee;
text-align: center;
}
.btn {
background: #428bca none repeat scroll 0 0;
border: 1px solid #357ebd;
border-radius: 3px;
display: inline-block;
font-size: 14px;
min-width: 60px;
padding: 8px 15px;
position: relative;
text-align: center;
text-decoration: none!important;
transition: color 0.1s ease 0s;
}
.btn:hover {
background: #357ebd none repeat scroll 0 0;
}
.btn span, .btn span:hover {; color: #fff;}
@media screen and (max-device-width: 480px) {
/* For mobile phones: */
.navigation {position: relative!important}
#content-background {width: 90%}
#form-area {width:90% !important}
}
</style>
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body <?php lp_body_class();?>>
<nav class="navigation">
<div class="navigation-brand">
</div>
<div class="callback">
<div class="phone-number">
<p style="font-size:18px;color:#003468;text-shadow: 1px 1px 2px rgba(255, 255, 255, 1);margin:5px 0;text-align:center">Звоните <b>8 (495) 649-56-29</b></p>
<p style="font-size:13px;color:#333333;text-shadow: 1px 1px 2px rgba(255, 255, 255, 1);margin:5px 0;text-align:center">или закажите обратный звонок</p></div>
<?php echo do_shortcode($conversion_area); /* Print out form content */ ?>
</div>
</nav>
<div id="page-wrapper">
<div id="heading-area">
<h1><?php lp_main_headline(); ?></h1>
</div>
<div id="content-wrapper">
<div id="content-background">
<div id="countdown"></div>
<p id="note"></p>
<!-- Show or hide form area -->
<div id="form-area">
<div id="content-area">
<?php echo do_shortcode($content);?>
</div> <!-- end content area -->
</div>
<div class="phone-number">
<p style="font-size:18px;color:#003468;text-shadow: 1px 1px 2px rgba(255, 255, 255, 1);margin:5px 0;text-align:center">Звоните <b>8 (495) 649-56-29</b></p>
<p style="font-size:13px;color:#333333;text-shadow: 1px 1px 2px rgba(255, 255, 255, 1);margin:5px 0;text-align:center">или закажите обратный звонок</p></div>
<?php echo do_shortcode($conversion_area); /* Print out form content */ ?>
</div>
</div>
</div>
<?php if ($social_display==="1" ) { // Show Social Media Icons?>
<footer>
<?php lp_social_media(); // print out social media buttons?>
<style type="text/css">
#lp-social-buttons {width: 517px;
margin: auto;
}
.sharrre .googleplus {
width: 90px !important;
}
.sharrre .pinterest {
width: 75px !important;
}
.twitter {
width: 111px;
}
.sharrre .button {
width: 106px;}
.linkedin {
margin-right: -14px;
}</style>
</footer>
<?php } ?>
<?php
break; endwhile; endif;
do_action('lp_footer');
wp_footer();
?>
</div>
<script>
if (window.location.hash == "#spasibo") {
jQuery('#popup').bPopup({
easing: 'easeOutBack', //uses jQuery easing plugin
speed: 1000,
transition: 'slideDown'
});
}
jQuery(document).ready(function () {
window.scrollTo(0,0);
});
if (!( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) )) {
jQuery(function(){
jQuery(window).scroll(function() {
var top = jQuery(document).scrollTop();
var yGap = 115;
if (top < yGap) jQuery(".navigation").css({top: '0'});
else jQuery(".navigation").css({top: yGap - top});
});
});
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment