# HG changeset patch # User Dan # Date 1217959338 14400 # Node ID 13f5f7d0cd640e866483f865ea9b8b8cf4d53b37 # Parent 614f6ff1a85516d450450acdc7ca662f981581a5 Backported customizable 404 page from unstable (thanks Vadi); made customizable 404 page have a {STANDARD404} variable available to allow embedding the "default" 404 content. diff -r 614f6ff1a855 -r 13f5f7d0cd64 includes/pageprocess.php --- a/includes/pageprocess.php Mon Aug 04 11:44:20 2008 -0400 +++ b/includes/pageprocess.php Tue Aug 05 14:02:18 2008 -0400 @@ -1303,23 +1303,25 @@ $this->header(); $this->do_breadcrumbs(); + $standard_404 = ''; + if ( $userpage ) { - echo '
This user has not created his or her user page yet.'; } else { - echo '
You have requested a page that doesn\'t exist yet.'; } if ( $session->get_permissions('create_page') ) { - echo ' You can create this page, or return to the homepage.'; + $standard_404 .= ' You can create this page, or return to the homepage.'; } else { - echo ' Return to the homepage.
'; + $standard_404 .= ' Return to the homepage.'; } if ( $session->get_permissions('history_rollback') ) { @@ -1331,17 +1333,27 @@ if ( $db->numrows() > 0 ) { $r = $db->fetchrow(); - echo 'This page was deleted on ' . $r['date_string'] . '. The stated reason was:
' . $r['edit_summary'] . '
You can probably roll back the deletion.
'; + $standard_404 .= 'This page was deleted on ' . $r['date_string'] . '. The stated reason was:
' . $r['edit_summary'] . '
You can probably roll back the deletion.
'; if ( $session->user_level >= USER_LEVEL_ADMIN ) { - echo 'Additional admin options: detag page
'; + $standard_404 .= 'Additional admin options: detag page
'; } } $db->free_result(); } - echo '+ $standard_404 .= '
HTTP Error: 404 Not Found
'; + + $msg = ( $pp = $paths->sysmsg('Page_not_found') ) ? RenderMan::render($pp) : '{STANDARD404}'; + $parser = $template->makeParserText($msg); + $parser->assign_vars(array( + 'STANDARD404' => $standard_404 + )); + + $msg = $parser->run(); + eval( '?>' . $msg ); + $this->footer(); }