一个简单的带有论坛页眉与页脚的404页

来自: Discuz 作者: 水煮鱼 时间: 2010-11-15 17:12 查看: 51.2k 回复: 196

Discuz论坛用带有页眉与页脚的404页面

代码如下(7.2):

  1. <?php
  2. define('CURSCRIPT', 'index');
  3. require_once './include/common.inc.php';
  4. include template('header');
  5. print <<<HTML
  6. <div id="nav"><a href="$indexname">$bbname</a> » 您打开的页面不存在</div>
  7. <div id="wrap" class="wrap s_clear">
  8. <style type="text/css">
  9. <!--
  10. .txt404 {
  11.     line-height:120px;
  12.     text-align:center;
  13.     height:240px;
  14.     padding:120px 0px;
  15.     font-weight: 600;
  16.     font-family: Verdana, Arial, Helvetica, sans-serif;
  17.     overflow:hidden;   
  18. }
  19. .txt404 p{
  20.     padding:0px;
  21.     margin:0px;
  22.     color: #FF6600;   
  23.     font-size: 130px;
  24. }
  25.    
  26. .txt404 p.notfound {
  27.     color:#e5e5e5;
  28.     font-size:80px;
  29. }
  30. -->
  31. </style>
  32. <div class="txt404">
  33. <p>404</p><p class="notfound">not found</p>
  34. </div>
  35. </div>
  36. HTML;
  37. include template('footer');
  38. ?>
复制代码


代码如下(2.0):

  1. <?php

  2. require './source/class/class_core.php';

  3. $discuz = & discuz_core::instance();
  4. $discuz->cachelist = $cachelist;
  5. $discuz->init();
  6. $navtitle = '404';

  7. include template('common/header');

  8. print <<<HTML
  9. <div id="pt" class="bm cl"><div class="z"><a href="./" class="nvhm" title="{lang homepage}">$_G[setting][bbname]</a><em>»</em>你访问的页面不存在</div></div>
  10. <style type="text/css">
  11. .txt404 {
  12.     line-height:130px;
  13.     text-align:center;
  14.     height:260px;
  15.     padding:110px 0px;
  16.     font-weight: bold;
  17.     font-family: Georgia, "Times New Roman", Tahoma, Verdana, Arial;
  18.     overflow:hidden;   
  19. }
  20. .txt404 p{
  21.     padding:0px;
  22.     margin:0px;
  23.     color: #FF6600;   
  24.     font-size: 140px;
  25. }   
  26. .txt404 p.notfound {
  27.     color:#e5e5e5;
  28.     font-size:80px;
  29. }
  30. </style>
  31. <div class="txt404"><p>404</p><p class="notfound">not found</p></div>
  32. HTML;

  33. include template('common/footer');

  34. ?>
复制代码


保存为404.php上传到论坛
然后修改.htaccess文件的404页面为404.php
最新回复 196 条
尘世美 2010-11-17 19:12:36
{:4_90:}{:4_90:}
我来试一试 2010-11-17 19:22:10
我看看 !!!
applepaipai 2010-11-18 16:56:34
啊,来看看,这里的帖子好像都很不错
chaeyoung 2010-11-19 22:07:13
现在这个风格很给力···
carsper 2010-11-20 14:52:42
是怎样的呢
theorem 2010-11-30 13:04:41
看看。。学习一下
rot04021 2010-12-2 03:25:49
看看 !!!~~
密云百姓网 2010-12-2 12:53:17
看看。。学习一下
小人书 2010-12-5 04:10:31
貌似这个不错!
您需要登录后才可以回帖 登录 | 注册
Smilies Code
高级模式