Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter ttb

    (@ttb)

    Can anybody help please?

    Thread Starter ttb

    (@ttb)

    I’ve just tried updating to the latest version of jQuery, but that didn’t solve the problem, so I assume if it is a conflict it’s down to the order of the files in some way?

    Thread Starter ttb

    (@ttb)

    Uploading a new jquery.js I can manage I think, but I’ve no idea what you mean by changing the order of jQuery files I’m afraid?

    Do you mean to change the order they are listed in the functions.php file? If so, the file looks like the below – I did try moving the section which mentions idangerous.swiper.min.js but just broke the site entirely so that it wouldn’t load, haha. Had to upload a clean functions.php just to get access back.

    [ Excessive PHP redacted please do not post that here. ]

    Cheers,

    Marc

    Thread Starter ttb

    (@ttb)

    Anybody, please?

    Thread Starter ttb

    (@ttb)

    Hi,

    Thanks for your reply – and apologies for only just trying it, I didn’t get a notification for some reason.

    I’ve tried that, however it’s still returning the same errors I’m afraid. ??

    Thanks,

    Marc

    Thread Starter ttb

    (@ttb)

    Anybody any suggestions please?

    Thanks

    Thread Starter ttb

    (@ttb)

    Don’t know whether any of this will help at all, however I’ve copied below the google_map.php file and the page-contact.php (which is the template used to create the contact page).

    <div id="googlemap<?php echo esc_attr($map_id); ?>" class="googlemap" style="height:<?php echo (int)$height; ?>px;"></div>
    <div class="clear"></div>
    <?php if ( $enlarge_button ) { ?>
    	<div class="map_buttons">
    		<a href="https://maps.google.com/maps?q=<?php echo htmlspecialchars( urlencode( $address ) ); ?>"
    		   target="_blank" class="icon-zoom-in-outline enlargemap"> <?php echo addcslashes($address,'"');?></a>
    	</div>
    <?php } ?>
    <?php if ( !is_page_template( 'page-contact.php' ) ) {
    if ( $map_id == 1 ) { ?>
    	<script type="text/javascript" src="//maps.google.com/maps/api/js?sensor=false"></script>
    <?php }
    	} ?>
    <script type="text/javascript">
    	(function ($) {
    		var geocoder;
    		var map;
    		var query = "<?php echo addcslashes($address,'"');?>";
    		function initialize() {
    			geocoder = new google.maps.Geocoder();
    			var myOptions = {
    				zoom: <?php echo (int)$zoom;?>,
    				scrollwheel: false,
    				styles: [
    			    {
    			        "featureType": "landscape.man_made",
    			        "elementType": "geometry",
    			        "stylers": [
    			            {
    			                "color": "#f7f1df"
    			            }
    			        ]
    			    },
    			    {
    			        "featureType": "landscape.natural",
    			        "elementType": "geometry",
    			        "stylers": [
    			            {
    			                "color": "#d0e3b4"
    			            }
    			        ]
    			    },
    			    {
    			        "featureType": "landscape.natural.terrain",
    			        "elementType": "geometry",
    			        "stylers": [
    			            {
    			                "visibility": "off"
    			            }
    			        ]
    			    },
    			    {
    			        "featureType": "poi",
    			        "elementType": "labels",
    			        "stylers": [
    			            {
    			                "visibility": "off"
    			            }
    			        ]
    			    },
    			    {
    			        "featureType": "poi.business",
    			        "elementType": "all",
    			        "stylers": [
    			            {
    			                "visibility": "off"
    			            }
    			        ]
    			    },
    			    {
    			        "featureType": "poi.medical",
    			        "elementType": "geometry",
    			        "stylers": [
    			            {
    			                "color": "#fbd3da"
    			            }
    			        ]
    			    },
    			    {
    			        "featureType": "poi.park",
    			        "elementType": "geometry",
    			        "stylers": [
    			            {
    			                "color": "#bde6ab"
    			            }
    			        ]
    			    },
    			    {
    			        "featureType": "road",
    			        "elementType": "geometry.stroke",
    			        "stylers": [
    			            {
    			                "visibility": "off"
    			            }
    			        ]
    			    },
    			    {
    			        "featureType": "road",
    			        "elementType": "labels",
    			        "stylers": [
    			            {
    			                "visibility": "on"
    			            }
    			        ]
    			    },
    			    {
    			        "featureType": "road.highway",
    			        "elementType": "geometry.fill",
    			        "stylers": [
    			            {
    			                "color": "#ffe15f"
    			            }
    			        ]
    			    },
    			    {
    			        "featureType": "road.highway",
    			        "elementType": "geometry.stroke",
    			        "stylers": [
    			            {
    			                "color": "#efd151"
    			            }
    			        ]
    			    },
    			    {
    			        "featureType": "road.arterial",
    			        "elementType": "geometry.fill",
    			        "stylers": [
    			            {
    			                "color": "#ffffff"
    			            }
    			        ]
    			    },
    			    {
    			        "featureType": "road.local",
    			        "elementType": "geometry.fill",
    			        "stylers": [
    			            {
    			                "color": "black"
    			            }
    			        ]
    			    },
    			    {
    			        "featureType": "transit.station.airport",
    			        "elementType": "geometry.fill",
    			        "stylers": [
    			            {
    			                "color": "#cfb2db"
    			            }
    			        ]
    			    },
    			    {
    			        "featureType": "water",
    			        "elementType": "geometry",
    			        "stylers": [
    			            {
    			                "color": "#a2daf2"
    			            }
    			        ]
    			    }
    			],
    
    				mapTypeId: google.maps.MapTypeId.ROADMAP,
    				mapTypeControlOptions: {
    			        style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR,
    			        position: google.maps.ControlPosition.RIGHT_BOTTOM,
    
    			    },
    			};
    			map = new google.maps.Map(document.getElementById("googlemap<?php echo $map_id;?>"), myOptions);
    			codeAddress();
    		}
    
    		function codeAddress() {
    			var address = query;
    			geocoder.geocode({'address': address}, function (results, status) {
    				if (status == google.maps.GeocoderStatus.OK) {
    					var marker = new google.maps.Marker({
    						map: map,
    						position: results[0].geometry.location
    					});
    					<?php if(strlen($innercontent)){ ?>
    					var infowindow = new google.maps.InfoWindow({
    						content: unescape("<?php echo str_replace('+',' ',(preg_replace('/\s+/',' ',addcslashes($innercontent,'"'))));?>")
    					});
    					google.maps.event.addListener(marker, 'click', function () {
    						infowindow.open(map, marker);
    					});
    					infowindow.open(map, marker);
    					<?php } ?>
    					map.setCenter(marker.getPosition());
    					setTimeout(function () {
    						map.panBy(0, -50);
    					}, 10);
    				} else {
    					alert("Geocode was not successful for the following reason: " + status);
    				}
    			});
    		}
    
    		$(function () {
    			initialize();
    		});
    	}(jQuery));
    </script>
    <?php
    /*
    Template Name: Contact
    */
    
    //contact form submitted?
    if ($unf_options['unf_contactformemail'] ) {
    //Only allows page to show if the contact form email has been set... Closes at end of this file.
    	$contactformemail = $unf_options['unf_contactformemail']; // this is later fed into the form script
    
    if(isset($_POST['submitted'])) {
    
    	//Check to see if the honeypot captcha field was filled in
    	if(trim($_POST['checking']) !== '') {
    		$captchaError = true;
    	} else {
    
    		//Check to make sure that the name field is not empty
    		if(trim($_POST['contactName']) === '') {
    			$nameError = 'You forgot to enter your name.';
    			$hasError = true;
    		} else {
    			$name = trim($_POST['contactName']);
    		}
    
    		//Check to make sure sure that a valid email address is submitted
    		if(trim($_POST['email']) === '')  {
    			$emailError = 'You forgot to enter your email address.';
    			$hasError = true;
    		} else if (! filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) ) {
    			$emailError = 'You entered an invalid email address.';
    			$hasError = true;
    		} else {
    			$email = trim($_POST['email']);
    		}
    
    		//Check to make sure comments were entered
    		if(trim($_POST['comments']) === '') {
    			$commentError = 'You forgot to enter your comments.';
    			$hasError = true;
    		} else {
    			if(function_exists('stripslashes')) {
    				$comments = stripslashes(trim($_POST['comments']));
    			} else {
    				$comments = trim($_POST['comments']);
    			}
    		}
    
    		//If there is no error, send the email
    		if(!isset($hasError)) {
    
    			$emailTo = $contactformemail;
    			$subject = 'Contact Form Submission from '.$name.' ( Sent from : '.esc_url( home_url() ).')';
    			$sendCopy = isset($_POST['sendCopy']) ? trim($_POST['sendCopy']) : false;
    			$body = "Name: $name \n\nEmail: $email \n\nComments: $comments";
    			$headers = 'From: My Site <'.$emailTo.'>' . "\r\n" . 'Reply-To: ' . $email;
    
    			mail($emailTo, $subject, $body, $headers);
    
    			if($sendCopy == true) {
    				$subject = 'Copy of message sent to '.esc_url( home_url() ).'.';
    				$headers = 'From: '.$name.' <'.$email.'>';
    				mail($email, $subject, $body, $headers);
    			}
    
    			$emailSent = true;
    
    		}
    	}
    }
    
    get_header();
    global $unf_options;
    
    if (!empty($unf_options['unf_contactsuccess'])){
    	$successmessage = $unf_options['unf_contactsuccess'];
    } else {
    	$successmessage = '<strong>Thanks!</strong> Your message was successfully sent.';
    }
    
    if (!empty($unf_options['unf_contactforgot'])){
    	$forgotmessage = $unf_options['unf_contactforgot'];
    } else {
    	$forgotmessage = 'You forgot to enter your';
    }
    
    if (!empty($unf_options['unf_contactinvalid'])){
    	$invalidmessage = $unf_options['unf_contactinvalid'];
    } else {
    	$invalidmessage = 'You entered an invalid';
    }
    ?>
    
    <script type="text/javascript" >
    
    jQuery(document).ready(function($){
    	jQuery('form#contactForm').submit(function() {
    		jQuery('form#contactForm .error').remove();
    		var hasError = false;
    		jQuery('.requiredField').each(function() {
    			if(jQuery.trim($(this).val()) == '') {
    				var labelText = jQuery(this).prev('label').text();
    				jQuery(this).parent().append('<div class="error alert small alert-warning"><?php echo wp_kses_post($forgotmessage);?> '+labelText+'.</div>');
    				hasError = true;
    			} else if($(this).hasClass('email')) {
    				var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
    				if(!emailReg.test(jQuery.trim($(this).val()))) {
    					var labelText = $(this).prev('label').text();
    					jQuery(this).parent().append('<div class="error alert small alert-warning"><?php echo wp_kses_post($invalidmessage);?> '+labelText+'.</div>');
    					hasError = true;
    				}
    			}
    		});
    		if(!hasError) {
    			jQuery('#content #submitted').fadeOut('normal', function() {
    			jQuery('#content .sendmessagebtn').hide();
    			jQuery(this).parent().append('<img src="<?php echo get_template_directory_uri(); ?>/library/img/loading.svg" alt="Loading&hellip;" height="31" width="31" />');
    			});
    			var formInput = $(this).serialize();
    			$.post($(this).attr('action'),formInput, function(data){
    				jQuery('form#contactForm').slideUp("fast", function() {
    					jQuery(this).before('<p class="thanks"><?php echo wp_kses_post($successmessage);?></p>');
    				});
    			});
    		}
    
    		return false;
    
    	});
    });
    
    </script>
    
    	<div id="content-wrapper" class="row clearfix contact-page-wrapper">
    
    		<div id="content" class="col-md-8 column">
    			<div class="article clearfix">
    				<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    					<?php get_template_part( 'library/unf/featured', 'image' ); ?>
    					<h1 class="post-title"><?php the_title();?></h1>
    
    					<?php
    					$layout = $unf_options['unf_contact-blocks']['enabled'];
    					if ($layout): foreach ($layout as $key=>$value) {
    
    					    switch($key) {
    
    					        case 'googlemap': get_template_part( 'library/unf/contactmap' );
    					        break;
    
    					        case 'contactform': get_template_part( 'library/unf/contactform' );
    					        break;
    
    					        case 'contactdetails': get_template_part( 'library/unf/contactdetails' );
    					        break;
    
    					        case 'pagecontent': the_content();
    					        break;
    
    					    }
    
    					}
    					endif;
    					?>
    
    			    <?php endwhile;
    			    endif; ?>
    			</div>
    		</div>
    
    		<?php get_sidebar('contact'); ?>
    	</div>
    
    <?php get_footer(); ?>
    
    <?php } else { ?>
    Please set your contact form's receiver email <a href="<?php echo site_url(); ?>/wp-admin/admin.php?page=toddlers_options&tab=4">here</a>
    <?php } ?>
    Thread Starter ttb

    (@ttb)

    Thanks for getting back to me, you’re the only person who is!

    I was just about to ask whether you’d consider taking a look for me if I gave you access to the server etc. Naturally would have been happy to pay for your time.

    However I had a bit of a brainwave (rare occurrence, haha) and tried replacing the image URL’s in a sample of my CSV data with images hosted elsewhere entirely, and they imported exactly as they should do – so the issue appears to be at my suppliers end with their server blocking my servers attempts to download the images. Strange as I can access them individually by URL from the same server, but not as part of the upload.

    I’ve asked the supplier to check whether/why they are blocking the requests, and will report back if it solves the problem.

    Thread Starter ttb

    (@ttb)

    The author of WP All Import has come back to me, however unfortunately he’s not been a great deal of help – his suggestion was that I manually upload the images to the server, and then use the CSV import to link to them instead.

    With thousands of lines, and images which aren’t stored or named appropriately, that would take weeks to manually download and upload them all and then recreate the CSV.

    Any suggestions greatly appreciated – I know it’s got to be a config issue of some kind as the images upload fine on their testing server, and I’ve previously used the same CSV to import from the same links into another WP website without any issues.

    Thread Starter ttb

    (@ttb)

    I’ve raised with WP All Import and Allaerd to see whether either can shed any light, just waiting to hear back from them.

    I’m fairly sure it’s not permissions, as I’ve tried every combination of perms on the wp-content/uploads directory – and I can upload directly by creating a product manually or via the media library, so presumably something is blocking the request. Nothing is logged anywhere though, it’s as if the upload goes through successfully, just minus the actual file haha.

    I’ll keep playing today, see if I can get anywhere. It’s definitely something in my config, as I’ve just tried using the WP All Import testing server and the images upload fine – so I know the issue isn’t with the CSV or the remote server, it’s config somewhere. ??

    Thread Starter ttb

    (@ttb)

    They’re just hosted on another web server (my supplier), the CSV contains a direct link to the image file on the remote server. If I follow the link in a browser then the image file loads as it should. Likewise if I use the WP ALL IMPORT plugin which has a preview facility the image previews correctly.

    Thread Starter ttb

    (@ttb)

    Apologies, I’ve looked at so many different sites today trying to resolve this that I confused myself. I thought it was Woothemes, but it’s not the one I was originally trying was just called CSV Import by Allaerd.

    I’ve also since tried WP All Import with the Woocommerce plugin, with exactly the same result – the import apparently completes successfully but the images are not imported.

    This is what leads me to believe it’s something else to do with the config, not specific issue to the plugin I’m trying to use, as all import plugins seem to give me the same result.

    Cheers,

    Thread Starter ttb

    (@ttb)

    It’s still from Woo Themes, just the free version without the premium features.

    I’ve also tried a few alternative CSV import plugins, and I’m getting the same result with all of them – no obvious errors, the image appears to have imported correctly according to the log however it does not show up in the media library.

    Have checked that permissions are set correctly for the /wp-content/uploads directory. It appears to be something to do with the WP or server config rather than any specific plugin issue as I’m getting the same with all of the import plugins, which is why I’ve posted here as it appears to be more of a generic issue – no doubt something I’ve missed or not set up correctly, but I can’t see what.

    Cheers,

    Thread Starter ttb

    (@ttb)

    I’ve just tried that link Mike and have registered, however it’s telling me that I can’t open a support ticket as I don’t have any paying subscriptions – it’s the free CSV import tool I’ve been trying to use.

Viewing 14 replies - 1 through 14 (of 14 total)