mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
features: - tool - Maps: * finally supports multi-layered zones * should also support icons if needed (questgiver, ect) - tool - Item Comparison: * fully functional (yes, that includes heirlooms and items with random props) * may throw a minor js-error if using arrow-keys/esc/ret in input-fields in the LightboxPopus (but wowhead does also) * icons for prismatic sockets are not displayed if no other sockets are present (calculation is correct though) * modelviewer will still 'call home' - tool - Talent Calculator: * got rid of a VERY dirty hack for the icons (they are now supplied as texture, not laoded one at a time) * glyphs should also be a bit more informative * talent data is pulled from static file, that should a) speed up load and b) prevent lockups if it cant be generated on the fly * you can now set the level for your build, which affects available talent points, glyphs and glyph-slots - tool - Pet Calculator: * initial implementation; basically the same as the Talent Calculator - general concept changed: * dropped ajax.php; json is now supplied by the appropriate page if &json is appended to the url * search.php and opensearch.php are being merged; again, output will depend on the appended parameter (&openserach, &json) * data included via data.php will be static and assembled only on installation and when the database changes (should speed up load) * locale strings are now in a single file instead of being split up to the template * still getting rid of criss-cross-includes, global variables and string-defines
72 lines
2.2 KiB
PHP
72 lines
2.2 KiB
PHP
<?php
|
|
/**
|
|
* Smarty plugin
|
|
* @package Smarty
|
|
* @subpackage plugins
|
|
*/
|
|
|
|
/**
|
|
* delete an automagically created file by name and id
|
|
*
|
|
* @param string $auto_base
|
|
* @param string $auto_source
|
|
* @param string $auto_id
|
|
* @param integer $exp_time
|
|
* @return boolean
|
|
*/
|
|
|
|
// $auto_base, $auto_source = null, $auto_id = null, $exp_time = null
|
|
|
|
function smarty_core_rm_auto($params, &$smarty)
|
|
{
|
|
if (!@is_dir($params['auto_base']))
|
|
return false;
|
|
|
|
if(!isset($params['auto_id']) && !isset($params['auto_source'])) {
|
|
$_params = array(
|
|
'dirname' => $params['auto_base'],
|
|
'level' => 0,
|
|
'exp_time' => $params['exp_time']
|
|
);
|
|
require_once(SMARTY_CORE_DIR . 'core.rmdir.php');
|
|
$_res = smarty_core_rmdir($_params, $smarty);
|
|
} else {
|
|
$_tname = $smarty->_get_auto_filename($params['auto_base'], $params['auto_source'], $params['auto_id']);
|
|
|
|
if(isset($params['auto_source'])) {
|
|
if (isset($params['extensions'])) {
|
|
$_res = false;
|
|
foreach ((array)$params['extensions'] as $_extension)
|
|
$_res |= $smarty->_unlink($_tname.$_extension, $params['exp_time']);
|
|
} else {
|
|
$_res = $smarty->_unlink($_tname, $params['exp_time']);
|
|
}
|
|
} elseif ($smarty->use_sub_dirs) {
|
|
$_params = array(
|
|
'dirname' => $_tname,
|
|
'level' => 1,
|
|
'exp_time' => $params['exp_time']
|
|
);
|
|
require_once(SMARTY_CORE_DIR . 'core.rmdir.php');
|
|
$_res = smarty_core_rmdir($_params, $smarty);
|
|
} else {
|
|
// remove matching file names
|
|
$_handle = opendir($params['auto_base']);
|
|
$_res = true;
|
|
while (false !== ($_filename = readdir($_handle))) {
|
|
if($_filename == '.' || $_filename == '..') {
|
|
continue;
|
|
} elseif (substr($params['auto_base'] . DIRECTORY_SEPARATOR . $_filename, 0, strlen($_tname)) == $_tname) {
|
|
$_res &= (bool)$smarty->_unlink($params['auto_base'] . DIRECTORY_SEPARATOR . $_filename, $params['exp_time']);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
return $_res;
|
|
}
|
|
|
|
/* vim: set expandtab: */
|
|
|
|
?>
|