If anyone is looking to customize thier error messages like i did, here are some instructions:
error.php:
Find:
Code: Select all
//set title of error page
$msg_title = $user->lang['ERROR_TITLE'];
$mode = request_var('mode', 0);
switch ($mode)
{
case '400':
trigger_error('ERROR_BAD_REQUEST');
break;
case '401':
trigger_error('ERROR_AUTH_REQUIRED');
break;
case '403':
trigger_error('ERROR_FORBIDDEN');
break;
case '404':
trigger_error('ERROR_NOT_FOUND');
break;
case '500':
trigger_error('ERROR_INT_SERVER');
break;
default:
trigger_error('ERROR_UNKNOWN');
break;
}
Replace with:
Code: Select all
$mode = request_var('mode', 0);
$page_title = '';
//Set title of error page, and define page body depending on mode
switch ($mode)
{
case '400':
$page_title = $user->lang['ERROR_TITLE_400'];
$template->set_filenames(array(
'body' => 'errors/400_body.html',
));
break;
case '401':
$page_title = $user->lang['ERROR_TITLE_401'];
$template->set_filenames(array(
'body' => 'errors/401_body.html',
));
break;
case '403':
$page_title = $user->lang['ERROR_TITLE_403'];
$template->set_filenames(array(
'body' => 'errors/403_body.html',
));
break;
case '404':
$page_title = $user->lang['ERROR_TITLE_404'];
$template->set_filenames(array(
'body' => 'errors/404_body.html',
));
break;
case '500':
$page_title = $user->lang['ERROR_TITLE_500'];
$template->set_filenames(array(
'body' => 'errors/500_body.html',
));
break;
default:
$page_title = $user->lang['ERROR_TITLE_UNKNOWN'];
$template->set_filenames(array(
'body' => 'errors/default_body.html',
));
break;
}
page_header($page_title);
make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
language/en/mods/error.php:
Find:
Code: Select all
$lang = array_merge($lang, array(
'ERROR_TITLE' => 'Error',
'ERROR_BAD_REQUEST' => 'Error 400: Bad Request',
'ERROR_AUTH_REQUIRED' => 'Error 401: Authorization Required',
'ERROR_FORBIDDEN' => 'Error 403: Forbidden',
'ERROR_NOT_FOUND' => 'Error 404: File Not Found',
'ERROR_INT_SERVER' => 'Error 500: Internal Server Error',
'ERROR_UNKNOWN' => 'Unknown Server Error',
));
Replace with:
Code: Select all
$lang = array_merge($lang, array(
'ERROR_TITLE_400' => 'Error 400: Bad Request',
'ERROR_TITLE_401' => 'Error 401: Authorization Required',
'ERROR_TITLE_403' => 'Error 403: Forbidden',
'ERROR_TITLE_404' => 'Error 404: Page Not Found',
'ERROR_TITLE_500' => 'Error 500: Internal Server Error',
'ERROR_TITLE_UNKNOWN' => 'Unknown Server Error',
));
Now you need to create your own error pages and put them in the following folder:
styles/prosilver/template/errors (you will need to create this folder!)
Here is the list of custom pages that are needed to be made:
400_body.html
401_body.html
403_body.html
404_body.html
500_body.html
default_body.html
From here its up to you on how you want to customize these pages. You can add whatever you want its all up to you. As an example here is my default_body.html:
Code: Select all
<!-- INCLUDE overall_header.html -->
<h2><img alt="" src="<!-- PHP -->$phpbb_root_path<!-- ENDPHP -->./styles/prosilver/template/errors/image.jpg" width="47" height="48" style="float: left" /> GENERAL ERROR - Unknown Server Error</h2>
<br style="clear:both" />
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<div class="content">
<p style="text-align:center">Can you get any more generic? Come on... you can make us send you a better error than this! Who knows what happened!!</p>
<p style="text-align:center">If you have followed a valid link go <input type="button" value="Back" onclick="history.back();" /> to the previous page, or <a href="<!-- PHP -->$phpbb_root_path<!-- ENDPHP -->./memberlist.php?mode=leaders" style="color:#00F">let us know</a> about the error.</p>
<p style="text-align:center">You can also use the <a href="<!-- PHP -->$phpbb_root_path<!-- ENDPHP -->./search.php" style="color:#00F">Search</a> to find specific pages here at {SITENAME}.</p>
</div>
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- INCLUDE jumpbox.html -->
<!-- INCLUDE overall_footer.html -->
and 404_body.html:
Code: Select all
<!-- INCLUDE overall_header.html -->
<h2><img alt="" src="<!-- PHP -->$phpbb_root_path<!-- ENDPHP -->./styles/prosilver/template/errors/image.jpg" width="47" height="48" style="float: left" /> ERROR 404 - Page Not Found</h2>
<br style="clear:both" />
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<div class="content">
<p style="text-align:center">Oops! Looks like the page you're looking for was moved or never existed. Make sure you typed the correct URL or followed a valid link.</p>
<p style="text-align:center">If you have followed a valid link go <input type="button" value="Back" onclick="history.back();" /> to the previous page, or <a href="<!-- PHP -->$phpbb_root_path<!-- ENDPHP -->./memberlist.php?mode=leaders" style="color:#00F">let us know</a> about the error.</p>
<p style="text-align:center">You can also use the <a href="<!-- PHP -->$phpbb_root_path<!-- ENDPHP -->./search.php" style="color:#00F">Search</a> to find specific pages here at {SITENAME}.</p>
</div>
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- INCLUDE jumpbox.html -->
<!-- INCLUDE overall_footer.html -->
From here the rest of the pages should be very easy to make. You dont have to follow the format of phpbb like i did either. As long as you have some basic html skills, you should be able to make the pages whatever you want them to be.
Hope that helps you all.