本文整理汇总了PHP中filelist函数的典型用法代码示例。如果您正苦于以下问题:PHP filelist函数的具体用法?PHP filelist怎么用?PHP filelist使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了filelist函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor
* Load the list with available plugins and assign them in the correct category
*/
public function __construct(\phpbb\titania\controller\helper $controller_helper)
{
$this->controller_helper = $controller_helper;
$this->phpbb_root_path = \phpbb::$root_path;
$this->php_ext = \phpbb::$php_ext;
// Set the path
$this->tool_box_path = $this->phpbb_root_path . 'ext/phpbb/titania/includes/manage_tools/';
// Load functions_admin.php if required
if (!function_exists('filelist')) {
include $this->phpbb_root_path . 'includes/functions_admin.' . $this->php_ext;
}
// Create a list with tools
$filelist = filelist($this->tool_box_path, '', $this->php_ext);
// Need to do some sanitization on the result of filelist
foreach ($filelist as $tools) {
// Don't want the extension
foreach ($tools as $tool) {
if (in_array($tool, $this->ignore_tools)) {
continue;
}
$this->plugin_list[] = ($pos = strpos($tool, '.' . $this->php_ext)) !== false ? substr($tool, 0, $pos) : $tool;
}
}
// Get the requested cat and tool
$this->tool_id = phpbb::$request->variable('t', '');
// Check if they want to use a tool or not, make sure that the tool name is legal, and make sure the tool exists
if (!$this->tool_id || preg_match('#([^a-zA-Z0-9_])#', $this->tool_id) || !file_exists($this->tool_box_path . $this->tool_id . '.' . $this->php_ext)) {
$this->tool_id = '';
}
// Make sure the form_key is set
add_form_key($this->tool_id);
// Assign the two menus to the template
$this->gen_left_nav();
}
开发者ID:OfficeForum,项目名称:customisation-db,代码行数:38,代码来源:manage_plugin.php
示例2: manage_plugin
/**
* Constructor
* Load the list with available plugins and assign them in the correct category
*/
function manage_plugin()
{
// Set the path
$this->tool_box_path = TITANIA_ROOT . 'includes/manage_tools/';
// Create a list with tools
$filelist = filelist($this->tool_box_path, '', PHP_EXT);
// Need to do some sanitization on the result of filelist
foreach ($filelist as $tools) {
// Don't want the extension
foreach ($tools as $tool) {
if (in_array($tool, $this->ignore_tools)) {
continue;
}
$this->plugin_list[] = ($pos = strpos($tool, '.' . PHP_EXT)) !== false ? substr($tool, 0, $pos) : $tool;
}
}
// Get the requested cat and tool
$this->tool_id = request_var('t', '');
// Check if they want to use a tool or not, make sure that the tool name is legal, and make sure the tool exists
if (!$this->tool_id || preg_match('#([^a-zA-Z0-9_])#', $this->tool_id) || !file_exists($this->tool_box_path . $this->tool_id . '.' . PHP_EXT)) {
$this->tool_id = '';
}
// Make sure the form_key is set
add_form_key($this->tool_id);
// Assign the two menus to the template
$this->gen_left_nav();
}
开发者ID:kairion,项目名称:customisation-db,代码行数:31,代码来源:manage_plugin.php
示例3: marker_image_select
protected function marker_image_select($marker, $path)
{
$path = $this->phpbb_extension_manager->get_extension_path('tas2580/usermap', true) . $path;
if (!function_exists('filelist')) {
include $this->phpbb_root_path . '/includes/functions_admin.' . $this->php_ext;
}
$imglist = filelist($path);
$edit_img = $filename_list = '';
foreach ($imglist as $path => $img_ary) {
sort($img_ary);
foreach ($img_ary as $img) {
$img = $path . $img;
if ($img == $marker) {
$selected = ' selected="selected"';
$edit_img = $img;
} else {
$selected = '';
}
if (strlen($img) > 255) {
continue;
}
$filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . $img . '</option>';
}
}
return '<option value=""' . ($edit_img == '' ? ' selected="selected"' : '') . '>----------</option>' . $filename_list;
}
开发者ID:tas2580,项目名称:usermap,代码行数:26,代码来源:class_usermap.php
示例4: add_file
/**
* Add file to archive
*/
function add_file($src, $src_rm_prefix = '', $src_add_prefix = '', $skip_files = '')
{
global $phpbb_root_path;
$skip_files = explode(',', $skip_files);
// Remove rm prefix from src path
$src_path = ($src_rm_prefix) ? preg_replace('#^(' . preg_quote($src_rm_prefix, '#') . ')#', '', $src) : $src;
// Add src prefix
$src_path = ($src_add_prefix) ? ($src_add_prefix . ((substr($src_add_prefix, -1) != '/') ? '/' : '') . $src_path) : $src_path;
// Remove initial "/" if present
$src_path = (substr($src_path, 0, 1) == '/') ? substr($src_path, 1) : $src_path;
if (is_file($phpbb_root_path . $src))
{
$this->data($src_path, file_get_contents("$phpbb_root_path$src"), false, stat("$phpbb_root_path$src"));
}
else if (is_dir($phpbb_root_path . $src))
{
// Clean up path, add closing / if not present
$src_path = ($src_path && substr($src_path, -1) != '/') ? $src_path . '/' : $src_path;
$filelist = array();
$filelist = filelist("$phpbb_root_path$src", '', '*');
krsort($filelist);
if ($src_path)
{
$this->data($src_path, '', true, stat("$phpbb_root_path$src"));
}
foreach ($filelist as $path => $file_ary)
{
if ($path)
{
// Same as for src_path
$path = (substr($path, 0, 1) == '/') ? substr($path, 1) : $path;
$path = ($path && substr($path, -1) != '/') ? $path . '/' : $path;
$this->data("$src_path$path", '', true, stat("$phpbb_root_path$src$path"));
}
foreach ($file_ary as $file)
{
if (in_array($path . $file, $skip_files))
{
continue;
}
$this->data("$src_path$path$file", file_get_contents("$phpbb_root_path$src$path$file"), false, stat("$phpbb_root_path$src$path$file"));
}
}
}
return true;
}
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:59,代码来源:functions_compress.php
示例5: add_file
/**
* Add file to archive
*/
function add_file($src, $src_rm_prefix = '', $src_add_prefix = '', $skip_files = '')
{
global $phpbb_root_path;
$skip_files = explode(',', $skip_files);
// Remove rm prefix from src path
$src_path = $src_rm_prefix ? preg_replace('#^(' . preg_quote($src_rm_prefix, '#') . ')#', '', $src) : $src;
// Add src prefix
$src_path = $src_add_prefix ? $src_add_prefix . (substr($src_add_prefix, -1) != '/' ? '/' : '') . $src_path : $src_path;
// Remove initial "/" if present
$src_path = substr($src_path, 0, 1) == '/' ? substr($src_path, 1) : $src_path;
if (is_file($phpbb_root_path . $src)) {
$this->data($src_path, file_get_contents("{$phpbb_root_path}{$src}"), false, stat("{$phpbb_root_path}{$src}"));
} else {
if (is_dir($phpbb_root_path . $src)) {
// Clean up path, add closing / if not present
$src_path = $src_path && substr($src_path, -1) != '/' ? $src_path . '/' : $src_path;
$filelist = array();
$filelist = filelist("{$phpbb_root_path}{$src}", '', '*');
krsort($filelist);
/**
* Commented out, as adding the folders produces corrupted archives
if ($src_path)
{
$this->data($src_path, '', true, stat("$phpbb_root_path$src"));
}
*/
foreach ($filelist as $path => $file_ary) {
/**
* Commented out, as adding the folders produces corrupted archives
if ($path)
{
// Same as for src_path
$path = (substr($path, 0, 1) == '/') ? substr($path, 1) : $path;
$path = ($path && substr($path, -1) != '/') ? $path . '/' : $path;
$this->data("$src_path$path", '', true, stat("$phpbb_root_path$src$path"));
}
*/
foreach ($file_ary as $file) {
if (in_array($path . $file, $skip_files)) {
continue;
}
$this->data("{$src_path}{$path}{$file}", file_get_contents("{$phpbb_root_path}{$src}{$path}{$file}"), false, stat("{$phpbb_root_path}{$src}{$path}{$file}"));
}
}
} else {
// $src does not exist
return false;
}
}
return true;
}
开发者ID:slackfaith,项目名称:deadbrain_site,代码行数:55,代码来源:functions_compress.php
示例6: repair
function repair()
{
global $db;
$stylelist = filelist(PHPBB_ROOT_PATH . 'styles/', '', 'cfg');
ksort($stylelist);
// Loop throught the files and try to find a style we can use.
// To be usable the directory name in the style.cfg is the same as the directory.
foreach (array_keys($stylelist) as $styledirname) {
if (!in_array('style.cfg', $stylelist[$styledirname])) {
continue;
}
// Read the cfg, should always be index 0
$items = parse_cfg_file(PHPBB_ROOT_PATH . 'styles/' . $styledirname . 'style.cfg');
// Unify the name in the cfg to something used as a directory
// Spaces -> '_'
// All lowercase
$stylename = utf8_clean_string(str_replace(' ', '_', $items['name']));
// Clean up the dirname
$dirname = substr($styledirname, -1) == '/' ? substr($styledirname, 0, -1) : $styledirname;
// If not the same switch to the next one
if ($dirname != $stylename) {
continue;
}
// If this style isn't installed we will install the style at this point.
$sql = 'SELECT style_id
FROM ' . STYLES_TABLE . "\n\t\t\t\tWHERE style_name = '" . $db->sql_escape($items['name']) . "'";
$result = $db->sql_query($sql);
$this->sid = $db->sql_fetchfield('style_id', false, $result);
$db->sql_freeresult($result);
if (empty($this->sid)) {
// Nasty, but the style installer fetches these in the method o_0
$GLOBALS['_REQUEST']['path'] = $stylename;
$GLOBALS['_POST']['update'] = true;
// Call the style installer
$this->ac->install('style');
// Fetch the id
$sql = 'SELECT style_id
FROM ' . STYLES_TABLE . "\n\t\t\t\t\tWHERE style_name = '" . $db->sql_escape($items['name']) . "'";
$result = $db->sql_query($sql);
$this->sid = $db->sql_fetchfield('style_id', false, $result);
$db->sql_freeresult($result);
}
// Set this style as the active style
set_config('default_style', $this->sid);
set_config('override_user_style', 1);
// Overriding the style should enable the board for everyone
return;
}
echo 'The support toolkit couldn\'t find an available style. Please seek further assistance in the support forums on <a href="http://www.phpbb.com/community/viewforum.php?f=46" title="phpBB.com Support forum">phpbb.com</a>';
garbage_collection();
exit_handler();
}
开发者ID:napus,项目名称:support-toolkit,代码行数:52,代码来源:style_dir_repair.php
示例7: plugin
/**
* Constructor
* Load the list with available plugins and assign them in the correct category
*/
function plugin()
{
// Set the path
$this->tool_box_path = STK_ROOT_PATH . 'tools/';
// Create a list with tools
$filelist = filelist($this->tool_box_path, '', PHP_EXT);
// Need to do some sanitization on the result of filelist
foreach ($filelist as $cat => $tools) {
// Don't need those
if (empty($cat)) {
continue;
}
$cat = substr($cat, -1) == '/' ? substr($cat, 0, -1) : $cat;
if (!isset($this->plugin_list[$cat])) {
$this->plugin_list[$cat] = array();
}
// Don't want the extension
foreach ($tools as $key => $tool) {
$tools[$key] = ($pos = strpos($tool, '.' . PHP_EXT)) !== false ? substr($tool, 0, $pos) : $tool;
}
$this->plugin_list[$cat] = $tools;
}
// Get the requested cat and tool
$this->_parts['c'] = request_var('c', $this->_parts['c']);
$this->_parts['t'] = request_var('t', $this->_parts['t']);
// We shouldn't rely on the given category request, unless there really is a tool with that name in the given category
if ($this->_parts['t'] && (!isset($this->plugin_list[$this->_parts['c']]) || !in_array($this->_parts['t'], $this->plugin_list[$this->_parts['c']]))) {
foreach ($this->plugin_list as $cat => $tools) {
foreach ($tools as $tool) {
if ($tool == $this->_parts['t']) {
$this->_parts['c'] = $cat;
}
}
}
}
// Check if they want to use a tool or not, make sure that the tool name is legal, and make sure the tool exists
if (!$this->_parts['t'] || preg_match('#([^a-zA-Z0-9_])#', $this->_parts['t']) || !file_exists(STK_ROOT_PATH . 'tools/' . $this->_parts['c'] . '/' . $this->_parts['t'] . '.' . PHP_EXT)) {
$this->_parts['t'] = '';
}
// Make sure the form_key is set
add_form_key($this->_parts['t']);
// Assign the two menus to the template
$this->gen_top_nav();
$this->gen_left_nav();
}
开发者ID:napus,项目名称:support-toolkit,代码行数:49,代码来源:plugin.php
示例8: filelist
function filelist($folderRoot, $folder = '')
{
$handle = opendir($folderRoot . '/' . $folder);
while ($file = readdir($handle)) {
if (is_dir($folderRoot . '/' . $folder . '/' . $file)) {
if ($file == '.' || $file == '..') {
} else {
$p = $file;
if ($folder > '') {
$p = $folder . '/' . $p;
}
filelist($folderRoot, $p);
}
} else {
$filehex = $folder . '/' . $file . "\t" . crc32_file3($folderRoot . '/' . $folder . '/' . $file);
$GLOBALS['filehexlist'] .= $filehex . "\r\n";
}
}
}
开发者ID:qunimalegfe,项目名称:mboapp,代码行数:19,代码来源:md5calc.php
示例9: filelist
function filelist()
{
//返回主题文件路径
$dir = APP_ROOT . "/User/Home/View";
//主题目录
$list = scandir($dir);
foreach ($list as $file) {
//遍历
$path = $dir . "/" . $file;
if (is_dir($path) && $file != "." && $file != "..") {
//判断是否是路径
filelist($path);
} else {
if ($this->extend($file) == "html") {
$rs[] = array("file" => $file, "path" => $path);
}
}
}
return $rs;
}
开发者ID:ShelterYa,项目名称:easyou,代码行数:20,代码来源:f.class.php
示例10: filelist
function filelist($folderRoot,$folder=''){
$handle=opendir($folderRoot.'/'.$folder);
while($file=readdir($handle)){
//if($folder=='.'){
// $path=$file;
//}else{
$path=$folderRoot.'/'.$folder.'/'.$file;
//}
if(is_dir($path)){
if($file=='.'||$file=='..'){
}else{
filelist($folderRoot,$path);
}
}else{
$pathx=$folder.'/'.$file;
$filehex=$pathx."\t".crc32_file3($path);
$GLOBALS['filehexlist'].=$filehex."\r\n";
}
}
}
开发者ID:qunimalegfe,项目名称:mboapp,代码行数:20,代码来源:md5calc+-+副本.php
示例11: filelist
function filelist($startdir = "./", $searchSubdirs = 0, $directoriesonly = 1, $maxlevel = "1", $level = 1)
{
//list the directory/file names that you want to ignore
$ignoredDirectory[] = ".";
$ignoredDirectory[] = "..";
$ignoredDirectory[] = "_vti_cnf";
global $directorylist;
//initialize global array
if (is_dir($startdir)) {
if ($dh = opendir($startdir)) {
while (($file = readdir($dh)) !== false) {
if (!(array_search($file, $ignoredDirectory) > -1)) {
if (filetype($startdir . $file) == "dir") {
//build your directory array however you choose;
//add other file details that you want.
$directorylist[$startdir . $file]['level'] = $level;
$directorylist[$startdir . $file]['dir'] = 1;
$directorylist[$startdir . $file]['name'] = $file;
$directorylist[$startdir . $file]['path'] = $startdir;
if ($searchSubdirs) {
if ($maxlevel == "all" or $maxlevel > $level) {
filelist($startdir . $file . "/", $searchSubdirs, $directoriesonly, $maxlevel, $level + 1);
}
}
} else {
if (!$directoriesonly) {
//if you want to include files; build your file array
//however you choose; add other file details that you want.
$directorylist[$startdir . $file]['level'] = $level;
$directorylist[$startdir . $file]['dir'] = 0;
$directorylist[$startdir . $file]['name'] = $file;
$directorylist[$startdir . $file]['path'] = $startdir;
}
}
}
}
closedir($dh);
}
}
return $directorylist;
}
开发者ID:Tim-NL,项目名称:SpaceBukkitPanel,代码行数:41,代码来源:findthemes.php
示例12: critical_repair
/**
* Construct critical repair.
* This method loads all critical repair tools
* @return void
*/
function critical_repair()
{
$this->tool_path = STK_ROOT_PATH . 'includes/critical_repair/';
$filelist = filelist($this->tool_path, '', PHP_EXT);
foreach ($filelist as $directory => $tools) {
if ($directory != 'autorun/') {
if (sizeof($tools)) {
foreach ($tools as $tool) {
$this->manual_tools[] = substr($tool, 0, strpos($tool, '.'));
}
}
} else {
if (sizeof($tools)) {
foreach ($tools as $tool) {
$this->autorun_tools[] = substr($tool, 0, strpos($tool, '.'));
}
}
}
}
return true;
}
开发者ID:napus,项目名称:support-toolkit,代码行数:26,代码来源:critical_repair.php
示例13: _store_in_db
/**
* Moves a template set to the database
*
* @access private
* @param string $mode The component to move - only template is supported
* @param int $id The template id
* @param string $path TThe path to the template files
*/
function _store_in_db($mode, $id, $path)
{
global $phpbb_root_path, $db;
$filelist = filelist("{$phpbb_root_path}styles/{$path}/template", '', 'html');
$this->store_templates('insert', $id, $path, $filelist);
// Okay, we do the query here -shouldn't be triggered often.
$sql = 'UPDATE ' . STYLES_TEMPLATE_TABLE . '
SET template_storedb = 1
WHERE template_id = ' . $id;
$db->sql_query($sql);
}
开发者ID:jverkoey,项目名称:Three20-Scope,代码行数:19,代码来源:acp_styles.php
示例14: foreach
if ($merken != DATABASE) {
$db->selectDB(DATABASE, "");
}
$where = "";
foreach ($array as $value) {
if ($where != "") {
$where .= " OR ";
}
$where .= "fid = '" . $value . "'";
}
$sql = "SELECT *\n FROM site_file\n WHERE " . $where . "\n ORDER BY ffname, funder";
$result = $db->query($sql);
if ($merken != DATABASE) {
$db->selectDB($merken, "");
}
filelist($result, "contented");
}
if (is_array($_SESSION["compilation_memo"])) {
foreach ($_SESSION["compilation_memo"] as $compid => $value) {
$pics = implode(":", $value);
$dataloop["selection"][] = array("id" => $compid, "pics" => $pics, "onclick" => "ebInsertSelNG(ebCanvas, '" . $compid . "', '" . $cfg["contented"]["sel_tag"][0] . "', '" . $cfg["contented"]["sel_tag"][1] . "', '" . $pics . "', '" . $cfg["contented"]["sel_tag"][2] . "', '" . $cfg["contented"]["sel_tag"][3] . "');");
}
if (count($dataloop["selection"]) > 0) {
$hidedata["selection"] = array();
}
}
// template version
$art = "";
}
// referer im form mit hidden element mitschleppen
if ($HTTP_GET_VARS["referer"] != "") {
开发者ID:BackupTheBerlios,项目名称:ewebuki-svn,代码行数:31,代码来源:contented-edit.inc.php
示例15: run
/**
* Run the tool
* This tool will run through the files and all files that are new, or of
* which the last change date has been changed will be checked for invalid
* characters.
*/
function run()
{
global $critical_repair, $stk_config;
// Get all the files
$filelist = filelist(PHPBB_ROOT_PATH, '', PHP_EXT);
foreach ($filelist as $directory => $files) {
// As the install dir can be renamed, we need to check here whether this
// is an install directory
if (in_array('convert_phpbb20.' . PHP_EXT, $files) || in_array('new_normalizer.' . PHP_EXT, $files) || in_array('database_update.' . PHP_EXT, $files)) {
// It is and we're not forcing a full scan, skip it
if (!$stk_config['bom_sniffer_force_full_scan']) {
continue;
}
}
// Step into the files
if (!empty($files)) {
// Test whether we're sniffing a language directory (any)
$lang_test_dir = '';
$lang_matches = array();
if (preg_match('#language/([a-zA-Z\\-_]+)/#ise', $directory, $lang_matches)) {
$lang_test_dir = str_replace($lang_matches[1], '..', $directory);
}
foreach ($files as $file) {
// If this is inside a language directory we need to check whether this file is
// in the whitelist and adjust the whitelist to include it
$sniff_lang_file = false;
if (!empty($lang_test_dir)) {
$sniff_lang_file = in_array($lang_test_dir . $file, $this->whitelist) ? true : false;
}
// Test this file against the whitelist
if (!$stk_config['bom_sniffer_force_full_scan'] && (!in_array($directory . $file, $this->whitelist) && $sniff_lang_file === false)) {
continue;
} else {
if (!isset($this->cache->cache_data[$directory . $file]) || filectime(PHPBB_ROOT_PATH . $directory . $file) != $this->cache->cache_data[$directory . $file] || !$stk_config['bom_sniffer_force_full_scan']) {
$this->sniff($directory, $file);
}
}
}
}
}
// Once finished always write the new data back to the cache file
$this->cache->storedata();
// Inform the user what to do if we've created files
if (is_dir(PHPBB_ROOT_PATH . 'store/bom_sniffer')) {
$critical_repair->trigger_error($this->messages['issue_found']);
}
}
开发者ID:napus,项目名称:support-toolkit,代码行数:53,代码来源:bom_sniffer.php
示例16: BuildContentPage
function BuildContentPage()
{
global $groupmode, $phpvars, $page, $logpage, $postlogpage, $GroupModeRefreshInterval, $FileModeRefreshInterval, $FileModeLog, $historymode, $hasusermenu;
if ($groupmode) {
currently_downloading($phpvars);
queued_downloading($phpvars, $page);
currently_processing($phpvars, $postlogpage);
queued_processing($phpvars);
historymain($phpvars);
logging($phpvars, $logpage);
} elseif ($historymode) {
history($phpvars, $page);
} else {
filelist($phpvars, $page);
if ($FileModeLog) {
echo '<br>';
logging($phpvars, $logpage);
}
}
serverinfobox($phpvars);
servercommandbox($phpvars);
if ($hasusermenu) {
usermenu($phpvars);
}
echo '<div style="display: none" id="updateinterval">' . ($groupmode ? $GroupModeRefreshInterval : $FileModeRefreshInterval) . '</div>';
echo '<div style="display: none" id="downloadlimit">' . $phpvars['status']['DownloadLimit'] / 1024 . '</div>';
if (isset($_COOKIE['upload_status'])) {
echo '<div style="display: none" id="uploadstatushidden">' . $_COOKIE['upload_status'] . '</div>';
}
if (isset($_COOKIE['newzbin_status'])) {
echo '<div style="display: none" id="newzbinstatushidden">' . $_COOKIE['newzbin_status'] . '</div>';
}
}
开发者ID:jasanders,项目名称:os-aios,代码行数:33,代码来源:status.php
示例17: main
//.........这里部分代码省略.........
switch ($method) {
case 'ftp':
$transfer = new ftp(request_var('host', ''), request_var('username', ''), request_var('password', ''), request_var('root_path', ''), request_var('port', ''), request_var('timeout', ''));
break;
default:
trigger_error($user->lang['INVALID_UPLOAD_METHOD']);
}
if (($result = $transfer->open_session()) !== true) {
trigger_error($user->lang[$result] . adm_back_link($this->u_action));
}
$transfer->rename($lang_path . $file, $lang_path . $file . '.bak');
$transfer->copy_file('store/' . $lang_path . $file, $lang_path . $file);
$transfer->close_session();
add_log('admin', 'LOG_LANGUAGE_FILE_REPLACED', $file);
trigger_error($user->lang['UPLOAD_COMPLETED']);
}
}
$action = 'details';
// no break;
// no break;
case 'details':
if (!$lang_id) {
trigger_error($user->lang['NO_LANG_ID'] . adm_back_link($this->u_action));
}
$this->page_title = 'LANGUAGE_PACK_DETAILS';
$sql = 'SELECT * FROM ' . LANG_TABLE . '
WHERE lang_id = ' . $lang_id;
$result = $db->sql_query($sql);
$lang_entries = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$lang_iso = $lang_entries['lang_iso'];
$missing_vars = $missing_files = array();
// Get email templates
$email_files = filelist($phpbb_root_path . 'language/' . $config['default_lang'], 'email', 'txt');
$email_files = $email_files['email/'];
// Get acp files
$acp_files = filelist($phpbb_root_path . 'language/' . $config['default_lang'], 'acp', $phpEx);
$acp_files = $acp_files['acp/'];
// Get mod files
$mods_files = filelist($phpbb_root_path . 'language/' . $config['default_lang'], 'mods', $phpEx);
$mods_files = isset($mods_files['mods/']) ? $mods_files['mods/'] : array();
// Check if our current filename matches the files
switch ($this->language_directory) {
case 'email':
if (!in_array($this->language_file, $email_files)) {
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id));
}
break;
case 'acp':
if (!in_array($this->language_file, $acp_files)) {
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id));
}
break;
case 'mods':
if (!in_array($this->language_file, $mods_files)) {
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id));
}
break;
default:
if (!in_array($this->language_file, $this->main_files)) {
trigger_error($user->lang['WRONG_LANGUAGE_FILE'] . adm_back_link($this->u_action . '&action=details&id=' . $lang_id));
}
}
if (isset($_POST['remove_store'])) {
$store_filename = $this->get_filename($lang_iso, $this->language_directory, $this->language_file, true, true);
@unlink($phpbb_root_path . $store_filename);
开发者ID:yunsite,项目名称:gloryroad,代码行数:67,代码来源:acp_language.php
示例18: main
function main($id, $mode)
{
global $db, $user, $template, $cache;
global $config, $phpbb_root_path;
global $request, $phpbb_container;
$user->add_lang('acp/posting');
// Set up general vars
$action = $request->variable('action', '');
$action = isset($_POST['add']) ? 'add' : $action;
$action = isset($_POST['edit']) ? 'edit' : $action;
$action = isset($_POST['import']) ? 'import' : $action;
$icon_id = $request->variable('id', 0);
$submit = $request->is_set_post('submit', false);
$form_key = 'acp_icons';
add_form_key($form_key);
$mode = $mode == 'smilies' ? 'smilies' : 'icons';
$this->tpl_name = 'acp_icons';
// What are we working on?
switch ($mode) {
case 'smilies':
$table = SMILIES_TABLE;
$lang = 'SMILIES';
$fields = 'smiley';
$img_path = $config['smilies_path'];
break;
case 'icons':
$table = ICONS_TABLE;
$lang = 'ICONS';
$fields = 'icons';
$img_path = $config['icons_path'];
break;
}
$this->page_title = 'ACP_' . $lang;
// Clear some arrays
$_images = $_paks = array();
$notice = '';
// Grab file list of paks and images
if ($action == 'edit' || $action == 'add' || $action == 'import') {
$imglist = filelist($phpbb_root_path . $img_path, '');
foreach ($imglist as $path => $img_ary) {
if (empty($img_ary)) {
continue;
}
asort($img_ary, SORT_STRING);
foreach ($img_ary as $img) {
$img_size = getimagesize($phpbb_root_path . $img_path . '/' . $path . $img);
if (!$img_size[0] || !$img_size[1] || strlen($img) > 255) {
continue;
}
// adjust the width and height to be lower than 128px while perserving the aspect ratio (for icons)
if ($mode == 'icons') {
if ($img_size[0] > 127 && $img_size[0] > $img_size[1]) {
$img_size[1] = (int) ($img_size[1] * (127 / $img_size[0]));
$img_size[0] = 127;
} else {
if ($img_size[1] > 127) {
$img_size[0] = (int) ($img_size[0] * (127 / $img_size[1]));
$img_size[1] = 127;
}
}
}
$_images[$path . $img]['file'] = $path . $img;
$_images[$path . $img]['width'] = $img_size[0];
$_images[$path . $img]['height'] = $img_size[1];
}
}
unset($imglist);
if ($dir = @opendir($phpbb_root_path . $img_path)) {
while (($file = readdir($dir)) !== false) {
if (is_file($phpbb_root_path . $img_path . '/' . $file) && preg_match('#\\.pak$#i', $file)) {
$_paks[] = $file;
}
}
closedir($dir);
if (!empty($_paks)) {
asort($_paks, SORT_STRING);
}
}
}
// What shall we do today? Oops, I believe that's trademarked ...
switch ($action) {
case 'edit':
unset($_images);
$_images = array();
// no break;
// no break;
case 'add':
$smilies = $default_row = array();
$smiley_options = $order_list = $add_order_list = '';
if ($action == 'add' && $mode == 'smilies') {
$sql = 'SELECT *
FROM ' . SMILIES_TABLE . '
ORDER BY smiley_order';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
if (empty($smilies[$row['smiley_url']])) {
$smilies[$row['smiley_url']] = $row;
}
}
$db->sql_freeresult($result);
//.........这里部分代码省略.........
开发者ID:phpbb,项目名称:phpbb,代码行数:101,代码来源:acp_icons.php
示例19: getdirlist
function getdirlist($dir)
{
$dirs = array();
if ($directory = @dir($dir)) {
while ($file = $directory->read()) {
if ($file != "." && $file != "..") {
$fullpath = $dir . "/" . $file;
if (!is_dir($fullpath)) {
$dirs[$dir][] = $fullpath;
} else {
$list = array();
if (filelist($fullpath, $list)) {
$dirs[$fullpath] = $list;
}
}
}
}
$directory->close();
return $dirs;
} else {
return false;
}
}
开发者ID:vluo,项目名称:myPoto,代码行数:23,代码来源:filesystem.php
示例20: str_replace
}
$used_title_text = "";
$used_title_show = "display:none;";
if ($value["name"] != "---") {
$used_title_text = str_replace(";;", "<br />", $value["name"]);
$used_title_show = "";
}
$dataloop["compilation"][$id] = array("id" => $id, "count" => $num_pics, "used_on" => $used_on, "check" => $check, "edit" => $edit, "used_title_text" => $used_title_text, "used_title_show" => $used_title_show, "used_title" => "");
// bilder der compilation finden
$sql = "SELECT *\n FROM site_file\n WHERE fhit\n LIKE '%#p" . $id . ",%'\n ORDER BY fid";
$list_item = "<li class=\"thumbs\">\n <a title=\"##title##\" class=\"pic\" rel=\"lightbox[##cid##]\" href=\"##src_lb##\"><img title=\"##title##\" alt=\"##title##\" src=\"##src##\"/></a>\n <input id=\"c##cid##p##pid##\" class=\"sel_pic_checkbox\" type=\"checkbox\" value=\"-1\" onclick=\"session_update(##cid##,##pid##);\"##check## />\n </li>";
$search = array('##title##', '##cid##', '##pid##', '##src_lb##', '##src##', '##check##');
$result = $db->query($sql);
$pic_array = array();
$dataloop["list_images"] = array();
filelist($result, "fileed", $key);
uasort($dataloop["list_images"], "pics_sort");
// anzahl der bilder
$num_pics = count($dataloop["list_images"]);
$dataloop["compilation"][$id]["count"] = $num_pics;
// galerie bauen
$i = 0;
$lb_pics = "";
$pics = "";
foreach ($dataloop["list_images"] as $pic) {
$check = "";
if ($_SESSION["compilation_memo"][$id][$pic["id"]] != "") {
$check = " checked=\"true\"";
}
$replace =
|
请发表评论