Delete pagination
This commit is contained in:
2017-02-02 06:46:43 +01:00
parent fa176aba46
commit 3b26d798a9
19 changed files with 3121 additions and 350 deletions

235
-child/Pagination/ce-mois.php Executable file
View File

@@ -0,0 +1,235 @@
<?php
/**
* Template Name: Ce-mois
*
* @package WordPress
* @subpackage Twenty_Ten
* @since Twenty Ten 1.0
*/
get_header();
$root = $_SERVER['DOCUMENT_ROOT'];
define('SERVERPATH',$root.'/zenphoto');
//define('WEBPATH','/'.basename(dirname(__FILE__)).'/zenphoto');
//require_once(SERVERPATH.'/zp-core/template-functions.php');
include('../photoblog/exifer/exif.php');
?>
<div class="content">
<div class="container">
<div class="post_content">
<?php if(have_posts()): the_post(); ?>
<article class="post_box" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
</article>
<?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)) {
//echo "<br />" ."file exist: " . $file;
// ../zenphoto/albums/photos-du-mois/4_2014.jpg
// 4_2014_800_watermark.jpg, 4_2014_FULL_watermark.jpg
$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]
);
}
} // / $size[0] > 1000
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' => ""
);
} // / ($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;
} // / isset($info["APP13"]
$exifInfo = "";
$exif_array = read_exif_data_raw($file,0);
$exifInfo = __('The','CreatorThemeRes-child') . " " .date(__("F j, Y, g:i a",'CreatorThemeRes-child'),strtotime($exif_array['SubIFD']['DateTimeOriginal'])).' - ';
$exifInfo .= $exif_array['SubIFD']['ExposureTime']. __(' at ','CreatorThemeRes-child') .$exif_array['SubIFD']['FNumber'].' - ' .$exif_array['SubIFD']['ISOSpeedRatings'].' ISO - '. __('Focal','CreatorThemeRes-child') .$exif_array['SubIFD']['FocalLength'];
$imgs['img_sd']['exif'] = $exifInfo;
break;
} // /file_exists($file)
$i++;
} // /while
//preprint($imgs);
?>
<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>
<?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">
<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-->
<p style="clear: both; "></p>
<div id="loading"></div>
<div id="container">
<!--div class="data"></div-->
<p style="clear: both; "></p>
<!--div class="pagination"></div-->
</div>
</div><!-- /#archive -->
<?php
endif; // /have_posts()
?>
</div><!-- /post_content -->
</div><!-- /container -->
</div><!-- /content -->
<?php
get_footer( 'page' );
?>

96
-child/Pagination/header.php Executable file
View File

@@ -0,0 +1,96 @@
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php wp_head(); ?>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
function loading_show(){
$('#loading').html("<img src='<?php echo get_stylesheet_directory_uri(); ?>/images/loading.gif'/>").fadeIn('fast');
}
function loading_hide(){
$('#loading').fadeOut('fast');
}
function loadData(page){
loading_show();
$.ajax
({
type: "POST",
url: "<?php echo get_stylesheet_directory_uri() . '/load_data.php'; ?>",
data: "page="+page,
success: function(msg)
{
$("#container").ajaxComplete(function(event, request, settings)
{
loading_hide();
$("#container").html(msg);
});
}
});
}
loadData(1); // For first time page load default results
$('#container .pagination li.active').live('click',function(){
var page = $(this).attr('p');
loadData(page);
});
$('#go_btn').live('click',function(){
var page = parseInt($('.goto').val());
var no_of_pages = parseInt($('.total').attr('a'));
if(page != 0 && page <= no_of_pages){
loadData(page);
}else{
alert('Enter a PAGE between 1 and '+no_of_pages);
$('.goto').val("").focus();
return false;
}
});
});
</script>
</head>
<body <?php body_class(); ?>>
<header id="head">
<div class="top-area">
<div class="container">
<div class="head-details">
<?php
echo (dess_setting('dess_tel') != '' ? __('Tel: ','creator').'<a href="tel:'.dess_setting('dess_tel').'">'. dess_setting('dess_tel').'</a>' : '');
echo (dess_setting('dess_email') != '' ? ' | '.__('Email: ','creator').'<a href="mailto:'.dess_setting('dess_email').'">'. dess_setting('dess_email').'</a>' : '');
echo (dess_setting('dess_hoursup') != '' ? ' | '.dess_setting('dess_hoursup') : '');
?>
</div><!-- head-details -->
<div class="head-socials">
<ul>
<?php
$socials = array('twitter','facebook','google-plus','instagram','pinterest','vimeo','youtube','linkedin');
for($i=0;$i<count($socials);$i++){
$url = '';
$s = $socials[$i];
$url = dess_setting('dess_'.$s);
echo ($url != '' ? '<li><a target="_blank" href="'.$url.'"><img src="'.esc_url( get_stylesheet_directory_uri() ).'/images/'.$s.'-icon.png" alt="'.$s.'" /></a></li>':'');
}
?>
</ul>
</div><!-- head-socials -->
<div class="clear"></div>
</div><!-- container -->
</div><!-- top-area -->
<div class="head-area">
<div class="container">
<div class="logo">
<?php echo (dess_setting('dess_logo') != '' ? '<a href="'.home_url().'"><img src="'.dess_setting('dess_logo').'" alt="logo" /></a>': '<a href="'.home_url().'"><img src="'.esc_url( get_stylesheet_directory_uri() ).'/images/logo.png" alt="logo" /></a>'); ?>
</div><!-- logo -->
<div class="head-nav">
<?php wp_nav_menu(array('theme_location' => 'header-menu')); ?>
</div><!-- head-nav -->
<div class="clear"></div>
</div><!-- container -->
</div><!-- head-area -->
</header>

187
-child/Pagination/load_data.php Executable file
View File

@@ -0,0 +1,187 @@
<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]-->
</style>
<?php
if($_POST['page'])
{
$page = $_POST['page'];
$cur_page = $page;
$page -= 1;
$per_page = 15;
$previous_btn = true;
$next_btn = true;
$first_btn = true;
$last_btn = true;
$start = $page * $per_page;
include("db.php");
include("fonctions.php");
$album = 'photos-du-mois'; //Photos du mois
$item_per_page = 12; //item to display per page
$table = array();
if ($_SERVER['HTTP_HOST'] == "macbook-pro.local") {
$table['images'] = ".images";
$table['albums'] = ".albums";
}
if ($_SERVER['HTTP_HOST'] == "clicclac.info") {
$table['images'] = "zenphoto_images";
$table['albums'] = "zenphoto_albums";
}
$mysqli = new mysqli($db_host, $db_username, $db_password, $db_name);
//Output any connection error
if ($mysqli->connect_error) {
die('Error : ('. $mysqli->connect_errno .') '. $mysqli->connect_error);
}
// Récupérer l'ID de l'album 'photos-du-mois' ($id_album)
$i = 0;
$conn = new mysqli($db_host, $db_username, $db_password, $db_name);
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();
/*
$query_pag_data = "SELECT msg_id,message from messages LIMIT $start, $per_page";
$result_pag_data = mysql_query($query_pag_data) or die('MySql Error' . mysql_error());
$msg = "";
while ($row = mysql_fetch_array($result_pag_data)) {
$htmlmsg=htmlentities($row['message']);
$msg .= "<li><b>" . $row['msg_id'] . "</b> " . $htmlmsg . "</li>";
}
$msg = "<div class='data'><ul>" . $msg . "</ul></div>"; // Content for Data
*/
$msg = "";
//Limit our results within a specified range.
$results = $mysqli->prepare("SELECT `filename` FROM `" . $table['images'] . "` WHERE `albumid` = ? ORDER BY `date` DESC LIMIT $start, $per_page");
$results->bind_param('i', $id_album);
$results->execute(); //Execute prepared Query
$results->bind_result($filename); //bind variables to prepared statement
//Display records fetched from database.
while($results->fetch()){ //fetch values
//$msg .= "<li><b>" . $filename . "</b></li>";
$msg .= displayRetina($filename,$album);
}
//$msg = "<div class='data'><ul>" . $msg . "</ul></div>"; // Content for Data
/* ---------------------------------------------
$query_pag_num = "SELECT COUNT(*) AS count FROM messages";
$result_pag_num = mysql_query($query_pag_num);
$row = mysql_fetch_array($result_pag_num);
$count = $row['count'];
*/
$results = $mysqli->query("SELECT COUNT(*) FROM `" . $table['images'] . "` WHERE `albumid` = $id_album ");
$count = $results->fetch_row(); //hold total records in variable
$no_of_paginations = ceil($count[0] / $per_page);
/* ---------------Calculating the starting and endign values for the loop----------------------------------- */
if ($cur_page >= 7) {
$start_loop = $cur_page - 3;
if ($no_of_paginations > $cur_page + 3)
$end_loop = $cur_page + 3;
else if ($cur_page <= $no_of_paginations && $cur_page > $no_of_paginations - 6) {
$start_loop = $no_of_paginations - 6;
$end_loop = $no_of_paginations;
} else {
$end_loop = $no_of_paginations;
}
} else {
$start_loop = 1;
if ($no_of_paginations > 7)
$end_loop = 7;
else
$end_loop = $no_of_paginations;
}
/* ----------------------------------------------------------------------------------------------------------- */
$msg .= "<div class='pagination'><ul>";
// FOR ENABLING THE FIRST BUTTON
if ($first_btn && $cur_page > 1) {
$msg .= "<li p='1' class='active'>First</li>";
} else if ($first_btn) {
$msg .= "<li p='1' class='inactive'>First</li>";
}
// FOR ENABLING THE PREVIOUS BUTTON
if ($previous_btn && $cur_page > 1) {
$pre = $cur_page - 1;
$msg .= "<li p='$pre' class='active'>Previous</li>";
} else if ($previous_btn) {
$msg .= "<li class='inactive'>Previous</li>";
}
for ($i = $start_loop; $i <= $end_loop; $i++) {
if ($cur_page == $i)
$msg .= "<li p='$i' style='color:#fff;background-color:#006699;' class='active'>{$i}</li>";
else
$msg .= "<li p='$i' class='active'>{$i}</li>";
}
// TO ENABLE THE NEXT BUTTON
if ($next_btn && $cur_page < $no_of_paginations) {
$nex = $cur_page + 1;
$msg .= "<li p='$nex' class='active'>Next</li>";
} else if ($next_btn) {
$msg .= "<li class='inactive'>Next</li>";
}
// TO ENABLE THE END BUTTON
if ($last_btn && $cur_page < $no_of_paginations) {
$msg .= "<li p='$no_of_paginations' class='active'>Last</li>";
} else if ($last_btn) {
$msg .= "<li p='$no_of_paginations' class='inactive'>Last</li>";
}
$goto = "<input type='text' class='goto' size='1' style='margin-top:-1px;margin-left:60px;'/><input type='button' id='go_btn' class='go_button' value='Go'/>";
$total_string = "<span class='total' a='$no_of_paginations'>Page <b>" . $cur_page . "</b> of <b>$no_of_paginations</b></span>";
$msg = $msg . "</ul>" . $total_string . "</div>"; // Content for pagination
echo $msg;
}

231
-child/ce-mois.php Executable file
View File

@@ -0,0 +1,231 @@
<?php
/**
* Template Name: Ce-mois
*
* @package WordPress
* @subpackage Twenty_Ten
* @since Twenty Ten 1.0
*/
get_header( 'page' );
$root = $_SERVER['DOCUMENT_ROOT'];
define('SERVERPATH',$root.'/zenphoto');
//define('WEBPATH','/'.basename(dirname(__FILE__)).'/zenphoto');
//require_once(SERVERPATH.'/zp-core/template-functions.php');
include('../photoblog/exifer/exif.php');
?>
<div class="content">
<div class="container">
<div class="post_content">
<?php if(have_posts()): the_post(); ?>
<article class="post_box" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
</article>
<?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)) {
//echo "<br />" ."file exist: " . $file;
// ../zenphoto/albums/photos-du-mois/4_2014.jpg
// 4_2014_800_watermark.jpg, 4_2014_FULL_watermark.jpg
$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]
);
}
} // / $size[0] > 1000
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' => ""
);
} // / ($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;
} // / isset($info["APP13"]
$exifInfo = "";
$exif_array = read_exif_data_raw($file,0);
$exifInfo = __('The','CreatorThemeRes-child') . " " .date(__("F j, Y, g:i a",'CreatorThemeRes-child'),strtotime($exif_array['SubIFD']['DateTimeOriginal'])).' - ';
$exifInfo .= $exif_array['SubIFD']['ExposureTime']. __(' at ','CreatorThemeRes-child') .$exif_array['SubIFD']['FNumber'].' - ' .$exif_array['SubIFD']['ISOSpeedRatings'].' ISO - '. __('Focal','CreatorThemeRes-child') .$exif_array['SubIFD']['FocalLength'];
$imgs['img_sd']['exif'] = $exifInfo;
break;
} // /file_exists($file)
$i++;
} // /while
//preprint($imgs);
?>
<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>
<?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">
<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-->
<p style="clear: both; "></p>
<div class="loading-div"><img src="<?php echo get_stylesheet_directory_uri(); ?>/ajax-loader.gif" ></div>
<div id="results"><!-- content will be loaded here --></div>
</div><!-- /#archive -->
<?php
endif; // /have_posts()
?>
</div><!-- /post_content -->
</div><!-- /container -->
</div><!-- /content -->
<?php
get_footer( 'page' );
?>

