summaryrefslogtreecommitdiff
path: root/inc/pageutils.php
diff options
context:
space:
mode:
authorlupo49 <post@lupo49.de>2011-09-11 19:02:50 +0200
committerlupo49 <post@lupo49.de>2011-09-11 19:02:50 +0200
commitded84e755a312cf3c82cd910d35b371b64bec5be (patch)
tree2d3bd07085d8ba68c9d487cc90dae8132bdd5824 /inc/pageutils.php
parente2b5ad84f88d0bd1fe510fa74673cc7557c6e630 (diff)
parent8bfdbb5efd72c2e708d005a977444400c7affcfa (diff)
downloadrpg-ded84e755a312cf3c82cd910d35b371b64bec5be.tar.gz
rpg-ded84e755a312cf3c82cd910d35b371b64bec5be.tar.bz2
Merge branch 'master' of github.com:lupo49/dokuwiki
Diffstat (limited to 'inc/pageutils.php')
-rw-r--r--inc/pageutils.php26
1 files changed, 22 insertions, 4 deletions
diff --git a/inc/pageutils.php b/inc/pageutils.php
index c9bf60135..81dcb66e7 100644
--- a/inc/pageutils.php
+++ b/inc/pageutils.php
@@ -295,8 +295,6 @@ function wikiLockFN($id) {
/**
* returns the full path to the meta file specified by ID and extension
*
- * The filename is URL encoded to protect Unicode chars
- *
* @author Steven Danz <steven-danz@kc.rr.com>
*/
function metaFN($id,$ext){
@@ -308,6 +306,19 @@ function metaFN($id,$ext){
}
/**
+ * returns the full path to the media's meta file specified by ID and extension
+ *
+ * @author Kate Arzamastseva <pshns@ukr.net>
+ */
+function mediaMetaFN($id,$ext){
+ global $conf;
+ $id = cleanID($id);
+ $id = str_replace(':','/',$id);
+ $fn = $conf['mediametadir'].'/'.utf8_encodeFN($id).$ext;
+ return $fn;
+}
+
+/**
* returns an array of full paths to all metafiles of a given ID
*
* @author Esther Brunner <esther@kaffeehaus.ch>
@@ -326,12 +337,19 @@ function metaFiles($id){
* The filename is URL encoded to protect Unicode chars
*
* @author Andreas Gohr <andi@splitbrain.org>
+ * @author Kate Arzamastseva <pshns@ukr.net>
*/
-function mediaFN($id){
+function mediaFN($id, $rev=''){
global $conf;
$id = cleanID($id);
$id = str_replace(':','/',$id);
- $fn = $conf['mediadir'].'/'.utf8_encodeFN($id);
+ if(empty($rev)){
+ $fn = $conf['mediadir'].'/'.utf8_encodeFN($id);
+ }else{
+ $ext = mimetype($id);
+ $name = substr($id,0, -1*strlen($ext[0])-1);
+ $fn = $conf['mediaolddir'].'/'.utf8_encodeFN($name .'.'.( (int) $rev ).'.'.$ext[0]);
+ }
return $fn;
}