First commit

Nouveau theme wordpress pour clicclac.info
This commit is contained in:
2019-01-05 07:49:43 +01:00
commit a6ec321c04
11 changed files with 1520 additions and 0 deletions

242
functions.php Executable file
View File

@@ -0,0 +1,242 @@
<?php load_theme_textdomain('toppic-child', get_template_directory() . '-child/languages'); ?>
<?php
/*-----------------------------------------------------------------------------------*/
/* ENQUEUES STYLES
/*-----------------------------------------------------------------------------------*/
function kktfwp_parent_styles() {
//wp_enqueue_style( 'kk-reset', get_theme_file_uri('/css/reset.css'), array(), KKFW_VERSION );
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css', array( 'kk-icons', 'kk-reset', 'kk-default' ), wp_get_theme()->get('Version') );
}
add_action( 'wp_enqueue_scripts', 'kktfwp_parent_styles' );
/*
* Filter for disabling the update notice in admin panel
*
*/
//add_filter( 'kkHideUpdateNotice', 'kkHideUpdateNotice' );
function kkHideUpdateNotice() {
return true;
}
/*-----------------------------------------------------------------------------------*/
/* WRITE YOUR OWN FUNCTIONS BELOW
/*-----------------------------------------------------------------------------------*/
/* Returns the name of one random file from within a directory
livre-d-or.php:39:
*/
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 show_bookmark_list(){ ?>
<ul>
<?php
$args = array(
'title_before' => '<h3>',
'title_after' => '</h3>',
);
wp_list_bookmarks( $args ); ?>
</ul>
<?php
}
add_shortcode('show_bookmark_list', 'show_bookmark_list');
/*
ce-mois.php
ce-mois-ci.php
*functions.php - date_archive()
*/
function mois2 ($mois) {
switch ($mois)
{
case 00:
$mois = "00";
break;
case 1:
$mois = __('January','toppic-child');
break;
case 2:
$mois = __('February','toppic-child');
break;
case 3:
$mois = __('March','toppic-child');
break;
case 4:
$mois = __('April','toppic-child');
break;
case 5:
$mois = __('May','toppic-child');
break;
case 6:
$mois = __('June','toppic-child');
break;
case 7:
$mois = __('July','toppic-child');
break;
case 8:
$mois = __('August','toppic-child');
break;
case 9:
$mois = __('September','toppic-child');
break;
case 10:
$mois = __('October','toppic-child');
break;
case 11:
$mois = __('November','toppic-child');
break;
case 12:
$mois = __('December','toppic-child');
break;
}
return $mois;
}
/*
ce-mois-ci.php
*/
function displayRetina ($filename,$album) {
global $ppage;
if ($ppage == "1") {
$fullpath = "../../zenphoto/";
}
else {
$fullpath = "../../../zenphoto/";
}
$file = explode(".", $filename);
$thumbpath = "../zenphoto/cache/" . $album . "/";
$a = $path . $filename;
$file_sd = $thumbpath . $file[0] . "_200_thumb.jpg";
$file_hd = $thumbpath . $file[0] . "_400_thumb.jpg";
//echo $file_sd;
//echo $file_hd;
/*
$file_sd = $path . $file[0] . "_180_watermark.jpg";
$file_hd = $path . $file[0] . "_360_watermark.jpg";
*/
$th_sd = false;
$th_hd = false;
$thumb = array();
if (file_exists($file_sd)) {
$th_sd = true;
$size_sd = getimagesize($file_sd, $info);
$thumb['sd'] = array(
'url' => "../../" . $file_sd,
'width' => $size_sd[0],
'height' => $size_sd[1]
);
}
if (file_exists($file_hd)) {
$th_hd = true;
$size_hd = getimagesize($file_hd, $info);
$thumb['hd'] = array(
'url' => "../../" . $file_hd,
'width' => $size_hd[0],
'height' => $size_hd[1]
);
}
if (($th_sd == true) && ($th_hd == true)) {
$standard = $thumb['sd']['url'] . ' 200w, ' . $thumb['hd']['url'] . ' 400w';
}
elseif ($th_sd == true) {
$standard = $thumb['sd']['url'] . ' 200w';
}
elseif ($th_hd == true) {
$standard = $thumb['hd']['url'] . ' 400w';
}
$display = '<div class="album">';
$display .= '<div class="holder">';
$display .= '<a href="' . $fullpath . 'albums/'.$album.'/'.$filename.'" title="'.date_archive($filename).'" class="kk-lightbox">';
/*
$display .= '<picture data-picture data-alt="">';
$display .= '<!--[if IE 9]><video style="display: none;"><![endif]-->';
$display .= '<source class="image_standard" srcset="' . $standard . '">';
$display .= '<!--[if IE 9]></video><![endif]-->';
$display .= '<img srcset="' . $thumb['sd']['url'] . '" width="' . $thumb['sd']['width'] . '" height="' . $thumb['sd']['height'] . '"alt="">';
$display .= '</picture>';
$display .= '<img width="" height=""
src="../../../zenphoto/cache/photos-du-mois/10_2016_200_thumb.jpg"
class="" alt=""
srcset="../../../zenphoto/cache/photos-du-mois/10_2016_200_thumb.jpg 200w,
../../../zenphoto/cache/photos-du-mois/10_2016_400_thumb.jpg 400w"
sizes="(max-width: 200px) 100vw, 200px" />';
$display .= '<img width="' . $thumb['sd']['width'] . '" height="' . $thumb['sd']['height'] . '"
src="' . $thumb['sd']['url'] . '"
class="" alt=""
srcset="' . $standard . '"
sizes="(max-width: 200px) 100vw, 200px" />';
*/
$display .= "<img width='" . $thumb['sd']['width'] . "' height='" . $thumb['sd']['height'] . "' src='" . $thumb['sd']['url'] . "' class='' alt='' srcset='" . $standard . "' sizes='(max-width: 200px) 100vw, 200px' />";
$display .= '</a>';
$display .= '</div>';
$display .= '<div class="albumdesc">';
$display .= '<a href="../../zenphoto/index.php?album='.$album.'&amp;image='.$filename.'" title= "'.date_archive($filename).'" class="">';
$display .= '<span class="exif">'.date_archive($filename).'</span>';
$display .= '</a></div>';
$display .= '</div>' . "\r\n";
//echo "display: " . $display;
return $display;
}
/*
*functions.php - displayRetina() displayRetina()
*/
function date_archive ($chaine) {
$pieces = explode(".", $chaine);
$b = explode("_", $pieces[0]);
$mois = $b[0];
$an = $b[1];
$chaine = mois2($mois) . ' '. $an;
return $chaine;
}
function preprint($s, $return=false) {
$x = "<pre>";
$x .= print_r($s, 1);
$x .= "</pre>";
if ($return) return $x;
else print $x;
}