11
-child/db.php Executable file
View File

@@ -0,0 +1,11 @@
<?php
$db_host = "localhost";
$db_username = "root";
$db_password = "sncfp1p2";
$db_name = "zenphoto";
$prefix = "";
/*
$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Opps some thing went wrong");
mysql_select_db($mysql_database, $bd) or die("Opps some thing went wrong");
*/
?>

1169
-child/exifer/exif.php Executable file

File diff suppressed because it is too large Load Diff

426
-child/exifer/makers/canon.php Executable file
View File

@@ -0,0 +1,426 @@
<?php //================================================================================================
//================================================================================================
//================================================================================================
/*
Exifer
Extracts EXIF information from digital photos.
Copyright © 2003 Jake Olefsky
http://www.offsky.com/software/exif/index.php
jake@olefsky.com
Please see exif.php for the complete information about this software.
------------
This program is free software; you can redistribute it and/or modify it under the terms of
the GNU General Public License as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details. http://www.gnu.org/copyleft/gpl.html
*/
//================================================================================================
//================================================================================================
//================================================================================================
//=================
// Looks up the name of the tag for the MakerNote (Depends on Manufacturer)
//====================================================================
function lookup_Canon_tag($tag) {
switch($tag) {
case "0001": $tag = "Settings 1";break;
case "0004": $tag = "Settings 4";break;
case "0006": $tag = "ImageType";break;
case "0007": $tag = "FirmwareVersion";break;
case "0008": $tag = "ImageNumber";break;
case "0009": $tag = "OwnerName";break;
case "000c": $tag = "CameraSerialNumber";break;
case "000f": $tag = "CustomFunctions";break;
case "0095": $tag = "LensInfo";break;
default: $tag = "unknown:".$tag;break;
}
return $tag;
}
//=================
// Formats Data for the data type
//====================================================================
function formatCanonData($type,$tag,$intel,$data,$exif,&$result) {
$place = 0;
if($type=="ASCII") {
$result = $data = str_replace("\0", "", $data);
} else if($type=="URATIONAL" || $type=="SRATIONAL") {
$data = unRational($data,$type,$intel);
if($tag=="0204") { //DigitalZoom
$data=$data."x";
}
} else if($type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
$data = rational($data,$type,$intel);
$result['RAWDATA'] = $data;
if($tag=="0001") { //first chunk
$result['Bytes']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//0
if ($result['Bytes'] != strlen($data) / 2) return $result; //Bad chunk
$result['Macro']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//1
switch($result['Macro']) {
case 1: $result['Macro'] = gettext("Macro"); break;
case 2: $result['Macro'] = gettext("Normal"); break;
default: $result['Macro'] = gettext("Unknown");
}
$result['SelfTimer']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//2
switch($result['SelfTimer']) {
case 0: $result['SelfTimer'] = gettext("Off"); break;
default: $result['SelfTimer'] .= gettext("/10s");
}
$result['Quality']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//3
switch($result['Quality']) {
case 2: $result['Quality'] = gettext("Normal"); break;
case 3: $result['Quality'] = gettext("Fine"); break;
case 5: $result['Quality'] = gettext("Superfine"); break;
default: $result['Quality'] = gettext("Unknown");
}
$result['Flash']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//4
switch($result['Flash']) {
case 0: $result['Flash'] = gettext("Off"); break;
case 1: $result['Flash'] = gettext("Auto"); break;
case 2: $result['Flash'] = gettext("On"); break;
case 3: $result['Flash'] = gettext("Red Eye Reduction"); break;
case 4: $result['Flash'] = gettext("Slow Synchro"); break;
case 5: $result['Flash'] = gettext("Auto + Red Eye Reduction"); break;
case 6: $result['Flash'] = gettext("On + Red Eye Reduction"); break;
case 16: $result['Flash'] = gettext("External Flash"); break;
default: $result['Flash'] = gettext("Unknown");
}
$result['DriveMode']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//5
switch($result['DriveMode']) {
case 0: $result['DriveMode'] = gettext("Single/Timer"); break;
case 1: $result['DriveMode'] = gettext("Continuous"); break;
default: $result['DriveMode'] = gettext("Unknown");
}
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//6
$result['FocusMode']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//7
switch($result['FocusMode']) {
case 0: $result['FocusMode'] = gettext("One-Shot"); break;
case 1: $result['FocusMode'] = gettext("AI Servo"); break;
case 2: $result['FocusMode'] = gettext("AI Focus"); break;
case 3: $result['FocusMode'] = gettext("Manual Focus"); break;
case 4: $result['FocusMode'] = gettext("Single"); break;
case 5: $result['FocusMode'] = gettext("Continuous"); break;
case 6: $result['FocusMode'] = gettext("Manual Focus"); break;
default: $result['FocusMode'] = gettext("Unknown");
}
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//8
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//9
$result['ImageSize']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//10
switch($result['ImageSize']) {
case 0: $result['ImageSize'] = gettext("Large"); break;
case 1: $result['ImageSize'] = gettext("Medium"); break;
case 2: $result['ImageSize'] = gettext("Small"); break;
default: $result['ImageSize'] = gettext("Unknown");
}
$result['EasyShooting']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//11
switch($result['EasyShooting']) {
case 0: $result['EasyShooting'] = gettext("Full Auto"); break;
case 1: $result['EasyShooting'] = gettext("Manual"); break;
case 2: $result['EasyShooting'] = gettext("Landscape"); break;
case 3: $result['EasyShooting'] = gettext("Fast Shutter"); break;
case 4: $result['EasyShooting'] = gettext("Slow Shutter"); break;
case 5: $result['EasyShooting'] = gettext("Night"); break;
case 6: $result['EasyShooting'] = gettext("Black & White"); break;
case 7: $result['EasyShooting'] = gettext("Sepia"); break;
case 8: $result['EasyShooting'] = gettext("Portrait"); break;
case 9: $result['EasyShooting'] = gettext("Sport"); break;
case 10: $result['EasyShooting'] = gettext("Macro/Close-Up"); break;
case 11: $result['EasyShooting'] = gettext("Pan Focus"); break;
default: $result['EasyShooting'] = gettext("Unknown");
}
$result['DigitalZoom']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//12
switch($result['DigitalZoom']) {
case 0:
case 65535: $result['DigitalZoom'] = gettext("None"); break;
case 1: $result['DigitalZoom'] = gettext("2x"); break;
case 2: $result['DigitalZoom'] = gettext("4x"); break;
default: $result['DigitalZoom'] = gettext("Unknown");
}
$result['Contrast']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//13
switch($result['Contrast']) {
case 0: $result['Contrast'] = gettext("Normal"); break;
case 1: $result['Contrast'] = gettext("High"); break;
case 65535: $result['Contrast'] = gettext("Low"); break;
default: $result['Contrast'] = gettext("Unknown");
}
$result['Saturation']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//14
switch($result['Saturation']) {
case 0: $result['Saturation'] = gettext("Normal"); break;
case 1: $result['Saturation'] = gettext("High"); break;
case 65535: $result['Saturation'] = gettext("Low"); break;
default: $result['Saturation'] = gettext("Unknown");
}
$result['Sharpness']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//15
switch($result['Sharpness']) {
case 0: $result['Sharpness'] = gettext("Normal"); break;
case 1: $result['Sharpness'] = gettext("High"); break;
case 65535: $result['Sharpness'] = gettext("Low"); break;
default: $result['Sharpness'] = gettext("Unknown");
}
$result['ISO']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//16
switch($result['ISO']) {
case 32767:
case 0: $result['ISO'] = isset($exif['SubIFD']['ISOSpeedRatings'])
? $exif['SubIFD']['ISOSpeedRatings'] : 'Unknown'; break;
case 15: $result['ISO'] = gettext("Auto"); break;
case 16: $result['ISO'] = gettext("50"); break;
case 17: $result['ISO'] = gettext("100"); break;
case 18: $result['ISO'] = gettext("200"); break;
case 19: $result['ISO'] = gettext("400"); break;
default: $result['ISO'] = gettext("Unknown");
}
$result['MeteringMode']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//17
switch($result['MeteringMode']) {
case 3: $result['MeteringMode'] = gettext("Evaluative"); break;
case 4: $result['MeteringMode'] = gettext("Partial"); break;
case 5: $result['MeteringMode'] = gettext("Center-weighted"); break;
default: $result['MeteringMode'] = gettext("Unknown");
}
$result['FocusType']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//18
switch($result['FocusType']) {
case 0: $result['FocusType'] = gettext("Manual"); break;
case 1: $result['FocusType'] = gettext("Auto"); break;
case 3: $result['FocusType'] = gettext("Close-up (Macro)"); break;
case 8: $result['FocusType'] = gettext("Locked (Pan Mode)"); break;
default: $result['FocusType'] = gettext("Unknown");
}
$result['AFPointSelected']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//19
switch($result['AFPointSelected']) {
case 12288: $result['AFPointSelected'] = gettext("Manual Focus"); break;
case 12289: $result['AFPointSelected'] = gettext("Auto Selected"); break;
case 12290: $result['AFPointSelected'] = gettext("Right"); break;
case 12291: $result['AFPointSelected'] = gettext("Center"); break;
case 12292: $result['AFPointSelected'] = gettext("Left"); break;
default: $result['AFPointSelected'] = gettext("Unknown");
}
$result['ExposureMode']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//20
switch($result['ExposureMode']) {
case 0: $result['ExposureMode'] = gettext("EasyShoot"); break;
case 1: $result['ExposureMode'] = gettext("Program"); break;
case 2: $result['ExposureMode'] = gettext("Tv"); break;
case 3: $result['ExposureMode'] = gettext("Av"); break;
case 4: $result['ExposureMode'] = gettext("Manual"); break;
case 5: $result['ExposureMode'] = gettext("Auto-DEP"); break;
default: $result['ExposureMode'] = gettext("Unknown");
}
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//21
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//22
$result['LongFocalLength']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//23
$result['LongFocalLength'] .= " focal units";
$result['ShortFocalLength']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//24
$result['ShortFocalLength'] .= " focal units";
$result['FocalUnits']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//25
$result['FocalUnits'] .= " per mm";
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//26
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//27
$result['FlashActivity']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//28
switch($result['FlashActivity']) {
case 0: $result['FlashActivity'] = gettext("Flash Did Not Fire"); break;
case 1: $result['FlashActivity'] = gettext("Flash Fired"); break;
default: $result['FlashActivity'] = gettext("Unknown");
}
$result['FlashDetails']=str_pad(base_convert(intel2Moto(substr($data,$place,4)), 16, 2), 16, "0", STR_PAD_LEFT);$place+=4;//29
$flashDetails = array();
if (substr($result['FlashDetails'], 1, 1) == 1) { $flashDetails[] = gettext('External E-TTL'); }
if (substr($result['FlashDetails'], 2, 1) == 1) { $flashDetails[] = gettext('Internal Flash'); }
if (substr($result['FlashDetails'], 4, 1) == 1) { $flashDetails[] = gettext('FP sync used'); }
if (substr($result['FlashDetails'], 8, 1) == 1) { $flashDetails[] = gettext('2nd(rear)-curtain sync used'); }
if (substr($result['FlashDetails'], 12, 1) == 1) { $flashDetails[] = gettext('1st curtain sync'); }
$result['FlashDetails']=implode(",", $flashDetails);
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//30
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//31
$anotherFocusMode=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//32
if(strpos(strtoupper($exif['IFD0']['Model']), "G1") !== false) {
switch($anotherFocusMode) {
case 0: $result['FocusMode'] = gettext("Single"); break;
case 1: $result['FocusMode'] = gettext("Continuous"); break;
default: $result['FocusMode'] = gettext("Unknown");
}
}
} else if($tag=="0004") { //second chunk
$result['Bytes']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//0
if ($result['Bytes'] != strlen($data) / 2) return $result; //Bad chunk
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//1
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//2
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//3
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//4
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//5
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//6
$result['WhiteBalance']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//7
switch($result['WhiteBalance']) {
case 0: $result['WhiteBalance'] = gettext("Auto"); break;
case 1: $result['WhiteBalance'] = gettext("Sunny"); break;
case 2: $result['WhiteBalance'] = gettext("Cloudy"); break;
case 3: $result['WhiteBalance'] = gettext("Tungsten"); break;
case 4: $result['WhiteBalance'] = gettext("Fluorescent"); break;
case 5: $result['WhiteBalance'] = gettext("Flash"); break;
case 6: $result['WhiteBalance'] = gettext("Custom"); break;
default: $result['WhiteBalance'] = gettext("Unknown");
}
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//8
$result['SequenceNumber']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//9
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//10
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//11
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//12
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//13
$result['AFPointUsed']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//14
$afPointUsed = array();
if ($result['AFPointUsed'] & 0x0001) $afPointUsed[] = gettext("Right"); //bit 0
if ($result['AFPointUsed'] & 0x0002) $afPointUsed[] = gettext("Center"); //bit 1
if ($result['AFPointUsed'] & 0x0004) $afPointUsed[] = gettext("Left"); //bit 2
if ($result['AFPointUsed'] & 0x0800) $afPointUsed[] = gettext("12"); //bit 12
if ($result['AFPointUsed'] & 0x1000) $afPointUsed[] = gettext("13"); //bit 13
if ($result['AFPointUsed'] & 0x2000) $afPointUsed[] = gettext("14"); //bit 14
if ($result['AFPointUsed'] & 0x4000) $afPointUsed[] = gettext("15"); //bit 15
$result['AFPointUsed'] = implode(",", $afPointUsed);
$result['FlashBias']=intel2Moto(substr($data,$place,4));$place+=4;//15
switch($result['FlashBias']) {
case 'ffc0': $result['FlashBias'] = "-2 EV"; break;
case 'ffcc': $result['FlashBias'] = "-1.67 EV"; break;
case 'ffd0': $result['FlashBias'] = "-1.5 EV"; break;
case 'ffd4': $result['FlashBias'] = "-1.33 EV"; break;
case 'ffe0': $result['FlashBias'] = "-1 EV"; break;
case 'ffec': $result['FlashBias'] = "-0.67 EV"; break;
case 'fff0': $result['FlashBias'] = "-0.5 EV"; break;
case 'fff4': $result['FlashBias'] = "-0.33 EV"; break;
case '0000': $result['FlashBias'] = "0 EV"; break;
case '000c': $result['FlashBias'] = "0.33 EV"; break;
case '0010': $result['FlashBias'] = "0.5 EV"; break;
case '0014': $result['FlashBias'] = "0.67 EV"; break;
case '0020': $result['FlashBias'] = "1 EV"; break;
case '002c': $result['FlashBias'] = "1.33 EV"; break;
case '0030': $result['FlashBias'] = "1.5 EV"; break;
case '0034': $result['FlashBias'] = "1.67 EV"; break;
case '0040': $result['FlashBias'] = "2 EV"; break;
default: $result['FlashBias'] = gettext("Unknown");
}
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//16
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//17
$result['Unknown']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//18
$result['SubjectDistance']=hexdec(intel2Moto(substr($data,$place,4)));$place+=4;//19
$result['SubjectDistance'] .= "/100 m";
} else if($tag=="0008") { //image number
if($intel==1) $data = intel2Moto($data);
$data=hexdec($data);
$result = round($data/10000)."-".$data%10000;
} else if($tag=="000c") { //camera serial number
if($intel==1) $data = intel2Moto($data);
$data=hexdec($data);
$result = "#".bin2hex(substr($data,0,16)).substr($data,16,16);
}
} else if($type=="UNDEFINED") {
} else {
$data = bin2hex($data);
if($intel==1) $data = intel2Moto($data);
}
return $data;
}
//=================
// Cannon Special data section
// Useful: http://www.burren.cx/david/canon.html
// http://www.burren.cx/david/canon.html
// http://www.ozhiker.com/electronics/pjmt/jpeg_info/canon_mn.html
//====================================================================
function parseCanon($block,&$result,$seek, $globalOffset) {
$place = 0; //current place
if($result['Endien']=="Intel") $intel=1;
else $intel=0;
$model = $result['IFD0']['Model'];
//Get number of tags (2 bytes)
$num = bin2hex(substr($block,$place,2));$place+=2;
if($intel==1) $num = intel2Moto($num);
$result['SubIFD']['MakerNote']['MakerNoteNumTags'] = hexdec($num);
//loop thru all tags Each field is 12 bytes
for($i=0;$i<hexdec($num);$i++) {
//2 byte tag
$tag = bin2hex(substr($block,$place,2));$place+=2;
if($intel==1) $tag = intel2Moto($tag);
$tag_name = lookup_Canon_tag($tag);
//2 byte type
$type = bin2hex(substr($block,$place,2));$place+=2;
if($intel==1) $type = intel2Moto($type);
lookup_type($type,$size);
//4 byte count of number of data units
$count = bin2hex(substr($block,$place,4));$place+=4;
if($intel==1) $count = intel2Moto($count);
$bytesofdata = validSize($size*hexdec($count));
if($bytesofdata<=0) {
return; //if this value is 0 or less then we have read all the tags we can
}
//4 byte value of data or pointer to data
$value = substr($block,$place,4);$place+=4;
if($bytesofdata<=4) {
$data = substr($value,0,$bytesofdata);
} else {
$value = bin2hex($value);
if($intel==1) $value = intel2Moto($value);
$v = fseek($seek,$globalOffset+hexdec($value)); //offsets are from TIFF header which is 12 bytes from the start of the file
if (isset($GLOBALS['exiferFileSize'])) {
$exiferFileSize = $GLOBALS['exiferFileSize'];
} else {
$exiferFileSize = 0;
}
if($v==0 && $bytesofdata < $exiferFileSize) {
$data = fread($seek, $bytesofdata);
} else if($v==-1) {
$result['Errors'] = $result['Errors']++;
$data = '';
} else {
$data = '';
}
}
$result['SubIFD']['MakerNote'][$tag_name] = ''; // insure the index exists
$formated_data = formatCanonData($type,$tag,$intel,$data,$result,$result['SubIFD']['MakerNote'][$tag_name]);
if($result['VerboseOutput']==1) {
//$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
if($type=="URATIONAL" || $type=="SRATIONAL" || $type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
$data = bin2hex($data);
if($intel==1) $data = intel2Moto($data);
}
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['RawData'] = $data;
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Type'] = $type;
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Bytes'] = $bytesofdata;
} else {
//$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
}
}
}
?>

