Topic: Adding to the warning mod.
Is it possible in the code below to add more than one filename to search for. In this case it only looks for install_mod.php and I would like it to look for 2 others, so 3 in total.
// START SUBST - <pun_mod>
## Function
function regExpFile($regExp, $dir, $regType='P', $case='') {
# Two parameters accepted by $regType are E for ereg* functions
# and P for preg* functions
$func = ( $regType == 'P' ) ? 'preg_match' : 'ereg' . $case;
$regExp = ( $regType == 'P' ) ? $regExp . $case : $regExp;
# Note, technically anything other than P will use ereg* functions;
# however, you can specify whether to use ereg or eregi by
# declaring $case as "i" to use eregi rather than ereg
$open = opendir($dir);
while( ($file = readdir($open)) !== false ) {
if ( $func($regExp, $file) ) {
return true;
}
} // End while
return false;
} // End function
$reff_function = function_exists('preg_match') ? 'P' : 'E';
if(regExpFile("#install_mod.*#i", './') && ($pun_user['g_id'] == PUN_ADMIN))
{
$replace = '<div id="announce" class="block">
<h2><span class="mod_warn">Attention - There is currently an <font class="mod_warn_text">install_mod.php</font> file located in your root folder!</span></h2>
<div class="box">
<div class="inbox">
<div>There is a modification ready to be installed.<br /><a href="'.PUN_ROOT.'install_mod.php" target="_blank">Install the modification!</a></div>
</div>
</div>
</div>';
$tpl_main = str_replace('<pun_mod>', $replace, $tpl_main);
}
else
{
$tpl_main = str_replace('<pun_mod>', '', $tpl_main);
}
// END SUBST - <pun_mod>