diff options
author | Esther Brunner <esther@kaffeehaus.ch> | 2005-08-16 20:22:01 +0200 |
---|---|---|
committer | Esther Brunner <esther@kaffeehaus.ch> | 2005-08-16 20:22:01 +0200 |
commit | e1f3d9e1aa287c644fee854d1fddcfb5de4e31f5 (patch) | |
tree | 4d5d2428e0be52fa5fcdaecdb04d3aa7d92d6b8c /inc/pageutils.php | |
parent | 5667eb6525051fa45d19dfa20281279c306d70fd (diff) | |
download | rpg-e1f3d9e1aa287c644fee854d1fddcfb5de4e31f5.tar.gz rpg-e1f3d9e1aa287c644fee854d1fddcfb5de4e31f5.tar.bz2 |
delete meta files on page deletion
darcs-hash:20050816182201-283c4-75638010c1f75cfb7e905bca5647253084e69323.gz
Diffstat (limited to 'inc/pageutils.php')
-rw-r--r-- | inc/pageutils.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/inc/pageutils.php b/inc/pageutils.php index e22dc3c86..dea691381 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -152,6 +152,27 @@ function metaFN($id,$ext){ } /** + * returns an array of full paths to all metafiles of a given ID + * + * @author Esther Brunner <esther@kaffeehaus.ch> + */ +function metaFiles($id){ + $name = noNS($id); + $dir = metaFN(getNS($id),''); + $files = array(); + + $dh = @opendir($dir); + if(!$dh) return; + while(($file = readdir($dh)) !== false){ + if(strpos($file,$name.'.') == 0 && !is_dir($dir.$file)) + $files[] = $dir.$file; + } + closedir($dh); + + return $files; +} + +/** * returns the full path to the mediafile specified by ID * * The filename is URL encoded to protect Unicode chars |