247
-child/exifer/makers/fujifilm.php Executable file
View File

@@ -0,0 +1,247 @@
<?php //================================================================================================
//================================================================================================
//================================================================================================
/*
Exifer
Extracts EXIF information from digital photos.
Copyright <20> 2003 Jake Olefsky
http://www.offsky.com/software/exif/index.php
jake@olefsky.com
Please see exif.php for the complete information about this software.
------------
This program is free software; you can redistribute it and/or modify it under the terms of
the GNU General Public License as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details. http://www.gnu.org/copyleft/gpl.html
*/
//================================================================================================
//================================================================================================
//================================================================================================
//=================
// Looks up the name of the tag for the MakerNote (Depends on Manufacturer)
//====================================================================
function lookup_Fujifilm_tag($tag) {
switch($tag) {
case "0000": $tag = "Version";break;
case "1000": $tag = "Quality";break;
case "1001": $tag = "Sharpness";break;
case "1002": $tag = "WhiteBalance";break;
case "1003": $tag = "Color";break;
case "1004": $tag = "Tone";break;
case "1010": $tag = "FlashMode";break;
case "1011": $tag = "FlashStrength";break;
case "1020": $tag = "Macro";break;
case "1021": $tag = "FocusMode";break;
case "1030": $tag = "SlowSync";break;
case "1031": $tag = "PictureMode";break;
case "1100": $tag = "ContinuousTakingBracket";break;
case "1200": $tag = "Unknown";break;
case "1300": $tag = "BlurWarning";break;
case "1301": $tag = "FocusWarning";break;
case "1302": $tag = "AEWarning";break;
default: $tag = "unknown:".$tag;break;
}
return $tag;
}
//=================
// Formats Data for the data type
//====================================================================
function formatFujifilmData($type,$tag,$intel,$data) {
if($type=="ASCII") {
} else if($type=="URATIONAL" || $type=="SRATIONAL") {
$data = unRational($data,$type,$intel);
if($tag=="1011") { //FlashStrength
$data=$data." EV";
}
} else if($type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
$data =rational($data,$type,$intel);
if($tag=="1001") { //Sharpness
if($data == 1) $data = gettext("Soft");
else if($data == 2) $data = gettext("Soft");
else if($data == 3) $data = gettext("Normal");
else if($data == 4) $data = gettext("Hard");
else if($data == 5) $data = gettext("Hard");
else $data = gettext("Unknown").": ".$data;
}
if($tag=="1002") { //WhiteBalance
if($data == 0) $data = gettext("Auto");
else if($data == 256) $data = gettext("Daylight");
else if($data == 512) $data = gettext("Cloudy");
else if($data == 768) $data = gettext("DaylightColor-fluorescence");
else if($data == 769) $data = gettext("DaywhiteColor-fluorescence");
else if($data == 770) $data = gettext("White-fluorescence");
else if($data == 1024) $data = gettext("Incandescence");
else if($data == 3840) $data = gettext("Custom");
else $data = gettext("Unknown").": ".$data;
}
if($tag=="1003") { //Color
if($data == 0) $data = gettext("Chroma Saturation Normal(STD)");
else if($data == 256) $data = gettext("Chroma Saturation High");
else if($data == 512) $data = gettext("Chroma Saturation Low(ORG)");
else $data = gettext("Unknown: ").$data;
}
if($tag=="1004") { //Tone
if($data == 0) $data = gettext("Contrast Normal(STD)");
else if($data == 256) $data = gettext("Contrast High(HARD)");
else if($data == 512) $data = gettext("Contrast Low(ORG)");
else $data = gettext("Unknown: ").$data;
}
if($tag=="1010") { //FlashMode
if($data == 0) $data = gettext("Auto");
else if($data == 1) $data = gettext("On");
else if($data == 2) $data = gettext("Off");
else if($data == 3) $data = gettext("Red-Eye Reduction");
else $data = gettext("Unknown: ").$data;
}
if($tag=="1020") { //Macro
if($data == 0) $data = gettext("Off");
else if($data == 1) $data = gettext("On");
else $data = gettext("Unknown: ").$data;
}
if($tag=="1021") { //FocusMode
if($data == 0) $data = gettext("Auto");
else if($data == 1) $data = gettext("Manual");
else $data = gettext("Unknown: ").$data;
}
if($tag=="1030") { //SlowSync
if($data == 0) $data = gettext("Off");
else if($data == 1) $data = gettext("On");
else $data = gettext("Unknown: ").$data;
}
if($tag=="1031") { //PictureMode
if($data == 0) $data = gettext("Auto");
else if($data == 1) $data = gettext("Portrait");
else if($data == 2) $data = gettext("Landscape");
else if($data == 4) $data = gettext("Sports");
else if($data == 5) $data = gettext("Night");
else if($data == 6) $data = gettext("Program AE");
else if($data == 256) $data = gettext("Aperture Priority AE");
else if($data == 512) $data = gettext("Shutter Priority");
else if($data == 768) $data = gettext("Manual Exposure");
else $data = gettext("Unknown: ").$data;
}
if($tag=="1100") { //ContinuousTakingBracket
if($data == 0) $data = gettext("Off");
else if($data == 1) $data = gettext("On");
else $data = gettext("Unknown: ").$data;
}
if($tag=="1300") { //BlurWarning
if($data == 0) $data = gettext("No Warning");
else if($data == 1) $data = gettext("Warning");
else $data = gettext("Unknown: ").$data;
}
if($tag=="1301") { //FocusWarning
if($data == 0) $data = gettext("Auto Focus Good");
else if($data == 1) $data = gettext("Out of Focus");
else $data = gettext("Unknown: ").$data;
}
if($tag=="1302") { //AEWarning
if($data == 0) $data = gettext("AE Good");
else if($data == 1) $data = gettext("Over Exposure");
else $data = gettext("Unknown: ").$data;
}
} else if($type=="UNDEFINED") {
} else {
$data = bin2hex($data);
if($intel==1) $data = intel2Moto($data);
}
return $data;
}
//=================
// Fujifilm Special data section
//====================================================================
function parseFujifilm($block,&$result) {
//if($result['Endien']=="Intel") $intel=1;
//else $intel=0;
$intel=1;
$model = $result['IFD0']['Model'];
$place=8; //current place
$offset=8;
$num = bin2hex(substr($block,$place,4));$place+=4;
if($intel==1) $num = intel2Moto($num);
$result['SubIFD']['MakerNote']['Offset'] = hexdec($num);
//Get number of tags (2 bytes)
$num = bin2hex(substr($block,$place,2));$place+=2;
if($intel==1) $num = intel2Moto($num);
$result['SubIFD']['MakerNote']['MakerNoteNumTags'] = hexdec($num);
//loop thru all tags Each field is 12 bytes
for($i=0;$i<hexdec($num);$i++) {
//2 byte tag
$tag = bin2hex(substr($block,$place,2));$place+=2;
if($intel==1) $tag = intel2Moto($tag);
$tag_name = lookup_Fujifilm_tag($tag);
//2 byte type
$type = bin2hex(substr($block,$place,2));$place+=2;
if($intel==1) $type = intel2Moto($type);
lookup_type($type,$size);
//4 byte count of number of data units
$count = bin2hex(substr($block,$place,4));$place+=4;
if($intel==1) $count = intel2Moto($count);
$bytesofdata = validSize($size*hexdec($count));
//4 byte value of data or pointer to data
$value = substr($block,$place,4);$place+=4;
if($bytesofdata<=4) {
$data = substr($value,0,$bytesofdata);
} else {
$value = bin2hex($value);
if($intel==1) $value = intel2Moto($value);
$data = substr($block,hexdec($value)-$offset,$bytesofdata*2);
}
$formated_data = formatFujifilmData($type,$tag,$intel,$data);
if($result['VerboseOutput']==1) {
$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
if($type=="URATIONAL" || $type=="SRATIONAL" || $type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
$data = bin2hex($data);
if($intel==1) $data = intel2Moto($data);
}
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['RawData'] = $data;
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Type'] = $type;
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Bytes'] = $bytesofdata;
} else {
$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
}
}
}
?>

