This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$('form').submit(function() { | |
if(typeof jQuery.data(this, "disabledOnSubmit") == 'undefined') { | |
jQuery.data(this, "disabledOnSubmit", { submited: true }); | |
$('input[type=submit], input[type=button]', this).each(function() { | |
$(this).attr("disabled", "disabled"); | |
}); | |
return true; | |
} | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ImageHelper extends Helper { | |
var $helpers = array('Html'); | |
var $cacheDir = 'cache'; // relative to IMAGES_URL path | |
function resize($path, $dst_w, $dst_h, $htmlAttributes = array(), $return = false) { | |
$types = array(1 => "gif", "jpeg", "png", "swf", "psd", "wbmp"); // used to determine image type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$mypage = add_management_page( 'myplugin', 'myplugin', 9, __FILE__, 'myplugin_admin_page' ); | |
add_action( "admin_print_scripts-$mypage", 'myplugin_admin_head' ); | |
function myplugin_admin_head() { | |
// what your plugin needs in its <head> | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public $gmail = array( | |
'host' => 'ssl://smtp.gmail.com', | |
'port' => 465, | |
'username' => 'votreidentifiant@gmail.com', | |
'password' => 'motdepasse', | |
'transport' => 'Smtp', | |
'timeout' => 30 | |
); | |
$email = new CakeEmail('gmail'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var countries = Object(); | |
countries['Africa'] = 'Algeria|Angola|Benin|Botswana|Burkina Faso|Burundi|Cameroon|Cape Verde|Central African Republic|Chad|Comoros|Congo, Dem.|Congo, Rep.|Djibouti|Egypt|Equatorial Guinea|Eritrea|Ethiopia|Gabon|Gambia|Ghana|Guinea|Guinea-Bissau|Kenya|Lesotho|Liberia|Libya|Madagascar|Malawi|Mali|Mauritania|Mauritius|Morocco|Mozambique|Namibia|Niger|Nigeria|Rwanda|Sao Tome/Principe|Senegal|Seychelles|Sierra Leone|Somalia|South Africa|Sudan|Swaziland|Tanzania|Togo|Tunisia|Uganda|Zambia|Zimbabwe'; | |
countries['Antarctica'] = 'Amundsen-Scott'; | |
countries['Asia'] = 'Bangladesh|Bhutan|Brunei|Burma (Myanmar)|Cambodia|China|East Timor|India|Indonesia|Japan|Kazakhstan|Korea (north)|Korea (south)|Laos|Malaysia|Maldives|Mongolia|Nepal|Philippines|Russian Federation|Singapore|Sri Lanka|Taiwan|Thailand|Vietnam'; | |
countries['Australia/Oceania'] = 'Australia|Fiji|Kiribati|Micronesia|Nauru|New Zealand|Palau|Papua New Guinea|Samoa|Tonga|Tuvalu|Vanuatu'; | |
countries['Caribbean'] = 'Anguilla|Antigua/Barbuda |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<meta name="description" content=" | |
<?php | |
if ((is_home()) || (is_front_page())){ | |
echo ('Your main description goes here'); | |
}elseif(is_category()){ | |
echo category_description(); | |
}elseif(is_tag()){ | |
echo '-tag archive page for this blog' . single_tag_title(); | |
}elseif(is_month()){ | |
echo 'archive page for this blog' . the_time('F, Y'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (have_posts()) : | |
while (have_posts()) : the_post(); | |
$customField = get_post_custom_values("full"); | |
if (isset($customField[0])) { | |
//Custom field is set, display a full post | |
the_title(); | |
the_content(); | |
}else{ | |
// No custom field set, let's display an excerpt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Google Maps Shortcode | |
function fn_googleMaps($atts, $content = null) { | |
extract (shortcode_atts (array ( | |
"width" => '640', | |
"height" => '480', | |
"src" => '' | |
), $atts)); | |
return '<iframe width="'.$width.'" height="'.$height.'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'.$src.'"></iframe>'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="<?php bloginfo('url'); ?>/" method="get"> | |
<?php | |
$select = wp_dropdown_categories('show_option_none=Select category&show_count=1&orderby=name&echo=0'); | |
$select = preg_replace("#<select([^>]*)>#", "<select$1 onchange='return this.form.submit()'>", $select); | |
echo $select; | |
?> | |
<noscript><input type="submit" value="View" /></noscript> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//for use in the loop, list 5 post titles related to first tag on | |
//current post | |
$tags = wp_get_post_tags($post->ID); | |
if ($tags) { | |
echo 'Related Posts'; | |
$first_tag = $tags[0]->term_id; | |
$args=array( | |
'tag__in' => array($first_tag), | |
'post__not_in' => array($post->ID), |
OlderNewer