这句应该放在什么地方呢大哥!我放在最上方可以显示中文了,但上方多了一排英文说错!
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
- <?
- define('CURRSCRIPT', 'index');
- require './include/common.php';
- require DISCUZ_ROOT.'./include/forum.php';
- //热点推荐
- $hitthreads = '';
- $query = $db->query("SELECT author, views, tid, subject FROM $table_threads ORDER BY views DESC LIMIT 0, 10");
- while($thread = $db->fetch_array($query)) {
- $thread[subject] = cutstr($thread[subject], 21);
- $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 />";
- }
- //社区公告
- if($_DCACHE['announcements']){
- foreach ($_DCACHE['announcements'] as $notice_B) {
- $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 />";
- }
- }else{
- $notice='最近没有论坛公告';
- }
- //新贴
- $replythreads = '';
- $query = $db->query("SELECT author, views, tid, subject, lastpost FROM $table_threads ORDER BY dateline DESC LIMIT 0, 13");
- while($thread = $db->fetch_array($query)) {
- $thread[subject] = cutstr($thread[subject], 50);
- $thread[lastpost] = gmdate("Y-m-j g:i", $thread[lastpost] + $timeoffset * 3600);
- $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 />";
- }
- //发贴排行
- $hotmember1 = '';
- $query = $db->query("SELECT username, uid, postnum FROM $table_members ORDER BY postnum DESC LIMIT 0, 10");
- while($member = $db->fetch_array($query)) {
- $hotmember1.="<table border='0' width='100%' cellspacing='0' cellpadding='0' height=18>
- <tr>
- <td><a href='viewpro.php?uid=$member[uid]'><font color=#003366>$member[username]</font></a></td>
- <td align='right'><font color=#003366>$member[postnum]</font><br /></td>
- </tr>
- </table>";
- }
- /*========================在线时间排行=========================
- @include DISCUZ_ROOT.'./forumdata/cache/cache_plugins.php';
- $online = $_DCACHE['plugins_settings']['onlinetime'];
- $query = $db->query("SELECT uid, username, onlinetime FROM $table_members order by onlinetime desc limit 0, 10");
- while($members=$db->fetch_array($query)){
- $h = intval($members['onlinetime']/3600);
- $m = intval($members['onlinetime']%3600/60);
- if($online[upgradetype] == 2 ){
- for($lv=0;$lv>=0;$lv++)
- if((5*($lv+1)*($lv+1)+15*($lv+1))>$h)
- break;
- $upgrade = 5*($lv+1)*($lv+1)+15*($lv+1)-$h;
- $lv = $lv + 1;
- }elseif($online[upgradetype]== 1 ){
- for($lv=0;$lv>=0;$lv++)
- if(($online[upgradetime]*$lv)>$h)
- break;
- $upgrade = $online[upgradetime]*($lv+1)-$h;
- }
-
- $alt = 'alt="等级:'.$lv.'
- 在线时间:'.$h.'小时'.$m.'分钟
- 升级还需:'.$upgrade.'小时 "';
- $windblv = '';
- for($i=intval($lv/($online[sm]*$online[ms])); $i>0; $i--){
- $windblv .= '<img src=images/sun.gif '.$alt.' border=0>';
- }
- for($i=intval($lv%($online[sm]*$online[ms])/$online[sm]); $i>0; $i--){
- $windblv .= '<img src=images/moon.gif '.$alt.' border=0></a>';
- }
- for($i=$lv%($online[sm]*$online[ms])%$online[sm]; $i>0; $i--){
- $windblv .= '<img src=images/star.gif '.$alt.' border=0>';
- }
- // $windblv.=showonline($post['onlinehour'],$post['onlinemin'])."<img src='$imgpath/QQLv/{$Lv}.gif' alt='在线等级:{$Lv} 级\n在线时长:{$members[onlinetime]} 小时\n升级剩余时间:{$more} 小时'>";
- $hotmember.="<table border='0' width='100%' cellspacing='0' cellpadding='0' height=18>".
- '<tr>'.
- "<td><a href='viewpro.php?uid={$members[uid]}' target='_blank'><font color=#003366>$members[username]</font></a></td>".
- "<td align='right'>{$windblv}<br /></td>".
- '</tr></table>';
- }
- unset($members);
- //===================在线时间排行结束==================*/
- $threads = $posts = 0;
- $forumlist = $catforumlist = $forums = $catforums = $categories = array();
- $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
- LEFT JOIN $table_access a ON a.uid='$discuz_uid' AND a.fid=f.fid
- WHERE f.status='1' ORDER BY f.type, f.displayorder"
- : "SELECT fid, fup, type, icon, name, description, moderator, threads, posts, lastpost, viewperm FROM $table_forums WHERE status='1' ORDER BY type, displayorder";
- $query = $db->query($sql);
- while($forum = $db->fetch_array($query)) {
- $forumname[$forum['fid']] = strip_tags($forum['name']);
- if($forum['type'] != 'group') {
- $threads += $forum['threads'];
- $posts += $forum['posts'];
- if($forum['type'] != 'sub') {
- $forums[$forum['fid']] = $forum;
- } elseif($forums[$forum['fup']]['type'] == 'forum') {
- $forums[$forum['fup']]['threads'] += $forum['threads'];
- $forums[$forum['fup']]['posts'] += $forum['posts'];
- }
- } else {
- $categories[] = $forum;
- }
- }
-
- if($categories) {
- foreach($categories as $group) {
- $group_forum = array();
- foreach($forums as $fid => $forum) {
- if($forum['fup'] == $group['fid']) {
- if(forum($forum)) {
- $group_forum[] = $forum;
- unset($forums[$fid]);
- }
- } elseif(!$forum['fup'] && $forum['type'] == 'forum') {
- $catforums[] = $forum;
- unset($forums[$fid]);
- }
- }
- if($group_forum) {
- $forumlist = array_merge($forumlist, array($group), $group_forum);
- }
- }
- } else {
- $catforums = $forums;
- }
- foreach($catforums as $forum) {
- if($forum['fid'] && forum($forum) ) {
- $catforumlist[] = $forum;
- }
- }
- if($catforumlist) {
- $forumlist[] = array('fid' => 0, 'type' => 'group', 'name' => $bbname);
- $forumlist = array_merge($forumlist, $catforumlist);
- }
- unset($fid, $forums, $catforums, $catforumlist, $categories, $group, $forum, $group_forum);
- //print_r($forumlist);
- foreach($forumlist as $key => $forum){
- // print_r($forum);
-
- $f_num=0;
- if ($forum['type'] == 'group' && $forumlist[($key + 1)]['type'] == 'forum'){
- $forumhtml .= <<<EOT
- <table width="560" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="22" valign="top"><img src="images/home/007_4.gif" width="14" height="12"></td>
- <td width="90" valign="top" nowrap><span class="orange-1">$forum[name]</span></td>
- <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td height="5" valign="top" background="images/home/007_6.gif"><img src="images/home/007_6.gif" width="9" height="5"></td>
- </tr>
- </table></td>
- <td width="88" align="right" valign="top"> <span class="blue-english">│ MeCee.com</span></td>
- </tr>
- </table>
- <table width="90%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td height="5" valign="top"></td>
- </tr>
- </table>
- <table width="567" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td valign="top"><img src="images/home/007_5a.gif" width="567" height="5"></td>
- </tr>
- </table>
- <table width="567" height="50" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td align="center" background="images/home/007_5b.gif" valign="top">
- <table cellspacing=0 cellpadding=0 width=95% align=center border=0><tr><td><table cellspacing=0 cellpadding=3 width=100% border=0>
- <tr>
- EOT;
- foreach($forumlist as $forum1){
- if ($forum1['type'] == 'forum' && $forum1['fup'] == $forum['fid']){
- $f_num++;
- if($f_num==5){
- $f_num=1;
- $forumhtml .= '</tr><tr>';
- }else{
- $forumhtml .= "<td width=25% title="$forums[t]">".
- "<a href='forumdisplay.php?fid=$forum1[fid]' class=fnamecolor>$forum1[name]</span></a></td>";
- }
- }
- }
- for($i=$f_num;$i<4;$i++){
- $forumhtml .= '<td width=25%> </td>';
- }
- $forumhtml .= <<<EOT
- </tr></table></td></tr></table></td>
- </tr>
- </table>
- <table width="567" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td valign="top"><img src="images/home/007_5c.gif" width="567" height="5"></td>
- </tr>
- </table>
- <table width="90%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td height="10" valign="top"></td>
- </tr>
- </table>
- EOT;
- }
- }
- include template('home');
- ?>
复制代码 |