3 /***************************************************************************
4 * xs_include_import.php
5 * ---------------------
6 * copyright : (C) 2003, 2004 CyberAlien
7 * support : http://www.phpbbstyles.com
12 * project revision : 51
13 * last modified : 25 Aug 2004 11:51:48
15 ***************************************************************************/
17 /***************************************************************************
19 * This program is free software; you can redistribute it and/or modify
20 * it under the terms of the GNU General Public License as published by
21 * the Free Software Foundation; either version 2 of the License, or
22 * (at your option) any later version.
24 ***************************************************************************/
26 if (!defined('IN_PHPBB') || !defined('IN_XS'))
28 die("Hacking attempt");
32 function generate_actions_files($dir)
36 $pos = strrpos($dir, '/');
37 $dir = $pos === strlen($dir) - 1 ? substr($dir, 0, $pos) : $dir;
38 $arr = array('processing: '.$dir);
39 for($i=0; $i<count($items); $i++)
41 if($items[$i]['dir'] === $dir)
44 'command' => 'upload',
45 'local' => $items[$i]['tmp'],
46 'remote' => $items[$i]['file']
53 function generate_actions_dirs($dir = '')
57 if($dir && substr($dir, strlen($dir) - 1) !== '/')
64 $pos = strrpos($dir, '/');
65 $str = $pos === strlen($dir) - 1 ? substr($dir, 0, $pos) : $dir;
66 // get last directory name
67 $pos = strrpos($str, '/');
68 $str = $pos ? substr($str, $pos + 1) : $str;
81 'list' => generate_actions_files($dir)
83 // create subdirectories
85 for($i=0; $i<count($dirs); $i++)
88 if(substr($str, 0, $len) === $dir)
92 $str = substr($str, $len + 1);
94 $pos = strpos($str, '/');
95 if($pos == strlen($str) - 1)
99 'list' => generate_actions_dirs($dirs[$i])
107 function generate_style_name($str)
109 $str = 'style_' . $str . '_%02d' . STYLE_EXTENSION;
114 $filename = sprintf($str, $num);
115 $found = @file_exists(XS_TEMP_DIR.$filename);