218
-child/exifer/makers/gps.php Executable file
View File

@@ -0,0 +1,218 @@
<?php //================================================================================================
//================================================================================================
//================================================================================================
/*
Exifer
Extracts EXIF information from digital photos.
Copyright © 2003 Jake Olefsky
http://www.offsky.com/software/exif/index.php
jake@olefsky.com
Please see exif.php for the complete information about this software.
------------
This program is free software; you can redistribute it and/or modify it under the terms of
the GNU General Public License as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details. http://www.gnu.org/copyleft/gpl.html
*/
//================================================================================================
//================================================================================================
//================================================================================================
//=================
// Looks up the name of the tag
//====================================================================
function lookup_GPS_tag($tag) {
switch($tag) {
case "0000": $tag = "Version";break;
case "0001": $tag = "Latitude Reference";break; //north or south
case "0002": $tag = "Latitude";break; //dd mm.mm or dd mm ss
case "0003": $tag = "Longitude Reference";break; //east or west
case "0004": $tag = "Longitude";break; //dd mm.mm or dd mm ss
case "0005": $tag = "Altitude Reference";break; //sea level or below sea level
case "0006": $tag = "Altitude";break; //positive rational number
case "0007": $tag = "Time";break; //three positive rational numbers
case "0008": $tag = "Satellite";break; //text string up to 999 bytes long
case "0009": $tag = "ReceiveStatus";break; //in progress or interop
case "000a": $tag = "MeasurementMode";break; //2D or 3D
case "000b": $tag = "MeasurementPrecision";break; //positive rational number
case "000c": $tag = "SpeedUnit";break; //KPH, MPH, knots
case "000d": $tag = "ReceiverSpeed";break; //positive rational number
case "000e": $tag = "MovementDirectionRef";break; //true or magnetic north
case "000f": $tag = "MovementDirection";break; //positive rational number
case "0010": $tag = "ImageDirectionRef";break; //true or magnetic north
case "0011": $tag = "ImageDirection";break; //positive rational number
case "0012": $tag = "GeodeticSurveyData";break; //text string up to 999 bytes long
case "0013": $tag = "DestLatitudeRef";break; //north or south
case "0014": $tag = "DestinationLatitude";break; //three positive rational numbers
case "0015": $tag = "DestLongitudeRef";break; //east or west
case "0016": $tag = "DestinationLongitude";break; //three positive rational numbers
case "0017": $tag = "DestBearingRef";break; //true or magnetic north
case "0018": $tag = "DestinationBearing";break; //positive rational number
case "0019": $tag = "DestDistanceRef";break; //km, miles, knots
case "001a": $tag = "DestinationDistance";break; //positive rational number
case "001b": $tag = "ProcessingMethod";break;
case "001c": $tag = "AreaInformation";break;
case "001d": $tag = "Datestamp";break; //text string 10 bytes long
case "001e": $tag = "DifferentialCorrection";break; //integer in range 0-65535
default: $tag = "unknown:".$tag;break;
}
return $tag;
}
//=================
// Formats Data for the data type
//====================================================================
function formatGPSData($type,$tag,$intel,$data) {
if($type=="ASCII") {
if($tag=="0001" || $tag=="0003"){ // Latitude Reference, Longitude Reference
$data = ($data{1} == @$data{2} && @$data{1} == @$data{3}) ? $data{0} : $data;
}
} else if($type=="URATIONAL" || $type=="SRATIONAL") {
if($tag=="0002" || $tag=="0004" || $tag=='0007') { //Latitude, Longitude, Time
$datum = array();
for ($i=0;$i<strlen($data);$i=$i+8) {
array_push($datum,substr($data, $i, 8));
}
$hour = unRational($datum[0],$type,$intel);
$minutes = unRational($datum[1],$type,$intel);
$seconds = unRational($datum[2],$type,$intel);
if($tag=="0007") { //Time
$data = $hour.":".$minutes.":".$seconds;
} else {
$data = $hour+$minutes/60+$seconds/3600;
}
} else {
$data = unRational($data,$type,$intel);
if($tag=="0006"){
$data .= 'm';
}
}
} else if($type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
$data = rational($data,$type,$intel);
} else if($type=="UNDEFINED") {
} else if($type=="UBYTE") {
$data = bin2hex($data);
if($intel==1) $num = intel2Moto($data);
if($tag=="0000") { // VersionID
$data = hexdec(substr($data,0,2)) .
".". hexdec(substr($data,2,2)) .
".". hexdec(substr($data,4,2)) .
".". hexdec(substr($data,6,2));
} else if($tag=="0005"){ // Altitude Reference
if($data == "00000000"){ $data = '+'; }
else if($data == "01000000"){ $data = '-'; }
}
} else {
$data = bin2hex($data);
if($intel==1) $data = intel2Moto($data);
}
return $data;
}
//=================
// GPS Special data section
// Useful websites
// http://drewnoakes.com/code/exif/sampleOutput.html
// http://www.geosnapper.com
//====================================================================
function parseGPS($block,&$result,$offset,$seek, $globalOffset) {
if($result['Endien']=="Intel") $intel=1;
else $intel=0;
$v = fseek($seek,$globalOffset+$offset); //offsets are from TIFF header which is 12 bytes from the start of the file
if($v==-1) {
$result['Errors'] = $result['Errors']++;
}
$num = bin2hex(fread( $seek, 2 ));
if($intel==1) $num = intel2Moto($num);
$num=hexdec($num);
$result['GPS']['NumTags'] = $num;
if ($num == 0) {
return;
}
$block = fread( $seek, $num*12 );
$place = 0;
//loop thru all tags Each field is 12 bytes
for($i=0;$i<$num;$i++) {
//2 byte tag
$tag = bin2hex(substr($block,$place,2));$place+=2;
if($intel==1) $tag = intel2Moto($tag);
$tag_name = lookup_GPS_tag($tag);
//2 byte datatype
$type = bin2hex(substr($block,$place,2));$place+=2;
if($intel==1) $type = intel2Moto($type);
lookup_type($type,$size);
//4 byte number of elements
$count = bin2hex(substr($block,$place,4));$place+=4;
if($intel==1) $count = intel2Moto($count);
$bytesofdata = validSize($size*hexdec($count));
//4 byte value or pointer to value if larger than 4 bytes
$value = substr($block,$place,4);$place+=4;
if($bytesofdata<=4) {
$data = substr($value,0,$bytesofdata);
} else {
if (strpos('unknown',$tag_name) !== false || $bytesofdata > 1024) {
$result['Errors'] = $result['Errors']++;
$data = '';
$type = 'ASCII';
} else {
$value = bin2hex($value);
if($intel==1) $value = intel2Moto($value);
$v = fseek($seek,$globalOffset+hexdec($value)); //offsets are from TIFF header which is 12 bytes from the start of the file
if($v==0) {
$data = fread($seek, $bytesofdata);
} else {
$result['Errors'] = $result['Errors']++;
$data = '';
$type = 'ASCII';
}
}
}
if($result['VerboseOutput']==1) {
$result['GPS'][$tag_name] = formatGPSData($type,$tag,$intel,$data);
$result['GPS'][$tag_name."_Verbose"]['RawData'] = bin2hex($data);
$result['GPS'][$tag_name."_Verbose"]['Type'] = $type;
$result['GPS'][$tag_name."_Verbose"]['Bytes'] = $bytesofdata;
} else {
$result['GPS'][$tag_name] = formatGPSData($type,$tag,$intel,$data);
}
}
}
?>

411
-child/exifer/makers/nikon.php Executable file
View File

