summaryrefslogtreecommitdiff
path: root/inc/pageutils.php
diff options
context:
space:
mode:
authorKate Arzamastseva <pshns@ukr.net>2011-05-26 14:23:33 +0300
committerKate Arzamastseva <pshns@ukr.net>2011-05-26 14:23:33 +0300
commite4f389ef1728a0f86164a0e4b88626be9860dabb (patch)
treee2a01458fe3e04fceccb80986f61fe2a25330e0d /inc/pageutils.php
parentf05345511bace85889aa9be5a83820897d322007 (diff)
downloadrpg-e4f389ef1728a0f86164a0e4b88626be9860dabb.tar.gz
rpg-e4f389ef1728a0f86164a0e4b88626be9860dabb.tar.bz2
media version saving
Diffstat (limited to 'inc/pageutils.php')
-rw-r--r--inc/pageutils.php22
1 files changed, 20 insertions, 2 deletions
diff --git a/inc/pageutils.php b/inc/pageutils.php
index c9bf60135..51567191e 100644
--- a/inc/pageutils.php
+++ b/inc/pageutils.php
@@ -308,6 +308,19 @@ function metaFN($id,$ext){
}
/**
+ * returns the full path to the media's meta file specified by ID and extension
+ *
+ * The filename is URL encoded to protect Unicode chars
+ */
+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>
@@ -327,11 +340,16 @@ function metaFiles($id){
*
* @author Andreas Gohr <andi@splitbrain.org>
*/
-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{
+ list($name, $ext) = explode(".", $id);
+ $fn = $conf['mediaolddir'].'/'.utf8_encodeFN($name).'.'.$rev.'.'.utf8_encodeFN($ext);
+ }
return $fn;
}