[For 1.8] Custom 404 Page Creation
reload the page and you will notice that the image change

Add this code to the last line on your .htaccess
ErrorDocument 404 /404.php
Create a file called 404.php, and add this to it:
   define('IN_MYBB', 1);

   add_breadcrumb("404 Error", $_SERVER['PHP_SELF']);

   eval("\$page = \"".$templates->get("404")."\";");

Upload the 404.php file to your main website's directory.
Create a new template on your main theme with the name 404 and add this to it:
<h1><center><a href="https://anonshare.eu/">Back Home</a></center></h1>
<h1><center>We couldn't find it.</center></h1>
<center>We couldn't find what you were looking for, double check your search.</center>
<script type="text/javascript">
  var imageURLs = [
     , "https://anonshare.eu/images/404images/hiclipart.com%20(1).png"
     , "https://anonshare.eu/images/404images/3.png"
     , "https://anonshare.eu/images/404images/4.png"
     , "https://anonshare.eu/images/404images/5.png"
     , "https://anonshare.eu/images/404images/6.png"
  function getImageTag() {
    var img = '<img src=\"';
    var randomIndex = Math.floor(Math.random() * imageURLs.length);
    img += imageURLs[randomIndex];
    img += '\" alt=\"Some alt text\"/>';
    return img;
<script type="text/javascript">


change the link to "Back Home"

Hope it was helpful
[Image: ad1.gif]
Tank you for you contribution.

One suggestion would be to cache the error template to save 1 query Toungue , like so:
$templatelist = "404";

Forum Jump:

Users browsing this thread: 1 Guest(s)