aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/config_default.inc.php7
-rw-r--r--include/constants.php2
-rw-r--r--include/functions.inc.php19
-rw-r--r--include/functions_url.inc.php4
-rw-r--r--include/ws_functions/pwg.php2
5 files changed, 31 insertions, 3 deletions
diff --git a/include/config_default.inc.php b/include/config_default.inc.php
index 60a3da323..eafb9d5a9 100644
--- a/include/config_default.inc.php
+++ b/include/config_default.inc.php
@@ -63,6 +63,13 @@ $conf['file_ext'] = array_merge(
array('tiff', 'tif', 'mpg','zip','avi','mp3','ogg','pdf')
);
+// enable_formats: should Piwigo search for multiple formats?
+$conf['enable_formats'] = false;
+
+// format_ext : file extensions for formats, ie additional versions of a
+// photo (or nay other file). Formats are in sub-directory pwg_format.
+$conf['format_ext'] = array('cr2', 'tif', 'tiff', 'nef', 'dng', 'ai', 'psd');
+
// top_number : number of element to display for "best rated" and "most
// visited" categories
$conf['top_number'] = 15;
diff --git a/include/constants.php b/include/constants.php
index 83d8747bc..ef321a4bc 100644
--- a/include/constants.php
+++ b/include/constants.php
@@ -105,5 +105,7 @@ if (!defined('THEMES_TABLE'))
define('THEMES_TABLE', $prefixeTable.'themes');
if (!defined('LANGUAGES_TABLE'))
define('LANGUAGES_TABLE', $prefixeTable.'languages');
+if (!defined('IMAGE_FORMAT_TABLE'))
+ define('IMAGE_FORMAT_TABLE', $prefixeTable.'image_format');
?>
diff --git a/include/functions.inc.php b/include/functions.inc.php
index 60a1885e5..2119abe8f 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -407,7 +407,7 @@ SELECT id, name
* @param string $image_type
* @return bool
*/
-function pwg_log($image_id = null, $image_type = null)
+function pwg_log($image_id = null, $image_type = null, $format_id = null)
{
global $conf, $user, $page;
@@ -445,6 +445,7 @@ INSERT INTO '.HISTORY_TABLE.'
category_id,
image_id,
image_type,
+ format_id,
tag_ids
)
VALUES
@@ -457,6 +458,7 @@ INSERT INTO '.HISTORY_TABLE.'
'.(isset($page['category']['id']) ? $page['category']['id'] : 'NULL').',
'.(isset($image_id) ? $image_id : 'NULL').',
'.(isset($image_type) ? "'".$image_type."'" : 'NULL').',
+ '.(isset($format_id) ? $format_id : 'NULL').',
'.(isset($tags_string) ? "'".$tags_string."'" : 'NULL').'
)
;';
@@ -953,6 +955,21 @@ function original_to_representative($path, $representative_ext)
}
/**
+ * Transforms an original path to its format
+ *
+ * @param string $path
+ * @param string $format_ext
+ * @return string
+ */
+function original_to_format($path, $format_ext)
+{
+ $pos = strrpos($path, '/');
+ $path = substr_replace($path, 'pwg_format/', $pos+1, 0);
+ $pos = strrpos($path, '.');
+ return substr_replace($path, $format_ext, $pos+1);
+}
+
+/**
* get the full path of an image
*
* @param array $element_info element information from db (at least 'path')
diff --git a/include/functions_url.inc.php b/include/functions_url.inc.php
index 138a895e1..e0f09a28c 100644
--- a/include/functions_url.inc.php
+++ b/include/functions_url.inc.php
@@ -379,7 +379,7 @@ function make_section_in_url($params)
$section_string.= '/'.$tag['id'];
break;
case 'tag':
- if (isset($tag['url_name']) and !is_numeric($tag['url_name']) )
+ if (isset($tag['url_name']))
{
$section_string.= '/'.$tag['url_name'];
break;
@@ -824,4 +824,4 @@ function url_is_remote($url)
return false;
}
-?> \ No newline at end of file
+?>
diff --git a/include/ws_functions/pwg.php b/include/ws_functions/pwg.php
index b96338eaf..6d9d49fcc 100644
--- a/include/ws_functions/pwg.php
+++ b/include/ws_functions/pwg.php
@@ -339,6 +339,8 @@ function ws_session_getStatus($params, &$service)
)
)
);
+
+ $res['upload_form_chunk_size'] = $conf['upload_form_chunk_size'];
}
return $res;