From 8630d32513e3892cade5fe267861eadd3c6ff19e Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Wed, 6 Sep 2017 15:18:24 -0400 Subject: [PATCH] Update the cam images Use time instead of random number. --- functions.php | 60 +++++++++++++++++++++--------------------- js/app.js | 9 ++++--- js/custom/pageSetup.js | 9 ++++--- 3 files changed, 40 insertions(+), 38 deletions(-) diff --git a/functions.php b/functions.php index 4db978d..94f1f21 100644 --- a/functions.php +++ b/functions.php @@ -25,7 +25,7 @@ if (!function_exists('glm_quicksite_widget_init')) { 'id' => 'slideshow', 'description' => __('Meta Slider/Slideshow Area') )); - + } } @@ -72,9 +72,9 @@ function woo_product_tab_edits( $tabs ) { ); $tabs['description']['title'] = __('Details'); unset( $tabs[ 'reviews' ]); - + unset( $tabs[ 'additional_information' ]); -// +// $tabs[ 'photos_tab' ][ 'priority' ] = 5; $tabs[ 'description' ][ 'priority' ] = 10; $tabs[ 'itinerary_tab' ][ 'priority' ] = 20; @@ -82,7 +82,7 @@ function woo_product_tab_edits( $tabs ) { $tabs[ 'product_inquiry_tab' ][ 'priority' ] = 40; return $tabs; - + } function woo_product_inquiry_content() { @@ -97,27 +97,27 @@ function woo_itinerary_content() { function woo_photos_content() { global $product; - + $attachment_ids = $product->get_gallery_attachment_ids(); echo ""; } add_filter( 'gform_field_value_product_name', 'gform_add_product_name_field' ); function gform_add_product_name_field( $value ) { - + global $product, $post, $woocommerce; - + if ( ! empty($_GET) && isset($_GET)){ $title = $_GET['title']; } else { @@ -136,7 +136,7 @@ function gform_add_product_name_field( $value ) { add_filter( 'gform_field_value_product_sku', 'gform_add_product_sku_field' ); function gform_add_product_sku_field( $value ) { global $product, $post, $woocommerce; - + if ( ! empty($_GET) && isset($_GET)){ $sku = $_GET['sku']; } else { @@ -168,7 +168,7 @@ remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_r add_action('woocommerce_after_shop_loop_item_title','woocommerce_template_single_excerpt', 5); function shareThis(){ - echo ''; + echo ''; } add_action( 'woocommerce_single_product_summary', 'shareThis', 20); @@ -198,7 +198,7 @@ function glm_site_scripts() 'glm_foundation', get_template_directory_uri() . '/js/app.js', 'jquery', - '1.0', + '1.1', true ); wp_enqueue_style('jquery-style', '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css'); @@ -227,10 +227,10 @@ function glm_get_header() { } echo '
', print_r($entry), ''; if($form['id'] === 4){ - + if ( $entry['36.3'] > 1){ $qty = $entry['36.3'] - 1; $qty = ($qty * 2) + 3; $entry['38.2'] = '$' . $qty; $entry['38.2'] = 2; } - + } if ( $form['gfpdf_form_settings'] ){ @@ -359,19 +359,19 @@ function change_post_content( $form ) { 'input_16_2'=>'input_16_3' ); foreach($fields as $key=>$value){ - + $prod_quantity = $_POST[$value]; - + if( $prod_quantity ){ $populated_fields[$key] = array('price'=>$_POST[$key], 'qty'=>$_POST[$value]); - } + } } // loop through the populated fields to calc the qty $quantity = 0; // foreach($populated_fields as $price=>$info){ // $quantity += $info['qty']; // } -// +// // // logic to determine the discount rate, every 4 gets $10 off // if($quantity % 4 === 0){ // $discount_qty = $quantity / 4; @@ -382,24 +382,24 @@ function change_post_content( $form ) { // $discount_qty = floor($quantity / 4); // $discount_price = $discount_qty * 10; // $price_total = ($quantity * 10) - $discount_price; -// +// // } else if( $quantity < 4){ // $price_total = $quantity * 10; // } -// +// // $new_price = $price_total / $quantity; -// +// // // set the newly calulated price for pdf form // foreach($populated_fields as $price=>$info){ // $_POST[$price] = $new_price; // } - + } add_action( 'gfpdf_post_html_fields', function( $entry, $config ) { if($entry['form_id'] === '2'){ echo "
DISCOUNTED TOTAL: " . $entry['20'] . "
"; } - - + + }, 10, 2 ); -?> \ No newline at end of file +?> diff --git a/js/app.js b/js/app.js index 199f05d..cece319 100644 --- a/js/app.js +++ b/js/app.js @@ -47,10 +47,11 @@ $(document).ready(function () { } }); setInterval(function(){ - $('#cam1').attr('src','http://cams.gaslightmedia.com/cameras/images/MacBridge_image2_large.jpg?b=' + Math.random()); - $('#cam2').attr('src','http://cams.gaslightmedia.com/cameras/images/MacBridge_image1_medium.jpg?b=' + Math.random()); - $('#cam3').attr('src','http://cams.gaslightmedia.com/cameras/images/MacBridge_image3_medium.jpg?b=' + Math.random()); - $('#cam4').attr('src','http://cams.gaslightmedia.com/cameras/images/MacBridge_image4_medium.jpg?b=' + Math.random()); + var d = new Date(); + $('#cam1').attr('src','http://cams.gaslightmedia.com/cameras/images/MacBridge_image2_large.jpg?b=' + d.getTime()); + $('#cam2').attr('src','http://cams.gaslightmedia.com/cameras/images/MacBridge_image1_medium.jpg?b=' + d.getTime()); + $('#cam3').attr('src','http://cams.gaslightmedia.com/cameras/images/MacBridge_image3_medium.jpg?b=' + d.getTime()); + $('#cam4').attr('src','http://cams.gaslightmedia.com/cameras/images/MacBridge_image4_medium.jpg?b=' + d.getTime()); }, 60000); var pdf_form = page.find( $(".pdf-form") ); diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index 38f2715..5788632 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -38,10 +38,11 @@ $(document).ready(function () { } }); setInterval(function(){ - $('#cam1').attr('src','http://cams.gaslightmedia.com/cameras/images/MacBridge_image2_large.jpg?b=' + Math.random()); - $('#cam2').attr('src','http://cams.gaslightmedia.com/cameras/images/MacBridge_image1_medium.jpg?b=' + Math.random()); - $('#cam3').attr('src','http://cams.gaslightmedia.com/cameras/images/MacBridge_image3_medium.jpg?b=' + Math.random()); - $('#cam4').attr('src','http://cams.gaslightmedia.com/cameras/images/MacBridge_image4_medium.jpg?b=' + Math.random()); + var d = new Date(); + $('#cam1').attr('src','http://cams.gaslightmedia.com/cameras/images/MacBridge_image2_large.jpg?b=' + d.getTime()); + $('#cam2').attr('src','http://cams.gaslightmedia.com/cameras/images/MacBridge_image1_medium.jpg?b=' + d.getTime()); + $('#cam3').attr('src','http://cams.gaslightmedia.com/cameras/images/MacBridge_image3_medium.jpg?b=' + d.getTime()); + $('#cam4').attr('src','http://cams.gaslightmedia.com/cameras/images/MacBridge_image4_medium.jpg?b=' + d.getTime()); }, 60000); var pdf_form = page.find( $(".pdf-form") ); -- 2.17.1