diff --git a/functions.php b/functions.php
index 9caec44..e985292 100644
--- a/functions.php
+++ b/functions.php
@@ -454,21 +454,19 @@ function zenphoto_handler($atts, $content=null) {
$selector = dess_setting('dess_lightbox_select');
$zenphoto_url = dess_setting('dess_zenphoto');
$size = dess_setting('dess_zp_size');
-/*
- $host = (($_SERVER['HTTPS'] != "") ? "https" : "http") . '://' . $_SERVER['HTTP_HOST'] . '/zenphoto/';
- if (substr_count($zenphoto_url2, "https") == 1) {
- $zenphoto_url = (($_SERVER['HTTPS'] != "") ? substr_replace($zenphoto_url2, 'https', 0, 4) : $zenphoto_url2);
- }
- $zenphoto_url = $host;
-*/
$album = ! empty( $atts['album'] ) ? $atts['album'] : '';
$album = filter_var($album, FILTER_SANITIZE_STRING);
$image = ! empty( $atts['image'] ) ? $atts['image'] : '';
$image = filter_var($image, FILTER_SANITIZE_STRING);
+
+ $caption = ! empty( $atts['caption'] ) ? $atts['caption'] : '';
+ $caption = filter_var($caption, FILTER_SANITIZE_STRING);
- $size = 610;
+ $rnd = rand (1000, 9999);
+
+ //$size = 610;
$folder = false;
$zenphoto_img = "";
@@ -512,53 +510,46 @@ function zenphoto_handler($atts, $content=null) {
$image = $img_album;
$folder = true;
}
-/*
- if (isset($atts['folder'])) {
- if ($atts['folder'] == "true") $folder = true;
- }
-*/
$img = substr($image, 0, strlen($image) - 4);
- $filename = $zenphoto_url . 'cache/' . $album . '/' . urlencode($img) . '_' . $size . '_watermark.jpg';
-
+ $filename = $_SERVER["DOCUMENT_ROOT"] . '/zenphoto/' . 'cache/' . $album . '/' . urlencode($img) . '_' . $size . '_watermark.jpg';
$zp_size = getimagesize(htmlentities($filename));
- //if ($folder == false) $zenphoto_link = '';
- //if ($folder == false) $zenphoto_link = '';
+ $zenphoto_img = (($caption != "") ? ' ';
- $caption .= $b['image_meta']['description'] . ' ' . $caption . '
';
+ $zenphoto_img .= '';
+
+ $zenphoto_img .= (($caption != "") ? '
<\/a>/i';
preg_match_all( $string, $content, $matches, PREG_SET_ORDER);
-//preprint($matches);
+
//Check which attachment is referenced
foreach ($matches as $val) {
$slimbox_caption = '';
@@ -726,17 +714,14 @@ function add_class_lightbox($content) {
//Replace the instance with the lightbox and title(caption) references. Won't fail if caption is empty.
$string = '
';
- //echo "string" . "
" . $string;
- //$replace = '';
$replace = '
';
- //echo "replace" . "
" . $replace;
$content = str_replace( $string, $replace, $content);
}
return $content;
}
-//add_filter('the_content', 'add_class_lightbox', 2);
+add_filter('the_content', 'add_class_lightbox', 2);
if ( ! function_exists( 'creator_post_nav' ) ) :
@@ -848,12 +833,19 @@ function addexif ($content) {
$display_exif = dess_setting('dess_display_exif');
$display_gps = dess_setting('dess_display_gps');
+/*
+# Avec ini_set (suffixage automatique avec un timestamp) :
+ini_set('xdebug.trace_output_dir', dirname(__FILE__));
+ini_set('xdebug.trace_output_name', 'xdebug_trace_%u');
+xdebug_start_trace(null, XDEBUG_TRACE_COMPUTERIZED);
+
+# Fichier unique :
+xdebug_start_trace('/Users/bruno/Sites', XDEBUG_TRACE_COMPUTERIZED);
+*/
+
if ($display_exif == true) {
$matches3 = array();
- //$coord = array();
-
-
// Le caption
//$pattern = '/
(.*?)<\/p>/'; @@ -866,15 +858,15 @@ function addexif ($content) { //$pattern = '/
echo $matches2[0][2];
*/
- //echo "count(matches2): " . count($matches2) . "
@@ -1008,14 +1007,9 @@ function addexif ($content) {
//$anc = str_replace("/>", "class='aligncenter' />", $ancien) . "\r\n";
} // else
-
+ $exif = "";
} // for
-
- //preprint ($coord);
-
-
-
return $content;
@@ -1114,6 +1108,7 @@ function creator_get_exif( $file ) {
return false;
}
*/
+ //echo "file: " . $file . "