= $number_of_words ) break; $x++; } if( $return_with_dots ) { $dots = '...'; } else { $dots = ''; } $that_last_space = trim( $truncated ); $final_string = trim( $that_last_space, ',-/"' ); return $final_string . $dots; } // Returns the video ID from almost any YouTube url. Pass the whole url function get_youtube_video_id( $url ) { if (preg_match('/youtube\.com\/watch\?v=([^\&\?\/]+)/', $url, $id)) { $values = $id[1]; } else if (preg_match('/youtube\.com\/embed\/([^\&\?\/]+)/', $url, $id)) { $values = $id[1]; } else if (preg_match('/youtube\.com\/v\/([^\&\?\/]+)/', $url, $id)) { $values = $id[1]; } else if (preg_match('/youtu\.be\/([^\&\?\/]+)/', $url, $id)) { $values = $id[1]; } else { return 'Not a YouTube video'; } return $values; } // Returns the YouTube thumbnail JPG hosted on their servers function get_youtube_thumbnail( $id ) { return "http://img.youtube.com/vi/{$id}/hqdefault.jpg"; } // Used for embedding YouTube videos (usually into Fancybox) function get_youtube_embed( $video_id ) { return '//www.youtube.com/embed/' . $video_id; } // Strip certain tags from string // $tags = single dimension numerically indexed array. Closing tags must also be specified eg. array('

', '

') function strip_specific_tags( $text, $tags ) { $e = $text; foreach( $tags as $tag ) { $e = str_replace( $tag, '', $e ); } return $e; } // BY SAM FROM PSS function list_find( $list, $value, $delimiter="," ) { $a = explode($delimiter,$list); for ($i=0;$i'; } add_filter('gform_submit_button','gform_submit_button', 10, 2); */ // Lists all the taxonomy terms associated with a post function list_taxonomies($post_id, $taxonomy_name, $seperator = ', ', $with_permalink = false) { $taxies_obj = get_the_terms($post_id, $taxonomy_name); $taxies_obj_clean = array_values($taxies_obj); $seperator_str_length = strlen($seperator); // If no taxonomies if(empty($taxies_obj_clean)) return null; // If only one taxonomy if(count($taxies_obj_clean) == 1) return $taxies_obj_clean[0]->name; // If multiple taxonomies $taxie_names = ''; foreach($taxies_obj_clean as $taxie) { if($with_permalink) { $permalink = get_term_link($taxie->term_id, $taxonomy_name); $taxie_names .= "{$taxie->name}{$seperator}"; } else { $taxie_names .= $taxie->name . $seperator; } } $return = substr($taxie_names, 0, '-'.$seperator_str_length); return $return; } // When adding a user using the GForms User Registration plugin, the avatar is returned as a media array // And when updating a user using the plugin, the avatar is returned as a url function get_user_gravity_forms_avatar($user_id) { $data = get_field('user-avatar', 'user_'.$user_id); if( is_array($data) ) { return $data['url']; } else { return $data; } } // Returns the post object of the top-most parent page function get_top_most_parent_page($id) { $parent = array_reverse(get_post_ancestors($id)); $first_parent = get_page($parent[0]); return $first_parent; } // Used to clean content for excerpts function clean_content( $content, $truncate = 0 ) { $clean = strip_tags($content); $clean = strip_shortcodes($content); if( $truncate != 0 ) { $clean = truncate_by_words($content, 50); } return trim( $clean ); } trans(8, 9), 'post_id' => NULL, 'date_created' => date('Y-m-d H:i:s'), 'is_starred' => 0, 'is_read' => 0, 'ip' => $_SERVER['REMOTE_ADDR'], 'source_url' => '', 'user_agent' => $_SERVER['HTTP_USER_AGENT'], 'status' => 'active', '1' => $response['name'], '2' => $response['business'], '15.1' => $response['address'], '3' => $response['email'], '4' => $response['telephone'], '16' => $response['industry'], '17' => $response['sector'], '18' => implode(', ', $response['type']), '5' => $response['description'], '11' => $response['materials'], '10' => $response['amount'], '19' => $response['frequency'], '12' => $response['palette'], '13' => $response['transporter'] ); if( isset($response['files']) && ! empty($response['files']) ){ $files = $response['files']; //echo '
'; print_r($files);

		$the_files = [];

		foreach($files as $key => $file){
			$the_files[] = 'Fichier #' . $key . '';
		}

		$args['20'] = implode(', ', $the_files);
	}

	$entry = array($args);

	// Create entry
	$entry_id = GFAPI::add_entry($entry);

	// Send en email
	$email_sendto = 'rlussier@abusy.ca, krousseau@abusy.ca';
	$email_subject = "Nouvelle demande de soumission - abusy.ca";
	$email_headers[] = 'From: abusy.ca <' . get_bloginfo('admin_email') . '>';
	$email_headers[] = 'MIME-Version: 1.0' . PHP_EOL;
	$email_headers[] = 'Content-type: text/html; charset=utf-8' . PHP_EOL;

	ob_start();

	include(THEME_URL_SERVER . '/includes/emails/quote.php');

	$email_content = ob_get_clean();

	wp_mail($email_sendto, $email_subject, $email_content, $email_headers);

	header('Location:' . get_permalink( trans(1129, 1131) ) );
	exit();
}



	
    
	
	<? is_front_page() ? the_title() : wp_title(''); ?> | <? bloginfo('name'); ?>
	
	

	
	
	

































 


	



	

	
	
	

404

Cette page ne peut être trouvée.

Return to home page
"> Logo kantaloup
'); } ?>