@@ -0,0 +1,411 @@
<?php //================================================================================================
//================================================================================================
//================================================================================================
/*
Exifer
Extracts EXIF information from digital photos.
Copyright <20> 2003 Jake Olefsky
http://www.offsky.com/software/exif/index.php
jake@olefsky.com
Please see exif.php for the complete information about this software.
------------
This program is free software; you can redistribute it and/or modify it under the terms of
the GNU General Public License as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details. http://www.gnu.org/copyleft/gpl.html
*/
//================================================================================================
//================================================================================================
//================================================================================================
//=================
// Looks up the name of the tag for the MakerNote (Depends on Manufacturer)
//====================================================================
function lookup_Nikon_tag($tag,$model) {
if($model==0) {
switch($tag) {
case "0003": $tag = "Quality";break;
case "0004": $tag = "ColorMode";break;
case "0005": $tag = "ImageAdjustment";break;
case "0006": $tag = "CCDSensitivity";break;
case "0007": $tag = "WhiteBalance";break;
case "0008": $tag = "Focus";break;
case "0009": $tag = "Unknown2";break;
case "000a": $tag = "DigitalZoom";break;
case "000b": $tag = gettext("Converter");break;
default: $tag = "unknown:".$tag;break;
}
} else if($model==1) {
switch($tag) {
case "0002": $tag = "ISOSetting";break;
case "0003": $tag = "ColorMode";break;
case "0004": $tag = "Quality";break;
case "0005": $tag = "Whitebalance";break;
case "0006": $tag = "ImageSharpening";break;
case "0007": $tag = "FocusMode";break;
case "0008": $tag = "FlashSetting";break;
case "0009": $tag = "FlashMode";break;
case "000b": $tag = "WhiteBalanceFine";break;
case "000c": $tag = "WB_RBLevels";break;
case "000d": $tag = "ProgramShift";break;
case "000e": $tag = "ExposureDifference";break;
case "000f": $tag = "ISOSelection";break;
case "0010": $tag = "DataDump";break;
case "0011": $tag = "NikonPreview";break;
case "0012": $tag = "FlashExposureComp";break;
case "0013": $tag = "ISOSetting2";break;
case "0014": $tag = "ColorBalanceA";break;
case "0016": $tag = "ImageBoundary";break;
case "0017": $tag = "FlashExposureComp";break;
case "0018": $tag = "FlashExposureBracketValue";break;
case "0019": $tag = "ExposureBracketValue";break;
case "001a": $tag = "ImageProcessing";break;
case "001b": $tag = "CropHiSpeed";break;
case "001c": $tag = "ExposureTuning";break;
case "001d": $tag = "SerialNumber";break;
case "001e": $tag = "ColorSpace";break;
case "001f": $tag = "VRInfo";break;
case "0020": $tag = "ImageAuthentication";break;
case "0022": $tag = "ActiveD-Lighting";break;
case "0023": $tag = "PictureControl";break;
case "0024": $tag = "WorldTime";break;
case "0025": $tag = "ISOInfo";break;
case "002a": $tag = "VignetteControl";break;
case "002b": $tag = "DistortInfo";break;
case "0080": $tag = "ImageAdjustment";break;
case "0081": $tag = "ToneCompensation";break;
case "0082": $tag = "Adapter";break;
case "0083": $tag = "LensType";break;
case "0084": $tag = "LensInfo";break;
case "0085": $tag = "ManualFocusDistance";break;
case "0086": $tag = "DigitalZoom";break;
case "0087": $tag = "FlashUsed";break;
case "0088": $tag = "AFFocusPosition";break;
case "0089": $tag = "ShootingMode";break;
case "008b": $tag = "LensFStops";break;
case "008c": $tag = "ContrastCurve";break;
case "008d": $tag = "ColorMode";break;
case "0090": $tag = "LightType";break;
case "0092": $tag = "HueAdjustment";break;
case "0093": $tag = "NEFCompression";break;
case "0094": $tag = "Saturation";break;
case "0095": $tag = "NoiseReduction";break;
case "009a": $tag = "SensorPixelSize";break;
default: $tag = "unknown:".$tag;break;
}
}
return $tag;
}
//=================
// Formats Data for the data type
//====================================================================
function formatNikonData($type,$tag,$intel,$model,$data) {
switch ($type) {
case "ASCII":
break; // do nothing!
case "URATIONAL":
case"SRATIONAL":
switch ($tag) {
case '0084': // LensInfo
$minFL = unRational(substr($data,0,8),$type,$intel);
$maxFL = unRational(substr($data,8,8),$type,$intel);
$minSP = unRational(substr($data,16,8),$type,$intel);
$maxSP = unRational(substr($data,24,8),$type,$intel);
if ($minFL == $maxFL) {
$data = sprintf('%0.0fmm f/%0.1f',$minFL,$minSP);
} elseif ($minSP == $maxSP) {
$data = sprintf('%0.0f-%0.0fmm f/%0.1f',$minFL,$maxFL,$minSP);
} else {
$data = sprintf('%0.0f-%0.0fmm f/%0.1f-%0.1f',$minFL,$maxFL,$minSP,$maxSP);
}
break;
case "0085":
if ($model==1) $data=unRational($data,$type,$intel)." m"; //ManualFocusDistance
break;
case "0086":
if ($model==1) $data=unRational($data,$type,$intel)."x"; //DigitalZoom
break;
case "000a":
if ($model==0) $data=unRational($data,$type,$intel)."x"; //DigitalZoom
break;
default:
$data=unRational($data,$type,$intel);
break;
}
break;
case "USHORT":
case $type=="SSHORT":
case $type=="ULONG":
case $type=="SLONG":
case $type=="FLOAT":
case $type=="DOUBLE":
$data = rational($data,$type,$intel);
switch ($tag) {
case "0003":
if ($model==0) { //Quality
switch ($data) {
case 1: $data = gettext("VGA Basic"); break;
case 2: $data = gettext("VGA Normal"); break;
case 3: $data = gettext("VGA Fine"); break;
case 4: $data = gettext("SXGA Basic"); break;
case 5: $data = gettext("SXGA Normal"); break;
case 6: $data = gettext("SXGA Fine"); break;
default: $data = gettext("Unknown").": ".$data; break;
}
}
break;
case "0004":
if ($model==0) { //Color
switch ($data) {
case 1: $data = gettext("Color"); break;
case 2: $data = gettext("Monochrome"); break;
default: $data = gettext("Unknown").": ".$data; break;
}
}
break;
case "0005":
if ($model==0) { //Image Adjustment
switch ($data) {
case 0: $data = gettext("Normal"); break;
case 1: $data = gettext("Bright+"); break;
case 2: $data = gettext("Bright-"); break;
case 3: $data = gettext("Contrast+"); break;
case 4: $data = gettext("Contrast-"); break;
default: $data = gettext("Unknown").": ".$data; break;
}
}
break;
case "0006":
if ($model==0) { //CCD Sensitivity
switch($data) {
case 0: $data = "ISO-80"; break;
case 2: $data = "ISO-160"; break;
case 4: $data = "ISO-320"; break;
case 5: $data = "ISO-100"; break;
default: $data = gettext("Unknown").": ".$data; break;
}
}
break;
case "0007":
if ($model==0) { //White Balance
switch ($data) {
case 0: $data = gettext("Auto"); break;
case 1: $data = gettext("Preset"); break;
case 2: $data = gettext("Daylight"); break;
case 3: $data = gettext("Incandescence"); break;
case 4: $data = gettext("Fluorescence"); break;
case 5: $data = gettext("Cloudy"); break;
case 6: $data = gettext("SpeedLight"); break;
default: $data = gettext("Unknown").": ".$data; break;
}
}
break;
case "000b":
if ($model==0) { //Converter
switch ($data) {
case 0: $data = gettext("None"); break;
case 1: $data = gettext("Fisheye"); break;
default: $data = gettext("Unknown").": ".$data; break;
}
}
break;
}
break;
case "UNDEFINED":
switch ($tag) {
case "0001":
if ($model==1) $data=$data/100; break; //Unknown (Version?)
break;
case "0088":
if ($model==1) { //AF Focus Position
$temp = gettext("Center");
$data = bin2hex($data);
$data = str_replace("01","Top",$data);
$data = str_replace("02","Bottom",$data);
$data = str_replace("03","Left",$data);
$data = str_replace("04","Right",$data);
$data = str_replace("00","",$data);
if(strlen($data)==0) $data = $temp;
}
break;
}
break;
default:
$data = bin2hex($data);
if($intel==1) $data = intel2Moto($data);
switch ($tag) {
case "0083":
if ($model==1) { //Lens Type
$data = hexdec(substr($data,0,2));
switch ($data) {
case 0: $data = gettext("AF non D"); break;
case 1: $data = gettext("Manual"); break;
case 2: $data = "AF-D or AF-S"; break;
case 6: $data = "AF-D G"; break;
case 10: $data = "AF-D VR"; break;
case 14: $data = "AF-D G VR"; break;
default: $data = gettext("Unknown").": ".$data; break;
}
}
break;
case "0087":
if ($model==1) { //Flash type
$data = hexdec(substr($data,0,2));
if($data == 0) $data = gettext("Did Not Fire");
else if($data == 4) $data = gettext("Unknown");
else if($data == 7) $data = gettext("External");
else if($data == 9) $data = gettext("On Camera");
else $data = gettext("Unknown").": ".$data;
}
break;
}
break;
}
return $data;
}
//=================
// Nikon Special data section
//====================================================================
function parseNikon($block,&$result) {
if($result['Endien']=="Intel") $intel=1;
else $intel=0;
$model = $result['IFD0']['Model'];
//these 6 models start with "Nikon". Other models dont.
if($model=="E700\0" || $model=="E800\0" || $model=="E900\0" || $model=="E900S\0" || $model=="E910\0" || $model=="E950\0") {
$place=8; //current place
$model = 0;
//Get number of tags (2 bytes)
$num = bin2hex(substr($block,$place,2));$place+=2;
if($intel==1) $num = intel2Moto($num);
$result['SubIFD']['MakerNote']['MakerNoteNumTags'] = hexdec($num);
//loop thru all tags Each field is 12 bytes
for($i=0;$i<hexdec($num);$i++) {
//2 byte tag
$tag = bin2hex(substr($block,$place,2));$place+=2;
if($intel==1) $tag = intel2Moto($tag);
$tag_name = lookup_Nikon_tag($tag, $model);
//2 byte type
$type = bin2hex(substr($block,$place,2));$place+=2;
if($intel==1) $type = intel2Moto($type);
lookup_type($type,$size);
//4 byte count of number of data units
$count = bin2hex(substr($block,$place,4));$place+=4;
if($intel==1) $count = intel2Moto($count);
$bytesofdata = validSize($size*hexdec($count));
//4 byte value of data or pointer to data
$value = substr($block,$place,4);$place+=4;
//if tag is 0002 then its the ASCII value which we know is at 140 so calc offset
//THIS HACK ONLY WORKS WITH EARLY NIKON MODELS
if($tag=="0002") $offset = hexdec($value)-140;
if($bytesofdata<=4) {
$data = substr($value,0,$bytesofdata);
} else {
$value = bin2hex($value);
if($intel==1) $value = intel2Moto($value);
$data = substr($block,hexdec($value)-$offset,$bytesofdata*2);
}
$formated_data = formatNikonData($type,$tag,$intel,$model,$data);
if($result['VerboseOutput']==1) {
$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['RawData'] = $data;
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Type'] = $type;
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Bytes'] = $bytesofdata;
} else {
$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
}
}
} else {
$place=0;//current place
$model = 1;
$nikon = substr($block,$place,8);$place+=8;
$endien = substr($block,$place,4);$place+=4;
//2 bytes of 0x002a
$tag = bin2hex(substr($block,$place,2));$place+=2;
//Then 4 bytes of offset to IFD0 (usually 8 which includes all 8 bytes of TIFF header)
$offset = bin2hex(substr($block,$place,4));$place+=4;
if($intel==1) $offset = intel2Moto($offset);
if(hexdec($offset)>8) $place+=$offset-8;
//Get number of tags (2 bytes)
$num = bin2hex(substr($block,$place,2));$place+=2;
if($intel==1) $num = intel2Moto($num);
//loop thru all tags Each field is 12 bytes
for($i=0;$i<hexdec($num);$i++) {
//2 byte tag
$tag = bin2hex(substr($block,$place,2));$place+=2;
if($intel==1) $tag = intel2Moto($tag);
$tag_name = lookup_Nikon_tag($tag, $model);
//2 byte type
$type = bin2hex(substr($block,$place,2));$place+=2;
if($intel==1) $type = intel2Moto($type);
lookup_type($type,$size);
//4 byte count of number of data units
$count = bin2hex(substr($block,$place,4));$place+=4;
if($intel==1) $count = intel2Moto($count);
$bytesofdata = validSize($size*hexdec($count));
//4 byte value of data or pointer to data
$value = substr($block,$place,4);$place+=4;
if($bytesofdata<=4) {
$data = substr($value,0,$bytesofdata);
} else {
$value = bin2hex($value);
if($intel==1) $value = intel2Moto($value);
$data = substr($block,hexdec($value)+hexdec($offset)+2,$bytesofdata);
}
$formated_data = formatNikonData($type,$tag,$intel,$model,$data);
if($result['VerboseOutput']==1) {
$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
if($type=="URATIONAL" || $type=="SRATIONAL" || $type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
$data = bin2hex($data);
if($intel==1) $data = intel2Moto($data);
}
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['RawData'] = $data;
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Type'] = $type;
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Bytes'] = $bytesofdata;
} else {
$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
}
}
}
}
?>

189
-child/exifer/makers/olympus.php Executable file
View File

@@ -0,0 +1,189 @@
<?php //================================================================================================
//================================================================================================
//================================================================================================
/*
Exifer
Extracts EXIF information from digital photos.
Copyright <20> 2003 Jake Olefsky
http://www.offsky.com/software/exif/index.php
jake@olefsky.com
Please see exif.php for the complete information about this software.
------------
This program is free software; you can redistribute it and/or modify it under the terms of
the GNU General Public License as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details. http://www.gnu.org/copyleft/gpl.html
*/
//================================================================================================
//================================================================================================
//================================================================================================
//=================
// Looks up the name of the tag for the MakerNote (Depends on Manufacturer)
//====================================================================
function lookup_Olympus_tag($tag) {
switch($tag) {
case "0200": $tag = "SpecialMode";break;
case "0201": $tag = "JpegQual";break;
case "0202": $tag = "Macro";break;
case "0203": $tag = "Unknown1";break;
case "0204": $tag = "DigiZoom";break;
case "0205": $tag = "Unknown2";break;
case "0206": $tag = "Unknown3";break;
case "0207": $tag = "SoftwareRelease";break;
case "0208": $tag = "PictInfo";break;
case "0209": $tag = "CameraID";break;
case "0f00": $tag = "DataDump";break;
default: $tag = "unknown:".$tag;break;
}
return $tag;
}
//=================
// Formats Data for the data type
//====================================================================
function formatOlympusData($type,$tag,$intel,$data) {
if($type=="ASCII") {
} else if($type=="URATIONAL" || $type=="SRATIONAL") {
$data = unRational($data,$type,$intel);
if($intel==1) $data = intel2Moto($data);
if($tag=="0204") { //DigitalZoom
$data=$data."x";
}
if($tag=="0205") { //Unknown2
}
} else if($type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
$data = rational($data,$type,$intel);
if($tag=="0201") { //JPEGQuality
if($data == 1) $data = "SQ";
else if($data == 2) $data = "HQ";
else if($data == 3) $data = "SHQ";
else $data = gettext("Unknown").": ".$data;
}
if($tag=="0202") { //Macro
if($data == 0) $data = "Normal";
else if($data == 1) $data = "Macro";
else $data = gettext("Unknown").": ".$data;
}
} else if($type=="UNDEFINED") {
} else {
$data = bin2hex($data);
if($intel==1) $data = intel2Moto($data);
}
return $data;
}
//==============================================================================
// Olympus Special data section
// - Updated by Zenphoto for new header tag in E-410/E-510/E-3 cameras. 2/24/2008
//==============================================================================
function parseOlympus($block, &$result, $seek, $globalOffset) {
if($result['Endien']=="Intel") $intel = 1;
else $intel = 0;
$model = $result['IFD0']['Model'];
// New header for new DSLRs - Check for it because the
// number of bytes that count the IFD fields differ in each case.
// Fixed by Zenphoto 2/24/08
$new = false;
if (substr($block, 0, 8) == "OLYMPUS\x00") {
$new = true;
} else if (substr($block, 0, 7) == "OLYMP\x00\x01"
|| substr($block, 0, 7) == "OLYMP\x00\x02") {
$new = false;
} else {
// Header does not match known Olympus headers.
// This is not a valid OLYMPUS Makernote.
return false;
}
// Offset of IFD entry after Olympus header.
$place = 8;
$offset = 8;
// Get number of tags (1 or 2 bytes, depending on New or Old makernote)
$countfieldbits = $new ? 1 : 2;
// New makernote repeats 1-byte value twice, so increment $place by 2 in either case.
$num = bin2hex(substr($block, $place, $countfieldbits)); $place += 2;
if ($intel == 1) $num = intel2Moto($num);
$ntags = hexdec($num);
$result['SubIFD']['MakerNote']['MakerNoteNumTags'] = $ntags;
//loop thru all tags Each field is 12 bytes
for($i=0; $i < $ntags; $i++) {
//2 byte tag
$tag = bin2hex(substr($block, $place,2));
$place += 2;
if ($intel == 1) $tag = intel2Moto($tag);
$tag_name = lookup_Olympus_tag($tag);
//2 byte type
$type = bin2hex(substr($block, $place,2));
$place += 2;
if ($intel == 1) $type = intel2Moto($type);
lookup_type($type,$size);
//4 byte count of number of data units
$count = bin2hex(substr($block, $place,4));
$place+=4;
if ($intel == 1) $count = intel2Moto($count);
$bytesofdata = $size * hexdec($count);
//4 byte value of data or pointer to data
$value = substr($block, $place,4);
$place += 4;
if ($bytesofdata <= 4) {
$data = substr($value,0,$bytesofdata);
} else {
$value = bin2hex($value);
if($intel==1) $value = intel2Moto($value);
$v = fseek($seek,$globalOffset+hexdec($value)); //offsets are from TIFF header which is 12 bytes from the start of the file
if(isset($GLOBALS['exiferFileSize']) && $v == 0 && $bytesofdata < $GLOBALS['exiferFileSize']) {
$data = fread($seek, $bytesofdata);
} else {
$result['Errors'] = $result['Errors']++;
$data = '';
}
}
$formated_data = formatOlympusData($type,$tag,$intel,$data);
if($result['VerboseOutput']==1) {
$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
if($type=="URATIONAL" || $type=="SRATIONAL" || $type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
$data = bin2hex($data);
if($intel==1) $data = intel2Moto($data);
}
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['RawData'] = $data;
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Type'] = $type;
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Bytes'] = $bytesofdata;
} else {
$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
}
}
}
?>

