aboutsummaryrefslogtreecommitdiffstats
path: root/i.php
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2012-02-29 21:21:46 +0000
committerpatdenice <patdenice@piwigo.org>2012-02-29 21:21:46 +0000
commitc0bdb8a765065429193d2d78a707031451d4abab (patch)
tree2cf369b31e60127e7c1b325368d95523c74b01d4 /i.php
parentce06fe8a489aea7ac2e2e67f36242784e919da06 (diff)
Multisize
Load thumbnails with ajax. git-svn-id: http://piwigo.org/svn/trunk@13444 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--i.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/i.php b/i.php
index e3313cd78..7dd2c6cb8 100644
--- a/i.php
+++ b/i.php
@@ -319,6 +319,17 @@ function try_switch_source(DerivativeParams $params, $original_mtime)
function send_derivative($expires)
{
global $page;
+
+ if (isset($_GET['ajaxload']) and $_GET['ajaxload'] == 'true')
+ {
+ include_once(PHPWG_ROOT_PATH.'include/functions_cookie.inc.php');
+ include_once(PHPWG_ROOT_PATH.'include/functions_url.inc.php');
+
+ $response = new json_response();
+ $response->url = embellish_url(get_absolute_root_url().$page['derivative_path']);
+ echo json_encode($response);
+ return;
+ }
$fp = fopen($page['derivative_path'], 'rb');
$fstat = fstat($fp);
@@ -343,6 +354,10 @@ function send_derivative($expires)
fclose($fp);
}
+class json_response
+{
+ var $url;
+}
$page=array();
$begin = $step = microtime(true);
@@ -400,6 +415,7 @@ if (!$need_generate)
exit;
}
send_derivative($expires);
+ exit;
}
$page['coi'] = null;