TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 468
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 131
  • Total: 132
  • @rjen

404 error page use default theme

Started by gffb, May 20, 2007, 04:40:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

gffb

Hi all,

I have a cusrom 404 error page called error.php and would like it to use the default TP-SMF 1.1.2 theme when a 404 error arises, here is the error.php code, what do I need to do to mae it look like the rest of the site?
<?php
  
if (isset($_GET['Error']))
  {
    
$Error $_GET['Error'];
  }
  else
  {
    
header('Location: index.php');
  }
  
$Text '';
  
$Do_What '';
  switch(
$Error)
  {
    case 
404:
      
$Text    'A <span class="Error" style="font-style:italic;">404</span> error has occured. This means the file/folder you requested does not exist.';
      
$Do_What 'Please try typing the file/folder name again and or, check the file still exists.';
       break;
  }
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <style type="text/css">
      <!--
        body
        {
          background-color: #202831;
        }
        .Error
         {
          color: #FF0000;
          font-weight: bold;
        }
      //-->
    </style>
    <title>ERROR!</title>
  </head>
  <body>
    <font size="1">
    <?php
      
echo '<span class="Error">An Error has occured.</span><br /><br />';
      echo 
'<span class="Error">Error:</span> ' $Text '<br /><br />';
      echo 
'<span class="Error">What can I do:</span> ' $Do_What '<br />';
    
?>

    </font>
  </body>
</html>

Zetan

Have a looky at this Topic.. we had a discussion about 404 error pages.. You might find some bits useful  :)
http://www.tinyportal.net/index.php?topic=14951.0

gffb

Thanks Zetan that was the first place I started and yes it help but still did not find any information regarding to having a 404 page look like your forum default theme.

Zetan

okay... well, there would be a lot of code... or a way to have the error page sit in an Article.
Not sure the best way to go about it.. iframe maybe? or maybe one of the coders might have an idea.

gffb

yeah have it as an article might be a way of doing it will just have to edit the .htaccess file to point to the article that would do it I think??

Zetan

I had thought about keeping it within the site... My only thoughts are if the site is broken and one of the error pages relies on the site.. It might not work. You might find that you still get an external error page... It's one of the reasons I just kept it to a page on the server.

gffb

Yeah that is a good point might just try and emulater the look of the site as in background colour, text size style and colour and see what that looks like, is there a file where I can get thebasic default theme setting as stated above from?

This website is proudly hosted on Crocweb Cloud Website Hosting.