View File

@@ -0,0 +1,292 @@
<?php
//================================================================================================
//================================================================================================
//================================================================================================
/*
Exifer
Extracts EXIF information from digital photos.
Copyright <20> 2003 Jake Olefsky
http://www.offsky.com/software/exif/index.php
jake@olefsky.com
Please see exif.php for the complete information about this software.
------------
This program is free software; you can redistribute it and/or modify it under the terms of
the GNU General Public License as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details. http://www.gnu.org/copyleft/gpl.html
*/
//================================================================================================
//================================================================================================
//================================================================================================
//=================
// Looks up the name of the tag for the MakerNote (Depends on Manufacturer)
//====================================================================
function lookup_Panasonic_tag($tag) {
switch($tag) {
case "0001": $tag = "Quality";break;
case "0002": $tag = "FirmwareVersion";break;
case "0003": $tag = "WhiteBalance";break;
case "0007": $tag = "FocusMode";break;
case "000f": $tag = "AFMode";break;
case "001a": $tag = "ImageStabilizer";break;
case "001c": $tag = "MacroMode";break;
case "001f": $tag = "ShootingMode";break;
case "0020": $tag = "Audio";break;
case "0021": $tag = "DataDump";break;
case "0023": $tag = "WhiteBalanceBias";break;
case "0024": $tag = "FlashBias";break;
case "0025": $tag = "SerialNumber";break;
case "0028": $tag = "ColourEffect";break;
case "002a": $tag = "BurstMode";break;
case "002b": $tag = "SequenceNumber";break;
case "002c": $tag = "Contrast";break;
case "002d": $tag = "NoiseReduction";break;
case "002e": $tag = "SelfTimer";break;
case "0030": $tag = "Rotation";break;
case "0032": $tag = "ColorMode";break;
case "0036": $tag = "TravelDay";break;
default: $tag = "unknown:".$tag;break;
}
return $tag;
}
//=================
// Formats Data for the data type
//====================================================================
function formatPanasonicData($type,$tag,$intel,$data) {
if($type=="ASCII") {
} else if($type=="UBYTE" || $type=="SBYTE") {
$data = bin2hex($data);
if($intel==1) $data = intel2Moto($data);
$data=hexdec($data);
if($tag=="000f") { //AFMode
if($data == 256) $data = "9-area-focusing";
else if($data == 16) $data = "1-area-focusing";
else if($data == 4096) $data = gettext("3-area-focusing (High speed)");
else if($data == 4112) $data = gettext("1-area-focusing (High speed)");
else if($data == 16) $data = gettext("1-area-focusing");
else if($data == 1) $data = gettext("Spot-focusing");
else $data = "Unknown (".$data.")";
}
} else if($type=="URATIONAL" || $type=="SRATIONAL") {
$data = unRational($data,$type,$intel);
} else if($type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
$data = rational($data,$type,$intel);
if($tag=="0001") { //Image Quality
if($data == 2) $data = gettext("High");
else if($data == 3) $data = gettext("Standard");
else if($data == 6) $data = gettext("Very High");
else if($data == 7) $data = gettext("RAW");
else $data = gettext("Unknown")." (".$data.")";
}
if($tag=="0003") { //White Balance
if($data == 1) $data = gettext("Auto");
else if($data == 2) $data = gettext("Daylight");
else if($data == 3) $data = gettext("Cloudy");
else if($data == 4) $data = gettext("Halogen");
else if($data == 5) $data = gettext("Manual");
else if($data == 8) $data = gettext("Flash");
else if($data == 10) $data = gettext("Black and White");
else if($data == 11) $data = gettext("Manual");
else $data = gettext("Unknown")." (".$data.")";
}
if($tag=="0007") { //Focus Mode
if($data == 1) $data = gettext("Auto");
else if($data == 2) $data = gettext("Manual");
else if($data == 4) $data = gettext("Auto, Focus button");
else if($data == 5) $data = gettext("Auto, Continuous");
else $data = gettext("Unknown")." (".$data.")";
}
if($tag=="001a") { //Image Stabilizer
if($data == 2) $data = gettext("Mode 1");
else if($data == 3) $data = gettext("Off");
else if($data == 4) $data = gettext("Mode 2");
else $data = gettext("Unknown")." (".$data.")";
}
if($tag=="001c") { //Macro mode
if($data == 1) $data = gettext("On");
else if($data == 2) $data = gettext("Off");
else $data = gettext("Unknown")." (".$data.")";
}
if($tag=="001f") { //Shooting Mode
if($data == 1) $data = gettext("Normal");
else if($data == 2) $data = gettext("Portrait");
else if($data == 3) $data = gettext("Scenery");
else if($data == 4) $data = gettext("Sports");
else if($data == 5) $data = gettext("Night Portrait");
else if($data == 6) $data = gettext("Program");
else if($data == 7) $data = gettext("Aperture Priority");
else if($data == 8) $data = gettext("Shutter Priority");
else if($data == 9) $data = gettext("Macro");
else if($data == 11) $data = gettext("Manual");
else if($data == 13) $data = gettext("Panning");
else if($data == 14) $data = gettext("Simple");
else if($data == 18) $data = gettext("Fireworks");
else if($data == 19) $data = gettext("Party");
else if($data == 20) $data = gettext("Snow");
else if($data == 21) $data = gettext("Night Scenery");
else if($data == 22) $data = gettext("Food");
else if($data == 23) $data = gettext("Baby");
else if($data == 27) $data = gettext("High Sensitivity");
else if($data == 29) $data = gettext("Underwater");
else if($data == 33) $data = gettext("Pet");
else $data = gettext("Unknown")." (".$data.")";
}
if($tag=="0020") { //Audio
if($data == 1) $data = gettext("Yes");
else if($data == 2) $data = gettext("No");
else $data = gettext("Unknown")." (".$data.")";
}
if($tag=="0023") { //White Balance Bias
$data=$data." EV";
}
if($tag=="0024") { //Flash Bias
$data = $data;
}
if($tag=="0028") { //Colour Effect
if($data == 1) $data = gettext("Off");
else if($data == 2) $data = gettext("Warm");
else if($data == 3) $data = gettext("Cool");
else if($data == 4) $data = gettext("Black and White");
else if($data == 5) $data = gettext("Sepia");
else $data = gettext("Unknown")." (".$data.")";
}
if($tag=="002a") { //Burst Mode
if($data == 0) $data = gettext("Off");
else if($data == 1) $data = gettext("Low/High Quality");
else if($data == 2) $data = gettext("Infinite");
else $data = gettext("Unknown")." (".$data.")";
}
if($tag=="002c") { //Contrast
if($data == 0) $data = gettext("Standard");
else if($data == 1) $data = gettext("Low");
else if($data == 2) $data = gettext("High");
else $data = gettext("Unknown")." (".$data.")";
}
if($tag=="002d") { //Noise Reduction
if($data == 0) $data = gettext("Standard");
else if($data == 1) $data = gettext("Low");
else if($data == 2) $data = gettext("High");
else $data = gettext("Unknown")." (".$data.")";
}
if($tag=="002e") { //Self Timer
if($data == 1) $data = gettext("Off");
else if($data == 2) $data = gettext("10s");
else if($data == 3) $data = gettext("2s");
else $data = gettext("Unknown")." (".$data.")";
}
if($tag=="0030") { //Rotation
if($data == 1) $data = gettext("Horizontal (normal)");
else if($data == 6) $data = gettext("Rotate 90 CW");
else if($data == 8) $data = gettext("Rotate 270 CW");
else $data = gettext("Unknown")." (".$data.")";
}
if($tag=="0032") { //Color Mode
if($data == 0) $data = gettext("Normal");
else if($data == 1) $data = gettext("Natural");
else $data = gettext("Unknown")." (".$data.")";
}
if($tag=="0036") { //Travel Day
$data=$data;
}
} else if($type=="UNDEFINED") {
} else {
$data = bin2hex($data);
if($intel==1) $data = intel2Moto($data);
}
return $data;
}
//=================
// Panasonic Special data section
//====================================================================
function parsePanasonic($block,&$result) {
//if($result['Endien']=="Intel") $intel=1;
//else $intel=0;
$intel=1;
$model = $result['IFD0']['Model'];
$place=8; //current place
$offset=8;
$num = bin2hex(substr($block,$place,4));$place+=4;
if($intel==1) $num = intel2Moto($num);
$result['SubIFD']['MakerNote']['Offset'] = hexdec($num);
//Get number of tags (2 bytes)
$num = bin2hex(substr($block,$place,2));$place+=2;
if($intel==1) $num = intel2Moto($num);
$result['SubIFD']['MakerNote']['MakerNoteNumTags'] = hexdec($num);
//loop thru all tags Each field is 12 bytes
for($i=0;$i<hexdec($num);$i++) {
//2 byte tag
$tag = bin2hex(substr($block,$place,2));$place+=2;
if($intel==1) $tag = intel2Moto($tag);
$tag_name = lookup_Panasonic_tag($tag);
//2 byte type
$type = bin2hex(substr($block,$place,2));$place+=2;
if($intel==1) $type = intel2Moto($type);
lookup_type($type,$size);
//4 byte count of number of data units
$count = bin2hex(substr($block,$place,4));$place+=4;
if($intel==1) $count = intel2Moto($count);
$bytesofdata = validSize($size*hexdec($count));
//4 byte value of data or pointer to data
$value = substr($block,$place,4);$place+=4;
if($bytesofdata<=4) {
$data = substr($value,0,$bytesofdata);
} else {
$value = bin2hex($value);
if($intel==1) $value = intel2Moto($value);
$data = substr($block,hexdec($value)-$offset,$bytesofdata*2);
}
$formated_data = formatPanasonicData($type,$tag,$intel,$data);
if($result['VerboseOutput']==1) {
$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
if($type=="URATIONAL" || $type=="SRATIONAL" || $type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
$data = bin2hex($data);
if($intel==1) $data = intel2Moto($data);
}
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['RawData'] = $data;
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Type'] = $type;
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Bytes'] = $bytesofdata;
} else {
$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
}
}
}
?>

157
-child/exifer/makers/sanyo.php Executable file
View File