97
header.php Executable file
View File

@@ -0,0 +1,97 @@
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<!-- start head -->
<head>
<!-- start favicon -->
<link rel="icon" href="<?php echo get_option("toppic_theme_favicon")?>" type="image/x-icon" />
<!-- start meta -->
<?php if (get_option('toppic_theme_con_res') == 'true') { ?>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<?php } ?>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<!-- start pingbacks -->
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php wp_head(); ?>
<style type="text/css">
/*found on http://www.brunildo.org/test/img_center.html*/
.wraptocenter {
display: table-cell!important;
text-align: center!important;
vertical-align: middle!important;
width: 200px;
height: 200px;
}
.wraptocenter * {
vertical-align: middle!important;
}
/*\*//*/
.wraptocenter {
display: block;
}
.wraptocenter span {
display: inline-block;
height: 100%;
width: 1px;
}
/**/
</style>
<!--[if IE]><style>
.wraptocenter span {
display: inline-block;
height: 100%;
}
</style><![endif]-->
</head>
<!-- end head -->
<!-- start body -->
<body <?php body_class() ?> >
<?php if ( get_option( 'toppic_theme_kk_page_anim' ) == 'true' ) { ?>
<div class="kk-bg kk-bg-in"></div>
<div class="kk-preloader kk-loader-play"></div>
<?php } ?>
<?php if ( ( get_option( 'toppic_theme_is_border' ) == 'true' ) & ( get_option( 'toppic_theme_menu_style' ) == 'kk-menu-slide-right' ) ) { ?>
<!-- start borders -->
<div class="kk-borders kk-border-top"></div>
<div class="kk-borders kk-border-left"></div>
<div class="kk-borders kk-border-bottom"></div>
<div class="kk-borders kk-border-right"></div>
<!-- end borders -->
<?php } ?>
<!-- start header -->
<?php
$kk_header_style = get_option( 'toppic_theme_menu_style' );
if ( false === $kk_header_style ) { $kk_get_this = 'default'; }
switch($kk_header_style) {
case 'kk-menu-default':
case 'kk-menu-default-hidden':
$kk_get_this = 'default';
break;
case 'kk-menu-classic':
$kk_get_this = 'classic';
break;
case 'kk-menu-slide-right':
$kk_get_this = 'creative-right';
break;
case 'kk-menu-left-boxed':
$kk_get_this = 'boxed';
break;
case 'kk-menu-fullscreen':
$kk_get_this = 'fullscreen';
break;
}
get_template_part( 'extends/menu/' . $kk_get_this );
?>
<!-- end header -->

BIN
languages/fr_FR.mo Normal file

Binary file not shown.

136
languages/fr_FR.po Normal file
View File

