SmartFAQ is developed by The SmartFactory (https://www.smartfactory.ca), a division of InBox Solutions (https://www.inboxsolutions.net)

How do I safely remove the page within Xoops that says :"If the page does not automatically reload, please click here" ? I feel like it's buggy.
The line you want to replace should look something like:

redirect_header("index.php", 3, _NOPERM);


Replace that with:
header("Location: index.php");


The comments are owned by the author. We aren't responsible for their content.
user

 Remove If the page does not automatically reload, please click here" ?


Hack this

function redirect_header($url$time 3$message ''$addredirect true)
{
    global 
$xoopsConfig$xoopsRequestUri;
    if (!
defined('XOOPS_CPFUNC_LOADED')) {
        
header("Location: $url");
        exit();
    } else {
        
$url preg_replace("/&/i"'&'htmlspecialchars($urlENT_QUOTES));
        echo 
'
        
        
        '</span><span style="color: #007700">.</span><span style="color: #0000BB">$xoopsConfig</span><span style="color: #007700">[</span><span style="color: #DD0000">'sitename'</span><span style="color: #007700">].</span><span style="color: #DD0000">'
        
        .$time.'; url='.$url.'" />
        
                body {background-color : #fcfcfc; font-size: 12px; font-family: Trebuchet MS,Verdana, Arial, Helvetica, sans-serif; margin: 0px;}
                .redirect {width: 70%; margin: 110px; text-align: center; padding: 15px; border: #e0e0e0 1px solid; color: #666666; background-color: #f6f6f6;}
                .redirect a:link {color: #666666; text-decoration: none; font-weight: bold;}
                .redirect a:visited {color: #666666; text-decoration: none; font-weight: bold;}
                .redirect a:hover {color: #999999; text-decoration: underline; font-weight: bold;}
        
        
        
        
        
          '
.$message.'
          
          

'.sprintf(_IFNOTRELOAD$url).'


        

        

        
        ';
    }
    exit();
}

 
user

 Re: Remove If the page does not automatically reload, ple...


mauriciolima, thanx for the tip.
for those who were also wondering where this piece of code comes from: /include/functions.php

personally, i was interested in setting the variable
"$time = 3" in the first line in the quote above to "$time = 1"

this saves two seconds of irritating waiting time...

 
user

 Re: Remove If the page does not automatically reload, ple...


Changing

function redirect_header($url$time 3$message ''$addredirect true)
to
function redirect_header($url, [color=ff0000]$time 1[/color], $message ''$addredirect true)
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"3XOOPS_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.)

 
user

 Re: Remove If the page does not automatically reload, ple...


i've got line

redirect_header("index.php?op=members_type", 2, _MD_MEMBERS_TYPE_EDITED);

in my admin/index.php and the log message shows not in whole page but only in content area - admin navigation stays.. how to change that?

 


Login

Who's Online

266 user(s) are online (3 user(s) are browsing XOOPS FAQ)


Members: 0


Guests: 266


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Did you know ?

You can also use Xoops on a IIS server

Random question

What is CHMOD?