@@ -0,0 +1,157 @@
<?php //================================================================================================
//================================================================================================
//================================================================================================
/*
Exifer
Extracts EXIF information from digital photos.
Copyright <20> 2003 Jake Olefsky
http://www.offsky.com/software/exif/index.php
jake@olefsky.com
Please see exif.php for the complete information about this software.
------------
This program is free software; you can redistribute it and/or modify it under the terms of
the GNU General Public License as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details. http://www.gnu.org/copyleft/gpl.html
*/
//================================================================================================
//================================================================================================
//================================================================================================
//=================
// Looks up the name of the tag for the MakerNote (Depends on Manufacturer)
//====================================================================
function lookup_Sanyo_tag($tag) {
switch($tag) {
case "0200": $tag = "SpecialMode";break;
case "0201": $tag = "Quality";break;
case "0202": $tag = "Macro";break;
case "0203": $tag = "Unknown";break;
case "0204": $tag = "DigiZoom";break;
case "0f00": $tag = "DataDump";break;
default: $tag = "unknown:".$tag;break;
}
return $tag;
}
//=================
// Formats Data for the data type
//====================================================================
function formatSanyoData($type,$tag,$intel,$data) {
if($type=="ASCII") {
} else if($type=="URATIONAL" || $type=="SRATIONAL") {
$data = unRational($data,$type,$intel);
} else if($type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
$data = rational($data,$type,$intel);
if($tag=="0200") { //SpecialMode
if($data == 0) $data = gettext("Normal");
else $data = gettext("Unknown").": ".$data;
}
if($tag=="0201") { //Quality
if($data == 2) $data = gettext("High");
else $data = gettext("Unknown").": ".$data;
}
if($tag=="0202") { //Macro
if($data == 0) $data = gettext("Normal");
else $data = gettext("Unknown").": ".$data;
}
} else if($type=="UNDEFINED") {
} else {
$data = bin2hex($data);
if($intel==1) $data = intel2Moto($data);
}
return $data;
}
//=================
// Sanyo Special data section
//====================================================================
function parseSanyo($block,&$result,$seek, $globalOffset) {
if($result['Endien']=="Intel") $intel=1;
else $intel=0;
$model = $result['IFD0']['Model'];
$place=8; //current place
$offset=8;
//Get number of tags (2 bytes)
$num = bin2hex(substr($block,$place,2));$place+=2;
if($intel==1) $num = intel2Moto($num);
$result['SubIFD']['MakerNote']['MakerNoteNumTags'] = hexdec($num);
//loop thru all tags Each field is 12 bytes
for($i=0;$i<hexdec($num);$i++) {
//2 byte tag
$tag = bin2hex(substr($block,$place,2));$place+=2;
if($intel==1) $tag = intel2Moto($tag);
$tag_name = lookup_Sanyo_tag($tag);
//2 byte type
$type = bin2hex(substr($block,$place,2));$place+=2;
if($intel==1) $type = intel2Moto($type);
lookup_type($type,$size);
//4 byte count of number of data units
$count = bin2hex(substr($block,$place,4));$place+=4;
if($intel==1) $count = intel2Moto($count);
$bytesofdata = validSize($size*hexdec($count));
//4 byte value of data or pointer to data
$value = substr($block,$place,4);$place+=4;
if($bytesofdata<=4) {
$data = substr($value,0,$bytesofdata);
} else {
$value = bin2hex($value);
if($intel==1) $value = intel2Moto($value);
$v = fseek($seek,$globalOffset+hexdec($value)); //offsets are from TIFF header which is 12 bytes from the start of the file
if($tag!=0) {
$data = fread($seek, $bytesofdata);
} else if($v==-1) {
$result['Errors'] = $result['Errors']++;
}
}
$formated_data = formatSanyoData($type,$tag,$intel,$data);
if($result['VerboseOutput']==1) {
$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
if($type=="URATIONAL" || $type=="SRATIONAL" || $type=="USHORT" || $type=="SSHORT" || $type=="ULONG" || $type=="SLONG" || $type=="FLOAT" || $type=="DOUBLE") {
$data = bin2hex($data);
if($intel==1) $data = intel2Moto($data);
}
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['RawData'] = $data;
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Type'] = $type;
$result['SubIFD']['MakerNote'][$tag_name."_Verbose"]['Bytes'] = $bytesofdata;
} else {
$result['SubIFD']['MakerNote'][$tag_name] = $formated_data;
}
}
}
?>

326
-child/fetch_pages.php Executable file
View File

@@ -0,0 +1,326 @@
<?php
/* Title : Ajax Pagination with jQuery & PHP
Example URL : http://www.sanwebe.com/2013/03/ajax-pagination-with-jquery-php */
function preprint($s, $return=false) {
$x = "<pre>";
$x .= print_r($s, 1);
$x .= "</pre>";
if ($return) return $x;
else print $x;
}
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. "<br>";
$file_sd = $path . $file[0] . "_180_thumb.jpg";
$file_hd = $path . $file[0] . "_360_thumb.jpg";
/*
$file_sd = $path . $file[0] . "_180_watermark.jpg";
$file_hd = $path . $file[0] . "_360_watermark.jpg";
*/
//
$th_sd = false;
$th_hd = false;
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]
);
}
//preprint($thumb);
if (($th_sd == true) && ($th_hd == true)) {
$standard = $thumb['sd']['url'] . ', ' . $thumb['hd']['url'] . ' 2x';
}
elseif ($th_sd == true) {
$standard = $thumb['sd']['url'];
}
elseif ($th_hd == true) {
$standard = $thumb['hd']['url'] . ' 2x';
}
$display = '<div class="album">';
//$display .= '<div class="holder">';
//$display .= '<a href="../../zenphoto/albums/'.$album.'/'.$filename.'" title="'.date_archive($filename).'" class="swipebox">';
$display .= '<div class="thumb">';
$display .= '<a class="wraptocenter" href="../../zenphoto/albums/'.$album.'/'.$filename.'" title="'.date_archive($filename).'" data-featherlight="image">';
//$display .= '<a class="wraptocenter gallery" href="../../zenphoto/albums/'.$album.'/'.$filename.'" title="'.date_archive($filename).'">';
//$display .= '<a href="../../zenphoto/albums/'.$album.'/'.$filename.'" title="'.date_archive($filename).'" class="wraptocenter">';
$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 .= '</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>';
return $display;
}
function date_archive ($chaine) {
$pieces = explode(".", $chaine);
$b = explode("_", $pieces[0]);
$mois = $b[0];
$an = $b[1];
$chaine = mois2($mois) . ' '. $an;
return $chaine;
}
function mois2 ($mois) {
switch ($mois)
{
case 00:
$mois = "00";
break;
case 1:
$mois = gettext('January');
break;
case 2:
$mois = gettext('February');
break;
case 3:
$mois = gettext('March');
break;
case 4:
$mois = gettext('April');
break;
case 5:
$mois = gettext('May');
break;
case 6:
$mois = gettext('June');
break;
case 7:
$mois = gettext('July');
break;
case 8:
$mois = gettext('August');
break;
case 9:
$mois = gettext('September');
break;
case 10:
$mois = gettext('October');
break;
case 11:
$mois = gettext('November');
break;
case 12:
$mois = gettext('December');
break;
}
return $mois;
}
//continue only if $_POST is set and it is a Ajax request
if(isset($_POST) && isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'){
//include("config.inc.php"); //include config file
//require_once($_SERVER['DOCUMENT_ROOT'].'/Connections/cnx.php');
$db_host = 'localhost';
$db_username = 'root';
$db_password = 'sncfp1p2';
$db_name = 'zenphoto';
$zptable = 'zenphoto';
$album = 'photos-du-mois'; //Photos du mois
$item_per_page = 12; //item to display per page
$table = array();
if ($_SERVER['HTTP_HOST'] == "macbook-pro.local") {
$table['images'] = ".images";
$table['albums'] = ".albums";
}
if ($_SERVER['HTTP_HOST'] == "clicclac.info") {
$table['images'] = "zenphoto_images";
$table['albums'] = "zenphoto_albums";
}
$mysqli = new mysqli($db_host, $db_username, $db_password, $db_name);
//Output any connection error
if ($mysqli->connect_error) {
die('Error : ('. $mysqli->connect_errno .') '. $mysqli->connect_error);
}
// Récupérer l'ID de l'album 'photos-du-mois' ($id_album)
$i = 0;
$conn = new mysqli($db_host, $db_username, $db_password, $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();
//Get page number from Ajax POST
if(isset($_POST["page"])){
$page_number = filter_var($_POST["page"], FILTER_SANITIZE_NUMBER_INT, FILTER_FLAG_STRIP_HIGH); //filter number
if(!is_numeric($page_number)){die('Invalid page number!');} //incase of invalid page number
}else{
$page_number = 1; //if there's no page number, set it to 1
}
//get total number of records from database for pagination
//$results = $mysqli->query("SELECT COUNT(*) FROM paginate");
$results = $mysqli->query("SELECT COUNT(*) FROM `" . $table['images'] . "` WHERE `albumid` = $id_album ");
$get_total_rows = $results->fetch_row(); //hold total records in variable
//break records into pages
$total_pages = ceil($get_total_rows[0]/$item_per_page);
//get starting position to fetch the records
$page_position = (($page_number-1) * $item_per_page);
//Limit our results within a specified range.
$results = $mysqli->prepare("SELECT `filename` FROM `" . $table['images'] . "` WHERE `albumid` = ? ORDER BY `date` DESC LIMIT $page_position, $item_per_page");
$results->bind_param('i', $id_album);
$results->execute(); //Execute prepared Query
$results->bind_result($filename); //bind variables to prepared statement
$path = "../../zenphoto/cache/" . $album . "/";
//echo '<section data-featherlight-gallery data-featherlight-filter="a">';
while($results->fetch()){ //fetch values
/* ----
$file = explode(".", $filename);
$file_sd = $path . $file[0] . "_180_thumb.jpg";
$size_sd = getimagesize($file_sd, $info);
$thumb['sd'] = array(
'url' => "../../" . $file_sd,
'width' => $size_sd[0],
'height' => $size_sd[1]
);
$file_hd = $path . $file[0] . "_360_thumb.jpg";
$size_hd = getimagesize($file_hd, $info);
$thumb['hd'] = array(
'url' => "../../" . $file_hd,
'width' => $size_hd[0],
'height' => $size_hd[1]
);*/
/* ---- */
/*
//echo $filename;
$display .= '<a href="../../zenphoto/albums/'.$album.'/'.$filename.'" title="'.date_archive($filename).'" class="swipebox">';
$display .= '<img srcset="' . $thumb['hd']['url'] . '" width="' . $thumb['hd']['width'] . '" height="' . $thumb['hd']['height'] . '"alt="">';
$display .= '</a>';
echo $display;
$display = "";
*/
//echo '<a href="../../zenphoto/albums/">';
//echo '<img src="test.jpg"></a>';
//echo '<a href="aa.php"><img src="test.jpg"></a>';
echo displayRetina($filename,$album);
}
//echo '</section>';
echo '<p style="clear: both; "></p>';
echo '<div align="center">';
/* We call the pagination function here to generate Pagination link for us.
As you can see I have passed several parameters to the function. */
echo paginate_function($item_per_page, $page_number, $get_total_rows[0], $total_pages);
echo '</div>';
echo '<p style="clear: both; "></p>';
exit;
}
################ pagination function #########################################
function paginate_function($item_per_page, $current_page, $total_records, $total_pages)
{
$pagination = '';
if($total_pages > 0 && $total_pages != 1 && $current_page <= $total_pages){ //verify total pages and current page number
$pagination .= '<ul class="pagination">';
$right_links = $current_page + 3;
$previous = $current_page - 3; //previous link
$next = $current_page + 1; //next link
$first_link = true; //boolean var to decide our first link
if($current_page > 1){
$previous_link = ($previous==0)? 1: $previous;
$pagination .= '<li class="first"><a href="#" data-page="1" title="First">&laquo;</a></li>'; //first link
$pagination .= '<li><a href="#" data-page="'.$previous_link.'" title="Previous">&lt;</a></li>'; //previous link
for($i = ($current_page-2); $i < $current_page; $i++){ //Create left-hand side links
if($i > 0){
$pagination .= '<li><a href="#" data-page="'.$i.'" title="Page'.$i.'">'.$i.'</a></li>';
}
}
$first_link = false; //set first link to false
}
if($first_link){ //if current active page is first link
$pagination .= '<li class="first active">'.$current_page.'</li>';
}elseif($current_page == $total_pages){ //if it's the last active link
$pagination .= '<li class="last active">'.$current_page.'</li>';
}else{ //regular current link
$pagination .= '<li class="active">'.$current_page.'</li>';
}
for($i = $current_page+1; $i < $right_links ; $i++){ //create right-hand side links
if($i<=$total_pages){
$pagination .= '<li><a href="#" data-page="'.$i.'" title="Page '.$i.'">'.$i.'</a></li>';
}
}
if($current_page < $total_pages){
$next_link = ($i > $total_pages) ? $total_pages : $i;
$pagination .= '<li><a href="#" data-page="'.$next_link.'" title="Next">&gt;</a></li>'; //next link
$pagination .= '<li class="last"><a href="#" data-page="'.$total_pages.'" title="Last">&raquo;</a></li>'; //last link
}
$pagination .= '</ul>';
}
return $pagination; //return pagination links
}
?>

154
-child/fonctions.php Normal file
View File

@@ -0,0 +1,154 @@
<?php
function preprint($s, $return=false) {
$x = "<pre>";
$x .= print_r($s, 1);
$x .= "</pre>";
if ($return) return $x;
else print $x;
}
function displayRetina ($filename,$album) {
$path = "../../../../zenphoto/cache/" . $album . "/";
$file = explode(".", $filename);
//echo $path . $filename . "<br>";
$file_sd = $path . $file[0] . "_180_thumb.jpg";
$file_hd = $path . $file[0] . "_360_thumb.jpg";
/*
$file_sd = $path . $file[0] . "_180_watermark.jpg";
$file_hd = $path . $file[0] . "_360_watermark.jpg";
*/
//
$th_sd = false;
$th_hd = false;
$thumb = array();
$standard = "";
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]
);
}
//preprint($thumb);
if (($th_sd == true) && ($th_hd == true)) {
$standard = $thumb['sd']['url'] . ', ' . $thumb['hd']['url'] . ' 2x';
}
elseif ($th_sd == true) {
$standard = $thumb['sd']['url'];
}
elseif ($th_hd == true) {
$standard = $thumb['hd']['url'] . ' 2x';
}
/*
$display = '<div class="album">';
$display .= '<div class="thumb">';
$display .= '<a href="../../zenphoto/albums/'.$album.'/'.$filename.'" title="'.date_archive($filename).'" class="wraptocenter swipebox" />';
$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 .= '</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>';
*/
/**/
$display = '<div class="album">';
$display .= '<a href="../../zenphoto/albums/'.$album.'/'.$filename.'" title="'.date_archive($filename).'" class="swipebox" />';
$display .= '<div class="holder">';
//$display .= '<picture data-picture data-alt="">';
//$display .= '<source class="image_standard" srcset="' . $standard . '">';
$display .= '<img srcset="' . $thumb['sd']['url'] . '" width="' . $thumb['sd']['width'] . '" height="' . $thumb['sd']['height'] . '"alt="">';
//$display .= '</picture>';
$display .= '</div>';
$display .= '</a>';
$display .= '<div class="albumdesc">';
$display .= '<span class="exif">';
$display .= '<a href="../../zenphoto/index.php?album='.$album.'&amp;image='.$filename.'" title= "'.date_archive($filename).'" class="" />'.date_archive($filename).'</a>';
$display .= '</span></div>';
$display .= '</div>';
return $display;
}
function date_archive ($chaine) {
$pieces = explode(".", $chaine);
$b = explode("_", $pieces[0]);
$mois = $b[0];
$an = $b[1];
$chaine = mois2($mois) . ' '. $an;
return $chaine;
}
function mois2 ($mois) {
switch ($mois)
{
case 00:
$mois = "00";
break;
case 1:
$mois = gettext('January');
break;
case 2:
$mois = gettext('February');
break;
case 3:
$mois = gettext('March');
break;
case 4:
$mois = gettext('April');
break;
case 5:
$mois = gettext('May');
break;
case 6:
$mois = gettext('June');
break;
case 7:
$mois = gettext('July');
break;
case 8:
$mois = gettext('August');
break;
case 9:
$mois = gettext('September');
break;
case 10:
$mois = gettext('October');
break;
case 11:
$mois = gettext('November');
break;
case 12:
$mois = gettext('December');
break;
}
return $mois;
}
?>