@@ -0,0 +1,136 @@
msgid ""
msgstr ""
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"Project-Id-Version: TopPic Child\n"
"POT-Creation-Date: 2019-01-04 22:25+0100\n"
"PO-Revision-Date: 2019-01-04 22:48+0100\n"
"Language-Team: Pesenti <bruno@cliccclac.info>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.2\n"
"X-Poedit-Basepath: ../..\n"
"X-Poedit-Flags-xgettext: --add-comments=translators:\n"
"X-Poedit-WPHeader: style.css\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
"Last-Translator: Pesenti <bruno@cliccclac.info>\n"
"Language: fr_FR\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPathExcluded-0: *.js\n"
#: functions.php:75
msgid "January"
msgstr "Janvier"
#: functions.php:78
msgid "February"
msgstr "Février"
#: functions.php:81
msgid "March"
msgstr "Mars"
#: functions.php:84
msgid "April"
msgstr "Avril"
#: functions.php:87
msgid "May"
msgstr "Mai"
#: functions.php:90
msgid "June"
msgstr "Juin"
#: functions.php:93
msgid "July"
msgstr "Juillet"
#: functions.php:96
msgid "August"
msgstr "Août"
#: functions.php:99
msgid "September"
msgstr "Septembre"
#: functions.php:102
msgid "October"
msgstr "Octobre"
#: functions.php:105
msgid "November"
msgstr "Novembre"
#: functions.php:108
msgid "December"
msgstr "Décembre"
#: page-ce-mois-ci.php:186
msgid "The"
msgstr "Le"
#: page-ce-mois-ci.php:186
msgid "F j, Y, g:i a"
msgstr "d.m.Y à H:i"
#: page-ce-mois-ci.php:187
msgid " at "
msgstr " à "
#: page-ce-mois-ci.php:187
msgid "Focal"
msgstr "Focale"
#: page-ce-mois-ci.php:335 page-ce-mois-ci.php:336
msgid "Archives"
msgstr "Archives"
#: page-ce-mois-ci.php:336
msgid "Help"
msgstr "Aide"
#: page-ce-mois-ci.php:366
msgid "Previous Page"
msgstr "Page précédente"
#: page-ce-mois-ci.php:370
msgid "Page"
msgstr "Page"
#: page-ce-mois-ci.php:377
msgid "Next Page"
msgstr "Page suivante"
#: page-ce-mois-ci.php:389 page-livre.php:73 page.php:58
msgid "Pages"
msgstr "Pages"
#. Theme Name of the plugin/theme
msgid "TopPic Child"
msgstr ""
#. Theme URI of the plugin/theme
msgid "http://themes.easysite.by/toppic-overview/"
msgstr ""
#. Description of the plugin/theme
msgid "A child theme of TopPic Theme"
msgstr "Un thème enfant de TopPic thème"
#. Author of the plugin/theme
msgid "kotofey"
msgstr ""
#. Author URI of the plugin/theme
msgid "http://www.themeforest.net/user/kotofey"
msgstr ""
#. Template Name of the plugin/theme
msgid "Guestbook"
msgstr "Livre d'or"
#. Template Name of the plugin/theme
msgid "Ce-mois-ci"
msgstr ""

138
languages/toppic-child.pot Normal file
View File

@@ -0,0 +1,138 @@
#, fuzzy
msgid ""
msgstr ""
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
"Project-Id-Version: TopPic Child\n"
"POT-Creation-Date: 2019-01-04 22:25+0100\n"
"PO-Revision-Date: 2019-01-04 22:24+0100\n"
"Last-Translator: Pesenti <bruno@cliccclac.info>\n"
"Language-Team: Pesenti <bruno@cliccclac.info>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.2\n"
"X-Poedit-Basepath: ../..\n"
"X-Poedit-Flags-xgettext: --add-comments=translators:\n"
"X-Poedit-WPHeader: style.css\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
"_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPathExcluded-0: *.js\n"
#: functions.php:75
msgid "January"
msgstr ""
#: functions.php:78
msgid "February"
msgstr ""
#: functions.php:81
msgid "March"
msgstr ""
#: functions.php:84
msgid "April"
msgstr ""
#: functions.php:87
msgid "May"
msgstr ""
#: functions.php:90
msgid "June"
msgstr ""
#: functions.php:93
msgid "July"
msgstr ""
#: functions.php:96
msgid "August"
msgstr ""
#: functions.php:99
msgid "September"
msgstr ""
#: functions.php:102
msgid "October"
msgstr ""
#: functions.php:105
msgid "November"
msgstr ""
#: functions.php:108
msgid "December"
msgstr ""
#: page-ce-mois-ci.php:186
msgid "The"
msgstr ""
#: page-ce-mois-ci.php:186
msgid "F j, Y, g:i a"
msgstr ""
#: page-ce-mois-ci.php:187
msgid " at "
msgstr ""
#: page-ce-mois-ci.php:187
msgid "Focal"
msgstr ""
#: page-ce-mois-ci.php:335 page-ce-mois-ci.php:336
msgid "Archives"
msgstr ""
#: page-ce-mois-ci.php:336
msgid "Help"
msgstr ""
#: page-ce-mois-ci.php:366
msgid "Previous Page"
msgstr ""
#: page-ce-mois-ci.php:370
msgid "Page"
msgstr ""
#: page-ce-mois-ci.php:377
msgid "Next Page"
msgstr ""
#: page-ce-mois-ci.php:389 page-livre.php:73 page.php:58
msgid "Pages"
msgstr ""
#. Theme Name of the plugin/theme
msgid "TopPic Child"
msgstr ""
#. Theme URI of the plugin/theme
msgid "http://themes.easysite.by/toppic-overview/"
msgstr ""
#. Description of the plugin/theme
msgid "A child theme of TopPic Theme"
msgstr ""
#. Author of the plugin/theme
msgid "kotofey"
msgstr ""
#. Author URI of the plugin/theme
msgid "http://www.themeforest.net/user/kotofey"
msgstr ""
#. Template Name of the plugin/theme
msgid "Guestbook"
msgstr ""
#. Template Name of the plugin/theme
msgid "Ce-mois-ci"
msgstr ""

