1er commit
1er version
This commit is contained in:
BIN
exclus/Archive.zip
Normal file
BIN
exclus/Archive.zip
Normal file
Binary file not shown.
254
exclus/_loop-attachment.php
Normal file
254
exclus/_loop-attachment.php
Normal file
@@ -0,0 +1,254 @@
|
||||
<?php
|
||||
/**
|
||||
* The loop that displays an attachment.
|
||||
*
|
||||
* The loop displays the posts and the post content. See
|
||||
* http://codex.wordpress.org/The_Loop to understand it and
|
||||
* http://codex.wordpress.org/Template_Tags to understand
|
||||
* the tags used in it.
|
||||
*
|
||||
* This can be overridden in child themes with loop-attachment.php.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Ten
|
||||
* @since Twenty Ten 1.2
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
// return geo exif in a nice form
|
||||
/*
|
||||
function geo_frac2dec($str) {
|
||||
@list( $n, $d ) = explode( '/', $str );
|
||||
if ( !empty($d) )
|
||||
return $n / $d;
|
||||
return $str;
|
||||
}
|
||||
|
||||
function geo_pretty_fracs2dec($fracs) {
|
||||
return geo_frac2dec($fracs[0]) . '° ' .
|
||||
geo_frac2dec($fracs[1]) . '′ ' .
|
||||
geo_frac2dec($fracs[2]) . '″ ';
|
||||
}
|
||||
|
||||
function geo_single_fracs2dec($fracs) {
|
||||
return geo_frac2dec($fracs[0]) +
|
||||
geo_frac2dec($fracs[1]) / 60 +
|
||||
geo_frac2dec($fracs[2]) / 3600;
|
||||
}
|
||||
*/
|
||||
?>
|
||||
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
|
||||
|
||||
<?php if ( ! empty( $post->post_parent ) ) : ?>
|
||||
<div id="nav-above" class="navigation">
|
||||
<div class="nav-previous"><a href="<?php echo get_permalink( $post->post_parent ); ?>" title="<?php esc_attr( printf( __( 'Return to %s', 'twentyten' ), get_the_title( $post->post_parent ) ) ); ?>" rel="gallery"><?php
|
||||
/* translators: %s - title of parent post */
|
||||
printf( __( '<span class="meta-nav">←</span> %s', 'twentyten' ), get_the_title( $post->post_parent ) );
|
||||
?></a></div>
|
||||
</div><!-- #nav-above -->
|
||||
<?php endif; ?>
|
||||
|
||||
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<h1 class="entry-title"><?php the_title(); ?></h1>
|
||||
|
||||
<div class="entry-meta">
|
||||
<?php
|
||||
printf( __( '%1$s', 'twentyten-child' ),
|
||||
sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>',
|
||||
get_permalink(),
|
||||
esc_attr( get_the_time() ),
|
||||
get_the_date()
|
||||
)
|
||||
);
|
||||
if ( wp_attachment_is_image() ) {
|
||||
echo ' <span class="meta-sep">|</span> ';
|
||||
$metadata = wp_get_attachment_metadata();
|
||||
printf( __( 'Full size is %s pixels', 'twentyten' ),
|
||||
sprintf( '<a href="%1$s" title="%2$s">%3$s × %4$s</a>',
|
||||
wp_get_attachment_url(),
|
||||
esc_attr( __( 'Link to full-size image', 'twentyten' ) ),
|
||||
$metadata['width'],
|
||||
$metadata['height']
|
||||
)
|
||||
);
|
||||
}
|
||||
?>
|
||||
<?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
|
||||
</div><!-- .entry-meta -->
|
||||
|
||||
<div class="entry-content">
|
||||
<div class="entry-attachment">
|
||||
<?php if ( wp_attachment_is_image() ) :
|
||||
$attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) );
|
||||
foreach ( $attachments as $k => $attachment ) {
|
||||
if ( $attachment->ID == $post->ID )
|
||||
break;
|
||||
}
|
||||
$k++;
|
||||
// If there is more than 1 image attachment in a gallery
|
||||
if ( count( $attachments ) > 1 ) {
|
||||
if ( isset( $attachments[ $k ] ) )
|
||||
// get the URL of the next image attachment
|
||||
$next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
|
||||
else
|
||||
// or get the URL of the first image attachment
|
||||
$next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID );
|
||||
} else {
|
||||
// or, if there's only 1 image attachment, get the URL of the image
|
||||
$next_attachment_url = wp_get_attachment_url();
|
||||
}
|
||||
?>
|
||||
<p class="attachment"><a href="<?php echo $next_attachment_url; ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php
|
||||
$attachment_width = apply_filters( 'twentyten_attachment_size', 900 );
|
||||
$attachment_height = apply_filters( 'twentyten_attachment_height', 900 );
|
||||
echo wp_get_attachment_image( $post->ID, array( $attachment_width, $attachment_height ) ); // filterable image width with, essentially, no limit for image height.
|
||||
?></a></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php else : ?>
|
||||
<a href="<?php echo wp_get_attachment_url(); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php echo basename( get_permalink() ); ?></a>
|
||||
|
||||
<?php endif; ?>
|
||||
<!-- .entry-attachment -->
|
||||
<div class="entry-caption"><?php if ( !empty( $post->post_excerpt ) ) the_excerpt(); ?>
|
||||
</div><!-- .entry-caption -->
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="droite" onclick="toggleExif(<?php echo $attachment->ID; ?>);">Voir les Exif</div>
|
||||
|
||||
|
||||
<?php //print_r($metadata); ?>
|
||||
|
||||
<?php
|
||||
/*
|
||||
if ($metadata['image_meta']['latitude'])
|
||||
$latitude = $metadata['image_meta']['latitude'];
|
||||
if ($metadata['image_meta']['longitude'])
|
||||
$longitude = $metadata['image_meta']['longitude'];
|
||||
if ($metadata['image_meta']['latitude_ref'])
|
||||
$lat_ref = $metadata['image_meta']['latitude_ref'];
|
||||
if ($metadata['image_meta']['longitude_ref'])
|
||||
$lng_ref = $metadata['image_meta']['longitude_ref'];
|
||||
$lat = geo_single_fracs2dec($latitude);
|
||||
$lng = geo_single_fracs2dec($longitude);
|
||||
if ($lat_ref == 'S') { $neg_lat = '-'; } else { $neg_lat = ''; }
|
||||
if ($lng_ref == 'W') { $neg_lng = '-'; } else { $neg_lng = ''; }
|
||||
//$start_geo_link = '<a href="http://maps.google.com/maps?q=' . $neg_lat . number_format($lat,6) . '+' . $neg_lng . number_format($lng, 6) . '&z=11">';
|
||||
$start_geo_link = '<a href="http://maps.google.com/maps?q=' . $neg_lat . number_format($lat,6) . '+' . $neg_lng . number_format($lng, 6) . '&z=11">';
|
||||
$jquery_geo_link = 'http://maps.google.com/maps?q=' . $neg_lat . number_format($lat,6) . '+' . $neg_lng . number_format($lng, 6) . '&z=11';
|
||||
$end_geo_link = '</a>';
|
||||
|
||||
// Aperture
|
||||
if (!empty($metadata['image_meta']['aperture']))
|
||||
$exif_list .= $before_item . __('Aperture', 'twentyten-child') . $sep . "f/" . $metadata['image_meta']['aperture'] . $after_item;
|
||||
|
||||
// Shutter speed
|
||||
if (!empty($metadata['image_meta']['shutter_speed'])) {
|
||||
$exif_list .= $before_item . __('Shutter speed', 'twentyten-child') . $sep;
|
||||
if ((1 / $metadata['image_meta']['shutter_speed']) > 1) {
|
||||
$exif_list .= "1/";
|
||||
if ((number_format((1 / $metadata['image_meta']['shutter_speed']), 1)) == 1.3
|
||||
or number_format((1 / $metadata['image_meta']['shutter_speed']), 1) == 1.5
|
||||
or number_format((1 / $metadata['image_meta']['shutter_speed']), 1) == 1.6
|
||||
or number_format((1 / $metadata['image_meta']['shutter_speed']), 1) == 2.5) {
|
||||
$exif_list .= number_format((1 / $metadata['image_meta']['shutter_speed']), 1, '.', '') . " s" . $after_item;
|
||||
}
|
||||
else {
|
||||
$exif_list .= number_format((1 / $metadata['image_meta']['shutter_speed']), 0, '.', '') . " s" . $after_item;
|
||||
}
|
||||
}
|
||||
else
|
||||
$exif_list .= $metadata['image_meta']['shutter_speed']." s" . $after_item;
|
||||
}
|
||||
}
|
||||
// Focal length
|
||||
if (!empty($metadata['image_meta']['focal_length']))
|
||||
$exif_list .= $before_item . __('Focal length', 'twentyten-child') . $sep . $metadata['image_meta']['focal_length'] . " mm" . $after_item;
|
||||
// Camera
|
||||
if (!empty($metadata['image_meta']['camera']))
|
||||
$exif_list .= $before_item . __('Camera', 'twentyten-child') . $sep . $metadata['image_meta']['camera'] . $after_item;
|
||||
// Creation time
|
||||
if (!empty($metadata['image_meta']['created_timestamp']))
|
||||
$exif_list .= $before_item . __('Taken', 'twentyten-child') . $sep . date('j F, Y',$metadata['image_meta']['created_timestamp']) . $after_item;
|
||||
|
||||
// Latitude and Longtitude
|
||||
if ($latitude != 0 && $longitude != 0)
|
||||
//affichage dans un cadre map caché
|
||||
//$exif_list .= $before_item . '<div onclick="toggleExif(\'map\');" ><image src="' . get_stylesheet_directory_uri() . '/images/monde.png" width="16" height="16" /></div>' . $after_item;
|
||||
$exif_list .= $before_item . '<image onclick="toggleExif(\'map\');" src="' . get_stylesheet_directory_uri() . '/images/monde.png" width="16" height="16" />' . $after_item;
|
||||
// jquery
|
||||
//$exif_list .= $before_item . '<a id="map_link" href="#"><image src="' . get_stylesheet_directory_uri() . '/images/monde.png" width="16" height="16" /></a>' . $after_item;
|
||||
|
||||
//affichage map dans nouvelle fenetre
|
||||
//$exif_list .= $before_item . $start_geo_link . '<image src="' . get_stylesheet_directory_uri() . '/images/monde.png" width="16" height="16" />' . $end_geo_link . $after_item;
|
||||
*/
|
||||
|
||||
$before_block = '<div class="bloc_exif" id="' . $attachment->ID . '"><ul>';
|
||||
$after_block = '</ul></div><!-- .bloc_exif -->';
|
||||
|
||||
$liste_exif = $before_block;
|
||||
$attach = $attachment->ID;
|
||||
// ListeExif renvoie 3 paramètres dans un tableau:
|
||||
// -les exifs sous forme de liste
|
||||
// -latitude et longitude pour le javascript
|
||||
// -le caption ou le nom du fichier pour l'infoWindow
|
||||
list($exif_list, $gm_lat, $gm_lng, $title_marker) = ListeExif($metadata, $attach);
|
||||
|
||||
$liste_exif .= $exif_list;
|
||||
$liste_exif .= $after_block;
|
||||
echo $liste_exif;
|
||||
|
||||
?>
|
||||
|
||||
<div id="map<?php echo $attach; ?>" class="" style="display: block;"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
var contentString = "<?php echo $title_marker; ?>";
|
||||
var curr_infw;
|
||||
var latlng = new google.maps.LatLng(<?php echo $gm_lat; ?>, <?php echo $gm_lng; ?>);
|
||||
var myOptions = {
|
||||
/* http://code.google.com/intl/fr/apis/maps/documentation/javascript/reference.html#MapOptions */
|
||||
zoom: 11,
|
||||
center: latlng,
|
||||
scrollwheel: true,
|
||||
scaleControl: false,
|
||||
disableDefaultUI: false,
|
||||
mapTypeId: google.maps.MapTypeId.ROADMAP
|
||||
};
|
||||
var map = new google.maps.Map(document.getElementById("map<?php echo $attach; ?>"), myOptions);
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
</div><!-- .entry-attachment -->
|
||||
|
||||
<!--p>Description</p-->
|
||||
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?>
|
||||
|
||||
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
|
||||
|
||||
<div id="nav-below" class="navigation">
|
||||
<div class="nav-previous"><?php previous_image_link( false ); ?></div>
|
||||
<div class="nav-next"><?php next_image_link( false ); ?></div>
|
||||
</div><!-- #nav-below -->
|
||||
|
||||
</div><!-- .entry-content -->
|
||||
|
||||
<div class="entry-utility">
|
||||
<?php twentyten_posted_in(); ?>
|
||||
<?php edit_post_link( __( 'Edit', 'twentyten' ), ' <span class="edit-link">', '</span>' ); ?>
|
||||
</div><!-- .entry-utility -->
|
||||
</div><!-- #post-## -->
|
||||
|
||||
<?php comments_template(); ?>
|
||||
|
||||
<?php endwhile; // end of the loop. ?>
|
||||
67
exclus/_loop-single.php
Normal file
67
exclus/_loop-single.php
Normal file
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* The loop that displays a single post.
|
||||
*
|
||||
* The loop displays the posts and the post content. See
|
||||
* http://codex.wordpress.org/The_Loop to understand it and
|
||||
* http://codex.wordpress.org/Template_Tags to understand
|
||||
* the tags used in it.
|
||||
*
|
||||
* This can be overridden in child themes with loop-single.php.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Ten
|
||||
* @since Twenty Ten 1.2
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
|
||||
|
||||
<div id="nav-above" class="navigation">
|
||||
<div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div>
|
||||
<div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten' ) . '</span>' ); ?></div>
|
||||
</div><!-- #nav-above -->
|
||||
|
||||
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<h1 class="entry-title"><?php the_title(); ?></h1>
|
||||
|
||||
<div class="entry-meta">
|
||||
<?php twentyten_posted_on(); ?>
|
||||
</div><!-- .entry-meta -->
|
||||
|
||||
<div class="entry-content">
|
||||
<?php the_content(); ?>
|
||||
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
|
||||
</div><!-- .entry-content -->
|
||||
|
||||
<?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries ?>
|
||||
<div id="entry-author-info">
|
||||
<div id="author-avatar">
|
||||
<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?>
|
||||
</div><!-- #author-avatar -->
|
||||
<div id="author-description">
|
||||
<h2><?php printf( __( 'About %s', 'twentyten' ), get_the_author() ); ?></h2>
|
||||
<?php the_author_meta( 'description' ); ?>
|
||||
<div id="author-link">
|
||||
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" rel="author">
|
||||
<?php printf( __( 'View all posts by %s <span class="meta-nav">→</span>', 'twentyten' ), get_the_author() ); ?>
|
||||
</a>
|
||||
</div><!-- #author-link -->
|
||||
</div><!-- #author-description -->
|
||||
</div><!-- #entry-author-info -->
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="entry-utility">
|
||||
<?php twentyten_posted_in(); ?>
|
||||
<?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>
|
||||
</div><!-- .entry-utility -->
|
||||
</div><!-- #post-## -->
|
||||
|
||||
<div id="nav-below" class="navigation">
|
||||
<div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div>
|
||||
<div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten' ) . '</span>' ); ?></div>
|
||||
</div><!-- #nav-below -->
|
||||
|
||||
<?php comments_template( '', true ); ?>
|
||||
|
||||
<?php endwhile; // end of the loop. ?>
|
||||
116
exclus/daves-wordpress-live-search.css
Normal file
116
exclus/daves-wordpress-live-search.css
Normal file
@@ -0,0 +1,116 @@
|
||||
/** Dave's WordPress Live Search CSS **/
|
||||
ul.search_results
|
||||
{
|
||||
display: block;
|
||||
background-color:#fff;
|
||||
width:250px;
|
||||
max-height: 500px;
|
||||
position:absolute;
|
||||
top:20px;
|
||||
left:0px;
|
||||
overflow:auto;
|
||||
z-index: 9999;
|
||||
|
||||
list-style-type: none;
|
||||
list-style-image: none;
|
||||
list-style-position: inside;
|
||||
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
|
||||
-moz-box-shadow: 5px 5px 3px #222;
|
||||
-webkit-box-shadow: 5px 5px 3px #222;
|
||||
box-shadow: 5px 5px 3px #222;
|
||||
}
|
||||
|
||||
ul.search_results li
|
||||
{
|
||||
display: block;
|
||||
padding: 5px 10px 5px 10px;
|
||||
margin: 0px 0px 0px 0px;
|
||||
border-top: 1px solid #eee;
|
||||
border-bottom: 1px solid #aaa;
|
||||
text-align: left;
|
||||
|
||||
color: #000;
|
||||
background-color: #ddd;
|
||||
text-decoration: none;
|
||||
|
||||
}
|
||||
|
||||
ul.search_results li:hover
|
||||
{
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
ul.search_results li a, ul.search_results li a:visited
|
||||
{
|
||||
display: block;
|
||||
color: #000;
|
||||
margin-left: 0px;
|
||||
padding-left: 0px;
|
||||
text-decoration: none;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
ul.search_results p#daves-wordpress-live-search_author
|
||||
{
|
||||
margin: 0px;
|
||||
font-size: 90%;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
ul.search_results p#daves-wordpress-live-search_date
|
||||
{
|
||||
margin: 0px;
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
/* BEGIN post thumbnails */
|
||||
ul.search_results li.post_with_thumb a {
|
||||
width:150px;
|
||||
float:left;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
ul.search_results li.post_with_thumb img.post_thumb
|
||||
{
|
||||
float: left;
|
||||
margin: 3px 10px 10px 0px;
|
||||
height: 48px;
|
||||
width: 48px;
|
||||
border: 1px solid #888;
|
||||
}
|
||||
/* END post thumbnails */
|
||||
|
||||
/* BEGIN post excerpt */
|
||||
ul.search_results .excerpt, ul.search_results .meta
|
||||
{
|
||||
font-size: 75%;
|
||||
width: 100%;
|
||||
}
|
||||
/* END post excerpt */
|
||||
|
||||
ul.search_results .clearfix
|
||||
{
|
||||
float: none !important;
|
||||
clear: both !important;
|
||||
}
|
||||
|
||||
.search_footer {
|
||||
background-color: #888;
|
||||
width: 100%;
|
||||
text-align: right;
|
||||
padding: .5em 0;
|
||||
font-size: .9em;
|
||||
}
|
||||
|
||||
.search_footer a,
|
||||
.search_footer a:visited {
|
||||
color: #fff;
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
#search_results_activity_indicator{
|
||||
z-index:999999;
|
||||
}
|
||||
62
exclus/gm.js
Normal file
62
exclus/gm.js
Normal file
@@ -0,0 +1,62 @@
|
||||
<script type="text/javascript">
|
||||
|
||||
//var latlng = new google.maps.LatLng(47.087170, 6.713577);
|
||||
/**/
|
||||
var contentString = "<?php echo $title_marker; ?>";
|
||||
var curr_infw;
|
||||
var latlng = new google.maps.LatLng(<?php echo $gm_lat; ?>, <?php echo $gm_lng; ?>);
|
||||
var myOptions = {
|
||||
/* http://code.google.com/intl/fr/apis/maps/documentation/javascript/reference.html#MapOptions */
|
||||
zoom: 11,
|
||||
center: latlng,
|
||||
scrollwheel: true,
|
||||
scaleControl: false,
|
||||
disableDefaultUI: false,
|
||||
mapTypeId: google.maps.MapTypeId.ROADMAP
|
||||
/*
|
||||
navigationControl: true,
|
||||
navigationControlOptions: {
|
||||
style: google.maps.NavigationControlStyle.SMALL
|
||||
}*/
|
||||
};
|
||||
var map = new google.maps.Map(document.getElementById("map"), myOptions);
|
||||
|
||||
marker = createMarker(latlng, '', contentString, map);
|
||||
|
||||
function createMarker(point, title, content, map) {
|
||||
var myMarkerImage = new google.maps.MarkerImage('http://maps.google.com/mapfiles/arrow.png');
|
||||
var myMarkerShadow = new google.maps.MarkerImage('http://maps.google.com/mapfiles/arrowshadow.png');
|
||||
var marker = new google.maps.Marker({
|
||||
position: point,
|
||||
map: map,
|
||||
icon: myMarkerImage,
|
||||
shadow: myMarkerShadow,
|
||||
title: title
|
||||
});
|
||||
var infowindow = new google.maps.InfoWindow({
|
||||
//content: content
|
||||
content: createInfo(content,content),
|
||||
//width: 500,
|
||||
//height: 400
|
||||
});
|
||||
|
||||
google.maps.event.addListener(marker, 'click', function() { /* mouseover */
|
||||
if(curr_infw) { curr_infw.close();} // We check to see if there is an info window stored in curr_infw, if there is, we use .close() to hide the window
|
||||
curr_infw = infowindow; // Now we put our new info window in to the curr_infw variable
|
||||
infowindow.open(map, marker); // Now we open the window
|
||||
});
|
||||
return marker;
|
||||
};
|
||||
|
||||
// Create information window
|
||||
function createInfo(title, content) {
|
||||
var html = '<div class="infowindow">';
|
||||
html += '<strong>'+ title +'</strong>';
|
||||
html += '<p>'+content+'</p>';
|
||||
html += '<ul><li>Lat: <?php echo $gm_lat; ?></li>';
|
||||
html += '<li>Long: <?php echo $gm_lng; ?></li>';
|
||||
html += '</div>';
|
||||
return html;
|
||||
}
|
||||
|
||||
</script>
|
||||
284
exclus/loop-attachment jquery.php
Normal file
284
exclus/loop-attachment jquery.php
Normal file
@@ -0,0 +1,284 @@
|
||||
<?php
|
||||
/**
|
||||
* The loop that displays an attachment.
|
||||
*
|
||||
* The loop displays the posts and the post content. See
|
||||
* http://codex.wordpress.org/The_Loop to understand it and
|
||||
* http://codex.wordpress.org/Template_Tags to understand
|
||||
* the tags used in it.
|
||||
*
|
||||
* This can be overridden in child themes with loop-attachment.php.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Ten
|
||||
* @since Twenty Ten 1.2
|
||||
*/
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function toggleExif(id) {
|
||||
var exifDiv = document.getElementById(id);
|
||||
if (exifDiv.style.display == "inline") {
|
||||
exifDiv.style.display = "none";
|
||||
}
|
||||
else {
|
||||
exifDiv.style.display = "inline";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
|
||||
<style type="text/css">
|
||||
.entry-content img {max-width: 100000%; /* override */}
|
||||
</style>
|
||||
|
||||
<?php
|
||||
// return geo exif in a nice form
|
||||
/*
|
||||
function geo_frac2dec($str) {
|
||||
@list( $n, $d ) = explode( '/', $str );
|
||||
if ( !empty($d) )
|
||||
return $n / $d;
|
||||
return $str;
|
||||
}
|
||||
|
||||
function geo_pretty_fracs2dec($fracs) {
|
||||
return geo_frac2dec($fracs[0]) . '° ' .
|
||||
geo_frac2dec($fracs[1]) . '′ ' .
|
||||
geo_frac2dec($fracs[2]) . '″ ';
|
||||
}
|
||||
|
||||
function geo_single_fracs2dec($fracs) {
|
||||
return geo_frac2dec($fracs[0]) +
|
||||
geo_frac2dec($fracs[1]) / 60 +
|
||||
geo_frac2dec($fracs[2]) / 3600;
|
||||
}
|
||||
*/
|
||||
?>
|
||||
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
|
||||
|
||||
<?php if ( ! empty( $post->post_parent ) ) : ?>
|
||||
<div id="nav-above" class="navigation">
|
||||
<div class="nav-previous"><a href="<?php echo get_permalink( $post->post_parent ); ?>" title="<?php esc_attr( printf( __( 'Return to %s', 'twentyten' ), get_the_title( $post->post_parent ) ) ); ?>" rel="gallery"><?php
|
||||
/* translators: %s - title of parent post */
|
||||
printf( __( '<span class="meta-nav">←</span> %s', 'twentyten' ), get_the_title( $post->post_parent ) );
|
||||
?></a></div>
|
||||
</div><!-- #nav-above -->
|
||||
<?php endif; ?>
|
||||
|
||||
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<h1 class="entry-title"><?php the_title(); ?></h1>
|
||||
|
||||
<div class="entry-meta">
|
||||
<?php
|
||||
printf( __( '%1$s', 'twentyten-child' ),
|
||||
sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>',
|
||||
get_permalink(),
|
||||
esc_attr( get_the_time() ),
|
||||
get_the_date()
|
||||
)
|
||||
);
|
||||
if ( wp_attachment_is_image() ) {
|
||||
echo ' <span class="meta-sep">|</span> ';
|
||||
$metadata = wp_get_attachment_metadata();
|
||||
printf( __( 'Full size is %s pixels', 'twentyten' ),
|
||||
sprintf( '<a href="%1$s" title="%2$s">%3$s × %4$s</a>',
|
||||
wp_get_attachment_url(),
|
||||
esc_attr( __( 'Link to full-size image', 'twentyten' ) ),
|
||||
$metadata['width'],
|
||||
$metadata['height']
|
||||
)
|
||||
);
|
||||
}
|
||||
?>
|
||||
<?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
|
||||
</div><!-- .entry-meta -->
|
||||
|
||||
<div class="entry-content">
|
||||
<div class="entry-attachment">
|
||||
<?php if ( wp_attachment_is_image() ) :
|
||||
$attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) );
|
||||
foreach ( $attachments as $k => $attachment ) {
|
||||
if ( $attachment->ID == $post->ID )
|
||||
break;
|
||||
}
|
||||
$k++;
|
||||
// If there is more than 1 image attachment in a gallery
|
||||
if ( count( $attachments ) > 1 ) {
|
||||
if ( isset( $attachments[ $k ] ) )
|
||||
// get the URL of the next image attachment
|
||||
$next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
|
||||
else
|
||||
// or get the URL of the first image attachment
|
||||
$next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID );
|
||||
} else {
|
||||
// or, if there's only 1 image attachment, get the URL of the image
|
||||
$next_attachment_url = wp_get_attachment_url();
|
||||
}
|
||||
?>
|
||||
<p class="attachment"><a href="<?php echo $next_attachment_url; ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php
|
||||
$attachment_width = apply_filters( 'twentyten_attachment_size', 900 );
|
||||
$attachment_height = apply_filters( 'twentyten_attachment_height', 900 );
|
||||
echo wp_get_attachment_image( $post->ID, array( $attachment_width, $attachment_height ) ); // filterable image width with, essentially, no limit for image height.
|
||||
?></a></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php else : ?>
|
||||
<a href="<?php echo wp_get_attachment_url(); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php echo basename( get_permalink() ); ?></a>
|
||||
|
||||
<?php endif; ?>
|
||||
<!-- .entry-attachment -->
|
||||
<div class="entry-caption"><?php if ( !empty( $post->post_excerpt ) ) the_excerpt(); ?>
|
||||
</div><!-- .entry-caption -->
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="droite" onclick="toggleExif(<?php echo $attachment->ID; ?>);">Voir les Exif</div>
|
||||
|
||||
|
||||
<?php //print_r($metadata); ?>
|
||||
|
||||
<?php
|
||||
$geo_links = true;
|
||||
//echo $attachment->ID;
|
||||
$before_item = '<li>';
|
||||
$after_item = '</li>';
|
||||
$sep = ': ';
|
||||
$before_block = '<div class="bloc_exif" id="' . $attachment->ID . '"><ul>';
|
||||
$after_block = '</ul></div>';
|
||||
|
||||
$exif_list = $before_block;
|
||||
if ($metadata['image_meta']['latitude'])
|
||||
$latitude = $metadata['image_meta']['latitude'];
|
||||
if ($metadata['image_meta']['longitude'])
|
||||
$longitude = $metadata['image_meta']['longitude'];
|
||||
if ($metadata['image_meta']['latitude_ref'])
|
||||
$lat_ref = $metadata['image_meta']['latitude_ref'];
|
||||
if ($metadata['image_meta']['longitude_ref'])
|
||||
$lng_ref = $metadata['image_meta']['longitude_ref'];
|
||||
$lat = geo_single_fracs2dec($latitude);
|
||||
$lng = geo_single_fracs2dec($longitude);
|
||||
if ($lat_ref == 'S') { $neg_lat = '-'; } else { $neg_lat = ''; }
|
||||
if ($lng_ref == 'W') { $neg_lng = '-'; } else { $neg_lng = ''; }
|
||||
//$start_geo_link = '<a href="http://maps.google.com/maps?q=' . $neg_lat . number_format($lat,6) . '+' . $neg_lng . number_format($lng, 6) . '&z=11">';
|
||||
$start_geo_link = '<a href="http://maps.google.com/maps?q=' . $neg_lat . number_format($lat,6) . '+' . $neg_lng . number_format($lng, 6) . '&z=11">';
|
||||
$jquery_geo_link = 'http://maps.google.com/maps?q=' . $neg_lat . number_format($lat,6) . '+' . $neg_lng . number_format($lng, 6) . '&z=11';
|
||||
$end_geo_link = '</a>';
|
||||
|
||||
//echo '<b>' . $latitude . '-' . $longitude . '-' . $lat_ref . '-' . $lng_ref . '-' . $lat . '-' . $lng . '-' . $start_geo_link . '</b>';
|
||||
?>
|
||||
|
||||
<?php
|
||||
// Aperture
|
||||
if (!empty($metadata['image_meta']['aperture']))
|
||||
$exif_list .= $before_item . __('Aperture', 'twentyten-child') . $sep . "f/" . $metadata['image_meta']['aperture'] . $after_item;
|
||||
|
||||
// Shutter speed
|
||||
if (!empty($metadata['image_meta']['shutter_speed'])) {
|
||||
$exif_list .= $before_item . __('Shutter speed', 'twentyten-child') . $sep;
|
||||
if ((1 / $metadata['image_meta']['shutter_speed']) > 1) {
|
||||
$exif_list .= "1/";
|
||||
if ((number_format((1 / $metadata['image_meta']['shutter_speed']), 1)) == 1.3
|
||||
or number_format((1 / $metadata['image_meta']['shutter_speed']), 1) == 1.5
|
||||
or number_format((1 / $metadata['image_meta']['shutter_speed']), 1) == 1.6
|
||||
or number_format((1 / $metadata['image_meta']['shutter_speed']), 1) == 2.5) {
|
||||
$exif_list .= number_format((1 / $metadata['image_meta']['shutter_speed']), 1, '.', '') . " s" . $after_item;
|
||||
}
|
||||
else {
|
||||
$exif_list .= number_format((1 / $metadata['image_meta']['shutter_speed']), 0, '.', '') . " s" . $after_item;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$exif_list .= $metadata['image_meta']['shutter_speed']." s" . $after_item;
|
||||
}
|
||||
}
|
||||
// Focal length
|
||||
if (!empty($metadata['image_meta']['focal_length']))
|
||||
$exif_list .= $before_item . __('Focal length', 'twentyten-child') . $sep . $metadata['image_meta']['focal_length'] . " mm" . $after_item;
|
||||
// Camera
|
||||
if (!empty($metadata['image_meta']['camera']))
|
||||
$exif_list .= $before_item . __('Camera', 'twentyten-child') . $sep . $metadata['image_meta']['camera'] . $after_item;
|
||||
// Creation time
|
||||
if (!empty($metadata['image_meta']['created_timestamp']))
|
||||
$exif_list .= $before_item . __('Taken', 'twentyten-child') . $sep . date('j F, Y',$metadata['image_meta']['created_timestamp']) . $after_item;
|
||||
|
||||
// Latitude and Longtitude
|
||||
if ($latitude != 0 && $longitude != 0)
|
||||
//affichage dans un cadre map caché
|
||||
//$exif_list .= $before_item . '<div onclick="toggleExif(\'map\');" ><image src="' . get_stylesheet_directory_uri() . '/images/monde.png" width="16" height="16" /></div>' . $after_item;
|
||||
//$exif_list .= $before_item . '<image onclick="toggleExif(\'map\');" src="' . get_stylesheet_directory_uri() . '/images/monde.png" width="16" height="16" />' . $after_item;
|
||||
$exif_list .= $before_item . '<a id="map_link" href="#"><image src="' . get_stylesheet_directory_uri() . '/images/monde.png" width="16" height="16" /></a>' . $after_item;
|
||||
|
||||
//affichage map dans nouvelle fenetre
|
||||
//$exif_list .= $before_item . $start_geo_link . '<image src="' . get_stylesheet_directory_uri() . '/images/monde.png" width="16" height="16" />' . $end_geo_link . $after_item;
|
||||
|
||||
$exif_list .= $after_block;
|
||||
|
||||
echo $exif_list;
|
||||
?>
|
||||
|
||||
|
||||
<!--div id="map"></div-->
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(function() {
|
||||
jQuery("#map_link").click(function(event) {
|
||||
event.preventDefault();
|
||||
jQuery("#map").slideToggle();
|
||||
jQuery("#map").html('<iframe width="500" height="300" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="<?php echo $jquery_geo_link; ?>&ie=UTF8&t=p&vpsrc=0&ll=47.08717,6.713577&output=embed"></iframe><br /><small><a href="<?php echo $jquery_geo_link; ?>&ie=UTF8&t=h&vpsrc=0&ll=47.08717,6.713577&source=embed" style="text-align:left">Agrandir le plan</a></small>').css('display','block');
|
||||
/*jQuery("#map").css('display','block');*/
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="map"></div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
//var latlng = new google.maps.LatLng(47.087170, 6.713577);
|
||||
/*
|
||||
var latlng = new google.maps.LatLng(<?php echo $neg_lat . number_format($lat,6); ?>, <?php echo $neg_lng . number_format($lng, 6); ?>);
|
||||
var myOptions = {
|
||||
zoom: 11,
|
||||
center: latlng,
|
||||
scrollwheel: true,
|
||||
scaleControl: false,
|
||||
disableDefaultUI: false,
|
||||
mapTypeId: google.maps.MapTypeId.ROADMAP
|
||||
};
|
||||
var map = new google.maps.Map(document.getElementById("map"),
|
||||
myOptions);
|
||||
|
||||
var marker = new google.maps.Marker({
|
||||
map: map,
|
||||
|
||||
position: map.getCenter()
|
||||
});*/
|
||||
</script>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div><!-- .entry-attachment -->
|
||||
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?>
|
||||
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
|
||||
|
||||
<div id="nav-below" class="navigation">
|
||||
<div class="nav-previous"><?php previous_image_link( false ); ?></div>
|
||||
<div class="nav-next"><?php next_image_link( false ); ?></div>
|
||||
</div><!-- #nav-below -->
|
||||
|
||||
</div><!-- .entry-content -->
|
||||
|
||||
<div class="entry-utility">
|
||||
<?php twentyten_posted_in(); ?>
|
||||
<?php edit_post_link( __( 'Edit', 'twentyten' ), ' <span class="edit-link">', '</span>' ); ?>
|
||||
</div><!-- .entry-utility -->
|
||||
</div><!-- #post-## -->
|
||||
|
||||
<?php comments_template(); ?>
|
||||
|
||||
<?php endwhile; // end of the loop. ?>
|
||||
300
exclus/loop-attachment ok.php
Normal file
300
exclus/loop-attachment ok.php
Normal file
@@ -0,0 +1,300 @@
|
||||
<?php
|
||||
/**
|
||||
* The loop that displays an attachment.
|
||||
*
|
||||
* The loop displays the posts and the post content. See
|
||||
* http://codex.wordpress.org/The_Loop to understand it and
|
||||
* http://codex.wordpress.org/Template_Tags to understand
|
||||
* the tags used in it.
|
||||
*
|
||||
* This can be overridden in child themes with loop-attachment.php.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Ten
|
||||
* @since Twenty Ten 1.2
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
// return geo exif in a nice form
|
||||
/*
|
||||
function geo_frac2dec($str) {
|
||||
@list( $n, $d ) = explode( '/', $str );
|
||||
if ( !empty($d) )
|
||||
return $n / $d;
|
||||
return $str;
|
||||
}
|
||||
|
||||
function geo_pretty_fracs2dec($fracs) {
|
||||
return geo_frac2dec($fracs[0]) . '° ' .
|
||||
geo_frac2dec($fracs[1]) . '′ ' .
|
||||
geo_frac2dec($fracs[2]) . '″ ';
|
||||
}
|
||||
|
||||
function geo_single_fracs2dec($fracs) {
|
||||
return geo_frac2dec($fracs[0]) +
|
||||
geo_frac2dec($fracs[1]) / 60 +
|
||||
geo_frac2dec($fracs[2]) / 3600;
|
||||
}
|
||||
*/
|
||||
?>
|
||||
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
|
||||
|
||||
<?php if ( ! empty( $post->post_parent ) ) : ?>
|
||||
<div id="nav-above" class="navigation">
|
||||
<div class="nav-previous"><a href="<?php echo get_permalink( $post->post_parent ); ?>" title="<?php esc_attr( printf( __( 'Return to %s', 'twentyten' ), get_the_title( $post->post_parent ) ) ); ?>" rel="gallery"><?php
|
||||
/* translators: %s - title of parent post */
|
||||
printf( __( '<span class="meta-nav">←</span> %s', 'twentyten' ), get_the_title( $post->post_parent ) );
|
||||
?></a></div>
|
||||
</div><!-- #nav-above -->
|
||||
<?php endif; ?>
|
||||
|
||||
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<h1 class="entry-title"><?php the_title(); ?></h1>
|
||||
|
||||
<div class="entry-meta">
|
||||
<?php
|
||||
printf( __( '%1$s', 'twentyten-child' ),
|
||||
sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>',
|
||||
get_permalink(),
|
||||
esc_attr( get_the_time() ),
|
||||
get_the_date()
|
||||
)
|
||||
);
|
||||
if ( wp_attachment_is_image() ) {
|
||||
echo ' <span class="meta-sep">|</span> ';
|
||||
$metadata = wp_get_attachment_metadata();
|
||||
printf( __( 'Full size is %s pixels', 'twentyten' ),
|
||||
sprintf( '<a href="%1$s" title="%2$s">%3$s × %4$s</a>',
|
||||
wp_get_attachment_url(),
|
||||
esc_attr( __( 'Link to full-size image', 'twentyten' ) ),
|
||||
$metadata['width'],
|
||||
$metadata['height']
|
||||
)
|
||||
);
|
||||
}
|
||||
?>
|
||||
<?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
|
||||
</div><!-- .entry-meta -->
|
||||
|
||||
<div class="entry-content">
|
||||
<div class="entry-attachment">
|
||||
<?php if ( wp_attachment_is_image() ) :
|
||||
$attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) );
|
||||
foreach ( $attachments as $k => $attachment ) {
|
||||
if ( $attachment->ID == $post->ID )
|
||||
break;
|
||||
}
|
||||
$k++;
|
||||
// If there is more than 1 image attachment in a gallery
|
||||
if ( count( $attachments ) > 1 ) {
|
||||
if ( isset( $attachments[ $k ] ) )
|
||||
// get the URL of the next image attachment
|
||||
$next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
|
||||
else
|
||||
// or get the URL of the first image attachment
|
||||
$next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID );
|
||||
} else {
|
||||
// or, if there's only 1 image attachment, get the URL of the image
|
||||
$next_attachment_url = wp_get_attachment_url();
|
||||
}
|
||||
?>
|
||||
<p class="attachment"><a href="<?php echo $next_attachment_url; ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php
|
||||
$attachment_width = apply_filters( 'twentyten_attachment_size', 900 );
|
||||
$attachment_height = apply_filters( 'twentyten_attachment_height', 900 );
|
||||
echo wp_get_attachment_image( $post->ID, array( $attachment_width, $attachment_height ) ); // filterable image width with, essentially, no limit for image height.
|
||||
?></a></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php else : ?>
|
||||
<a href="<?php echo wp_get_attachment_url(); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php echo basename( get_permalink() ); ?></a>
|
||||
|
||||
<?php endif; ?>
|
||||
<!-- .entry-attachment -->
|
||||
<div class="entry-caption"><?php if ( !empty( $post->post_excerpt ) ) the_excerpt(); ?>
|
||||
</div><!-- .entry-caption -->
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="droite" onclick="toggleExif(<?php echo $attachment->ID; ?>);">Voir les Exif</div>
|
||||
|
||||
|
||||
<?php //print_r($metadata); ?>
|
||||
|
||||
<?php
|
||||
$geo_links = true;
|
||||
//echo $attachment->ID;
|
||||
$before_item = '<li>';
|
||||
$after_item = '</li>';
|
||||
$sep = ': ';
|
||||
$before_block = '<div class="bloc_exif" id="' . $attachment->ID . '"><ul>';
|
||||
$after_block = '</ul></div>';
|
||||
|
||||
$exif_list = $before_block;
|
||||
if ($metadata['image_meta']['latitude'])
|
||||
$latitude = $metadata['image_meta']['latitude'];
|
||||
if ($metadata['image_meta']['longitude'])
|
||||
$longitude = $metadata['image_meta']['longitude'];
|
||||
if ($metadata['image_meta']['latitude_ref'])
|
||||
$lat_ref = $metadata['image_meta']['latitude_ref'];
|
||||
if ($metadata['image_meta']['longitude_ref'])
|
||||
$lng_ref = $metadata['image_meta']['longitude_ref'];
|
||||
$lat = geo_single_fracs2dec($latitude);
|
||||
$lng = geo_single_fracs2dec($longitude);
|
||||
if ($lat_ref == 'S') { $neg_lat = '-'; } else { $neg_lat = ''; }
|
||||
if ($lng_ref == 'W') { $neg_lng = '-'; } else { $neg_lng = ''; }
|
||||
//$start_geo_link = '<a href="http://maps.google.com/maps?q=' . $neg_lat . number_format($lat,6) . '+' . $neg_lng . number_format($lng, 6) . '&z=11">';
|
||||
$start_geo_link = '<a href="http://maps.google.com/maps?q=' . $neg_lat . number_format($lat,6) . '+' . $neg_lng . number_format($lng, 6) . '&z=11">';
|
||||
$jquery_geo_link = 'http://maps.google.com/maps?q=' . $neg_lat . number_format($lat,6) . '+' . $neg_lng . number_format($lng, 6) . '&z=11';
|
||||
$end_geo_link = '</a>';
|
||||
|
||||
// Aperture
|
||||
if (!empty($metadata['image_meta']['aperture']))
|
||||
$exif_list .= $before_item . __('Aperture', 'twentyten-child') . $sep . "f/" . $metadata['image_meta']['aperture'] . $after_item;
|
||||
|
||||
// Shutter speed
|
||||
if (!empty($metadata['image_meta']['shutter_speed'])) {
|
||||
$exif_list .= $before_item . __('Shutter speed', 'twentyten-child') . $sep;
|
||||
if ((1 / $metadata['image_meta']['shutter_speed']) > 1) {
|
||||
$exif_list .= "1/";
|
||||
if ((number_format((1 / $metadata['image_meta']['shutter_speed']), 1)) == 1.3
|
||||
or number_format((1 / $metadata['image_meta']['shutter_speed']), 1) == 1.5
|
||||
or number_format((1 / $metadata['image_meta']['shutter_speed']), 1) == 1.6
|
||||
or number_format((1 / $metadata['image_meta']['shutter_speed']), 1) == 2.5) {
|
||||
$exif_list .= number_format((1 / $metadata['image_meta']['shutter_speed']), 1, '.', '') . " s" . $after_item;
|
||||
}
|
||||
else {
|
||||
$exif_list .= number_format((1 / $metadata['image_meta']['shutter_speed']), 0, '.', '') . " s" . $after_item;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$exif_list .= $metadata['image_meta']['shutter_speed']." s" . $after_item;
|
||||
}
|
||||
}
|
||||
// Focal length
|
||||
if (!empty($metadata['image_meta']['focal_length']))
|
||||
$exif_list .= $before_item . __('Focal length', 'twentyten-child') . $sep . $metadata['image_meta']['focal_length'] . " mm" . $after_item;
|
||||
// Camera
|
||||
if (!empty($metadata['image_meta']['camera']))
|
||||
$exif_list .= $before_item . __('Camera', 'twentyten-child') . $sep . $metadata['image_meta']['camera'] . $after_item;
|
||||
// Creation time
|
||||
if (!empty($metadata['image_meta']['created_timestamp']))
|
||||
$exif_list .= $before_item . __('Taken', 'twentyten-child') . $sep . date('j F, Y',$metadata['image_meta']['created_timestamp']) . $after_item;
|
||||
|
||||
// Latitude and Longtitude
|
||||
if ($latitude != 0 && $longitude != 0)
|
||||
//affichage dans un cadre map caché
|
||||
//$exif_list .= $before_item . '<div onclick="toggleExif(\'map\');" ><image src="' . get_stylesheet_directory_uri() . '/images/monde.png" width="16" height="16" /></div>' . $after_item;
|
||||
$exif_list .= $before_item . '<image onclick="toggleExif(\'map\');" src="' . get_stylesheet_directory_uri() . '/images/monde.png" width="16" height="16" />' . $after_item;
|
||||
// jquery
|
||||
//$exif_list .= $before_item . '<a id="map_link" href="#"><image src="' . get_stylesheet_directory_uri() . '/images/monde.png" width="16" height="16" /></a>' . $after_item;
|
||||
|
||||
//affichage map dans nouvelle fenetre
|
||||
//$exif_list .= $before_item . $start_geo_link . '<image src="' . get_stylesheet_directory_uri() . '/images/monde.png" width="16" height="16" />' . $end_geo_link . $after_item;
|
||||
|
||||
$exif_list .= $after_block;
|
||||
|
||||
echo $exif_list;
|
||||
|
||||
// Titre du marker
|
||||
if ($metadata['image_meta']['caption']) $title_marker = $metadata['image_meta']['caption'];
|
||||
elseif ($metadata['file']) $title_marker = $metadata['file'];
|
||||
?>
|
||||
|
||||
|
||||
<div id="map"></div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
//var latlng = new google.maps.LatLng(47.087170, 6.713577);
|
||||
/**/
|
||||
var contentString = "<?php echo $title_marker; ?>";
|
||||
var curr_infw;
|
||||
var latlng = new google.maps.LatLng(<?php echo $neg_lat . number_format($lat,6); ?>, <?php echo $neg_lng . number_format($lng, 6); ?>);
|
||||
var myOptions = {
|
||||
/* http://code.google.com/intl/fr/apis/maps/documentation/javascript/reference.html#MapOptions */
|
||||
zoom: 11,
|
||||
center: latlng,
|
||||
scrollwheel: true,
|
||||
scaleControl: false,
|
||||
disableDefaultUI: false,
|
||||
mapTypeId: google.maps.MapTypeId.ROADMAP
|
||||
/*
|
||||
navigationControl: true,
|
||||
navigationControlOptions: {
|
||||
style: google.maps.NavigationControlStyle.SMALL
|
||||
}*/
|
||||
};
|
||||
var map = new google.maps.Map(document.getElementById("map"), myOptions);
|
||||
|
||||
marker = createMarker(latlng, '', contentString, map);
|
||||
|
||||
function createMarker(point, title, content, map) {
|
||||
var myMarkerImage = new google.maps.MarkerImage('http://maps.google.com/mapfiles/arrow.png');
|
||||
var myMarkerShadow = new google.maps.MarkerImage('http://maps.google.com/mapfiles/arrowshadow.png');
|
||||
var marker = new google.maps.Marker({
|
||||
position: point,
|
||||
map: map,
|
||||
icon: myMarkerImage,
|
||||
shadow: myMarkerShadow,
|
||||
title: title
|
||||
});
|
||||
var infowindow = new google.maps.InfoWindow({
|
||||
//content: content
|
||||
content: createInfo(content,content),
|
||||
//width: 500,
|
||||
//height: 400
|
||||
});
|
||||
|
||||
google.maps.event.addListener(marker, 'click', function() { /* mouseover */
|
||||
if(curr_infw) { curr_infw.close();} // We check to see if there is an info window stored in curr_infw, if there is, we use .close() to hide the window
|
||||
curr_infw = infowindow; // Now we put our new info window in to the curr_infw variable
|
||||
infowindow.open(map, marker); // Now we open the window
|
||||
});
|
||||
return marker;
|
||||
};
|
||||
|
||||
// Create information window
|
||||
function createInfo(title, content) {
|
||||
var html = '<div class="infowindow">';
|
||||
html += '<strong>'+ title +'</strong>';
|
||||
html += '<p>'+content+'</p>';
|
||||
html += '<ul><li>Lat: <?php echo $neg_lat . number_format($lat,6); ?></li>';
|
||||
html += '<li>Long: <?php echo $neg_lng . number_format($lng, 6); ?></li>';
|
||||
html += '</div>';
|
||||
return html;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div><!-- .entry-attachment -->
|
||||
|
||||
<!--p>Description</p-->
|
||||
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?>
|
||||
|
||||
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
|
||||
|
||||
<div id="nav-below" class="navigation">
|
||||
<div class="nav-previous"><?php previous_image_link( false ); ?></div>
|
||||
<div class="nav-next"><?php next_image_link( false ); ?></div>
|
||||
</div><!-- #nav-below -->
|
||||
|
||||
</div><!-- .entry-content -->
|
||||
|
||||
<div class="entry-utility">
|
||||
<?php twentyten_posted_in(); ?>
|
||||
<?php edit_post_link( __( 'Edit', 'twentyten' ), ' <span class="edit-link">', '</span>' ); ?>
|
||||
</div><!-- .entry-utility -->
|
||||
</div><!-- #post-## -->
|
||||
|
||||
<?php comments_template(); ?>
|
||||
|
||||
<?php endwhile; // end of the loop. ?>
|
||||
320
exclus/loop-attachment v1.php
Normal file
320
exclus/loop-attachment v1.php
Normal file
@@ -0,0 +1,320 @@
|
||||
<?php
|
||||
/**
|
||||
* The loop that displays an attachment.
|
||||
*
|
||||
* The loop displays the posts and the post content. See
|
||||
* http://codex.wordpress.org/The_Loop to understand it and
|
||||
* http://codex.wordpress.org/Template_Tags to understand
|
||||
* the tags used in it.
|
||||
*
|
||||
* This can be overridden in child themes with loop-attachment.php.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Ten
|
||||
* @since Twenty Ten 1.2
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
function ListeExif($meta, $attach){
|
||||
$before_item = '<li>';
|
||||
$after_item = '</li>';
|
||||
$sep = ': ';
|
||||
$zoom = '11';
|
||||
|
||||
if ($meta['image_meta']['latitude'])
|
||||
$latitude = $meta['image_meta']['latitude'];
|
||||
if ($meta['image_meta']['longitude'])
|
||||
$longitude = $meta['image_meta']['longitude'];
|
||||
if ($meta['image_meta']['latitude_ref'])
|
||||
$lat_ref = $meta['image_meta']['latitude_ref'];
|
||||
if ($meta['image_meta']['longitude_ref'])
|
||||
$lng_ref = $meta['image_meta']['longitude_ref'];
|
||||
|
||||
$lat = geo_single_fracs2dec($latitude);
|
||||
$lng = geo_single_fracs2dec($longitude);
|
||||
|
||||
if ($lat_ref == 'S') { $neg_lat = '-'; } else { $neg_lat = ''; }
|
||||
if ($lng_ref == 'W') { $neg_lng = '-'; } else { $neg_lng = ''; }
|
||||
|
||||
$gm_lat = $neg_lat . number_format($lat,6);
|
||||
$gm_lng = $neg_lng . number_format($lng, 6);
|
||||
|
||||
//$start_geo_link = '<a href="http://maps.google.com/maps?q=' . $neg_lat . number_format($lat,6) . '+' . $neg_lng . number_format($lng, 6) . '&z=11">';
|
||||
$start_geo_link = '<a href="http://maps.google.com/maps?q=' . $neg_lat . number_format($lat,6) . '+' . $neg_lng . number_format($lng, 6) . '&z=11">';
|
||||
//$jquery_geo_link = 'http://maps.google.com/maps?q=' . $neg_lat . number_format($lat,6) . '+' . $neg_lng . number_format($lng, 6) . '&z=11';
|
||||
$end_geo_link = '</a>';
|
||||
|
||||
// Aperture
|
||||
if (!empty($meta['image_meta']['aperture']))
|
||||
$exif_list .= $before_item . __('Aperture', 'twentyten-child') . $sep . "f/" . $meta['image_meta']['aperture'] . $after_item;
|
||||
|
||||
// Shutter speed
|
||||
if (!empty($meta['image_meta']['shutter_speed'])) {
|
||||
$exif_list .= $before_item . __('Shutter speed', 'twentyten-child') . $sep;
|
||||
if ((1 / $meta['image_meta']['shutter_speed']) > 1) {
|
||||
$exif_list .= "1/";
|
||||
if ((number_format((1 / $meta['image_meta']['shutter_speed']), 1)) == 1.3
|
||||
or number_format((1 / $meta['image_meta']['shutter_speed']), 1) == 1.5
|
||||
or number_format((1 / $meta['image_meta']['shutter_speed']), 1) == 1.6
|
||||
or number_format((1 / $meta['image_meta']['shutter_speed']), 1) == 2.5) {
|
||||
$exif_list .= number_format((1 / $meta['image_meta']['shutter_speed']), 1, '.', '') . " s" . $after_item;
|
||||
}
|
||||
else {
|
||||
$exif_list .= number_format((1 / $meta['image_meta']['shutter_speed']), 0, '.', '') . " s" . $after_item;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$exif_list .= $meta['image_meta']['shutter_speed']." s" . $after_item;
|
||||
}
|
||||
}
|
||||
// Focal length
|
||||
if (!empty($meta['image_meta']['focal_length']))
|
||||
$exif_list .= $before_item . __('Focal length', 'twentyten-child') . $sep . $meta['image_meta']['focal_length'] . " mm" . $after_item;
|
||||
// Camera
|
||||
if (!empty($meta['image_meta']['camera']))
|
||||
$exif_list .= $before_item . __('Camera', 'twentyten-child') . $sep . $meta['image_meta']['camera'] . $after_item;
|
||||
// Creation time
|
||||
if (!empty($meta['image_meta']['created_timestamp']))
|
||||
$exif_list .= $before_item . __('Taken', 'twentyten-child') . $sep . date('j F, Y',$meta['image_meta']['created_timestamp']) . $after_item;
|
||||
|
||||
// Latitude and Longtitude
|
||||
if ($latitude != 0 && $longitude != 0)
|
||||
//affichage dans un cadre map caché
|
||||
//$exif_list .= $before_item . '<div onclick="toggleExif(\'map\');" ><image src="' . get_stylesheet_directory_uri() . '/images/monde.png" width="16" height="16" /></div>' . $after_item;
|
||||
$exif_list .= $before_item . '<image onclick="toggleExif(\'map\');" src="' . get_stylesheet_directory_uri() . '/images/monde.png" width="16" height="16" />' . $after_item;
|
||||
// jquery
|
||||
//$exif_list .= $before_item . '<a id="map_link" href="#"><image src="' . get_stylesheet_directory_uri() . '/images/monde.png" width="16" height="16" /></a>' . $after_item;
|
||||
|
||||
//affichage map dans nouvelle fenetre
|
||||
//$exif_list .= $before_item . $start_geo_link . '<image src="' . get_stylesheet_directory_uri() . '/images/monde.png" width="16" height="16" />' . $end_geo_link . $after_item;
|
||||
|
||||
// Titre du marker
|
||||
if ($meta['image_meta']['caption']) $title_marker = $meta['image_meta']['caption'];
|
||||
elseif ($meta['file']) $title_marker = $meta['file'];
|
||||
|
||||
return array($exif_list, $gm_lat, $gm_lng, $title_marker);
|
||||
}
|
||||
|
||||
// return geo exif in a nice form
|
||||
/*
|
||||
function geo_frac2dec($str) {
|
||||
@list( $n, $d ) = explode( '/', $str );
|
||||
if ( !empty($d) )
|
||||
return $n / $d;
|
||||
return $str;
|
||||
}
|
||||
|
||||
function geo_pretty_fracs2dec($fracs) {
|
||||
return geo_frac2dec($fracs[0]) . '° ' .
|
||||
geo_frac2dec($fracs[1]) . '′ ' .
|
||||
geo_frac2dec($fracs[2]) . '″ ';
|
||||
}
|
||||
|
||||
function geo_single_fracs2dec($fracs) {
|
||||
return geo_frac2dec($fracs[0]) +
|
||||
geo_frac2dec($fracs[1]) / 60 +
|
||||
geo_frac2dec($fracs[2]) / 3600;
|
||||
}
|
||||
*/
|
||||
?>
|
||||
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
|
||||
|
||||
<?php if ( ! empty( $post->post_parent ) ) : ?>
|
||||
<div id="nav-above" class="navigation">
|
||||
<div class="nav-previous"><a href="<?php echo get_permalink( $post->post_parent ); ?>" title="<?php esc_attr( printf( __( 'Return to %s', 'twentyten' ), get_the_title( $post->post_parent ) ) ); ?>" rel="gallery"><?php
|
||||
/* translators: %s - title of parent post */
|
||||
printf( __( '<span class="meta-nav">←</span> %s', 'twentyten' ), get_the_title( $post->post_parent ) );
|
||||
?></a></div>
|
||||
</div><!-- #nav-above -->
|
||||
<?php endif; ?>
|
||||
|
||||
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<h1 class="entry-title"><?php the_title(); ?></h1>
|
||||
|
||||
<div class="entry-meta">
|
||||
<?php
|
||||
printf( __( '%1$s', 'twentyten-child' ),
|
||||
sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>',
|
||||
get_permalink(),
|
||||
esc_attr( get_the_time() ),
|
||||
get_the_date()
|
||||
)
|
||||
);
|
||||
if ( wp_attachment_is_image() ) {
|
||||
echo ' <span class="meta-sep">|</span> ';
|
||||
$metadata = wp_get_attachment_metadata();
|
||||
printf( __( 'Full size is %s pixels', 'twentyten' ),
|
||||
sprintf( '<a href="%1$s" title="%2$s">%3$s × %4$s</a>',
|
||||
wp_get_attachment_url(),
|
||||
esc_attr( __( 'Link to full-size image', 'twentyten' ) ),
|
||||
$metadata['width'],
|
||||
$metadata['height']
|
||||
)
|
||||
);
|
||||
}
|
||||
?>
|
||||
<?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
|
||||
</div><!-- .entry-meta -->
|
||||
|
||||
<div class="entry-content">
|
||||
<div class="entry-attachment">
|
||||
<?php if ( wp_attachment_is_image() ) :
|
||||
$attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) );
|
||||
foreach ( $attachments as $k => $attachment ) {
|
||||
if ( $attachment->ID == $post->ID )
|
||||
break;
|
||||
}
|
||||
$k++;
|
||||
// If there is more than 1 image attachment in a gallery
|
||||
if ( count( $attachments ) > 1 ) {
|
||||
if ( isset( $attachments[ $k ] ) )
|
||||
// get the URL of the next image attachment
|
||||
$next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
|
||||
else
|
||||
// or get the URL of the first image attachment
|
||||
$next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID );
|
||||
} else {
|
||||
// or, if there's only 1 image attachment, get the URL of the image
|
||||
$next_attachment_url = wp_get_attachment_url();
|
||||
}
|
||||
?>
|
||||
<p class="attachment"><a href="<?php echo $next_attachment_url; ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php
|
||||
$attachment_width = apply_filters( 'twentyten_attachment_size', 900 );
|
||||
$attachment_height = apply_filters( 'twentyten_attachment_height', 900 );
|
||||
echo wp_get_attachment_image( $post->ID, array( $attachment_width, $attachment_height ) ); // filterable image width with, essentially, no limit for image height.
|
||||
?></a></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php else : ?>
|
||||
<a href="<?php echo wp_get_attachment_url(); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php echo basename( get_permalink() ); ?></a>
|
||||
|
||||
<?php endif; ?>
|
||||
<!-- .entry-attachment -->
|
||||
<div class="entry-caption"><?php if ( !empty( $post->post_excerpt ) ) the_excerpt(); ?>
|
||||
</div><!-- .entry-caption -->
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="droite" onclick="toggleExif(<?php echo $attachment->ID; ?>);">Voir les Exif</div>
|
||||
|
||||
|
||||
<?php //print_r($metadata); ?>
|
||||
|
||||
<?php
|
||||
//$geo_links = true;
|
||||
$attach = $attachment->ID;
|
||||
|
||||
//echo $attachment->ID;
|
||||
$before_block = '<div class="bloc_exif" id="' . $attach . '"><ul>';
|
||||
$after_block = '</ul></div><!-- .bloc_exif -->';
|
||||
$liste_exif = $before_block;
|
||||
|
||||
list($exif_list, $gm_lat, $gm_lng, $title_marker) = ListeExif($metadata, $attach);
|
||||
|
||||
$liste_exif .= $exif_list;
|
||||
$liste_exif .= $after_block;
|
||||
|
||||
echo $liste_exif;
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<div id="map"></div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
//var latlng = new google.maps.LatLng(47.087170, 6.713577);
|
||||
/**/
|
||||
var contentString = "<?php echo $title_marker; ?>";
|
||||
var curr_infw;
|
||||
var latlng = new google.maps.LatLng(<?php echo $gm_lat; ?>, <?php echo $gm_lng; ?>);
|
||||
var myOptions = {
|
||||
/* http://code.google.com/intl/fr/apis/maps/documentation/javascript/reference.html#MapOptions */
|
||||
zoom: 11,
|
||||
center: latlng,
|
||||
scrollwheel: true,
|
||||
scaleControl: false,
|
||||
disableDefaultUI: false,
|
||||
mapTypeId: google.maps.MapTypeId.ROADMAP
|
||||
/*
|
||||
navigationControl: true,
|
||||
navigationControlOptions: {
|
||||
style: google.maps.NavigationControlStyle.SMALL
|
||||
}*/
|
||||
};
|
||||
var map = new google.maps.Map(document.getElementById("map"), myOptions);
|
||||
|
||||
marker = createMarker(latlng, '', contentString, map);
|
||||
|
||||
function createMarker(point, title, content, map) {
|
||||
var myMarkerImage = new google.maps.MarkerImage('http://maps.google.com/mapfiles/arrow.png');
|
||||
var myMarkerShadow = new google.maps.MarkerImage('http://maps.google.com/mapfiles/arrowshadow.png');
|
||||
var marker = new google.maps.Marker({
|
||||
position: point,
|
||||
map: map,
|
||||
icon: myMarkerImage,
|
||||
shadow: myMarkerShadow,
|
||||
title: title
|
||||
});
|
||||
var infowindow = new google.maps.InfoWindow({
|
||||
//content: content
|
||||
content: createInfo(content,content),
|
||||
//width: 500,
|
||||
//height: 400
|
||||
});
|
||||
|
||||
google.maps.event.addListener(marker, 'click', function() { /* mouseover */
|
||||
if(curr_infw) { curr_infw.close();} // We check to see if there is an info window stored in curr_infw, if there is, we use .close() to hide the window
|
||||
curr_infw = infowindow; // Now we put our new info window in to the curr_infw variable
|
||||
infowindow.open(map, marker); // Now we open the window
|
||||
});
|
||||
return marker;
|
||||
};
|
||||
|
||||
// Create information window
|
||||
function createInfo(title, content) {
|
||||
var html = '<div class="infowindow">';
|
||||
html += '<strong>'+ title +'</strong>';
|
||||
html += '<p>'+content+'</p>';
|
||||
html += '<ul><li>Lat: <?php echo $gm_lat; ?></li>';
|
||||
html += '<li>Long: <?php echo $gm_lng; ?></li>';
|
||||
html += '</div>';
|
||||
return html;
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div><!-- .entry-attachment -->
|
||||
|
||||
<!--p>Description</p-->
|
||||
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?>
|
||||
|
||||
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
|
||||
|
||||
<div id="nav-below" class="navigation">
|
||||
<div class="nav-previous"><?php previous_image_link( false ); ?></div>
|
||||
<div class="nav-next"><?php next_image_link( false ); ?></div>
|
||||
</div><!-- #nav-below -->
|
||||
|
||||
</div><!-- .entry-content -->
|
||||
|
||||
<div class="entry-utility">
|
||||
<?php twentyten_posted_in(); ?>
|
||||
<?php edit_post_link( __( 'Edit', 'twentyten' ), ' <span class="edit-link">', '</span>' ); ?>
|
||||
</div><!-- .entry-utility -->
|
||||
</div><!-- #post-## -->
|
||||
|
||||
<?php comments_template(); ?>
|
||||
|
||||
<?php endwhile; // end of the loop. ?>
|
||||
180
exclus/loop-attachment v2.php
Normal file
180
exclus/loop-attachment v2.php
Normal file
@@ -0,0 +1,180 @@
|
||||
<?php
|
||||
/**
|
||||
* The loop that displays an attachment.
|
||||
*
|
||||
* The loop displays the posts and the post content. See
|
||||
* http://codex.wordpress.org/The_Loop to understand it and
|
||||
* http://codex.wordpress.org/Template_Tags to understand
|
||||
* the tags used in it.
|
||||
*
|
||||
* This can be overridden in child themes with loop-attachment.php.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Ten
|
||||
* @since Twenty Ten 1.2
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
// return geo exif in a nice form
|
||||
/*
|
||||
function geo_frac2dec($str) {
|
||||
@list( $n, $d ) = explode( '/', $str );
|
||||
if ( !empty($d) )
|
||||
return $n / $d;
|
||||
return $str;
|
||||
}
|
||||
|
||||
function geo_pretty_fracs2dec($fracs) {
|
||||
return geo_frac2dec($fracs[0]) . '° ' .
|
||||
geo_frac2dec($fracs[1]) . '′ ' .
|
||||
geo_frac2dec($fracs[2]) . '″ ';
|
||||
}
|
||||
|
||||
function geo_single_fracs2dec($fracs) {
|
||||
return geo_frac2dec($fracs[0]) +
|
||||
geo_frac2dec($fracs[1]) / 60 +
|
||||
geo_frac2dec($fracs[2]) / 3600;
|
||||
}
|
||||
*/
|
||||
?>
|
||||
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
|
||||
|
||||
<?php if ( ! empty( $post->post_parent ) ) : ?>
|
||||
<div id="nav-above" class="navigation">
|
||||
<div class="nav-previous"><a href="<?php echo get_permalink( $post->post_parent ); ?>" title="<?php esc_attr( printf( __( 'Return to %s', 'twentyten' ), get_the_title( $post->post_parent ) ) ); ?>" rel="gallery"><?php
|
||||
/* translators: %s - title of parent post */
|
||||
printf( __( '<span class="meta-nav">←</span> %s', 'twentyten' ), get_the_title( $post->post_parent ) );
|
||||
?></a></div>
|
||||
</div><!-- #nav-above -->
|
||||
<?php endif; ?>
|
||||
|
||||
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<h1 class="entry-title"><?php the_title(); ?></h1>
|
||||
|
||||
<div class="entry-meta">
|
||||
<?php
|
||||
printf( __( '%1$s', 'twentyten-child' ),
|
||||
sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>',
|
||||
get_permalink(),
|
||||
esc_attr( get_the_time() ),
|
||||
get_the_date()
|
||||
)
|
||||
);
|
||||
if ( wp_attachment_is_image() ) {
|
||||
echo ' <span class="meta-sep">|</span> ';
|
||||
$metadata = wp_get_attachment_metadata();
|
||||
printf( __( 'Full size is %s pixels', 'twentyten' ),
|
||||
sprintf( '<a href="%1$s" title="%2$s">%3$s × %4$s</a>',
|
||||
wp_get_attachment_url(),
|
||||
esc_attr( __( 'Link to full-size image', 'twentyten' ) ),
|
||||
$metadata['width'],
|
||||
$metadata['height']
|
||||
)
|
||||
);
|
||||
}
|
||||
?>
|
||||
<?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
|
||||
</div><!-- .entry-meta -->
|
||||
|
||||
<div class="entry-content">
|
||||
<div class="entry-attachment">
|
||||
<?php if ( wp_attachment_is_image() ) :
|
||||
$attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) );
|
||||
foreach ( $attachments as $k => $attachment ) {
|
||||
if ( $attachment->ID == $post->ID )
|
||||
break;
|
||||
}
|
||||
$k++;
|
||||
// If there is more than 1 image attachment in a gallery
|
||||
if ( count( $attachments ) > 1 ) {
|
||||
if ( isset( $attachments[ $k ] ) )
|
||||
// get the URL of the next image attachment
|
||||
$next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
|
||||
else
|
||||
// or get the URL of the first image attachment
|
||||
$next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID );
|
||||
} else {
|
||||
// or, if there's only 1 image attachment, get the URL of the image
|
||||
$next_attachment_url = wp_get_attachment_url();
|
||||
}
|
||||
?>
|
||||
<p class="attachment"><a href="<?php echo $next_attachment_url; ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php
|
||||
$attachment_width = apply_filters( 'twentyten_attachment_size', 900 );
|
||||
$attachment_height = apply_filters( 'twentyten_attachment_height', 900 );
|
||||
echo wp_get_attachment_image( $post->ID, array( $attachment_width, $attachment_height ) ); // filterable image width with, essentially, no limit for image height.
|
||||
?></a></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php else : ?>
|
||||
<a href="<?php echo wp_get_attachment_url(); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php echo basename( get_permalink() ); ?></a>
|
||||
|
||||
<?php endif; ?>
|
||||
<!-- .entry-attachment -->
|
||||
<div class="entry-caption"><?php if ( !empty( $post->post_excerpt ) ) the_excerpt(); ?>
|
||||
</div><!-- .entry-caption -->
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="droite" onclick="toggleExif(<?php echo $attachment->ID; ?>);">Voir les Exif</div>
|
||||
|
||||
|
||||
<?php //print_r($metadata); ?>
|
||||
|
||||
<?php
|
||||
//$geo_links = true;
|
||||
$attach = $attachment->ID;
|
||||
|
||||
//echo $attachment->ID;
|
||||
$before_block = '<div class="bloc_exif" id="' . $attach . '"><ul>';
|
||||
$after_block = '</ul></div><!-- .bloc_exif -->';
|
||||
$liste_exif = $before_block;
|
||||
|
||||
list($exif_list, $gm_lat, $gm_lng, $title_marker) = ListeExif($metadata, $attach);
|
||||
|
||||
$liste_exif .= $exif_list;
|
||||
$liste_exif .= $after_block;
|
||||
|
||||
echo $liste_exif;
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<div id="map"></div>
|
||||
<script type="text/javascript">
|
||||
var curr_infw;
|
||||
initialize(<?php echo $gm_lat; ?>, <?php echo $gm_lng; ?>, "<?php echo $title_marker; ?>")
|
||||
</script>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div><!-- .entry-attachment -->
|
||||
|
||||
<!--p>Description</p-->
|
||||
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyten' ) ); ?>
|
||||
|
||||
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
|
||||
|
||||
<div id="nav-below" class="navigation">
|
||||
<div class="nav-previous"><?php previous_image_link( false ); ?></div>
|
||||
<div class="nav-next"><?php next_image_link( false ); ?></div>
|
||||
</div><!-- #nav-below -->
|
||||
|
||||
</div><!-- .entry-content -->
|
||||
|
||||
<div class="entry-utility">
|
||||
<?php twentyten_posted_in(); ?>
|
||||
<?php edit_post_link( __( 'Edit', 'twentyten' ), ' <span class="edit-link">', '</span>' ); ?>
|
||||
</div><!-- .entry-utility -->
|
||||
</div><!-- #post-## -->
|
||||
|
||||
<?php comments_template(); ?>
|
||||
|
||||
<?php endwhile; // end of the loop. ?>
|
||||
136
exclus/ls
Normal file
136
exclus/ls
Normal file
@@ -0,0 +1,136 @@
|
||||
http://forrst.com/posts/jquery_livesearch_for_twentyten_theme-tV3
|
||||
|
||||
//livesearch.js
|
||||
|
||||
jQuery(document).ready(function ($) {
|
||||
var contentCache, searched = false;
|
||||
jQuery('#searchform').submit(function () {
|
||||
var s = jQuery(this).find('#s').val();
|
||||
if (s.length == 0) {
|
||||
return;
|
||||
}
|
||||
var submit = $('#searchsubmit');
|
||||
submit.attr('disabled', false);
|
||||
var url = jQuery(this).attr('action') + '?s=' + encodeURIComponent(s) + '&action=search_ajax'
|
||||
jQuery.ajax({
|
||||
url: url,
|
||||
type: 'get',
|
||||
dataType: 'html',
|
||||
beforeSend: function () {
|
||||
|
||||
submit.attr('disabled', true).fadeTo('slow', 0.5);
|
||||
document.body.style.cursor = 'wait';
|
||||
var load = '<div id="content" role="main"><h1 class="page-title">Searching...</h1></div>';
|
||||
jQuery('#container').empty().html(load);
|
||||
},
|
||||
success: function (data) {
|
||||
submit.attr('disabled', false).fadeTo('slow', 1);
|
||||
document.body.style.cursor = 'auto';
|
||||
jQuery('#container').empty().html(data);
|
||||
jQuery('#ajaxback').click(function () {
|
||||
jQuery('#container').empty().html(contentCache);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
return false;
|
||||
});
|
||||
var timer, currentKey;
|
||||
jQuery('#s').keyup(function () {
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(function () {
|
||||
var sInput = jQuery('#s');
|
||||
var s = sInput.val();
|
||||
if (s.length == 0) {
|
||||
if (searched) {
|
||||
jQuery('#container').empty().html(contentCache);
|
||||
sInput.focus();
|
||||
//jQuery('#search-form span.processing').remove();
|
||||
searched = false;
|
||||
}
|
||||
currentKey = s;
|
||||
} else {
|
||||
if (s != currentKey) {
|
||||
if (!searched) {
|
||||
contentCache = jQuery('#container')[0].innerHTML;
|
||||
searched = true;
|
||||
}
|
||||
currentKey = s;
|
||||
if (s != ' ') {
|
||||
jQuery('#searchform').submit();
|
||||
jQuery('#s').attr('value','');
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 800);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
//functions.php
|
||||
|
||||
add_action('init','ajax_live_search_js');
|
||||
|
||||
function ajax_live_search_js() {
|
||||
wp_enqueue_script('jquery');
|
||||
wp_register_script('ajax_live_search', get_bloginfo('stylesheet_directory') . '/js/2010.js', array('jquery'), '1.0');
|
||||
wp_enqueue_script('ajax_live_search');
|
||||
}
|
||||
|
||||
function ajax_live_search_template() {
|
||||
if (is_search()) {
|
||||
include(dirname(__FILE__) . '/livesearch.php');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
add_action('template_redirect','ajax_live_search_template');
|
||||
|
||||
//livesearch.php
|
||||
|
||||
<?php
|
||||
|
||||
if(!$_GET['action']) {
|
||||
get_header();
|
||||
echo '<div id="container">';
|
||||
}
|
||||
|
||||
else { $do_ajax =1;}
|
||||
|
||||
?>
|
||||
|
||||
<div id="content" role="main">
|
||||
|
||||
<?php if ( have_posts() ) : ?>
|
||||
|
||||
<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentyten' ), '<span>' . get_search_query() . '</span>'); ?></h1>
|
||||
|
||||
<?php get_template_part( 'loop', 'search' );?>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<div id="post-0" class="post no-results not-found">
|
||||
|
||||
<h2 class="entry-title"><?php _e( 'Nothing Found', 'twentyten' ); ?></h2>
|
||||
|
||||
<div class="entry-content">
|
||||
|
||||
<p><?php _e( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'twentyten' ); ?><?php if($do_ajax ==1){ echo'<a id ="ajaxback" href="javascript:void(0);" title="Back to last page">Go back to last page?</a>';} ?></p>
|
||||
|
||||
</div><!-- .entry-content -->
|
||||
</div><!-- #post-0 -->
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div><!-- #content -->
|
||||
|
||||
<?php
|
||||
if(!$_GET['action']) {
|
||||
echo '</div><!-- #container -->';
|
||||
get_sidebar();
|
||||
get_footer();
|
||||
}
|
||||
|
||||
?>
|
||||
269
exclus/single 2.php
Normal file
269
exclus/single 2.php
Normal file
@@ -0,0 +1,269 @@
|
||||
<?php
|
||||
/**
|
||||
* The Template for displaying all single posts.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Ten
|
||||
* @since Twenty Ten 1.0
|
||||
*/
|
||||
|
||||
get_header(); ?>
|
||||
|
||||
<div id="container">
|
||||
<div id="content" role="main">
|
||||
|
||||
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
|
||||
|
||||
<div id="nav-above" class="navigation">
|
||||
<div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten-child' ) . '</span> %title' ); ?></div>
|
||||
<div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten-child' ) . '</span>' ); ?></div>
|
||||
|
||||
</div><!-- #nav-above -->
|
||||
|
||||
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<h1 class="entry-title"><?php the_title(); ?></h1>
|
||||
|
||||
<div class="entry-meta">
|
||||
<?php //twentyten_posted_on(); ?>
|
||||
<?php RelativeTime(); ?>
|
||||
</div><!-- .entry-meta -->
|
||||
|
||||
|
||||
<div class="entry-content">
|
||||
<?php //the_content(); ?>
|
||||
|
||||
<?php
|
||||
/**/
|
||||
$content = apply_filters('the_content', get_the_content());
|
||||
$content = str_replace(']]>', ']]>', $content);
|
||||
|
||||
//$pattern = '/<img[^>]*>/Ui';
|
||||
//$pattern = '/<img[^>]* src=\"([^\"]*)\"[^>]*>/Ui';
|
||||
$pattern = '/<img[^>]*src=\"?([^\"]*)\"?([^>]*alt=\"?([^\"]*)\"?)?[^>]*>/Ui';
|
||||
preg_match_all($pattern, $content , $matches, PREG_SET_ORDER);
|
||||
|
||||
for ($i = 0; $i <= (count($matches) - 1); $i++) {
|
||||
$ancien = $matches[$i][0];
|
||||
|
||||
//echo $ancien . '<br>';
|
||||
|
||||
if (substr_count($ancien, 'wordpress') != 0) {
|
||||
|
||||
echo "wordpress";
|
||||
|
||||
$new_img = $ancien . '</a>' . "\r\n" . '<div class="droite" onclick="toggleExif(' . $i . ');">Voir les Exifs</div>'."\r\n";
|
||||
$new_img .= '<div class="bloc_exif" id="' . $i .'">'."\r\n";
|
||||
$new_img .= '<ul class="exif" id="bloc_exif' . $i . '">'."\r\n";
|
||||
|
||||
$pattern2 = '#wp-image-[0-9]{1,3}#';
|
||||
preg_match($pattern2, $ancien, $matches2);
|
||||
$attachment = substr($matches2[0],9);
|
||||
$metadata = wp_get_attachment_metadata( $attachment );
|
||||
|
||||
//echo $attachment;
|
||||
//print_r($metadata);
|
||||
|
||||
//echo "erreur2: " . $ancien;
|
||||
list($exif_list, $gm_lat, $gm_lng, $title_marker) = ListeExif($metadata, $attachment);
|
||||
//echo $gm_lat;
|
||||
|
||||
$new_img .= $exif_list;
|
||||
$new_img .= '</ul></div>'."\r\n";
|
||||
|
||||
//$new_img .= '<script type="text/javascript">initial(' . $attachment . ')</script>';
|
||||
|
||||
//$new_img .= '<div id="map' . $attachment .'" class="mappy"></div>'."\r\n";
|
||||
//$new_img .= '<div id="map">test</div>'."\r\n";
|
||||
}
|
||||
elseif (substr_count($ancien, 'zenphoto') != 0) {
|
||||
|
||||
echo "zenphoto";
|
||||
|
||||
//echo $ancien;
|
||||
$ancien_img = 'http://alubook.local/zenphoto/albums/becasseaux/2008-09-07_BecasseauVariable_0351.jpg';
|
||||
|
||||
$new_img = $ancien . '</a>' . "\r\n" . '<div class="droite" onclick="toggleExif(' . $i . ');">Voir les Exifs</div>'."\r\n";
|
||||
$new_img .= '<div class="bloc_exif" id="' . $i .'">'."\r\n";
|
||||
$new_img .= '<ul class="exif" id="bloc_exif' . $i . '">'."\r\n";
|
||||
|
||||
//$exif = exif_read_data('http://alubook.local/zenphoto/zp-core/i.php?a=becasseaux&i=2008-09-07_BecasseauVariable_0351.jpg', 0, true);
|
||||
$exif = exif_read_data($ancien_img, 0, true);
|
||||
//print_r($exif);
|
||||
//src = http://alubook.local/zenphoto/zp-core/i.php?a=becasseaux&i=2008-09-07_BecasseauVariable_0351.jpg
|
||||
//<img class="ZenphotoPress_thumb " title="2008-09-07_BecasseauVariable_0351" src="http://alubook.local/zenphoto/zp-core/i.php?a=becasseaux&i=2008-09-07_BecasseauVariable_0351.jpg&w=610&h=403" alt="2008-09-07_BecasseauVariable_0351" />
|
||||
|
||||
$metadata =array();
|
||||
if ($exif[GPS][GPSLatitude]) {
|
||||
$metadata['image_meta']['latitude'] = $exif[GPS][GPSLatitude];
|
||||
//print_r($metadata['image_meta']['latitude']);
|
||||
}
|
||||
if ($exif[GPS][GPSLongitude]) $metadata['image_meta']['longitude'] = $exif[GPS][GPSLongitude];
|
||||
if ($exif[GPS][GPSLatitudeRef]) $metadata['image_meta']['latitude_ref'] = $exif[GPS][GPSLatitudeRef];
|
||||
if ($exif[GPS][GPSLongitudeRef]) $metadata['image_meta']['longitude_ref'] = $exif[GPS][GPSLongitudeRef];
|
||||
if ($exif[EXIF][FNumber]) {
|
||||
$ouverture = explode("/", $exif[EXIF][FNumber]); // 63/10
|
||||
$a = ($ouverture[0] / $ouverture[1]);
|
||||
$metadata['image_meta']['aperture'] = ($ouverture[0] / $ouverture[1]);
|
||||
}
|
||||
if ($exif[EXIF][ExposureTime]) $metadata['image_meta']['shutter_speed'] = $exif[EXIF][ExposureTime];
|
||||
if ($exif[EXIF][FocalLength]) {
|
||||
$focale = explode("/", $exif[EXIF][FocalLength]);
|
||||
$metadata['image_meta']['focal_length'] = $focale[0];
|
||||
}
|
||||
if ($exif[EXIF][Model]) $metadata['image_meta']['camera'] = $exif[EXIF][Model];
|
||||
//if ($exif[EXIF][DateTimeOriginal]) $metadata['image_meta']['created_timestamp'] = $exif[EXIF][DateTimeOriginal];
|
||||
if ($exif[EXIF][DateTimeOriginal]) {
|
||||
$metadata['image_meta']['created_timestamp'] = strtotime($exif[EXIF][DateTimeOriginal]);
|
||||
}
|
||||
$metadata['image_meta']['caption'] = '';
|
||||
|
||||
//print_r($metadata);
|
||||
//echo 'latitude_ref: ' . $metadata['image_meta']['latitude_ref'];
|
||||
|
||||
list($exif_list, $gm_lat, $gm_lng, $title_marker) = ListeExif($metadata, $attachment);
|
||||
//echo $exif_list; //ok
|
||||
|
||||
$new_img .= $exif_list;
|
||||
//$new_img .= '</ul></div>'."\r\n";
|
||||
$new_img .= '</ul>' . $gm_lat . ' ; ' . $gm_lng . '</div>'."\r\n";
|
||||
|
||||
//echo $new_img;
|
||||
|
||||
//print_r($exif_list);
|
||||
|
||||
//$new_img = $ancien;
|
||||
}
|
||||
else {
|
||||
|
||||
echo "autres...";
|
||||
|
||||
//$new_img = $ancien;
|
||||
}
|
||||
|
||||
$content = str_replace($ancien, $new_img, $content);
|
||||
//echo $content;
|
||||
|
||||
}
|
||||
|
||||
echo $content;
|
||||
|
||||
?>
|
||||
|
||||
<a name="carte"></a><p> </p><div id="map" name="carte"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
/**/
|
||||
var map;
|
||||
function initialize(lat, lng) {
|
||||
var myLatlng = new google.maps.LatLng(lat, lng);
|
||||
var myOptions = {
|
||||
zoom: 14,
|
||||
center: myLatlng,
|
||||
mapTypeId: google.maps.MapTypeId.ROADMAP
|
||||
}
|
||||
map = new google.maps.Map(document.getElementById("map"), myOptions);
|
||||
|
||||
|
||||
marker = new google.maps.Marker({
|
||||
position: myLatlng,
|
||||
map: map,
|
||||
title:"If this is your exact location, press \"Add this location\""
|
||||
});
|
||||
google.maps.event.addListener(marker, 'click', function() {
|
||||
map.setZoom(8);
|
||||
});
|
||||
}
|
||||
|
||||
initialize(<?php echo $gm_lat; ?>, <?php echo $gm_lng; ?>);
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten-child' ), 'after' => '</div>' ) ); ?>
|
||||
</div><!-- .entry-content -->
|
||||
|
||||
<?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries ?>
|
||||
<div id="entry-author-info">
|
||||
<div id="author-avatar">
|
||||
<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?>
|
||||
</div><!-- #author-avatar -->
|
||||
<div id="author-description">
|
||||
<h2><?php printf( esc_attr__( 'About %s', 'twentyten-child' ), get_the_author() ); ?></h2>
|
||||
<?php the_author_meta( 'description' ); ?>
|
||||
<div id="author-link">
|
||||
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
|
||||
<?php printf( __( 'View all posts by %s <span class="meta-nav">→</span>', 'twentyten-child' ), get_the_author() ); ?>
|
||||
</a>
|
||||
</div><!-- #author-link -->
|
||||
</div><!-- #author-description -->
|
||||
</div><!-- #entry-author-info -->
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- rajout -->
|
||||
|
||||
<div id="related">
|
||||
|
||||
<?php //for use in the loop, list 5 post titles related to first tag on current post
|
||||
$backup = $post; // backup the current object
|
||||
$tags = wp_get_post_tags($post->ID);
|
||||
$tagIDs = array();
|
||||
if ($tags) {
|
||||
$tagcount = count($tags);
|
||||
for ($i = 0; $i < $tagcount; $i++) {
|
||||
$tagIDs[$i] = $tags[$i]->term_id;
|
||||
}
|
||||
$args=array(
|
||||
'tag__in' => $tagIDs,
|
||||
'post__not_in' => array($post->ID),
|
||||
'showposts'=>-1,
|
||||
'caller_get_posts'=>1
|
||||
);
|
||||
$my_query = new WP_Query($args);
|
||||
if( $my_query->have_posts() ) {
|
||||
_e('Related articles:', 'twentyten-child' );
|
||||
?>
|
||||
<br/>
|
||||
<ul class="related">
|
||||
<?php
|
||||
while ($my_query->have_posts()) : $my_query->the_post(); ?>
|
||||
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a> (<?php the_date("F Y"); ?>)</li>
|
||||
<?php endwhile;
|
||||
?></ul><?php
|
||||
}
|
||||
else { ?>
|
||||
<!--h3>No related posts found!</h3-->
|
||||
<?php }
|
||||
}
|
||||
$post = $backup; // copy it back
|
||||
wp_reset_query(); // to use the original query again
|
||||
?>
|
||||
|
||||
<?php twentyten_post_updated(); ?>
|
||||
|
||||
</div><!-- #related -->
|
||||
|
||||
<!-- /rajout -->
|
||||
|
||||
<div class="entry-utility">
|
||||
<?php twentyten_posted_in(); ?>
|
||||
<?php edit_post_link( __( 'Edit', 'twentyten-child' ), '<span class="edit-link">', '</span>' ); ?>
|
||||
</div><!-- .entry-utility -->
|
||||
</div><!-- #post-## -->
|
||||
|
||||
<div id="nav-below" class="navigation">
|
||||
<div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten-child' ) . '</span> %title' ); ?></div>
|
||||
<div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten-child' ) . '</span>' ); ?></div>
|
||||
</div><!-- #nav-below -->
|
||||
|
||||
<?php comments_template( '', true ); ?>
|
||||
|
||||
<?php endwhile; // end of the loop. ?>
|
||||
|
||||
</div><!-- #content -->
|
||||
</div><!-- #container -->
|
||||
|
||||
<?php get_sidebar(); ?>
|
||||
<?php get_footer(); ?>
|
||||
149
exclus/single 5.php
Normal file
149
exclus/single 5.php
Normal file
@@ -0,0 +1,149 @@
|
||||
<?php
|
||||
/**
|
||||
* The Template for displaying all single posts.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Ten
|
||||
* @since Twenty Ten 1.0
|
||||
*/
|
||||
|
||||
get_header(); ?>
|
||||
|
||||
<div id="container">
|
||||
<div id="content" role="main">
|
||||
|
||||
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
|
||||
|
||||
<div id="nav-above" class="navigation">
|
||||
<div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten-child' ) . '</span> %title' ); ?></div>
|
||||
<div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten-child' ) . '</span>' ); ?></div>
|
||||
</div><!-- #nav-above -->
|
||||
|
||||
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<h1 class="entry-title"><?php the_title(); ?></h1>
|
||||
|
||||
<div class="entry-meta">
|
||||
<?php //twentyten_posted_on(); ?>
|
||||
<?php RelativeTime(); ?>
|
||||
</div><!-- .entry-meta -->
|
||||
|
||||
|
||||
<div class="entry-content">
|
||||
<?php //the_content(); ?>
|
||||
|
||||
<?php
|
||||
|
||||
$content = apply_filters('the_content', get_the_content());
|
||||
$content = str_replace(']]>', ']]>', $content);
|
||||
|
||||
$pattern = '/<img[^>]*>/Ui';
|
||||
preg_match_all($pattern, $content , $matches, PREG_SET_ORDER);
|
||||
|
||||
for ($i = 0; $i <= (count($matches) - 1); $i++) {
|
||||
$ancien = $matches[$i][0];
|
||||
|
||||
$new_img = $ancien . '</a>' . "\r\n" . '<div class="droite" onclick="toggleExif(' . $i . ');">Voir les Exif</div>'."\r\n";
|
||||
$new_img .= '<div class="bloc_exif" id="' . $i .'">'."\r\n";
|
||||
$new_img .= '<ul class="exif" id="bloc_exif' . $i . '">'."\r\n";
|
||||
|
||||
$pattern2 = '#wp-image-[0-9]{1,3}#';
|
||||
preg_match($pattern2, $ancien, $matches2);
|
||||
$metadata = wp_get_attachment_metadata( substr($matches2[0],9) );
|
||||
list($exif_list, $gm_lat, $gm_lng, $title_marker) = ListeExif($metadata);
|
||||
echo $gm_lat;
|
||||
|
||||
$new_img .= $exif_list;
|
||||
$new_img .= '</ul></div>'."\r\n";
|
||||
|
||||
$content = str_replace($ancien, $new_img, $content);
|
||||
}
|
||||
|
||||
echo $content;
|
||||
|
||||
?>
|
||||
|
||||
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten-child' ), 'after' => '</div>' ) ); ?>
|
||||
</div><!-- .entry-content -->
|
||||
|
||||
<?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries ?>
|
||||
<div id="entry-author-info">
|
||||
<div id="author-avatar">
|
||||
<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?>
|
||||
</div><!-- #author-avatar -->
|
||||
<div id="author-description">
|
||||
<h2><?php printf( esc_attr__( 'About %s', 'twentyten-child' ), get_the_author() ); ?></h2>
|
||||
<?php the_author_meta( 'description' ); ?>
|
||||
<div id="author-link">
|
||||
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
|
||||
<?php printf( __( 'View all posts by %s <span class="meta-nav">→</span>', 'twentyten-child' ), get_the_author() ); ?>
|
||||
</a>
|
||||
</div><!-- #author-link -->
|
||||
</div><!-- #author-description -->
|
||||
</div><!-- #entry-author-info -->
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- rajout -->
|
||||
|
||||
<div id="related">
|
||||
|
||||
<?php //for use in the loop, list 5 post titles related to first tag on current post
|
||||
$backup = $post; // backup the current object
|
||||
$tags = wp_get_post_tags($post->ID);
|
||||
$tagIDs = array();
|
||||
if ($tags) {
|
||||
$tagcount = count($tags);
|
||||
for ($i = 0; $i < $tagcount; $i++) {
|
||||
$tagIDs[$i] = $tags[$i]->term_id;
|
||||
}
|
||||
$args=array(
|
||||
'tag__in' => $tagIDs,
|
||||
'post__not_in' => array($post->ID),
|
||||
'showposts'=>-1,
|
||||
'caller_get_posts'=>1
|
||||
);
|
||||
$my_query = new WP_Query($args);
|
||||
if( $my_query->have_posts() ) {
|
||||
_e('Related articles:', 'twentyten-child' );
|
||||
?>
|
||||
<br/>
|
||||
<ul class="related">
|
||||
<?php
|
||||
while ($my_query->have_posts()) : $my_query->the_post(); ?>
|
||||
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a> (<?php the_date("F Y"); ?>)</li>
|
||||
<?php endwhile;
|
||||
?></ul><?php
|
||||
}
|
||||
else { ?>
|
||||
<!--h3>No related posts found!</h3-->
|
||||
<?php }
|
||||
}
|
||||
$post = $backup; // copy it back
|
||||
wp_reset_query(); // to use the original query again
|
||||
?>
|
||||
|
||||
<?php twentyten_post_updated(); ?>
|
||||
|
||||
</div><!-- #related -->
|
||||
|
||||
<!-- /rajout -->
|
||||
|
||||
<div class="entry-utility">
|
||||
<?php twentyten_posted_in(); ?>
|
||||
<?php edit_post_link( __( 'Edit', 'twentyten-child' ), '<span class="edit-link">', '</span>' ); ?>
|
||||
</div><!-- .entry-utility -->
|
||||
</div><!-- #post-## -->
|
||||
|
||||
<div id="nav-below" class="navigation">
|
||||
<div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten-child' ) . '</span> %title' ); ?></div>
|
||||
<div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten-child' ) . '</span>' ); ?></div>
|
||||
</div><!-- #nav-below -->
|
||||
|
||||
<?php comments_template( '', true ); ?>
|
||||
|
||||
<?php endwhile; // end of the loop. ?>
|
||||
|
||||
</div><!-- #content -->
|
||||
</div><!-- #container -->
|
||||
|
||||
<?php get_sidebar(); ?>
|
||||
<?php get_footer(); ?>
|
||||
145
exclus/single bof.php
Normal file
145
exclus/single bof.php
Normal file
@@ -0,0 +1,145 @@
|
||||
<?php
|
||||
/**
|
||||
* The Template for displaying all single posts.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Ten
|
||||
* @since Twenty Ten 1.0
|
||||
*/
|
||||
|
||||
get_header(); ?>
|
||||
|
||||
<div id="container">
|
||||
<div id="content" role="main">
|
||||
|
||||
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
|
||||
|
||||
<div id="nav-above" class="navigation">
|
||||
<div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten-child' ) . '</span> %title' ); ?></div>
|
||||
<div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten-child' ) . '</span>' ); ?></div>
|
||||
</div><!-- #nav-above -->
|
||||
|
||||
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<h1 class="entry-title"><?php the_title(); ?></h1>
|
||||
|
||||
<div class="entry-meta">
|
||||
<?php //twentyten_posted_on(); ?>
|
||||
<?php RelativeTime(); ?>
|
||||
</div><!-- .entry-meta -->
|
||||
|
||||
<div class="entry-content">
|
||||
<?php //the_content(); ?>
|
||||
|
||||
<?php
|
||||
$content = apply_filters('the_content', get_the_content());
|
||||
$content = str_replace(']]>', ']]>', $content);
|
||||
|
||||
$pattern = '/<img[^>]*>/Ui';
|
||||
preg_match_all($pattern, $content , $matches, PREG_SET_ORDER);
|
||||
|
||||
|
||||
preg_match_all('{<a href.*?rel="(.*?)".*?>}',$content,$attachment, PREG_SET_ORDER);
|
||||
/*
|
||||
preg_match_all('%<a[^>]+rel=("([^"]+)"|\'([^\']+)\')[^>]*>%i', $content,$attachment);*/
|
||||
//print_r($attachment[0][1]); //attachment wp-att-293
|
||||
//print_r($attachment[1][1]); //attachment wp-att-294
|
||||
|
||||
for ($i = 0; $i <= (count($matches) - 1); $i++) {
|
||||
$ancien = $matches[$i][0];
|
||||
//$new_img = $ancien . $ajout;
|
||||
$new_img = $ancien . mod_image($i);
|
||||
$content = str_replace($ancien, $new_img, $content);
|
||||
}
|
||||
|
||||
echo $content;
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<?php //echo display_exif('aperture,shutter,focus,location',457); ?>
|
||||
|
||||
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten-child' ), 'after' => '</div>' ) ); ?>
|
||||
</div><!-- .entry-content -->
|
||||
|
||||
<?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries ?>
|
||||
<div id="entry-author-info">
|
||||
<div id="author-avatar">
|
||||
<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?>
|
||||
</div><!-- #author-avatar -->
|
||||
<div id="author-description">
|
||||
<h2><?php printf( esc_attr__( 'About %s', 'twentyten-child' ), get_the_author() ); ?></h2>
|
||||
<?php the_author_meta( 'description' ); ?>
|
||||
<div id="author-link">
|
||||
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
|
||||
<?php printf( __( 'View all posts by %s <span class="meta-nav">→</span>', 'twentyten-child' ), get_the_author() ); ?>
|
||||
</a>
|
||||
</div><!-- #author-link -->
|
||||
</div><!-- #author-description -->
|
||||
</div><!-- #entry-author-info -->
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- rajout -->
|
||||
|
||||
<div id="related">
|
||||
|
||||
<?php //for use in the loop, list 5 post titles related to first tag on current post
|
||||
$backup = $post; // backup the current object
|
||||
$tags = wp_get_post_tags($post->ID);
|
||||
$tagIDs = array();
|
||||
if ($tags) {
|
||||
$tagcount = count($tags);
|
||||
for ($i = 0; $i < $tagcount; $i++) {
|
||||
$tagIDs[$i] = $tags[$i]->term_id;
|
||||
}
|
||||
$args=array(
|
||||
'tag__in' => $tagIDs,
|
||||
'post__not_in' => array($post->ID),
|
||||
'showposts'=>-1,
|
||||
'caller_get_posts'=>1
|
||||
);
|
||||
$my_query = new WP_Query($args);
|
||||
if( $my_query->have_posts() ) {
|
||||
_e('Related articles:', 'twentyten-child' );
|
||||
?>
|
||||
<br/>
|
||||
<ul class="related">
|
||||
<?php
|
||||
while ($my_query->have_posts()) : $my_query->the_post(); ?>
|
||||
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a> (<?php the_date("F Y"); ?>)</li>
|
||||
<?php endwhile;
|
||||
?></ul><?php
|
||||
}
|
||||
else { ?>
|
||||
<!--h3>No related posts found!</h3-->
|
||||
<?php }
|
||||
}
|
||||
$post = $backup; // copy it back
|
||||
wp_reset_query(); // to use the original query again
|
||||
?>
|
||||
|
||||
<?php twentyten_post_updated(); ?>
|
||||
|
||||
</div><!-- #related -->
|
||||
|
||||
<!-- /rajout -->
|
||||
|
||||
<div class="entry-utility">
|
||||
<?php twentyten_posted_in(); ?>
|
||||
<?php edit_post_link( __( 'Edit', 'twentyten-child' ), '<span class="edit-link">', '</span>' ); ?>
|
||||
</div><!-- .entry-utility -->
|
||||
</div><!-- #post-## -->
|
||||
|
||||
<div id="nav-below" class="navigation">
|
||||
<div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten-child' ) . '</span> %title' ); ?></div>
|
||||
<div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten-child' ) . '</span>' ); ?></div>
|
||||
</div><!-- #nav-below -->
|
||||
|
||||
<?php comments_template( '', true ); ?>
|
||||
|
||||
<?php endwhile; // end of the loop. ?>
|
||||
|
||||
</div><!-- #content -->
|
||||
</div><!-- #container -->
|
||||
|
||||
<?php get_sidebar(); ?>
|
||||
<?php get_footer(); ?>
|
||||
198
exclus/single v2.php
Normal file
198
exclus/single v2.php
Normal file
@@ -0,0 +1,198 @@
|
||||
<?php
|
||||
/**
|
||||
* The Template for displaying all single posts.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Ten
|
||||
* @since Twenty Ten 1.0
|
||||
*/
|
||||
|
||||
get_header(); ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
/**/
|
||||
var map;
|
||||
function initialize(lat, lng, id) {
|
||||
var myLatlng = new google.maps.LatLng(lat, lng);
|
||||
var myOptions = {
|
||||
zoom: 14,
|
||||
center: myLatlng,
|
||||
mapTypeId: google.maps.MapTypeId.ROADMAP
|
||||
}
|
||||
map = new google.maps.Map(document.getElementById(id), myOptions);
|
||||
|
||||
|
||||
marker = new google.maps.Marker({
|
||||
position: myLatlng,
|
||||
map: map,
|
||||
title:"If this is your exact location, press \"Add this location\""
|
||||
});
|
||||
google.maps.event.addListener(marker, 'click', function() {
|
||||
map.setZoom(8);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="container">
|
||||
<div id="content" role="main">
|
||||
|
||||
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
|
||||
|
||||
<div id="nav-above" class="navigation">
|
||||
<div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten-child' ) . '</span> %title' ); ?></div>
|
||||
<div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten-child' ) . '</span>' ); ?></div>
|
||||
|
||||
</div><!-- #nav-above -->
|
||||
|
||||
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<h1 class="entry-title"><?php the_title(); ?></h1>
|
||||
|
||||
<div class="entry-meta">
|
||||
<?php //twentyten_posted_on(); ?>
|
||||
<?php RelativeTime(); ?>
|
||||
</div><!-- .entry-meta -->
|
||||
|
||||
|
||||
<div class="entry-content">
|
||||
<?php //the_content(); ?>
|
||||
|
||||
<?php
|
||||
|
||||
$content = apply_filters('the_content', get_the_content());
|
||||
$content = str_replace(']]>', ']]>', $content);
|
||||
|
||||
$pattern = '/<img[^>]*>/Ui';
|
||||
preg_match_all($pattern, $content , $matches, PREG_SET_ORDER);
|
||||
|
||||
for ($i = 0; $i <= (count($matches) - 1); $i++) {
|
||||
$ancien = $matches[$i][0];
|
||||
|
||||
$new_img = $ancien . '</a>' . "\r\n" . '<div class="droite" onclick="toggleExif(' . $i . ');">Voir les Exif</div>'."\r\n";
|
||||
$new_img .= '<div class="bloc_exif" id="' . $i .'">'."\r\n";
|
||||
$new_img .= '<ul class="exif" id="bloc_exif' . $i . '">'."\r\n";
|
||||
|
||||
$pattern2 = '#wp-image-[0-9]{1,3}#';
|
||||
preg_match($pattern2, $ancien, $matches2);
|
||||
$attachment = substr($matches2[0],9);
|
||||
$metadata = wp_get_attachment_metadata( $attachment );
|
||||
|
||||
list($exif_list, $gm_lat, $gm_lng, $title_marker) = ListeExif($metadata, $attachment);
|
||||
//echo $gm_lat;
|
||||
|
||||
$new_img .= $exif_list;
|
||||
$new_img .= '</ul></div>'."\r\n";
|
||||
|
||||
//$new_img .= '<script type="text/javascript">initial(' . $attachment . ')</script>';
|
||||
|
||||
//$new_img .= '<div id="map' . $attachment .'" class="mappy"></div>'."\r\n";
|
||||
|
||||
$map = "map" . $attachment;
|
||||
|
||||
|
||||
$new_img .= '<div id="' . $map . '" class="mappy">test<br>test<br>test<br>test</div>'."\r\n";
|
||||
|
||||
|
||||
$new_img .= '<script type="text/javascript">initialize(' . $gm_lat . ',' . $gm_lng . ', "' . $map .'");</script>';
|
||||
|
||||
|
||||
$content = str_replace($ancien, $new_img, $content);
|
||||
//echo $content;
|
||||
|
||||
}
|
||||
|
||||
echo $content;
|
||||
|
||||
?>
|
||||
<!--div id="map" name="carte"></div-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten-child' ), 'after' => '</div>' ) ); ?>
|
||||
</div><!-- .entry-content -->
|
||||
|
||||
<?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries ?>
|
||||
<div id="entry-author-info">
|
||||
<div id="author-avatar">
|
||||
<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?>
|
||||
</div><!-- #author-avatar -->
|
||||
<div id="author-description">
|
||||
<h2><?php printf( esc_attr__( 'About %s', 'twentyten-child' ), get_the_author() ); ?></h2>
|
||||
<?php the_author_meta( 'description' ); ?>
|
||||
<div id="author-link">
|
||||
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
|
||||
<?php printf( __( 'View all posts by %s <span class="meta-nav">→</span>', 'twentyten-child' ), get_the_author() ); ?>
|
||||
</a>
|
||||
</div><!-- #author-link -->
|
||||
</div><!-- #author-description -->
|
||||
</div><!-- #entry-author-info -->
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- rajout -->
|
||||
|
||||
<div id="related">
|
||||
|
||||
<?php //for use in the loop, list 5 post titles related to first tag on current post
|
||||
$backup = $post; // backup the current object
|
||||
$tags = wp_get_post_tags($post->ID);
|
||||
$tagIDs = array();
|
||||
if ($tags) {
|
||||
$tagcount = count($tags);
|
||||
for ($i = 0; $i < $tagcount; $i++) {
|
||||
$tagIDs[$i] = $tags[$i]->term_id;
|
||||
}
|
||||
$args=array(
|
||||
'tag__in' => $tagIDs,
|
||||
'post__not_in' => array($post->ID),
|
||||
'showposts'=>-1,
|
||||
'caller_get_posts'=>1
|
||||
);
|
||||
$my_query = new WP_Query($args);
|
||||
if( $my_query->have_posts() ) {
|
||||
_e('Related articles:', 'twentyten-child' );
|
||||
?>
|
||||
<br/>
|
||||
<ul class="related">
|
||||
<?php
|
||||
while ($my_query->have_posts()) : $my_query->the_post(); ?>
|
||||
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a> (<?php the_date("F Y"); ?>)</li>
|
||||
<?php endwhile;
|
||||
?></ul><?php
|
||||
}
|
||||
else { ?>
|
||||
<!--h3>No related posts found!</h3-->
|
||||
<?php }
|
||||
}
|
||||
$post = $backup; // copy it back
|
||||
wp_reset_query(); // to use the original query again
|
||||
?>
|
||||
|
||||
<?php twentyten_post_updated(); ?>
|
||||
|
||||
</div><!-- #related -->
|
||||
|
||||
<!-- /rajout -->
|
||||
|
||||
<div class="entry-utility">
|
||||
<?php twentyten_posted_in(); ?>
|
||||
<?php edit_post_link( __( 'Edit', 'twentyten-child' ), '<span class="edit-link">', '</span>' ); ?>
|
||||
</div><!-- .entry-utility -->
|
||||
</div><!-- #post-## -->
|
||||
|
||||
<div id="nav-below" class="navigation">
|
||||
<div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten-child' ) . '</span> %title' ); ?></div>
|
||||
<div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten-child' ) . '</span>' ); ?></div>
|
||||
</div><!-- #nav-below -->
|
||||
|
||||
<?php comments_template( '', true ); ?>
|
||||
|
||||
<?php endwhile; // end of the loop. ?>
|
||||
|
||||
</div><!-- #content -->
|
||||
</div><!-- #container -->
|
||||
|
||||
<?php get_sidebar(); ?>
|
||||
<?php get_footer(); ?>
|
||||
314
exclus/single.php
Normal file
314
exclus/single.php
Normal file
@@ -0,0 +1,314 @@
|
||||
<?php
|
||||
/**
|
||||
* The Template for displaying all single posts.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Ten
|
||||
* @since Twenty Ten 1.0
|
||||
*/
|
||||
|
||||
get_header(); ?>
|
||||
|
||||
<div id="container">
|
||||
<div id="content" role="main">
|
||||
|
||||
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
|
||||
|
||||
<div id="nav-above" class="navigation">
|
||||
<div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten-child' ) . '</span> %title' ); ?></div>
|
||||
<div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten-child' ) . '</span>' ); ?></div>
|
||||
|
||||
</div><!-- #nav-above -->
|
||||
|
||||
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<h1 class="entry-title"><?php the_title(); ?></h1>
|
||||
|
||||
<div class="entry-meta">
|
||||
<?php //twentyten_posted_on(); ?>
|
||||
<?php RelativeTime(); ?>
|
||||
</div><!-- .entry-meta -->
|
||||
|
||||
|
||||
<div class="entry-content">
|
||||
<?php //the_content(); ?>
|
||||
|
||||
<?php
|
||||
/**/
|
||||
$content = apply_filters('the_content', get_the_content());
|
||||
$content = str_replace(']]>', ']]>', $content);
|
||||
|
||||
// retina 2x
|
||||
if (function_exists( ' wr2x_init' ) ) $pattern = '/<img[^>]* src=\"([^\"]*)\"[^>]*>/Ui';
|
||||
// sans retina
|
||||
else $pattern = '/<img[^>]*src=\"?([^\"]*)\"?([^>]*alt=\"?([^\"]*)\"?)?[^>]*>/Ui';
|
||||
preg_match_all($pattern, $content , $matches, PREG_SET_ORDER);
|
||||
|
||||
//preprint($matches);
|
||||
|
||||
for ($i = 0; $i <= (count($matches) - 1); $i++) {
|
||||
$ancien = $matches[$i][0];
|
||||
|
||||
if (substr_count($ancien, 'wordpress') != 0) {
|
||||
|
||||
$new_img = $ancien . '</a>' . "\r\n" . '<div class="droite" onclick="toggleExif(' . $i . ');">Voir les Exifs</div>'."\r\n";
|
||||
$new_img .= '<div class="bloc_exif" id="' . $i .'">'."\r\n";
|
||||
$new_img .= '<ul class="exif" id="bloc_exif' . $i . '">'."\r\n";
|
||||
|
||||
$pattern2 = '#wp-image-[0-9]{1,4}#';
|
||||
preg_match($pattern2, $ancien, $matches2);
|
||||
$attachment = substr($matches2[0],9);
|
||||
//echo $attachment . "<br>";
|
||||
|
||||
|
||||
$metadata = wp_get_attachment_metadata($attachment);
|
||||
//preprint($metadata);
|
||||
|
||||
//echo "erreur2: " . $ancien;
|
||||
list($exif_list, $gm_lat, $gm_lng, $title_marker) = ListeExif($metadata, $attachment, $i);
|
||||
//echo $gm_lat;
|
||||
|
||||
$new_img .= $exif_list;
|
||||
$new_img .= '</ul></div>'."\r\n";
|
||||
|
||||
//$new_img .= '<script type="text/javascript">initial(' . $attachment . ')</script>';
|
||||
|
||||
//$new_img .= '<div id="map' . $attachment .'" class="mappy"></div>'."\r\n";
|
||||
//$new_img .= '<div id="map">test</div>'."\r\n";
|
||||
}
|
||||
elseif (substr_count($ancien, 'zenphoto') != 0) {
|
||||
|
||||
//echo "zenphoto";
|
||||
|
||||
//echo $ancien;
|
||||
$ancien_img = 'http://macbook-pro.local/zenphoto/albums/becasseaux/2008-09-07_BecasseauVariable_0351.jpg';
|
||||
|
||||
$new_img = $ancien . '</a>' . "\r\n" . '<div class="droite" onclick="toggleExif(' . $i . ');">Voir les Exifs</div>'."\r\n";
|
||||
$new_img .= '<div class="bloc_exif" id="' . $i .'">'."\r\n";
|
||||
$new_img .= '<ul class="exif" id="bloc_exif' . $i . '">'."\r\n";
|
||||
|
||||
//$exif = exif_read_data('http://alubook.local/zenphoto/zp-core/i.php?a=becasseaux&i=2008-09-07_BecasseauVariable_0351.jpg', 0, true);
|
||||
$exif = exif_read_data($ancien_img, 0, true);
|
||||
//print_r($exif);
|
||||
//src = http://alubook.local/zenphoto/zp-core/i.php?a=becasseaux&i=2008-09-07_BecasseauVariable_0351.jpg
|
||||
//<img class="ZenphotoPress_thumb " title="2008-09-07_BecasseauVariable_0351" src="http://alubook.local/zenphoto/zp-core/i.php?a=becasseaux&i=2008-09-07_BecasseauVariable_0351.jpg&w=610&h=403" alt="2008-09-07_BecasseauVariable_0351" />
|
||||
|
||||
$metadata =array();
|
||||
if ($exif[GPS][GPSLatitude]) {
|
||||
$metadata['image_meta']['latitude'] = $exif[GPS][GPSLatitude];
|
||||
//print_r($metadata['image_meta']['latitude']);
|
||||
}
|
||||
if ($exif[GPS][GPSLongitude]) $metadata['image_meta']['longitude'] = $exif[GPS][GPSLongitude];
|
||||
if ($exif[GPS][GPSLatitudeRef]) $metadata['image_meta']['latitude_ref'] = $exif[GPS][GPSLatitudeRef];
|
||||
if ($exif[GPS][GPSLongitudeRef]) $metadata['image_meta']['longitude_ref'] = $exif[GPS][GPSLongitudeRef];
|
||||
if ($exif[EXIF][FNumber]) {
|
||||
$ouverture = explode("/", $exif[EXIF][FNumber]); // 63/10
|
||||
$a = ($ouverture[0] / $ouverture[1]);
|
||||
$metadata['image_meta']['aperture'] = ($ouverture[0] / $ouverture[1]);
|
||||
}
|
||||
if ($exif[EXIF][ExposureTime]) $metadata['image_meta']['shutter_speed'] = $exif[EXIF][ExposureTime];
|
||||
if ($exif[EXIF][FocalLength]) {
|
||||
$focale = explode("/", $exif[EXIF][FocalLength]);
|
||||
$metadata['image_meta']['focal_length'] = $focale[0];
|
||||
}
|
||||
if ($exif[EXIF][Model]) $metadata['image_meta']['camera'] = $exif[EXIF][Model];
|
||||
//if ($exif[EXIF][DateTimeOriginal]) $metadata['image_meta']['created_timestamp'] = $exif[EXIF][DateTimeOriginal];
|
||||
if ($exif[EXIF][DateTimeOriginal]) {
|
||||
$metadata['image_meta']['created_timestamp'] = strtotime($exif[EXIF][DateTimeOriginal]);
|
||||
}
|
||||
$metadata['image_meta']['caption'] = '';
|
||||
|
||||
//print_r($metadata);
|
||||
//echo 'latitude_ref: ' . $metadata['image_meta']['latitude_ref'];
|
||||
|
||||
list($exif_list, $gm_lat, $gm_lng, $title_marker) = ListeExif($metadata, $attachment, $i);
|
||||
//echo $exif_list; //ok
|
||||
|
||||
$new_img .= $exif_list;
|
||||
//$new_img .= '</ul></div>'."\r\n";
|
||||
$new_img .= '</ul>' . $gm_lat . ' ; ' . $gm_lng . '</div>'."\r\n";
|
||||
|
||||
|
||||
|
||||
//echo $new_img;
|
||||
|
||||
//print_r($exif_list);
|
||||
|
||||
//$new_img = $ancien;
|
||||
}
|
||||
else {
|
||||
|
||||
//echo "autres...";
|
||||
|
||||
//$new_img = $ancien;
|
||||
}
|
||||
|
||||
$content = str_replace($ancien, $new_img, $content);
|
||||
//echo $content;
|
||||
|
||||
}
|
||||
|
||||
echo $content;
|
||||
|
||||
?>
|
||||
|
||||
<a name="carte"></a><p> </p>
|
||||
|
||||
<script type="text/javascript">
|
||||
function getMap(box,latitude,longitude) {
|
||||
var mylatlng = new google.maps.LatLng(latitude,longitude);
|
||||
var myOptions = {
|
||||
zoom: 14,
|
||||
center: mylatlng,
|
||||
mapTypeId: google.maps.MapTypeId.HYBRID
|
||||
};
|
||||
|
||||
var mymap = new google.maps.Map(document.getElementById('map_canvas' + box), myOptions);
|
||||
|
||||
var marker = new google.maps.Marker({
|
||||
position: mylatlng,
|
||||
map: mymap
|
||||
});
|
||||
|
||||
google.maps.event.addListener(marker, 'click', function() {
|
||||
map.setZoom(8);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
//getMap(1, <?php echo $gm_lat; ?>, <?php echo $gm_lng; ?>);
|
||||
|
||||
//getMap(2, 41.68, 2.317);
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
//getMap(<?php echo $i; ?>, <?php echo $gm_lat; ?>, <?php echo $gm_lng; ?>);
|
||||
|
||||
getMap(2, 41.68, 2.317);
|
||||
</script>
|
||||
|
||||
<div id="map_canvas1" ></div>
|
||||
<div id="map_canvas2" ></div>
|
||||
<div id="map_canvas3" ></div>
|
||||
<div id="map_canvas4" ></div>
|
||||
<div id="map_canvas5" ></div>
|
||||
<div id="map_canvas6" ></div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
/*
|
||||
var map;
|
||||
function initialize(lat, lng) {
|
||||
var myLatlng = new google.maps.LatLng(lat, lng);
|
||||
var myOptions = {
|
||||
zoom: 14,
|
||||
center: myLatlng,
|
||||
mapTypeId: google.maps.MapTypeId.ROADMAP
|
||||
}
|
||||
map = new google.maps.Map(document.getElementById("map"), myOptions);
|
||||
|
||||
|
||||
marker = new google.maps.Marker({
|
||||
position: myLatlng,
|
||||
map: map,
|
||||
title:"If this is your exact location, press \"Add this location\""
|
||||
});
|
||||
google.maps.event.addListener(marker, 'click', function() {
|
||||
map.setZoom(8);
|
||||
});
|
||||
}
|
||||
|
||||
initialize(<?php echo $gm_lat; ?>, <?php echo $gm_lng; ?>,);
|
||||
*/
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten-child' ), 'after' => '</div>' ) ); ?>
|
||||
</div><!-- .entry-content -->
|
||||
|
||||
<?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries ?>
|
||||
<div id="entry-author-info">
|
||||
<div id="author-avatar">
|
||||
<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?>
|
||||
</div><!-- #author-avatar -->
|
||||
<div id="author-description">
|
||||
<h2><?php printf( esc_attr__( 'About %s', 'twentyten-child' ), get_the_author() ); ?></h2>
|
||||
<?php the_author_meta( 'description' ); ?>
|
||||
<div id="author-link">
|
||||
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
|
||||
<?php printf( __( 'View all posts by %s <span class="meta-nav">→</span>', 'twentyten-child' ), get_the_author() ); ?>
|
||||
</a>
|
||||
</div><!-- #author-link -->
|
||||
</div><!-- #author-description -->
|
||||
</div><!-- #entry-author-info -->
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- rajout -->
|
||||
|
||||
<div id="related">
|
||||
|
||||
<?php //for use in the loop, list 5 post titles related to first tag on current post
|
||||
$backup = $post; // backup the current object
|
||||
$tags = wp_get_post_tags($post->ID);
|
||||
$tagIDs = array();
|
||||
if ($tags) {
|
||||
$tagcount = count($tags);
|
||||
for ($i = 0; $i < $tagcount; $i++) {
|
||||
$tagIDs[$i] = $tags[$i]->term_id;
|
||||
}
|
||||
$args=array(
|
||||
'tag__in' => $tagIDs,
|
||||
'post__not_in' => array($post->ID),
|
||||
'showposts'=>-1,
|
||||
'caller_get_posts'=>1
|
||||
);
|
||||
$my_query = new WP_Query($args);
|
||||
if( $my_query->have_posts() ) {
|
||||
_e('Related articles:', 'twentyten-child' );
|
||||
?>
|
||||
<br/>
|
||||
<ul class="related">
|
||||
<?php
|
||||
while ($my_query->have_posts()) : $my_query->the_post(); ?>
|
||||
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a> (<?php the_date("F Y"); ?>)</li>
|
||||
<?php endwhile;
|
||||
?></ul><?php
|
||||
}
|
||||
else { ?>
|
||||
<!--h3>No related posts found!</h3-->
|
||||
<?php }
|
||||
}
|
||||
$post = $backup; // copy it back
|
||||
wp_reset_query(); // to use the original query again
|
||||
?>
|
||||
|
||||
<?php twentyten_post_updated(); ?>
|
||||
|
||||
</div><!-- #related -->
|
||||
|
||||
<!-- /rajout -->
|
||||
|
||||
<div class="entry-utility">
|
||||
<?php twentyten_posted_in(); ?>
|
||||
<?php edit_post_link( __( 'Edit', 'twentyten-child' ), '<span class="edit-link">', '</span>' ); ?>
|
||||
</div><!-- .entry-utility -->
|
||||
</div><!-- #post-## -->
|
||||
|
||||
<div id="nav-below" class="navigation">
|
||||
<div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten-child' ) . '</span> %title' ); ?></div>
|
||||
<div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten-child' ) . '</span>' ); ?></div>
|
||||
</div><!-- #nav-below -->
|
||||
|
||||
<?php comments_template( '', true ); ?>
|
||||
|
||||
<?php endwhile; // end of the loop. ?>
|
||||
|
||||
</div><!-- #content -->
|
||||
</div><!-- #container -->
|
||||
|
||||
<?php get_sidebar(); ?>
|
||||
<?php get_footer(); ?>
|
||||
318
exclus/single__.php
Normal file
318
exclus/single__.php
Normal file
@@ -0,0 +1,318 @@
|
||||
<?php
|
||||
/**
|
||||
* The Template for displaying all single posts.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Ten
|
||||
* @since Twenty Ten 1.0
|
||||
*/
|
||||
|
||||
get_header(); ?>
|
||||
|
||||
<div id="container">
|
||||
<div id="content" role="main">
|
||||
|
||||
<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
|
||||
|
||||
<div id="nav-above" class="navigation">
|
||||
<div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten-child' ) . '</span> %title' ); ?></div>
|
||||
<div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten-child' ) . '</span>' ); ?></div>
|
||||
|
||||
</div><!-- #nav-above -->
|
||||
|
||||
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
||||
<h1 class="entry-title"><?php the_title(); ?></h1>
|
||||
|
||||
<div class="entry-meta">
|
||||
<?php //twentyten_posted_on(); ?>
|
||||
<?php RelativeTime(); ?>
|
||||
</div><!-- .entry-meta -->
|
||||
|
||||
|
||||
<div class="entry-content">
|
||||
<?php //the_content(); ?>
|
||||
|
||||
<?php
|
||||
/**/
|
||||
$content = apply_filters('the_content', get_the_content());
|
||||
$content = str_replace(']]>', ']]>', $content);
|
||||
|
||||
//$pattern = '/<img[^>]*>/Ui';
|
||||
//$pattern = '/<img[^>]* src=\"([^\"]*)\"[^>]*>/Ui';
|
||||
$pattern = '/<img[^>]*src=\"?([^\"]*)\"?([^>]*alt=\"?([^\"]*)\"?)?[^>]*>/Ui';
|
||||
preg_match_all($pattern, $content , $matches, PREG_SET_ORDER);
|
||||
|
||||
print_r($matches);
|
||||
echo "<br><br>";
|
||||
|
||||
for ($i = 0; $i <= (count($matches) - 1); $i++) {
|
||||
$ancien = $matches[$i][0];
|
||||
|
||||
//echo $ancien . '<br>';
|
||||
|
||||
if (substr_count($ancien, 'wordpress') != 0) {
|
||||
|
||||
//echo "wordpress";
|
||||
|
||||
$new_img = $ancien . '</a>' . "\r\n" . '<div class="droite" onclick="toggleExif(' . $i . ');">Voir les Exifs</div>'."\r\n";
|
||||
$new_img .= '<div class="bloc_exif" id="' . $i .'">'."\r\n";
|
||||
$new_img .= '<ul class="exif" id="bloc_exif' . $i . '">'."\r\n";
|
||||
|
||||
$pattern2 = '#wp-image-[0-9]{1,3}#';
|
||||
preg_match($pattern2, $ancien, $matches2);
|
||||
$attachment = substr($matches2[0],9);
|
||||
$metadata = wp_get_attachment_metadata( $attachment );
|
||||
|
||||
echo $attachment;
|
||||
echo $metadata;
|
||||
//print_r($metadata);
|
||||
|
||||
//echo "erreur2: " . $ancien;
|
||||
list($exif_list, $gm_lat, $gm_lng, $title_marker) = ListeExif($metadata, $attachment, $i);
|
||||
//echo $gm_lat;
|
||||
|
||||
$new_img .= $exif_list;
|
||||
$new_img .= '</ul></div>'."\r\n";
|
||||
|
||||
//$new_img .= '<script type="text/javascript">initial(' . $attachment . ')</script>';
|
||||
|
||||
//$new_img .= '<div id="map' . $attachment .'" class="mappy"></div>'."\r\n";
|
||||
//$new_img .= '<div id="map">test</div>'."\r\n";
|
||||
}
|
||||
elseif (substr_count($ancien, 'zenphoto') != 0) {
|
||||
|
||||
//echo "zenphoto";
|
||||
|
||||
//echo $ancien;
|
||||
$ancien_img = 'http://macbook-pro.local/zenphoto/albums/becasseaux/2008-09-07_BecasseauVariable_0351.jpg';
|
||||
|
||||
$new_img = $ancien . '</a>' . "\r\n" . '<div class="droite" onclick="toggleExif(' . $i . ');">Voir les Exifs</div>'."\r\n";
|
||||
$new_img .= '<div class="bloc_exif" id="' . $i .'">'."\r\n";
|
||||
$new_img .= '<ul class="exif" id="bloc_exif' . $i . '">'."\r\n";
|
||||
|
||||
//$exif = exif_read_data('http://alubook.local/zenphoto/zp-core/i.php?a=becasseaux&i=2008-09-07_BecasseauVariable_0351.jpg', 0, true);
|
||||
$exif = exif_read_data($ancien_img, 0, true);
|
||||
//print_r($exif);
|
||||
//src = http://alubook.local/zenphoto/zp-core/i.php?a=becasseaux&i=2008-09-07_BecasseauVariable_0351.jpg
|
||||
//<img class="ZenphotoPress_thumb " title="2008-09-07_BecasseauVariable_0351" src="http://alubook.local/zenphoto/zp-core/i.php?a=becasseaux&i=2008-09-07_BecasseauVariable_0351.jpg&w=610&h=403" alt="2008-09-07_BecasseauVariable_0351" />
|
||||
|
||||
$metadata =array();
|
||||
if ($exif[GPS][GPSLatitude]) {
|
||||
$metadata['image_meta']['latitude'] = $exif[GPS][GPSLatitude];
|
||||
//print_r($metadata['image_meta']['latitude']);
|
||||
}
|
||||
if ($exif[GPS][GPSLongitude]) $metadata['image_meta']['longitude'] = $exif[GPS][GPSLongitude];
|
||||
if ($exif[GPS][GPSLatitudeRef]) $metadata['image_meta']['latitude_ref'] = $exif[GPS][GPSLatitudeRef];
|
||||
if ($exif[GPS][GPSLongitudeRef]) $metadata['image_meta']['longitude_ref'] = $exif[GPS][GPSLongitudeRef];
|
||||
if ($exif[EXIF][FNumber]) {
|
||||
$ouverture = explode("/", $exif[EXIF][FNumber]); // 63/10
|
||||
$a = ($ouverture[0] / $ouverture[1]);
|
||||
$metadata['image_meta']['aperture'] = ($ouverture[0] / $ouverture[1]);
|
||||
}
|
||||
if ($exif[EXIF][ExposureTime]) $metadata['image_meta']['shutter_speed'] = $exif[EXIF][ExposureTime];
|
||||
if ($exif[EXIF][FocalLength]) {
|
||||
$focale = explode("/", $exif[EXIF][FocalLength]);
|
||||
$metadata['image_meta']['focal_length'] = $focale[0];
|
||||
}
|
||||
if ($exif[EXIF][Model]) $metadata['image_meta']['camera'] = $exif[EXIF][Model];
|
||||
//if ($exif[EXIF][DateTimeOriginal]) $metadata['image_meta']['created_timestamp'] = $exif[EXIF][DateTimeOriginal];
|
||||
if ($exif[EXIF][DateTimeOriginal]) {
|
||||
$metadata['image_meta']['created_timestamp'] = strtotime($exif[EXIF][DateTimeOriginal]);
|
||||
}
|
||||
$metadata['image_meta']['caption'] = '';
|
||||
|
||||
//print_r($metadata);
|
||||
//echo 'latitude_ref: ' . $metadata['image_meta']['latitude_ref'];
|
||||
|
||||
list($exif_list, $gm_lat, $gm_lng, $title_marker) = ListeExif($metadata, $attachment, $i);
|
||||
//echo $exif_list; //ok
|
||||
|
||||
$new_img .= $exif_list;
|
||||
//$new_img .= '</ul></div>'."\r\n";
|
||||
$new_img .= '</ul>' . $gm_lat . ' ; ' . $gm_lng . '</div>'."\r\n";
|
||||
|
||||
|
||||
|
||||
//echo $new_img;
|
||||
|
||||
//print_r($exif_list);
|
||||
|
||||
//$new_img = $ancien;
|
||||
}
|
||||
else {
|
||||
|
||||
//echo "autres...";
|
||||
|
||||
//$new_img = $ancien;
|
||||
}
|
||||
|
||||
$content = str_replace($ancien, $new_img, $content);
|
||||
//echo $content;
|
||||
|
||||
}
|
||||
|
||||
echo $content;
|
||||
|
||||
?>
|
||||
|
||||
<a name="carte"></a><p> </p>
|
||||
|
||||
<script type="text/javascript">
|
||||
function getMap(box,latitude,longitude) {
|
||||
var mylatlng = new google.maps.LatLng(latitude,longitude);
|
||||
var myOptions = {
|
||||
zoom: 14,
|
||||
center: mylatlng,
|
||||
mapTypeId: google.maps.MapTypeId.HYBRID
|
||||
};
|
||||
|
||||
var mymap = new google.maps.Map(document.getElementById('map_canvas' + box), myOptions);
|
||||
|
||||
var marker = new google.maps.Marker({
|
||||
position: mylatlng,
|
||||
map: mymap
|
||||
});
|
||||
|
||||
google.maps.event.addListener(marker, 'click', function() {
|
||||
map.setZoom(8);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
//getMap(1, <?php echo $gm_lat; ?>, <?php echo $gm_lng; ?>);
|
||||
|
||||
//getMap(2, 41.68, 2.317);
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
//getMap(<?php echo $i; ?>, <?php echo $gm_lat; ?>, <?php echo $gm_lng; ?>);
|
||||
|
||||
getMap(2, 41.68, 2.317);
|
||||
</script>
|
||||
|
||||
<div id="map_canvas1" ></div>
|
||||
<div id="map_canvas2" ></div>
|
||||
<div id="map_canvas3" ></div>
|
||||
<div id="map_canvas4" ></div>
|
||||
<div id="map_canvas5" ></div>
|
||||
<div id="map_canvas6" ></div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
/*
|
||||
var map;
|
||||
function initialize(lat, lng) {
|
||||
var myLatlng = new google.maps.LatLng(lat, lng);
|
||||
var myOptions = {
|
||||
zoom: 14,
|
||||
center: myLatlng,
|
||||
mapTypeId: google.maps.MapTypeId.ROADMAP
|
||||
}
|
||||
map = new google.maps.Map(document.getElementById("map"), myOptions);
|
||||
|
||||
|
||||
marker = new google.maps.Marker({
|
||||
position: myLatlng,
|
||||
map: map,
|
||||
title:"If this is your exact location, press \"Add this location\""
|
||||
});
|
||||
google.maps.event.addListener(marker, 'click', function() {
|
||||
map.setZoom(8);
|
||||
});
|
||||
}
|
||||
|
||||
initialize(<?php echo $gm_lat; ?>, <?php echo $gm_lng; ?>,);
|
||||
*/
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten-child' ), 'after' => '</div>' ) ); ?>
|
||||
</div><!-- .entry-content -->
|
||||
|
||||
<?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries ?>
|
||||
<div id="entry-author-info">
|
||||
<div id="author-avatar">
|
||||
<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?>
|
||||
</div><!-- #author-avatar -->
|
||||
<div id="author-description">
|
||||
<h2><?php printf( esc_attr__( 'About %s', 'twentyten-child' ), get_the_author() ); ?></h2>
|
||||
<?php the_author_meta( 'description' ); ?>
|
||||
<div id="author-link">
|
||||
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
|
||||
<?php printf( __( 'View all posts by %s <span class="meta-nav">→</span>', 'twentyten-child' ), get_the_author() ); ?>
|
||||
</a>
|
||||
</div><!-- #author-link -->
|
||||
</div><!-- #author-description -->
|
||||
</div><!-- #entry-author-info -->
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- rajout -->
|
||||
|
||||
<div id="related">
|
||||
|
||||
<?php //for use in the loop, list 5 post titles related to first tag on current post
|
||||
$backup = $post; // backup the current object
|
||||
$tags = wp_get_post_tags($post->ID);
|
||||
$tagIDs = array();
|
||||
if ($tags) {
|
||||
$tagcount = count($tags);
|
||||
for ($i = 0; $i < $tagcount; $i++) {
|
||||
$tagIDs[$i] = $tags[$i]->term_id;
|
||||
}
|
||||
$args=array(
|
||||
'tag__in' => $tagIDs,
|
||||
'post__not_in' => array($post->ID),
|
||||
'showposts'=>-1,
|
||||
'caller_get_posts'=>1
|
||||
);
|
||||
$my_query = new WP_Query($args);
|
||||
if( $my_query->have_posts() ) {
|
||||
_e('Related articles:', 'twentyten-child' );
|
||||
?>
|
||||
<br/>
|
||||
<ul class="related">
|
||||
<?php
|
||||
while ($my_query->have_posts()) : $my_query->the_post(); ?>
|
||||
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a> (<?php the_date("F Y"); ?>)</li>
|
||||
<?php endwhile;
|
||||
?></ul><?php
|
||||
}
|
||||
else { ?>
|
||||
<!--h3>No related posts found!</h3-->
|
||||
<?php }
|
||||
}
|
||||
$post = $backup; // copy it back
|
||||
wp_reset_query(); // to use the original query again
|
||||
?>
|
||||
|
||||
<?php twentyten_post_updated(); ?>
|
||||
|
||||
</div><!-- #related -->
|
||||
|
||||
<!-- /rajout -->
|
||||
|
||||
<div class="entry-utility">
|
||||
<?php twentyten_posted_in(); ?>
|
||||
<?php edit_post_link( __( 'Edit', 'twentyten-child' ), '<span class="edit-link">', '</span>' ); ?>
|
||||
</div><!-- .entry-utility -->
|
||||
</div><!-- #post-## -->
|
||||
|
||||
<div id="nav-below" class="navigation">
|
||||
<div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentyten-child' ) . '</span> %title' ); ?></div>
|
||||
<div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentyten-child' ) . '</span>' ); ?></div>
|
||||
</div><!-- #nav-below -->
|
||||
|
||||
<?php comments_template( '', true ); ?>
|
||||
|
||||
<?php endwhile; // end of the loop. ?>
|
||||
|
||||
</div><!-- #content -->
|
||||
</div><!-- #container -->
|
||||
|
||||
<?php get_sidebar(); ?>
|
||||
<?php get_footer(); ?>
|
||||
710
exclus/style.css
Normal file
710
exclus/style.css
Normal file
@@ -0,0 +1,710 @@
|
||||
/*
|
||||
Theme Name: Twenty Ten Child
|
||||
Description: Theme enfant pour Twenty Ten
|
||||
Author: Le nom de l'auteur
|
||||
Template: twentyten
|
||||
*/
|
||||
|
||||
@import url("../twentyten/style.css");
|
||||
|
||||
body {
|
||||
background-color: #e7e7e2;
|
||||
/*background-color: #b7a691;*/
|
||||
}
|
||||
|
||||
a:link, a:visited {
|
||||
color: #858585;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #373737;
|
||||
}
|
||||
a img {
|
||||
padding: 4px;
|
||||
border: thin solid #736c4d;
|
||||
}
|
||||
.iiframe {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#randomImg img {
|
||||
padding: 10px;
|
||||
background-color: #fff;
|
||||
border: 1px solid #818181;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
display: block;
|
||||
}
|
||||
/**/
|
||||
|
||||
#wrapper {
|
||||
background-color: #e7e7e2;
|
||||
/*background-color: #b7a691;*/
|
||||
/*margin-top: 20px;
|
||||
padding: 0 20px;*/
|
||||
}
|
||||
|
||||
#main {
|
||||
/*background-color: #bfb68a;*/
|
||||
background-color: #fffefc;
|
||||
-webkit-border-radius: 16px 16px 0 0;
|
||||
-moz-border-radius: 16px 16px 0 0;
|
||||
border-radius: 16px 16px 0 0;
|
||||
border: thin solid #a0966c;
|
||||
padding-top: 30px;
|
||||
}
|
||||
|
||||
#main .widget-area ul {
|
||||
padding: 0 20px;
|
||||
}
|
||||
/*
|
||||
#container {
|
||||
margin: 0 -260px 0 0;
|
||||
}
|
||||
|
||||
#primary {
|
||||
width: 240px;
|
||||
}
|
||||
*/
|
||||
#container {
|
||||
margin: 0 -230px 0 0;
|
||||
}
|
||||
|
||||
#container2, container-fullwidth {
|
||||
margin: 0 0 0 0;
|
||||
}
|
||||
|
||||
#primary {
|
||||
width: 230px;
|
||||
}
|
||||
|
||||
#content {
|
||||
width: 660px;
|
||||
}
|
||||
#content2 {
|
||||
margin: 0 20px;
|
||||
width: 890px;
|
||||
}
|
||||
|
||||
/* Header */
|
||||
|
||||
#header {
|
||||
margin-bottom:20px;
|
||||
padding:0 10px;
|
||||
/*width:940px;*/
|
||||
/*display:block;*/
|
||||
font-family: "Lucida Grande", Lucida, Verdana, sans-serif;
|
||||
}
|
||||
#header #logo {
|
||||
float:left;
|
||||
}
|
||||
|
||||
#header #pagenav {
|
||||
float:right;
|
||||
}
|
||||
|
||||
#pagenav ul {
|
||||
margin: 16px 0 0;
|
||||
padding-left: 2em;
|
||||
}
|
||||
|
||||
#pagenav li {
|
||||
display: inline;
|
||||
list-style-type: none;
|
||||
padding: 8px;
|
||||
}
|
||||
#pagenav li a {
|
||||
text-decoration: none;
|
||||
font-size: large;
|
||||
padding-bottom: 20px;
|
||||
text-shadow: 1px 1px 1px #aaa;
|
||||
color: #fff;
|
||||
}
|
||||
#pagenav li a:hover {
|
||||
border-bottom: 2px solid #fff;
|
||||
}
|
||||
#logo a {
|
||||
color: #fff;
|
||||
text-shadow: 1px 1px 1px #aaa;
|
||||
text-decoration: none;
|
||||
font-size: xx-large;
|
||||
letter-spacing: 5px;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
#content {
|
||||
color: #444;
|
||||
}
|
||||
*/
|
||||
#content,
|
||||
#content input,
|
||||
#content textarea,
|
||||
#content2,
|
||||
#content2 input,
|
||||
#content2 textarea {
|
||||
color: #444;
|
||||
font-size: 13px;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
#content h2, #content2 h2 {
|
||||
font-family: "Lucida Grande", Lucida, Verdana, sans-serif;
|
||||
}
|
||||
#content h2 a, #content2 h2 a {
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
letter-spacing: 0.5px;
|
||||
font-size: x-large;
|
||||
color: #736c4d;
|
||||
text-shadow: 3px 3px 3px #d9d3c1;
|
||||
}
|
||||
|
||||
#content a:hover, #content2 a:hover {
|
||||
color: #373737;
|
||||
}
|
||||
.entry-content, .entry-summary p, .comment-body {
|
||||
font-family: "Lucida Grande", Lucida, Verdana, sans-serif;
|
||||
}
|
||||
|
||||
.entry-content p, .entry-summary p, .comment-body p {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.entry-date {
|
||||
|
||||
}
|
||||
|
||||
.entry-meta a {
|
||||
text-decoration: none;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.entry-utility {
|
||||
text-align: right;
|
||||
color: #444;
|
||||
margin-top: 30px;
|
||||
}
|
||||
.navigation {
|
||||
line-height: 34px;
|
||||
}
|
||||
.nav-previous a, .nav-next a {
|
||||
font-size: larger;
|
||||
}
|
||||
|
||||
/* */
|
||||
|
||||
.format-gallery .size-thumbnail img,
|
||||
.category-gallery .size-thumbnail img {
|
||||
border: 1px solid #f1f1f1;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.gallery img {
|
||||
border-style: none;
|
||||
border-width: 0;
|
||||
}
|
||||
|
||||
.gallery img {
|
||||
border: 1px solid #f1f1f1;
|
||||
}
|
||||
|
||||
/* liens */
|
||||
|
||||
#content ul {
|
||||
list-style-type: none;
|
||||
margin-left: 3em;
|
||||
}
|
||||
#content2 ol {
|
||||
list-style-type: none;
|
||||
margin: 0 8em;
|
||||
}
|
||||
|
||||
#content h3 {
|
||||
margin-bottom: 1em;
|
||||
margin-top: 2em;
|
||||
}
|
||||
/* single */
|
||||
|
||||
#content h1.entry-title, #content2 h1.entry-title {
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
letter-spacing: 0.5px;
|
||||
font-size: x-large;
|
||||
color: #736c4d;
|
||||
text-shadow: 3px 3px 3px #d9d3c1;
|
||||
font-family: "Lucida Grande", Lucida, Verdana, sans-serif;
|
||||
}
|
||||
|
||||
#related {
|
||||
margin-left: 3em;
|
||||
margin-right: 2em;
|
||||
font-family: "Lucida Grande", Lucida, Verdana, sans-serif;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.maj {
|
||||
font-size: 10px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/* related post*/
|
||||
.related {
|
||||
font-size: smaller;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
/* author info */
|
||||
#entry-author-info {
|
||||
font-family: "Lucida Grande", Lucida, Verdana, sans-serif;
|
||||
/**/background: #e7e7e2;
|
||||
border-top: 0px;
|
||||
clear: both;
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
margin: 24px 0;
|
||||
overflow: hidden;
|
||||
padding: 18px 20px;
|
||||
}
|
||||
|
||||
#author-link {
|
||||
clear: both;
|
||||
color: #777;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
|
||||
}
|
||||
/* comments */
|
||||
|
||||
#comments h3 {
|
||||
font-family: "Lucida Grande", Lucida, Verdana, sans-serif;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
color: #444;
|
||||
}
|
||||
|
||||
.comment-notes {
|
||||
font-family: "Lucida Grande", Lucida, Verdana, sans-serif;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.comment-author cite {
|
||||
color: #000;
|
||||
font-style: italic;
|
||||
font-family: Georgia, "Times New Roman", Times, serif;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.commentmetadata-guestbook {
|
||||
text-align: right;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
ol.commentlist{
|
||||
border-bottom: 1px solid #e7e7e7;
|
||||
}
|
||||
|
||||
#respond {
|
||||
border-top: 0;
|
||||
margin-left: 5em;
|
||||
margin-right: 5em;
|
||||
}
|
||||
|
||||
#respond input {
|
||||
margin: 0 0 9px;
|
||||
width: 60%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#respond textarea {
|
||||
width: 98%;
|
||||
}
|
||||
|
||||
#respond label {
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
.form-submit {
|
||||
text-align: right;
|
||||
padding-right: 3em;
|
||||
}
|
||||
|
||||
/* livre d'or */
|
||||
|
||||
#randomImg {
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
/* sidebar */
|
||||
|
||||
input[type="text"],
|
||||
textarea {
|
||||
font-family: "Lucida Grande", Lucida, Verdana, sans-serif;
|
||||
}
|
||||
|
||||
#primary h3 {
|
||||
|
||||
}
|
||||
.widget_search #s {/* This keeps the search inputs in line */
|
||||
width: 55%;
|
||||
}
|
||||
|
||||
.widget-container {
|
||||
/*font-family: "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;*/
|
||||
font-family: "Lucida Grande", Lucida, Verdana, sans-serif;
|
||||
}
|
||||
|
||||
.widget-title {
|
||||
color: #736c4d;
|
||||
text-shadow: 0px 0px 3px #d9d3c1;
|
||||
margin-bottom: 24px;
|
||||
font: normal large "Lucida Grande", Lucida, Verdana, sans-serif;
|
||||
padding-bottom: 10px;
|
||||
border-bottom-style: solid;
|
||||
border-bottom-width: thin;
|
||||
}
|
||||
|
||||
.widget-area ul ul {
|
||||
margin-left: 0px;
|
||||
/*list-style-image: url(images/icon_bullet.png);*/
|
||||
}
|
||||
|
||||
/**/
|
||||
.widget-area ul ul li {
|
||||
margin-left: 0px;
|
||||
padding-bottom:0px;
|
||||
padding-left:22px;
|
||||
background: url(images/icon_bullet.png) 0 5px no-repeat;
|
||||
list-style-type: none;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
|
||||
|
||||
#colophon {
|
||||
border-top: 1px solid #919191;
|
||||
margin-top: -1px;
|
||||
overflow: hidden;
|
||||
padding: 18px 0;
|
||||
}
|
||||
|
||||
#site-info ul {
|
||||
font-family: "Lucida Grande", Lucida, Verdana, sans-serif; }
|
||||
|
||||
#site-info ul {
|
||||
|
||||
}
|
||||
|
||||
#site-info li {
|
||||
display: inline;
|
||||
list-style-type: none;
|
||||
border-right: 1px solid #999;
|
||||
padding-right: 3px
|
||||
}
|
||||
/**/
|
||||
#site-info li:last-child {
|
||||
border-right:0px;
|
||||
}
|
||||
|
||||
#site-info li a {
|
||||
color: #999;
|
||||
text-decoration: none;
|
||||
font-size: small;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
/* contact form 7 */
|
||||
|
||||
.wpcf7-form {
|
||||
border: thin solid #b1b1b1;
|
||||
padding: 1em 1em 1em 2em;
|
||||
margin: 3em 4em;
|
||||
}
|
||||
|
||||
/* caption */
|
||||
|
||||
.wp-caption, .entry-caption {
|
||||
background: transparent;
|
||||
line-height: 18px;
|
||||
margin-bottom: 20px;
|
||||
max-width: 632px !important; /* prevent too-wide images from breaking layout */
|
||||
padding: 0;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
}
|
||||
.wp-caption img {
|
||||
margin: 0;
|
||||
}
|
||||
.wp-caption p.wp-caption-text, .entry-caption p {
|
||||
background: #f1f1f1;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 1px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* search */
|
||||
|
||||
#searchform input.inputfield {
|
||||
width: 150px;
|
||||
}
|
||||
#searchform input.pushbutton {
|
||||
width:20px; height: 20px;border:0;background: transparent url(images/search2.png) no-repeat 0 4px; text-indent: -9999px; cursor:pointer;
|
||||
}
|
||||
#searchform input.pushbutton:hover {cursor:pointer;}
|
||||
|
||||
/* --------------------------------------------
|
||||
|
||||
#jquery-live-search {
|
||||
background: #fff;
|
||||
|
||||
padding: 5px 10px;
|
||||
max-height: 400px;
|
||||
overflow: auto;
|
||||
|
||||
position: absolute;
|
||||
z-index: 99;
|
||||
|
||||
border: 1px solid #A9A9A9;
|
||||
border-width: 0 1px 1px 1px;
|
||||
|
||||
-webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.3);
|
||||
-moz-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.3);
|
||||
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
*/
|
||||
/* -------------------------------------------- */
|
||||
/* ThreeWP_Ajax_Search */
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/*
|
||||
The container contains the whole ajax search results box. The "content".
|
||||
*/
|
||||
div.threewp_ajax_search_container
|
||||
{
|
||||
position: absolute;
|
||||
z-index: 100;
|
||||
width: 300px;
|
||||
height: 400px;
|
||||
}
|
||||
|
||||
/**
|
||||
Below are the default settings that look OK on TwentyTen.
|
||||
**/
|
||||
|
||||
/**
|
||||
Content box
|
||||
**/
|
||||
div.threewp_ajax_search_results_content
|
||||
{
|
||||
position: relative;
|
||||
overflow: auto;
|
||||
background-color: #e7e7e2;
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
|
||||
-moz-box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
|
||||
-webkit-box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
|
||||
border-radius: 4px;
|
||||
font-size: smaller;
|
||||
}
|
||||
|
||||
div.threewp_ajax_search_results_content ul
|
||||
{
|
||||
list-style-type: none;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
div.threewp_ajax_search_results_content ul li
|
||||
{
|
||||
padding: 4px;
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
div.threewp_ajax_search_results_content ul li a
|
||||
{
|
||||
display: block;
|
||||
height: 100%; /** So that clicking anywhere on that line will work. */
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
div.threewp_ajax_search_results_content ul li a:link,
|
||||
div.threewp_ajax_search_results_content ul li a:visited
|
||||
{
|
||||
color: #858585;
|
||||
text-decoration: none;
|
||||
}
|
||||
div.threewp_ajax_search_results_content ul li a:hover
|
||||
{
|
||||
color: #373737;
|
||||
text-decoration: underline;
|
||||
}
|
||||
/**
|
||||
The first item has .item_first, which enables us to, in this case, have nice, rounded borders on the top.
|
||||
*/
|
||||
div.threewp_ajax_search_results_content ul li.item_first
|
||||
{
|
||||
-moz-border-radius-topleft: 4px;
|
||||
-moz-border-radius-topright: 4px;
|
||||
-webkit-border-radius-topleft: 4px;
|
||||
-webkit-border-radius-topright: 4px;
|
||||
border-top-left-radius: 4px;
|
||||
border-top-right-radius: 4px;
|
||||
}
|
||||
|
||||
/**
|
||||
The last item has .item_last, which enables us to, in this case, have nice, rounded borders on the bottom.
|
||||
*/
|
||||
div.threewp_ajax_search_results_content ul li.item_last
|
||||
{
|
||||
-moz-border-radius-bottomright: 4px;
|
||||
-moz-border-radius-bottomleft: 4px;
|
||||
-webkit-border-radius-bottomright: 4px;
|
||||
-webkit-border-radius-bottomleft: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
}
|
||||
|
||||
/**
|
||||
Since we parse actual search page results and display those, remove whatever we don't want.
|
||||
|
||||
Another way of doing this would be to use a custom url, like http://testsite.com/?ajax_search&s=
|
||||
|
||||
Will be sent as http://testsite.com/?ajax_search&s=text
|
||||
|
||||
The theme could then detect $_GET['ajax_search'] and display simpler results. Either way, it's up to you.
|
||||
**/
|
||||
div.threewp_ajax_search_results_content .entry-utility,
|
||||
div.threewp_ajax_search_results_content .meta-nav,
|
||||
div.threewp_ajax_search_results_content .entry-summary,
|
||||
div.threewp_ajax_search_results_content .entry-meta,
|
||||
div.threewp_ajax_search_results_content .entry-content
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
div.threewp_ajax_search_results_content ul li.item_selected,
|
||||
div.threewp_ajax_search_results_content ul li:hover
|
||||
{
|
||||
background: #ccc;
|
||||
}
|
||||
|
||||
/**
|
||||
Search in progress!
|
||||
|
||||
The container gets the class threewp_ajax_search_in_progress when it's busy doing a search.
|
||||
This allows us to have fancy loading graphics, which I've taken from the normal Wordpress graphics.
|
||||
|
||||
If you've blocked access to /wp-admin then it's your own fault your users aren't seeing moving graphics.
|
||||
*/
|
||||
.threewp_ajax_search_in_progress #s
|
||||
{
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.threewp_ajax_search_in_progress #s
|
||||
{
|
||||
background-image: url("../../../../wp-admin/images/loading.gif");
|
||||
background-position: right;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/* / ThreeWP_Ajax_Search */
|
||||
/* -------------------------------------------- */
|
||||
|
||||
|
||||
/* JW Player Plugin for WordPress */
|
||||
|
||||
.Custom {
|
||||
/* background-color: maroon;
|
||||
text-align: center;
|
||||
margin-right: auto;
|
||||
margin-left: auto;*/
|
||||
}
|
||||
.JWPlayer {
|
||||
max-width: 420px;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.droite {
|
||||
text-align: right;
|
||||
font-style: italic;
|
||||
font-size: x-small;
|
||||
color: #858585;
|
||||
margin-bottom: 3em;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.droite:hover {
|
||||
color: #373737;
|
||||
cursor:pointer;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.bloc_exif {
|
||||
display: none;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#content .bloc_exif img {
|
||||
border: none;
|
||||
margin: 0;
|
||||
display: inline;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
#content .bloc_exif img {
|
||||
cursor:pointer;
|
||||
}
|
||||
#content .bloc_exif ul {
|
||||
list-style:none;
|
||||
background:#fff;
|
||||
border:solid #ddd;
|
||||
border-width:1px;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
width: 620px;
|
||||
padding: 1em 0.5em;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
.bloc_exif img {
|
||||
border: none;
|
||||
margin: 0;
|
||||
display: inline;
|
||||
}
|
||||
.bloc_exif ul {list-style:none; padding:1em; background:#fff; border:solid #ddd; border-width:1px;
|
||||
}
|
||||
*/
|
||||
#content .bloc_exif li {display:inline; padding-right:0.5em; font-size:0.857em;
|
||||
}
|
||||
|
||||
#map, #map_canvas1, #map_canvas2, #map_canvas3, #map_canvas4, #map_canvas5 {
|
||||
width: 500px;
|
||||
height: 350px;
|
||||
display: none;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
margin-bottom: 5em;
|
||||
}
|
||||
.close {
|
||||
|
||||
}
|
||||
.mappy {
|
||||
display: none;
|
||||
}
|
||||
.infowindow ul {
|
||||
list-style-image: none;
|
||||
display: block;
|
||||
}
|
||||
.infowindow li {
|
||||
font-size: x-small;
|
||||
}
|
||||
.infowindow {
|
||||
width: 350px;
|
||||
Reference in New Issue
Block a user