184
-child/header-page.php Executable file
View File

@@ -0,0 +1,184 @@
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php wp_head(); ?>
<!--link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri(); ?>/css/swipebox.css" type="text/css" media="screen" charset="utf-8" />
<script src="<?php echo get_stylesheet_directory_uri(); ?>/js/jquery.swipebox.js" type="text/javascript" charset="utf-8"></script-->
<script src="//cdnjs.cloudflare.com/ajax/libs/detect_swipe/2.1.1/jquery.detect_swipe.min.js"></script>
<link href="//cdn.rawgit.com/noelboss/featherlight/1.7.0/release/featherlight.min.css" type="text/css" rel="stylesheet" />
<link href="//cdn.rawgit.com/noelboss/featherlight/1.3.4/release/featherlight.gallery.min.css" type="text/css" rel="stylesheet" />
<style type="text/css">
@media all {
.lightbox { display: none; }
.fl-page h1,
.fl-page h3,
.fl-page h4 {
font-family: 'HelveticaNeue-UltraLight', 'Helvetica Neue UltraLight', 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-weight: 100;
letter-spacing: 1px;
}
.fl-page h1 { font-size: 110px; margin-bottom: 0.5em; }
.fl-page h1 i { font-style: normal; color: #ddd; }
.fl-page h1 span { font-size: 30px; color: #333;}
.fl-page h3 { text-align: right; }
.fl-page h3 { font-size: 15px; }
.fl-page h4 { font-size: 2em; }
.fl-page .jumbotron { margin-top: 2em; }
.fl-page .btn-download { float: right; margin-top: -40px; }
.fl-page .btn-default { vertical-align: bottom; }
.fl-page .row { margin-top: 2em;}
.fl-page .btn-lg span { font-size: 0.7em; }
.fl-page .footer { margin-top: 3em; color: #aaa; font-size: 0.9em;}
.fl-page .footer a { color: #999; text-decoration: none; margin-right: 0.75em;}
.fl-page .github { margin: 2em 0; }
.fl-page .github a { vertical-align: top; }
/* customized gallery */
.featherlight-gallery2 {
background: rgba(100,100,100,0.5);
}
.featherlight-gallery2 .featherlight-content {
background: #000;
}
.featherlight-gallery2 .featherlight-next:hover,
.featherlight-gallery2 .featherlight-previous:hover {
background: rgba(0,0,0,0.5);
}
.featherlight-gallery2 .featherlight-next:hover span,
.featherlight-gallery2 .featherlight-previous:hover span {
font-size: 25px;
line-height: 25px;
margin-top: -12.5px;
color: #fff;
}
.featherlight-gallery2 .featherlight-close {
background: transparent;
color: #fff;
font-size: 1.2em;
}
.featherlight-gallery2.featherlight-last-slide .featherlight-next,
.featherlight-gallery2.featherlight-first-slide .featherlight-previous {
display: none;
}
/* text slide */
.thumbnail a { text-decoration: none; }
.blurb {
display: inline-block;
width: 150px;
height: 150px;
}
.blurb h2 { text-align: center;}
.blurb .detail { display: none;}
.blurb .teaser {
font-style: italic;
text-align: center;
}
.featherlight .blurb {
display: inline-block;
width: 500px;
height: 300px;
color: #99f;
}
.featherlight .blurb .detail {
color: #ddf;
font-size: large;
display: inherit;
}
.featherlight .blurb .teaser { display: none;}
}
@media(max-width: 768px){
.fl-page h1 span { display: block; }
.fl-page .btn-download { float: none; margin-bottom: 1em; }
}
</style>
<script type="text/javascript">
/*
jQuery(function($) {
$(".swipebox").click(function() {
swipebox();
//hideBarsDelay : 3000 // 0 to always show caption and action bar
});
});
*/
</script>
<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>
<body <?php body_class(); ?>>
<header id="head">
<div class="top-area">
<div class="container">
<div class="head-details">
<?php
echo (dess_setting('dess_tel') != '' ? __('Tel: ','creator').'<a href="tel:'.dess_setting('dess_tel').'">'. dess_setting('dess_tel').'</a>' : '');
echo (dess_setting('dess_email') != '' ? ' | '.__('Email: ','creator').'<a href="mailto:'.dess_setting('dess_email').'">'. dess_setting('dess_email').'</a>' : '');
echo (dess_setting('dess_hoursup') != '' ? ' | '.dess_setting('dess_hoursup') : '');
?>
</div><!-- head-details -->
<div class="head-socials">
<ul>
<?php
$socials = array('twitter','facebook','google-plus','instagram','pinterest','vimeo','youtube','linkedin');
for($i=0;$i<count($socials);$i++){
$url = '';
$s = $socials[$i];
$url = dess_setting('dess_'.$s);
echo ($url != '' ? '<li><a target="_blank" href="'.$url.'"><img src="'.esc_url( get_stylesheet_directory_uri() ).'/images/'.$s.'-icon.png" alt="'.$s.'" /></a></li>':'');
}
?>
</ul>
</div><!-- head-socials -->
<div class="clear"></div>
</div><!-- container -->
</div><!-- top-area -->
<div class="head-area">
<div class="container">
<div class="logo">
<?php echo (dess_setting('dess_logo') != '' ? '<a href="'.home_url().'"><img src="'.dess_setting('dess_logo').'" alt="logo" /></a>': '<a href="'.home_url().'"><img src="'.esc_url( get_stylesheet_directory_uri() ).'/images/logo.png" alt="logo" /></a>'); ?>
</div><!-- logo -->
<div class="head-nav">
<?php wp_nav_menu(array('theme_location' => 'header-menu')); ?>
</div><!-- head-nav -->
<div class="clear"></div>
</div><!-- container -->
</div><!-- head-area -->
</header>

131
-child/pagination.php Executable file
View File

@@ -0,0 +1,131 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- This is a pagination script using Jquery, Ajax and PHP
The enhancements done in this script pagination with first,last, previous, next buttons -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Pagination with Jquery, Ajax, PHP</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
function loading_show(){
$('#loading').html("<img src='images/loading.gif'/>").fadeIn('fast');
}
function loading_hide(){
$('#loading').fadeOut('fast');
}
function loadData(page){
loading_show();
$.ajax
({
type: "POST",
url: "load_data.php",
data: "page="+page,
success: function(msg)
{
$("#container").ajaxComplete(function(event, request, settings)
{
loading_hide();
$("#container").html(msg);
});
}
});
}
loadData(1); // For first time page load default results
$('#container .pagination li.active').live('click',function(){
var page = $(this).attr('p');
loadData(page);
});
$('#go_btn').live('click',function(){
var page = parseInt($('.goto').val());
var no_of_pages = parseInt($('.total').attr('a'));
if(page != 0 && page <= no_of_pages){
loadData(page);
}else{
alert('Enter a PAGE between 1 and '+no_of_pages);
$('.goto').val("").focus();
return false;
}
});
});
</script>
<style type="text/css">
body{
width: 800px;
margin: 0 auto;
padding: 0;
}
#loading{
width: 100%;
position: absolute;
top: 100px;
left: 100px;
margin-top:200px;
}
#container .pagination ul li.inactive,
#container .pagination ul li.inactive:hover{
background-color:#ededed;
color:#bababa;
border:1px solid #bababa;
cursor: default;
}
#container .data ul li{
list-style: none;
font-family: verdana;
margin: 5px 0 5px 0;
color: #000;
font-size: 13px;
}
#container .pagination{
width: 800px;
height: 25px;
}
#container .pagination ul li{
list-style: none;
float: left;
border: 1px solid #006699;
padding: 2px 6px 2px 6px;
margin: 0 3px 0 3px;
font-family: arial;
font-size: 14px;
color: #006699;
font-weight: bold;
background-color: #f2f2f2;
}
#container .pagination ul li:hover{
color: #fff;
background-color: #006699;
cursor: pointer;
}
.go_button
{
background-color:#f2f2f2;border:1px solid #006699;color:#cc0000;padding:2px 6px 2px 6px;cursor:pointer;position:absolute;margin-top:-1px;
}
.total
{
float:right;font-family:arial;color:#999;
}
</style>
</head>
<body>
<!--div style="margin-top:10px;">
<blockquote>&nbsp;</blockquote>
<iframe src="http://onlinewebapplication.com/ads.html" frameborder="0" scrolling="no" height="126px" width="100%"></iframe>
</div-->
</div>
<!--div align="center" style="font-size:24px;color:#cc0000;font-weight:bold">Pagination with jquery, Ajax and PHP</div-->
<div id="loading"></div>
<div id="container">
<div class="data"></div>
<div class="pagination"></div>
</div>
</body>
</html>

12
-child/searchform.php Normal file
View File

@@ -0,0 +1,12 @@
<form role="search" method="get" class="searchform group" action="<?php echo home_url( '/' ); ?>">
<label>
<span class="offscreen"><?php //echo _x( 'Search for:', 'label' ) ?></span>
<input type="search" class="search-field"
placeholder="<?php echo esc_attr_x( 'Search', 'placeholder' ) ?>"
value="<?php echo get_search_query() ?>" name="s"
title="<?php echo esc_attr_x( 'Search for:', 'label' ) ?>" />
</label>
<input type="image" alt="Submit search query"
src="data:image/svg+xml;base64,CjxzdmcgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIgdmlld0JveD0iMCAwIDEwMDAgMTAwMCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMTAwMCAxMDAwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPG1ldGFkYXRhPiBTdmcgVmVjdG9yIEljb25zIDogaHR0cDovL3d3dy5vbmxpbmV3ZWJmb250cy5jb20vaWNvbiA8L21ldGFkYXRhPgogIDxnPjxnPjxnIGlkPSJTZWFyY2hfMV8iPjxnPjxwYXRoIGQ9Ik05NjcuOSw4NjEuMmwtMTc3LjEtMTc3YzQ4LjUtNjkuNiw3Ny4yLTE1NCw3Ny4yLTI0NS4yYzAtMjM3LTE5Mi4xLTQyOS00MjktNDI5Yy0yMzcsMC00MjksMTkyLjEtNDI5LDQyOXMxOTIuMSw0MjksNDI5LDQyOWM5MS4yLDAsMTc1LjYtMjguNywyNDUuMi03Ny4ybDE3NywxNzdjMjkuNSwyOS41LDc3LjIsMjkuNSwxMDYuNywwQzk5Ny40LDkzOC41LDk5Ny40LDg5MC43LDk2Ny45LDg2MS4yeiBNNDM5LDc0NS41Yy0xNjkuMiwwLTMwNi41LTEzNy4yLTMwNi41LTMwNi41YzAtMTY5LjIsMTM3LjItMzA2LjUsMzA2LjUtMzA2LjVjMTY5LjIsMCwzMDYuNSwxMzcuMiwzMDYuNSwzMDYuNUM3NDUuNSw2MDguMyw2MDguMyw3NDUuNSw0MzksNzQ1LjV6IiBzdHlsZT0iZmlsbDojYTliN2I3Ij48L3BhdGg+PC9nPjwvZz48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PGc+PC9nPjxnPjwvZz48Zz48L2c+PC9nPjwvc3ZnPgogIA==" width="16" height="16">
</form>