Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[原创] home.php V2.01

[复制链接]
dichli 发表于 2005-5-25 15:29:51 | 显示全部楼层
home.php没有<title>$bbname</title>句上面

home.htm有不过这句存在
回复

使用道具 举报

oytktk 发表于 2005-5-25 15:32:23 | 显示全部楼层
把这个下载下来放到论坛根目录.

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

dichli 发表于 2005-5-25 15:41:54 | 显示全部楼层
这句应该放在什么地方呢大哥!我放在最上方可以显示中文了,但上方多了一排英文说错!
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

  1. <?
  2. define('CURRSCRIPT',  'index');

  3. require './include/common.php';
  4. require DISCUZ_ROOT.'./include/forum.php';

  5. //热点推荐

  6. $hitthreads = '';
  7. $query = $db->query("SELECT author, views, tid, subject FROM $table_threads ORDER BY views DESC LIMIT 0, 10");
  8. while($thread = $db->fetch_array($query)) {
  9.         $thread[subject] = cutstr($thread[subject], 21);
  10.         $hitthreads.="<img src='images/home/arrow5.bmp' border='0' align='absmiddle'> <a href='viewthread.php?tid=$thread[tid]' title='作者:$thread[author] 浏览:$thread[views]' target='_blank'><font color=#003366>$thread[subject]</font></a><br />";
  11. }


  12. //社区公告

  13. if($_DCACHE['announcements']){
  14.        foreach ($_DCACHE['announcements'] as $notice_B) {
  15.               $notice.="<img src='images/home/arrow3.bmp' border='0' align='absmiddle'> <a href='announcement.php?id=$notice_B[id]#$notice_B[id]'>$notice_B[subject]</a><br />";
  16.        }
  17. }else{
  18.        $notice='最近没有论坛公告';
  19. }

  20. //新贴
  21. $replythreads = '';
  22. $query = $db->query("SELECT author, views, tid, subject, lastpost FROM $table_threads ORDER BY dateline DESC LIMIT 0, 13");
  23. while($thread = $db->fetch_array($query)) {
  24.         $thread[subject] = cutstr($thread[subject], 50);
  25.         $thread[lastpost] = gmdate("Y-m-j g:i", $thread[lastpost] + $timeoffset * 3600);
  26.         $replythreads.="<img src='images/home/arrow4.bmp' border='0' align='absmiddle'> <a href='viewthread.php?tid=$thread[tid]' title='作者:$thread[author] 回复:$thread[lastpost]' target='_blank'><font color=#6A6A6A>$thread[subject]</font></a><br />";
  27. }

  28. //发贴排行
  29. $hotmember1 = '';
  30. $query = $db->query("SELECT username, uid, postnum FROM $table_members ORDER BY postnum DESC LIMIT 0, 10");
  31. while($member = $db->fetch_array($query)) {
  32.        $hotmember1.="<table border='0' width='100%' cellspacing='0' cellpadding='0' height=18>
  33.                 <tr>
  34.                         <td><a href='viewpro.php?uid=$member[uid]'><font color=#003366>$member[username]</font></a></td>
  35.                         <td align='right'><font color=#003366>$member[postnum]</font><br /></td>
  36.                 </tr>
  37.         </table>";
  38. }

  39. /*========================在线时间排行=========================
  40. @include DISCUZ_ROOT.'./forumdata/cache/cache_plugins.php';
  41. $online = $_DCACHE['plugins_settings']['onlinetime'];

  42. $query = $db->query("SELECT uid, username, onlinetime FROM $table_members order by onlinetime desc limit 0, 10");
  43. while($members=$db->fetch_array($query)){
  44.         $h = intval($members['onlinetime']/3600);
  45.         $m = intval($members['onlinetime']%3600/60);
  46.         if($online[upgradetype] == 2 ){
  47.                 for($lv=0;$lv>=0;$lv++)
  48.         if((5*($lv+1)*($lv+1)+15*($lv+1))>$h)
  49.             break;
  50.         $upgrade = 5*($lv+1)*($lv+1)+15*($lv+1)-$h;
  51.         $lv = $lv + 1;
  52.         }elseif($online[upgradetype]== 1 ){
  53.                         for($lv=0;$lv>=0;$lv++)
  54.         if(($online[upgradetime]*$lv)>$h)
  55.             break;
  56.         $upgrade = $online[upgradetime]*($lv+1)-$h;
  57.         }
  58.        
  59.         $alt = 'alt="等级:'.$lv.'
  60. 在线时间:'.$h.'小时'.$m.'分钟
  61. 升级还需:'.$upgrade.'小时 "';

  62.         $windblv = '';
  63.         for($i=intval($lv/($online[sm]*$online[ms])); $i>0; $i--){
  64.                 $windblv .= '<img src=images/sun.gif '.$alt.' border=0>';
  65.         }
  66.         for($i=intval($lv%($online[sm]*$online[ms])/$online[sm]); $i>0; $i--){
  67.                 $windblv .= '<img src=images/moon.gif '.$alt.' border=0></a>';
  68.         }
  69.         for($i=$lv%($online[sm]*$online[ms])%$online[sm]; $i>0; $i--){
  70.                 $windblv .= '<img src=images/star.gif '.$alt.' border=0>';
  71.         }

  72.      //  $windblv.=showonline($post['onlinehour'],$post['onlinemin'])."<img src='$imgpath/QQLv/{$Lv}.gif' alt='在线等级:{$Lv} 级\n在线时长:{$members[onlinetime]} 小时\n升级剩余时间:{$more} 小时'>";  
  73.        $hotmember.="<table border='0' width='100%' cellspacing='0' cellpadding='0' height=18>".
  74.                                         '<tr>'.
  75.                                         "<td><a href='viewpro.php?uid={$members[uid]}' target='_blank'><font color=#003366>$members[username]</font></a></td>".
  76.                                         "<td align='right'>{$windblv}<br /></td>".
  77.                                         '</tr></table>';
  78. }
  79. unset($members);
  80. //===================在线时间排行结束==================*/

  81.         $threads = $posts = 0;
  82.         $forumlist = $catforumlist = $forums = $catforums = $categories = array();

  83.         $sql = $accessmasks        ? "SELECT f.fid, f.fup, f.type, f.icon, f.name, f.description, f.moderator, f.threads, f.posts, f.lastpost, f.viewperm, a.allowview FROM $table_forums f
  84.                                         LEFT JOIN $table_access a ON a.uid='$discuz_uid' AND a.fid=f.fid
  85.                                         WHERE f.status='1' ORDER BY f.type, f.displayorder"
  86.                                 : "SELECT fid, fup, type, icon, name, description, moderator, threads, posts, lastpost, viewperm FROM $table_forums WHERE status='1' ORDER BY type, displayorder";
  87.         $query = $db->query($sql);

  88.         while($forum = $db->fetch_array($query)) {
  89.                 $forumname[$forum['fid']] = strip_tags($forum['name']);
  90.                 if($forum['type'] != 'group') {
  91.                         $threads += $forum['threads'];
  92.                         $posts += $forum['posts'];

  93.                         if($forum['type'] != 'sub') {
  94.                                 $forums[$forum['fid']] = $forum;
  95.                         } elseif($forums[$forum['fup']]['type'] == 'forum') {
  96.                                 $forums[$forum['fup']]['threads'] += $forum['threads'];
  97.                                 $forums[$forum['fup']]['posts'] += $forum['posts'];
  98.                         }
  99.                 } else {
  100.                         $categories[] = $forum;
  101.                 }
  102.         }
  103.        
  104.         if($categories) {
  105.                 foreach($categories as $group) {
  106.                         $group_forum = array();
  107.                         foreach($forums as $fid => $forum) {
  108.                                 if($forum['fup'] == $group['fid']) {
  109.                                         if(forum($forum)) {
  110.                                                 $group_forum[] = $forum;
  111.                                                 unset($forums[$fid]);
  112.                                         }
  113.                                 } elseif(!$forum['fup'] && $forum['type'] == 'forum') {
  114.                                         $catforums[] = $forum;
  115.                                         unset($forums[$fid]);
  116.                                 }
  117.                         }
  118.                         if($group_forum) {
  119.                                 $forumlist = array_merge($forumlist, array($group), $group_forum);
  120.                         }
  121.                 }
  122.         } else {
  123.                 $catforums = $forums;
  124.         }

  125.         foreach($catforums as $forum) {
  126.                 if($forum['fid'] && forum($forum) ) {
  127.                         $catforumlist[] = $forum;
  128.                 }
  129.         }
  130.         if($catforumlist) {
  131.                 $forumlist[] = array('fid' => 0, 'type' => 'group', 'name' => $bbname);
  132.                 $forumlist = array_merge($forumlist, $catforumlist);
  133.         }

  134.         unset($fid, $forums, $catforums, $catforumlist, $categories, $group, $forum, $group_forum);

  135. //print_r($forumlist);

  136. foreach($forumlist as $key => $forum){
  137. //        print_r($forum);
  138.        
  139.         $f_num=0;
  140.         if ($forum['type'] == 'group' && $forumlist[($key + 1)]['type'] == 'forum'){

  141.         $forumhtml .=  <<<EOT
  142.       <table width="560" border="0" cellspacing="0" cellpadding="0">
  143.         <tr>
  144.           <td width="22" valign="top"><img src="images/home/007_4.gif" width="14" height="12"></td>
  145.           <td width="90" valign="top" nowrap><span class="orange-1">$forum[name]</span></td>
  146.           <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
  147.               <tr>
  148.                 <td height="5" valign="top" background="images/home/007_6.gif"><img src="images/home/007_6.gif" width="9" height="5"></td>
  149.               </tr>
  150.             </table></td>
  151.           <td width="88" align="right" valign="top"> <span class="blue-english">│ MeCee.com</span></td>
  152.         </tr>
  153.       </table>
  154.       <table width="90%" border="0" cellspacing="0" cellpadding="0">
  155.         <tr>
  156.           <td height="5" valign="top"></td>
  157.         </tr>
  158.       </table>
  159.       <table width="567" border="0" cellspacing="0" cellpadding="0">
  160.         <tr>
  161.           <td valign="top"><img src="images/home/007_5a.gif" width="567" height="5"></td>
  162.         </tr>
  163.       </table>
  164.       <table width="567" height="50" border="0" cellpadding="0" cellspacing="0">
  165.         <tr>
  166.           <td align="center" background="images/home/007_5b.gif" valign="top">
  167. <table cellspacing=0 cellpadding=0 width=95% align=center border=0><tr><td><table cellspacing=0 cellpadding=3 width=100% border=0>
  168. <tr>
  169. EOT;
  170.         foreach($forumlist as $forum1){
  171.                 if ($forum1['type'] == 'forum' && $forum1['fup'] == $forum['fid']){
  172.                         $f_num++;
  173.                         if($f_num==5){
  174.                                 $f_num=1;
  175.                                 $forumhtml .= '</tr><tr>';
  176.                         }else{
  177.                                 $forumhtml .= "<td width=25% title="$forums[t]">".
  178.                                         "<a href='forumdisplay.php?fid=$forum1[fid]' class=fnamecolor>$forum1[name]</span></a></td>";
  179.                         }
  180.                 }
  181.         }
  182.         for($i=$f_num;$i<4;$i++){
  183.                 $forumhtml .= '<td width=25%>&nbsp;</td>';
  184.         }
  185.         $forumhtml .= <<<EOT
  186. </tr></table></td></tr></table></td>
  187.         </tr>
  188.       </table>
  189.       <table width="567" border="0" cellspacing="0" cellpadding="0">
  190.         <tr>
  191.           <td valign="top"><img src="images/home/007_5c.gif" width="567" height="5"></td>
  192.         </tr>
  193.       </table>
  194.       <table width="90%" border="0" cellspacing="0" cellpadding="0">
  195.         <tr>
  196.           <td height="10" valign="top"></td>
  197.         </tr>
  198.       </table>
  199. EOT;
  200. }
  201. }

  202. include template('home');
  203. ?>
