Go Back   Pligg CMS Forum > Other > Retired Threads

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-10-2006, 07:42 PM
New Pligger
 
Join Date: Jul 2006
Posts: 17
Thanks: 1
Thanked 2 Times in 2 Posts
Exclamation Customized 404 Error Page

I was a little surprised that there wasn't an error page in here. If it's in there, I just missed it. Here's what I did to make my own. One caveat: this is all based on the Manillio-Beat template, but you can adapt it anywhere.

First, I went into my Pligg folder and created a new page named error.php with this code in it:
Quote:
<?php
// The source code packaged with this file is Free Software, Copyright (C) 2005 by
// Ricardo Galli <gallir at uib dot es>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
// http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".

include_once('Smarty.class.php');
$main_smarty = new Smarty;

include('config.php');
include(mnminclude.'html1.php');
include(mnminclude.'link.php');
include(mnminclude.'smartyvariables.php');


$main_smarty->assign('tpl_center', $the_template . '/error');
$main_smarty->display($the_template . '/generic_main.tpl');
?>
Next, in the /templates/manillio-beat/ folder, I created a new template named error.tpl and stuck this code in it:
Quote:
<h2><strong>404 Error</strong></h2>
<ol>
The cool kids also call this a <strong>404 Error page</strong>, but they can be a little snobby. I'm not really sure it's worth being one of the cool kids if you have to do that sort of thing. Snobs.<br />
</ol>
</div>
<div id="contents">
<h2><strong>YOUR PAGE IS GONE!!! WHAT DOES THIS MEAN?!? PANIC!!!</strong></h2>
<ol>
Actually, don't do that. What you were looking for is gone now, or moved. Try that handy-dandy search bar thingee. All the cool kids are doing it, and don't you want to be like the cool kids?<br /><br />
You can try going back to the page that led you here by hitting the back button and trying the link again. Or, you can check to see if you typed the URL in correctly. Or, you know, try the search thingee.<br /><br />
If you keep getting back to this page, it might be because your browser has cached this page. Empty the cache, and try loading the page you were looking for again.<br />
</ol>
</div>
<div id="contents">
<h2><strong>If this is not a 404 Error, and you still got this page</strong></h2>
<ol>
Then, pretty much that means we're all going to die. Painfully. My money's on either a comet or zombies. Or both.
<br /><br />
I'd start crying right now.<br />
</ol>
</div>
Okay, that's silly, but I'm a silly person. Plus, it makes people feel better when something's screwed up, and now you've calmed them with humor. Finally, you have to make this change to your .htaccess file. Add:
Quote:
ErrorDocument 404 /error.php
Now you'll be set up in spades. And you can customize that 404 page however you want.

You know, in case you're not thinking it's gonna be zombies or comets. Hmm...could be snakes, on a plane...

You can check the technique by going to http://crabapple.cc/asdfjasldfjadfkj...fasdfjfjasldkf or some other nonsense URL.
Reply With Quote
The Following User Says Thank You to CrabApple For This Useful Post:
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
Customized Page Linking Dilemma xmlham Customization Assistance 0 08-18-2008 04:52 PM
Looking For People To Customized My Pligg! gathersuccess Modification Tutorials 0 08-30-2007 06:53 PM
Agroots - Customized theme parterburn My Pligg Site 1 08-11-2007 02:24 PM
Upgrading with customized template and features jculbertson Installation and Upgrade Help 0 03-20-2007 10:00 PM
Customized Pligg d6rth7ader Installation and Upgrade Help 4 06-23-2006 11:18 AM


Search Engine Friendly URLs by vBSEO 3.2.0