406
page-ce-mois-ci.php Executable file
View File

@@ -0,0 +1,406 @@
<?php
/**
* Template Name: Ce-mois-ci
*
*/
get_header() ?>
<?php
$root = $_SERVER['DOCUMENT_ROOT'];
define('SERVERPATH',$root.'/zenphoto');
include('../photoblog/exifer/exif.php');
//nb d'archive par page
$nb = 12;
global $ppage;
$url = $_SERVER['REDIRECT_URL'];
$a = explode("/", $url);
$pages = end($a);
$pages = prev($a);
if ($pages != get_page_uri()) $ppage = $pages;
else $ppage = "1";
$kk_parallax = kk_parallax();
$title_type = $kk_parallax[0];
$bg_title_img = $kk_parallax[1];
?>
<?php if ( post_password_required( $post ) ) {
get_template_part( 'password-form' );
} else {
?>
<!-- start main container -->
<div class="content page-content">
<?php if( $title_type == 'parallax' ) { ?>
<div id="kk-parallax-wrapper" class="kk-parallax-wrapper">
<div id="kk-parallax-bg" class="kk-parallax-bg kk-hidden">
<img id="kk-img-check" src="<?php echo esc_url( $bg_title_img ) ?>" alt="<?php echo esc_attr( $kk_parallax[2] ) ?>" />
</div>
<div id="kk-parallax-title-wrapper" class="kk-parallax-title-wrapper">
<div id="kk-parallax-title" class="page-title">
<?php the_title( '<h1>', '</h1>' ); ?>
</div>
</div>
<a id="kk-down" class="kk-down is-loading" href="#kk-to-me"></a>
</div>
<?php } ?>
<div class="content-inner-wrapper clearfix">
<span id="kk-to-me"></span>
<?php if( $title_type == 'default' ) { ?>
<div class="post-title">
<?php the_title( '<h1>', '</h1>' ); ?>
</div>
<div class="divider clear"></div>
<?php } ?>
<div class="inner-content">
<?php the_post(); ?>
<?php the_content (); ?>
<?php
$mois = date('n');
$an = date('Y');
$image = $mois . '_' . $an . '.jpg';
$annee = $an;
// nom des fichiers: 7_2009.jpg et non pas 07_2009.jpg
for ($i = 0; $i <= 11 ; $i++) {
$a = ($mois - $i);
if ($a < 1) {
$a = (12 + $a);
$annee = $an - 1;
}
$tableau[$i] = $a . '_' . $annee . '.jpg';
}
$i = 0;
while ($i < 13) {
$file = '../zenphoto/albums/photos-du-mois/' . $tableau[$i];
//echo $file;
if (file_exists($file)) {
$photo_du_mois = $file;
$title = $tableau[$i];
$size = getimagesize($photo_du_mois, $info);
//preprint($size);
if ($size[0] > 1000) {
// HD
$hd = '../../zenphoto/cache/photos-du-mois/' . substr($tableau[$i], 0, strlen($tableau[$i]) - 4) . "_FULL_watermark.jpg";
if (file_exists($hd)) {
$size_hd = getimagesize($hd, $info_hd);
$imgs['img_hd'] = array(
'url' => $hd,
'width' => $size_hd[0],
'height' => $size_hd[1]
);
}
else {
$imgs['img_hd'] = array(
'url' => '../' . $photo_du_mois,
'width' => $size[0],
'height' => $size[1]
);
}
// SD
$sd = '../../zenphoto/cache/photos-du-mois/' . substr($tableau[$i], 0, strlen($tableau[$i]) - 4) . "_800_watermark.jpg";
if (file_exists($sd)) {
$size_sd = getimagesize($sd, $info_sd);
$imgs['img_sd'] = array(
'url' => $sd,
'width' => $size_sd[0],
'height' => $size_sd[1]
);
}
}
else {
// SD
$sd = '../../zenphoto/cache/photos-du-mois/' . substr($tableau[$i], 0, strlen($tableau[$i]) - 4) . "_800_watermark.jpg";
if (file_exists($sd)) {
$size_sd = getimagesize($sd, $info_sd);
$imgs['img_sd'] = array(
'url' => $sd,
'width' => $size_sd[0],
'height' => $size_sd[1]
);
}
$imgs['img_hd'] = array(
'url' => "",
'width' => "",
'height' => ""
);
} // if ($size[0] > 1000)
$title = explode('.',$title);
$title = explode('_',$title[0]);
$title = mois2($title[0]) . ' ' . $title[1];
$imgs['img_sd']['title'] = $title;
if (isset($info["APP13"])) {
$iptc = iptcparse($info["APP13"]);
if (isset($iptc['2#120'][0])) $legende = $iptc['2#120'][0];
else $legende = "";
if (isset($iptc['2#005'][0])) $titre = $iptc['2#005'][0];
else $titre = "";
$keyword = "";
if (isset($iptc['2#025'])) {
foreach ($iptc['2#025'] as $key => $val) {
$keyword .= '<a href="' . $host . '/zenphoto/index.php?p=search&amp;words=' . $val . '" title="Tag > ' . $val . '" rel="tag">' . $val . '</a>';
$keyword .= ', ';
}
$keyword = substr($keyword, 0, -2);
}
$imgs['img_sd']['legende'] = $legende;
$imgs['img_sd']['titre'] = $titre;
$imgs['img_sd']['keyword'] = $keyword;
}
$exifInfo = "";
$exif_array = read_exif_data_raw($file,'EXIF');
$exifInfo = __('The','toppic-child') . " " .date(__("F j, Y, g:i a",'toppic-child'),strtotime($exif_array['SubIFD']['DateTimeOriginal'])).' - ';
$exifInfo .= $exif_array['SubIFD']['ExposureTime']. __(' at ','toppic-child') .$exif_array['SubIFD']['FNumber'].' - ' .$exif_array['SubIFD']['ISOSpeedRatings'].' ISO - '. __('Focal','toppic-child') .$exif_array['SubIFD']['FocalLength'];
$imgs['img_sd']['exif'] = $exifInfo;
//preprint($exif_array);
break;
}
$i++;
}
//preprint($imgs);
?>
<?php if ($ppage == "1") { ?>
<!-- image du mois -->
<div class="cadre">
<?php if (($imgs['img_sd']['titre'] != "") || ($imgs['img_sd']['legende'] != "")) { ?>
<p class="titrePhoto"><?php echo $imgs['img_sd']['titre']; ?>Titre</p>
<p class="legendePhoto"><?php echo $imgs['img_sd']['legende']; ?>Légende</p>
<?php } ?>
<!--img src="watermark2.php?src=<?php echo $photo_du_mois; ?>" alt="Image du mois" title="<?php echo $title; ?>" <?php echo $size[3]; ?> /-->
<!-- Retina -->
<?php
if (($imgs['img_sd']['url'] != "") && ($imgs['img_hd']['url'] != "")) {
$standard_source = $imgs['img_sd']['url'] . ', ' . $imgs['img_hd']['url'] . ' 2x';
//echo "1";
}
else if ($imgs['img_sd']['url'] != "") {
$standard_source = $imgs['img_sd']['url'];
//echo "2";
}
else if ($imgs['img_hd']['url'] != "") {
$standard_source = $imgs['img_hd']['url'] . ' 2x';
//echo "3";
}
//echo $standard_source;
?>
<picture data-picture data-alt="">
<!--[if IE 9]><video style="display: none;"><![endif]-->
<source class="image_standard" srcset="<?php echo $standard_source; ?>">
<!--source class="image_medium" srcset="" media="(max-width: 767px)">
<source class="image_small" srcset="" media="(max-width: 767px)"-->
<!--[if IE 9]></video><![endif]-->
<?php
echo '<img srcset="' . $imgs['img_sd']['url'] . '" alt="" width="'. $imgs['img_sd']['width'] . '" height="'. $imgs['img_sd']['height'] .'" />';
?>
</picture>
<!-- /Retina -->
</div><!-- /cadre -->
<?php if (($imgs['img_sd']['titre'] != "") || ($imgs['img_sd']['legende'] != "")) { ?>
<p class="titrePhoto"><?php echo $imgs['img_sd']['titre']; ?>Titre</p>
<p class="legendePhoto"><?php echo $imgs['img_sd']['legende']; ?>Légende</p>
<?php } ?>
<p class="exifs"><?php echo $imgs['img_sd']['exif']; ?></p>
<!-- /image du mois -->
<?php } ?>
<?php
require_once($_SERVER['DOCUMENT_ROOT'].'/Connections/cnx.php');
$album = 'photos-du-mois'; //Photos du mois
$table = array();
if ($_SERVER['HTTP_HOST'] == "silverbook.local") {
$table['images'] = ".images";
$table['albums'] = ".albums";
}
/*
if ($_SERVER['HTTP_HOST'] == "clicclac.info") {
$table['images'] = "zp_images";
$table['albums'] = "zp_albums";
}
*/
if ($_SERVER['HTTP_HOST'] == "clicclac.info") {
$table['images'] = "zenphoto_images";
$table['albums'] = "zenphoto_albums";
}
// Récupérer l'ID de l'album 'photos-du-mois' ($id_album)
$i = 0;
$conn = new mysqli($dbhost, $dbuser, $dbpassword, $zptable);
if ($conn->connect_error) {
trigger_error('Database connection failed: ' . $conn->connect_error, E_USER_ERROR);
exit();
}
$conn->set_charset("utf8");
$excquery = "SELECT `id` FROM `" . $table['albums'] . "` WHERE `folder` = '" . $album . "'";
if ($result = $conn->query($excquery)) {
$result->data_seek(0);
$row = $result->fetch_row();
$id_album = $row[0];
$result->close();
}
$conn->close();
// Récupérer toutes les fichiers de l'album 'photos-du-mois' ($fichier[])
$conn = new mysqli($dbhost, $dbuser, $dbpassword, $zptable);
if ($conn->connect_error) {
trigger_error('Database connection failed: ' . $conn->connect_error, E_USER_ERROR);
exit();
}
$conn->set_charset("utf8");
$pictquery = "SELECT `filename` FROM `" . $table['images'] . "` WHERE `albumid` = ? ORDER BY `date` DESC";
$stmt = $conn->prepare($pictquery);
//echo $pictquery;
if($stmt === false) {
trigger_error('Wrong SQL: ' . $pictquery . ' Error: ' . $conn->error, E_USER_ERROR);
}
else {
$stmt->bind_param('i', $id_album);
$stmt->execute();
$stmt->bind_result($filename);
while ($stmt->fetch()) {
$fichier[] = $filename;
$i++;
//echo $filename;
}
}
$stmt->close();
//
?>
<?php
$aide = "<span class='aide'> ? </span><b>Utilisation:</b> cliquer sur une vignette, puis....<br />";
$aide .= " <b><i>-sur ordinateur:</i></b> naviguer avec les touches flèches droite et gauche, quitter avec ESC.<br />";
$aide .= " <b><i>-sur tablettes et smartphones:</i></b> balayer l'écran avec un doigt vers la droite ou vers la gauche, ou naviguer avec les touches flèches droite et gauche. Cliquer sur la X pour quitter.";
?>
<div id="archive" class="modele">
<p style="clear: both; "></p>
<h4><?php echo gettext("Archives"); ?> (<abbr title="<?php echo $aide; ?>" rel="tooltip"> ? </abbr>)</h4>
<!--h4><?php echo gettext("Archives"); ?> <span class='aide'><a href="#" title="<?php echo $aide; ?>" class="tooltip"><span title="<?php echo gettext("Help"); ?>">( ? )</span></a></span></h4-->
<?php
$debut = (($ppage - 1) * $nb) +1; // page 1: 2, page 2: 14, page 3: 26
$fin = ($debut + $nb) - 1;
/**/
for ($j=$debut; $j<=$fin; $j++) {
if ($j <= count($fichier)-1) echo displayRetina($fichier[$j],$album);
if ($j+1 <= count($fichier)-1) echo displayRetina($fichier[$j+1],$album);
if ($j+2 <= count($fichier)-1) echo displayRetina($fichier[$j+2],$album);
$j = $j + 2;
}
?>
<p style="clear: both; "></p>
<div class="blog-pagination">
<?php
/**/
// calcul du nombre de pages (arrondi a l'entier superieur)
$nbpages = ceil(count($fichier) / 12);
$prec = $ppage - 1;
$suiv = $ppage + 1;
if ($ppage >= 2) echo '<a class="prev page-numbers" href="'.$_SERVER['REQUEST_URI'].'?page='.$prec.'" title="'.gettext("Previous Page").'"> ← </a>&nbsp;';
for ($i = 1; $i <= $nbpages; $i++) {
if ($i != $ppage) {
echo '<a class="page-numbers" href="'.$_SERVER['REQUEST_URI'].'?page='.$i.'" title="'.gettext("Page").' '.$i.'">'.$i.' </a>&nbsp;';
}
else {
echo "<span class='current page-numbers'>".$i."</span>&nbsp;&nbsp;";
}
}
if ($page < $nbpages) echo '<a class="next page-numbers" href="'.$_SERVER['REQUEST_URI'].'?page='.$suiv.'" title="'.gettext("Next Page").'"> → </a>&nbsp;';
?>
</div>
</div>
<?php
wp_link_pages( array(
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages', 'toppic' ) . '</span>',
'after' => '</div>',
'link_before' => '<span class="link-num">',
'link_after' => '</span>'
)
);
?>
</div>
</div>
<?php get_template_part('extends/footer-area') ?>
</div>
<!-- end container -->
<?php } ?>
<?php get_footer()?>

