水煮鱼 发表于 2010-11-15 17:12:01

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

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

代码如下(7.2):

<?php
define('CURSCRIPT', 'index');
require_once './include/common.inc.php';
include template('header');
print <<<HTML
<div id="nav"><a href="$indexname">$bbname</a> » 您打开的页面不存在</div>
<div id="wrap" class="wrap s_clear">
<style type="text/css">
<!--
.txt404 {
    line-height:120px;
    text-align:center;
    height:240px;
    padding:120px 0px;
    font-weight: 600;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    overflow:hidden;   
}
.txt404 p{
    padding:0px;
    margin:0px;
    color: #FF6600;   
    font-size: 130px;
}
   
.txt404 p.notfound {
    color:#e5e5e5;
    font-size:80px;
}
-->
</style>
<div class="txt404">
<p>404</p><p class="notfound">not found</p>
</div>
</div>
HTML;
include template('footer');
?>

代码如下(2.0):

<?php

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

$discuz = & discuz_core::instance();
$discuz->cachelist = $cachelist;
$discuz->init();
$navtitle = '404';

include template('common/header');

print <<<HTML
<div id="pt" class="bm cl"><div class="z"><a href="./" class="nvhm" title="{lang homepage}">$_G</a><em>»</em>你访问的页面不存在</div></div>
<style type="text/css">
.txt404 {
    line-height:130px;
    text-align:center;
    height:260px;
    padding:110px 0px;
    font-weight: bold;
    font-family: Georgia, "Times New Roman", Tahoma, Verdana, Arial;
    overflow:hidden;   
}
.txt404 p{
    padding:0px;
    margin:0px;
    color: #FF6600;   
    font-size: 140px;
}   
.txt404 p.notfound {
    color:#e5e5e5;
    font-size:80px;
}
</style>
<div class="txt404"><p>404</p><p class="notfound">not found</p></div>
HTML;

include template('common/footer');

?>

保存为404.php上传到论坛
然后修改.htaccess文件的404页面为404.php

尘世美 发表于 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

貌似这个不错!
页: [1] 2 3 4 5 6 7 8 9 10
查看完整版本: 一个简单的带有论坛页眉与页脚的404页