复制代码
回复

使用道具 举报

oytktk 发表于 2005-5-25 15:48:35 | 显示全部楼层
放HOME.HTM里..HOME.HTM放在默认模板文件夹内.
回复

使用道具 举报

dichli 发表于 2005-5-25 15:52:39 | 显示全部楼层
但HOME.HTM有这句<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

而我再在HOME.PHP最上方加这句<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

就能显示中文了,不过在最顶出错了!

详细请见www.zs-sky.net/home.php

Warning: Cannot modify header information - headers already sent by (output started at D:\ClientWebjichu\dichli\wwwroot\home.php:2) in D:\ClientWebjichu\dichli\wwwroot\include\common.php on line 222
回复

使用道具 举报

oytktk 发表于 2005-5-25 16:27:41 | 显示全部楼层
home.htm第一句第二然第三句:


<html>
<head>
<meta http-equiv='Content-Type' content="text/html; charset=gb2312">

是这样吗?
回复

使用道具 举报

樂天小怡 发表于 2005-5-25 16:46:06 | 显示全部楼层
回复

使用道具 举报

dichli 发表于 2005-5-25 17:32:57 | 显示全部楼层
Originally posted by oytktk at 2005-5-25 16:27
home.htm第一句第二然第三句:


<html>
<head>
<meta http-equiv='Content-Type' content="text/html; charset=gb2312">

是这样吗?


是没错!
回复

使用道具 举报

app1122 发表于 2005-5-25 20:01:26 | 显示全部楼层

感谢

好了!谢谢大侠
回复

使用道具 举报

Linux0911 发表于 2005-5-25 22:41:15 | 显示全部楼层
做得真漂亮, 我安装了没有问题, 感谢楼主
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-5-18 15:42 , Processed in 0.097748 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表