90
page-livre.php Executable file
View File

@@ -0,0 +1,90 @@
<?php
/**
* Template Name: Guestbook
*
*/
get_header() ?>
<?php
$kk_parallax = kk_parallax();
$title_type = $kk_parallax[0];
$bg_title_img = $kk_parallax[1];
?>
<?php if ( post_password_required( $post ) ) {
get_template_part( 'password-form' );
} else {
?>
<!-- start main container -->
<div class="content page-content">
<?php if( $title_type == 'parallax' ) { ?>
<div id="kk-parallax-wrapper" class="kk-parallax-wrapper">
<div id="kk-parallax-bg" class="kk-parallax-bg kk-hidden">
<img id="kk-img-check" src="<?php echo esc_url( $bg_title_img ) ?>" alt="<?php echo esc_attr( $kk_parallax[2] ) ?>" />
</div>
<div id="kk-parallax-title-wrapper" class="kk-parallax-title-wrapper">
<div id="kk-parallax-title" class="page-title">
<?php the_title( '<h1>', '</h1>' ); ?>
</div>
</div>
<a id="kk-down" class="kk-down is-loading" href="#kk-to-me"></a>
</div>
<?php } ?>
<div class="content-inner-wrapper clearfix">
<span id="kk-to-me"></span>
<?php if( $title_type == 'default' ) { ?>
<div class="post-title">
<?php the_title( '<h1>', '</h1>' ); ?>
</div>
<div class="divider clear"></div>
<?php } ?>
<div class="inner-content">
<?php the_post(); ?>
<?php the_content (); ?>
<?php
$imagesDir = '../zenphoto/albums/photos-du-mois';
$imageURL = getRandomFile($imagesDir);
$RandomImage = '../' . $imagesDir . '/' . $imageURL;
echo '<div id="randomImg"><img src="' . $RandomImage . '" alt="Livre d\'Or" title="" /></div>';
?>
<?php comments_template(); ?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages', 'toppic' ) . '</span>',
'after' => '</div>',
'link_before' => '<span class="link-num">',
'link_after' => '</span>'
)
);
?>
</div>
</div>
<?php get_template_part('extends/footer-area') ?>
</div>
<!-- end container -->
<?php } ?>
<?php get_footer()?>

75
page.php Executable file
View File

@@ -0,0 +1,75 @@
<?php get_header() ?>
<?php
$kk_parallax = kk_parallax();
$title_type = $kk_parallax[0];
$bg_title_img = $kk_parallax[1];
?>
<?php if ( post_password_required( $post ) ) {
get_template_part( 'password-form' );
} else {
?>
<!-- start main container -->
<div class="content page-content">
<?php if( $title_type == 'parallax' ) { ?>
<div id="kk-parallax-wrapper" class="kk-parallax-wrapper">
<div id="kk-parallax-bg" class="kk-parallax-bg kk-hidden">
<img id="kk-img-check" src="<?php echo esc_url( $bg_title_img ) ?>" alt="<?php echo esc_attr( $kk_parallax[2] ) ?>" />
</div>
<div id="kk-parallax-title-wrapper" class="kk-parallax-title-wrapper">
<div id="kk-parallax-title" class="page-title">
<?php the_title( '<h1>', '</h1>' ); ?>
</div>
</div>
<a id="kk-down" class="kk-down is-loading" href="#kk-to-me"></a>
</div>
<?php } ?>
<div class="content-inner-wrapper clearfix">
<span id="kk-to-me"></span>
<?php if( $title_type == 'default' ) { ?>
<div class="post-title">
<?php the_title( '<h1>', '</h1>' ); ?>
</div>
<div class="divider clear"></div>
<?php } ?>
<div class="inner-content">
<?php the_post(); ?>
<?php the_content (); ?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages', 'toppic' ) . '</span>',
'after' => '</div>',
'link_before' => '<span class="link-num">',
'link_after' => '</span>'
)
);
?>
</div>
</div>
<?php get_template_part('extends/footer-area') ?>
</div>
<!-- end container -->
<?php } ?>
<?php get_footer()?>

