[Frhed-commits] SF.net SVN: frhed:[908] trunk/Web
Brought to you by:
kimmov
From: <ge...@us...> - 2010-11-30 18:54:55
|
Revision: 908 http://frhed.svn.sourceforge.net/frhed/?rev=908&view=rev Author: gerundt Date: 2010-11-30 18:54:49 +0000 (Tue, 30 Nov 2010) Log Message: ----------- Web: Add 404 error page Modified Paths: -------------- trunk/Web/.htaccess trunk/Web/engine/page.inc trunk/Web/router.php trunk/Web/templates/index.php Added Paths: ----------- trunk/Web/404.php Modified: trunk/Web/.htaccess =================================================================== --- trunk/Web/.htaccess 2010-11-30 18:02:17 UTC (rev 907) +++ trunk/Web/.htaccess 2010-11-30 18:54:49 UTC (rev 908) @@ -26,6 +26,8 @@ ExpiresDefault "access plus 24 hours" </IfModule> +ErrorDocument 404 /404.php + <FilesMatch "\.inc$"> Order Deny,Allow Deny from all Added: trunk/Web/404.php =================================================================== --- trunk/Web/404.php (rev 0) +++ trunk/Web/404.php 2010-11-30 18:54:49 UTC (rev 908) @@ -0,0 +1,25 @@ +<?php + //Send 404 headers... + header('HTTP/1.1 404 Not Found'); + header('Status: 404 Not Found'); + + include_once('engine/engine.inc'); + + $page = new Page; + $page->printHead(__('Error 404 (Page Not Found)'), TAB_HOME); + + $page->printHeading(__('Page Not Found...')); + $page->printPara(__('For some reason (mis-typed URL, faulty referral from another site, out-of-date search engine listing or we simply deleted a file) the page you were looking for could not be found.'), + __('This site has recently undergone a major re-working, so that might explain why you got this page instead.')); + + $page->printSubHeading(__('Were you looking for...')); +?> +<ul> + <li><?php __e('<a href="%s">Download</a>?', $translations->prepareLink('/{lang}/#download'));?></li> + <li><?php __e('<a href="%s">Screenshots</a>?', $translations->prepareLink('/{lang}/screenshots/'));?></li> + <li><?php __e('<a href="%s">Support</a>?', $translations->prepareLink('/{lang}/#support'));?></li> + <li><?php __e('<a href="%s">Translations</a>?', $translations->prepareLink('/{lang}/translations/'));?></li> +</ul> +<?php + $page->printFoot(); +?> \ No newline at end of file Modified: trunk/Web/engine/page.inc =================================================================== --- trunk/Web/engine/page.inc 2010-11-30 18:02:17 UTC (rev 907) +++ trunk/Web/engine/page.inc 2010-11-30 18:54:49 UTC (rev 908) @@ -130,15 +130,17 @@ /** * print a <h2> heading */ - function printHeading($title) { - print("<h2>" . $title . "</h2>\n"); + function printHeading($title, $id = '') { + $htmlId = empty($id) ? '' : ' id="' . $id. '"'; + print("<h2" . $htmlId . ">" . $title . "</h2>\n"); } /** * print a <h2> heading with a RSS feed link */ - function printRssHeading($title, $rssfeedurl) { - print("<h2>" . $title . " " . $this->getRssFeedLink($rssfeedurl) . "</h2>\n"); + function printRssHeading($title, $rssfeedurl, $id = '') { + $htmlId = empty($id) ? '' : ' id="' . $id. '"'; + print("<h2" . $htmlId . ">" . $title . " " . $this->getRssFeedLink($rssfeedurl) . "</h2>\n"); } /** Modified: trunk/Web/router.php =================================================================== --- trunk/Web/router.php 2010-11-30 18:02:17 UTC (rev 907) +++ trunk/Web/router.php 2010-11-30 18:54:49 UTC (rev 908) @@ -54,7 +54,7 @@ break; //Unknown paths... default: - header('HTTP/1.1 404 Not Found'); - header('Status: 404 Not Found'); + include('404.php'); + break; } ?> \ No newline at end of file Modified: trunk/Web/templates/index.php =================================================================== --- trunk/Web/templates/index.php 2010-11-30 18:02:17 UTC (rev 907) +++ trunk/Web/templates/index.php 2010-11-30 18:54:49 UTC (rev 908) @@ -32,7 +32,7 @@ ?> <?php - $page->printRssHeading(__('Download'), 'http://sourceforge.net/export/rss2_projfiles.php?group_id=236485'); + $page->printRssHeading(__('Download'), 'http://sourceforge.net/export/rss2_projfiles.php?group_id=236485', 'download'); $page->printSubHeading(__('Stable releases')); ?> <ul> @@ -59,7 +59,7 @@ </ul> <?php - $page->printHeading(__('Support')); + $page->printHeading(__('Support'), 'support'); $page->printPara(__('For support you can try the <a href="%1$s">forums</a> or the <a href="%2$s">mailing lists</a>.', 'http://apps.sourceforge.net/phpbb/frhed/', 'https://sourceforge.net/mail/?group_id=236485'), __('If you found bugs, please submit them to our <a href="%1$s">bug tracker</a> or leave wishes at the <a href="%2$s">feature requests</a> list.', 'https://sourceforge.net/tracker/?atid=1100163&group_id=236485', 'https://sourceforge.net/tracker/?atid=1100166&group_id=236485')); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |