get('Version') ); } add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); add_filter( 'body_class', 'custom_class' ); function custom_class( $classes ) { /* if ( is_page_template( 'page-example.php' ) ) { $classes[] = 'example'; } */ if (is_archive()) { $classes[] = 'page-template-tpl-blog'; } return $classes; } function RelativeTime() { $jour = get_the_date('U'); $aujourdhui = date('U'); $delta = round(($aujourdhui - $jour) / (3600 * 24)); if ($delta == 0) $text = "aujourd'hui"; elseif ($delta == 1) $text = __("yesterday", 'CreatorThemeRes-child'); elseif ($delta == 2) $text = __("the day before yesterday", 'CreatorThemeRes-child'); elseif ($delta == 3) $text = __("two days ago", 'CreatorThemeRes-child'); elseif (($delta > 3) and ($delta <= 7)) $text = sprintf( __('%1$s days ago', 'CreatorThemeRes-child'), $delta ); elseif (($delta > 7) and ($delta <= 14)) { $nb = round ($delta / 7); if ($nb < 2) $text = sprintf( __('%1$s week ago', 'CreatorThemeRes-child'), $nb ); else $text = sprintf( __('%1$s weeks ago', 'CreatorThemeRes-child'), $nb ); } else $text = get_the_date(); /* printf( __( '%1$s', 'CreatorThemeRes-child' ), sprintf( ''.$text.'', get_permalink(), esc_attr( get_the_date() . ' ' . get_the_time() ) ) ); */ echo $text; } function getRandomFile($start_dir) { chdir($start_dir); $dir = opendir('.'); while (($myfile = readdir($dir)) !==false) { if ($myfile != '.' && $myfile != '..' && is_file($myfile) && $myfile != 'resource.frk') { $files[] = $myfile; } } closedir($dir); chdir('../'); srand ((float) microtime() * 10000000); $file = array_rand($files); return $files[$file]; } function preprint($s, $return=false) { $x = "
";
$x .= print_r($s, 1);
$x .= "";
if ($return) return $x;
else print $x;
}
/* photo du mois */
function exif_date($date,$apn) {
//'Model' => string 'Canon EOS 50D' (length=13)
//50D: 'DateTimeOriginal' => string '2009:12:05 12:42:33' (length=19)
//'Model' => string 'Canon EOS 7D' (length=12)
//7D: DateTimeOriginal' => string '2010-02-20T15:07:05.24+01:00' (length=28)
// -> 50D
if (!preg_match("/7D/", $apn)) {
$pieces = explode(' ', $date);
list($yy, $mm, $dd) = explode(':', $pieces[0]);
list($hh, $min, $ss) = explode(':', $pieces[1]);
}
// 7D
else {
$pieces = explode('T', $date);
list($yy, $mm, $dd) = explode('-', $pieces[0]);
$pieces_h = explode('.', $pieces[1]);
list($hh, $min, $ss) = explode(':', $pieces_h[0]);
}
$timestamp = mktime((int) $hh, (int) $min, (int) $ss, (int) $mm, (int) $dd, (int) $yy, '-1');
$date = date('d.m.Y à H:i',$timestamp);
return $date;
}
function mois2 ($mois) {
switch ($mois)
{
case 00:
$mois = "00";
break;
case 1:
$mois = __('January','CreatorThemeRes-child');
break;
case 2:
$mois = __('February','CreatorThemeRes-child');
break;
case 3:
$mois = __('March','CreatorThemeRes-child');
break;
case 4:
$mois = __('April','CreatorThemeRes-child');
break;
case 5:
$mois = __('May','CreatorThemeRes-child');
break;
case 6:
$mois = __('June','CreatorThemeRes-child');
break;
case 7:
$mois = __('July','CreatorThemeRes-child');
break;
case 8:
$mois = __('August','CreatorThemeRes-child');
break;
case 9:
$mois = __('September','CreatorThemeRes-child');
break;
case 10:
$mois = __('October','CreatorThemeRes-child');
break;
case 11:
$mois = __('November','CreatorThemeRes-child');
break;
case 12:
$mois = __('December','CreatorThemeRes-child');
break;
}
return $mois;
}
function display ($filename,$album) {
$display = '';
return $display;
}
function displayRetina ($filename,$album) {
// 6_2012.jpg
// 4_2014_180_thumb.jpg 4_2014_360_thumb.jpg
$path = "../zenphoto/cache/" . $album . "/";
$file = explode(".", $filename);
//$a = $path . $filename;
//echo $a. "