BIN
screenshot.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

169
style 2.css Executable file
View File

@@ -0,0 +1,169 @@
/*
Theme Name: TopPic Child
Theme URI: http://themes.easysite.by/toppic-overview/
Author: kotofey
Author URI: http://www.themeforest.net/user/kotofey
Description: A child theme of TopPic Theme
Template: toppic
Version: 1.5
*/
/*-----------------------------------------------------------------------------------*/
/* WRITE YOUR OWN STYLES BELOW
/*-----------------------------------------------------------------------------------*/
#randomImg img {
padding: 10px;
background-color: #fff;
border: 1px solid #818181;
margin-right: auto;
margin-left: auto;
display: block;
width: 800px;
}
.inner-content ul li {
margin-top: 32px;
list-style-type: none;
}
.inner-content ul li h3 {
margin-bottom: 10px;
}
.inner-content ul li ul li{
margin-top: 2px;
margin-bottom: 2px;
list-style-type: none;
}
.form_newsletter {
padding-left: 30px;
}
/*
.tnp-subscription input[type="email"] {
background-color: transparent!important;
border-color: #444!important;
color: 000!important;
}
.tnp-subscription input.tnp-submit {
background-color: #fff!important;
color: #d37657;
width: auto!important;
}
ul li input.input-email
input.tnp-email
*/
/*
div.modele {
box-sizing: content-box;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
}
*/
#archive {
/**/
margin: 0 0 80px;
}
.cadre {
text-align: center;
margin-top: 1em;
}
.cadre img {
padding: 50px;
background-color: #fff;
border: 1px solid #ccc;
}
.exifs {
text-align: center;
color: #909090;
font-size: smaller;
margin-bottom: 3em;
margin-top: 1em;
}
.thumb {
/*float: left;
line-height: 200px;*/
width: 200px;
height: 200px;
border: 1px solid #ccc;
background-color: #fff;
}
.albumdesc {
float: right;
text-align:center;
width: 200px;
padding: 6px 0 0 0;
text-align:center;
vertical-align: middle;
}
.albumdesc a, .pagination a {
color: #333;
}
.gras {
font-weight: bold;
}
input.search-field {
width: 200px;
height: 24px;
border: 1px dashed #eee;
margin: 0 5px 0 0;
}
.albumdesc:hover {
/*
background: #ddd;
color: #333 !important;
border-radius: 0;
*/
font-weight: bold;
}
.album {
/* Hack pour themes/toppic/css/reset.css */
box-sizing: content-box;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
/* */
float: left;
width: 200px;
height: 200px;
text-align:center;
margin-top: 0;
margin-right: auto;
/* entre 2 rangées d'albums */
margin-bottom: 25px;
margin-left: auto;
padding: 0px 11px 20px;
}
.holder {
display:table-cell;
vertical-align:middle;
text-align:center;
height:200px;
width:200px;
background-color: #fff;
border: 1px solid #ccc;
}

