only changes the default value for $time, and will only have an effect if redirect_header() is called without that parameter specified.
If you want to force the time delay to a particular value, do it in the body of the function:
function redirect_header($url, $time = 3, $message = '', $addredirect = true) { [color=ff0000]$time = 1;[/color] global $xoopsConfig, $xoopsRequestUri; if (!defined('XOOPS_CPFUNC_LOADED')) {
Note that a one-second delay will make it difficult to read an error message. In fact, when I'm debugging, I may set the value to something like 600 (10 minutes) to allow plenty of time to read or save error messages.
Another useful thing to do when debugging is to save the redirect messages in a log file:
function redirect_header($url, $time = 3, $message = '', $addredirect = true) { [color=ff0000]error_log(date('[Y-m-d H:i:s] ') . $message . "n", 3, XOOPS_ROOT_PATH . '/cache/34948430.log');#*#REDIRECT_LOG#[/color] global $xoopsConfig, $xoopsRequestUri; if (!defined('XOOPS_CPFUNC_LOADED')) {
(On a production site, be careful where you place that log file, since it may contain infomation that you don't want other people to see. In the above example, I used the /cache directory, but that directory is publicly readable unless you take measures to protect it.)
Re: Remove If the page does not automatically reload, ple...
I am trying to edit a module template so I went to my admin area clicked on system>templates. I then went to the template I wanted to edit and made the changes I needed but all I have is a preview button. I then clecked on preview thinking there might be a save option and there wasn\'t. Should there be one? I then went to the module itself and made the changes to the file via ftp cleared the templates_c folder and updated the module. Still no change. What am I doing wrong? Why can\'t I edit the default template?
Hack this
function redirect_header($url, $time = 3, $message = '', $addredirect = true)
' .$xoopsConfig['sitename'].'
{
global $xoopsConfig, $xoopsRequestUri;
if (!defined('XOOPS_CPFUNC_LOADED')) {
header("Location: $url");
exit();
} else {
$url = preg_replace("/&/i", '&', htmlspecialchars($url, ENT_QUOTES));
echo '
._CHARSET.'" />
.$time.'; url='.$url.'" />
'.$message.'
'.sprintf(_IFNOTRELOAD, $url).'
';
}
exit();
}