167
style.css Executable file
View File

@@ -0,0 +1,167 @@
/*
Theme Name: TopPic Child
Theme URI: http://themes.easysite.by/toppic-overview/
Author: kotofey
Author URI: http://www.themeforest.net/user/kotofey
Description: A child theme of TopPic Theme
Template: toppic
Version: 1.5
*/
/*-----------------------------------------------------------------------------------*/
/* WRITE YOUR OWN STYLES BELOW
/*-----------------------------------------------------------------------------------*/
#randomImg img {
padding: 10px;
background-color: #fff;
border: 1px solid #818181;
margin-right: auto;
margin-left: auto;
display: block;
width: 800px;
}
.inner-content ul li {
margin-top: 32px;
list-style-type: none;
}
.inner-content ul li h3 {
margin-bottom: 10px;
}
.inner-content ul li ul li{
margin-top: 2px;
margin-bottom: 2px;
list-style-type: none;
}
.form_newsletter {
padding-left: 30px;
}
/*
.tnp-subscription input[type="email"] {
background-color: transparent!important;
border-color: #444!important;
color: 000!important;
}
.tnp-subscription input.tnp-submit {
background-color: #fff!important;
color: #d37657;
width: auto!important;
}
ul li input.input-email
input.tnp-email
*/
/*
div.modele {
box-sizing: content-box;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
}
*/
#archive {
/**/
margin: 0 0 80px;
}
.cadre {
text-align: center;
margin-top: 1em;
}
.cadre img {
padding: 50px;
background-color: #fff;
border: 1px solid #ccc;
}
.exifs {
text-align: center;
color: #909090;
font-size: smaller;
margin-bottom: 3em;
margin-top: 1em;
}
/*
.thumb {
width: 200px;
height: 200px;
border: 1px solid #ccc;
background-color: #fff;
}
*/
.albumdesc {
float: right;
text-align:center;
width: 220px;
padding: 6px 0 0 0;
text-align:center;
vertical-align: middle;
}
.albumdesc a, .pagination a {
color: #333;
}
.gras {
font-weight: bold;
}
input.search-field {
width: 200px;
height: 24px;
border: 1px dashed #eee;
margin: 0 5px 0 0;
}
.albumdesc:hover {
/*
background: #ddd;
color: #333 !important;
border-radius: 0;
*/
font-weight: bold;
}
.album {
/* Hack pour themes/toppic/css/reset.css */
box-sizing: content-box;
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box;
/* */
float: left;
width: 220px;
height: 220px;
text-align:center;
margin-top: 0;
margin-right: auto;
/* entre 2 rangées d'albums */
margin-bottom: 25px;
margin-left: auto;
padding: 0px 11px 20px;
}
.holder {
display:table-cell;
vertical-align:middle;
text-align:center;
height:220px;
width:220px;
background-color: #fff;
border: 1px solid #ccc;
}