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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

首页n格的问题整理与解决[最后更新:2007.11.05 JS调用附件]

[复制链接]
习明 发表于 2007-7-7 21:16:40 | 显示全部楼层
如果你自己没改调用条数 就不是多了标题
回复

使用道具 举报

zzpthegreat 发表于 2007-7-9 00:18:12 | 显示全部楼层
怎么把四格改成2格?就简单的最新回复和最新主题就可以了?
不敢自己改,请教!
回复

使用道具 举报

ccvsn.com 发表于 2007-7-9 02:46:57 | 显示全部楼层
我想修改首页4格每个显示帖子的数量 我现在除第一个格式是广告以外另外3个格式都是调用的最新帖子 最新回复 最热话题  每个调用15个主题 我想改成12个左右  刚才修改的toplist.php文件里的15改成了12 确实是显示12个主题了 但是整个网站都成乱码了 无数的正方形框框吓死了 又还原回去了 我应该修改哪个文件 具体怎么修改呢  小弟先谢谢了 万分着急 我安装的首页4格是朋友帮找的 一共3个文件加修改2处 3个文件分别是 slide.js  toplist.php   toplist.htm  修改了2处是 首页index.php 和 discuz.htm 1、index.php
这是修改详情
查找
require_once DISCUZ_ROOT.'./include/forum.func.php';

下面加
require_once DISCUZ_ROOT.'./include/toplist.php';

2、templates/default/discuz.htm

<!--{if !empty($advlist['text'])}-->
        <div style="clear: both; margin-top: 5px;">
        <div class="spaceborder" style="width: {TABLEWIDTH}">
        <table cellspacing="1" border="0" cellpadding="{TABLESPACE}" width="100%" style="background: {BGBORDER}">$advlist[text]</table>
        </div><br></div>
<!--{/if}-->
在下面加
<!--{if empty($gid)}-->
<div style="clear: both; margin-top: 5px">
{template toplist}
<br>
</div>
<!--{/if}-->

下面是JS里的代码

var xsImgTextheight = text_height;

document.write("<style type=\"text/css\">#slidearea { width:" + xsImgSize[0] + "px; height:" + xsImgSize[1] + "px; margin: 0 auto; } #slidearea img {width:" + xsImgSize[0] + "px; height:" + xsImgSize[1] + "px; border:0px;} #slidefooter {width:" + xsImgSize[0] + "px; height: 27px; margin: 0 auto;} #slidenext, #slideprev {display: block; width: 20px; height: 27px; overflow: hidden; line-height: 27px; } #slideprev {float: left; } #slidenext {float: right; } #slidetext { margin: 0; line-height: 27px; width:" + (parseInt(xsImgSize[0])-40) + "px !important; width:" + (parseInt(xsImgSize[0])-46) + "px; height: 27px; overflow: hidden; text-align: center; }</style>")
document.write("<div id=\"slidearea\">")
if (xsImgs.length != 0) {
        document.write("<a href=\""+ xsImgLinks[curImg] +"\" target=\"_blank\"><img  src=\"" + xsImgs[0] + "\" border=\"0\" onload=\"imgLoadNotify();\" \/><\/a>")
}
document.write("<\/div>")
if (xsImgTextheight != 0) {
        document.write("<div id=\"slidefooter\">")
        if (xsImgTexts.length != 0) {
                document.write("<a id=\"slideprev\" title=\"上一幅\" href=\"#\" onclick=\"rewind();return false\">&laquo;<\/a><a id=\"slidenext\" title=\"下一幅\" href=\"#\" onclick=\"forward();return false\">&raquo;<\/a><p id=\"slidetext\"><a href=\""+ xsImgLinks[0] +"\" target=\"_blank\">"+ xsImgTexts[0] +"<\/a><\/p>")
        }
        document.write("<\/div>")
}


var arrPreload = new Array();
var begImg  = 0;
var arrPreload = new Array();
var spd = 2;

function init()
{
    preloadRange(0,_PRELOADRANGE-1);

    curImg = begImg;
    if (curImg < 0 || curImg > xsImgs.length - 1)
        curImg = xsImgs.length - 1;
    changeSlide();
    setTimeout("play()", 3000)
}



var curImg = 0;
var timerId = -1;
var interval = 3500;
var imgIsLoaded = false;

var current_transition = 15;
var flag = true;
var bFirst = false;


var transitions = new Array;
transitions[0] = "progidXImageTransform.Microsoft.Fade(duration=1)";
transitions[1] = "progidXImageTransform.Microsoft.Blinds(Duration=1,bands=20)";
transitions[2] = "progidXImageTransform.Microsoft.Checkerboard(Duration=1,squaresX=20,squaresY=20)";
transitions[3] = "progid:DXImageTransform.Microsoft.Strips(Duration=1,motion=rightdown)";
transitions[4] = "progid:DXImageTransform.Microsoft.Barn(Duration=1,orientation=vertical)";
transitions[5] = "progid:DXImageTransform.Microsoft.GradientWipe(duration=1)";
transitions[6] = "progid:DXImageTransform.Microsoft.Iris(Duration=1,motion=out)";
transitions[7] = "progid:DXImageTransform.Microsoft.Wheel(Duration=1,spokes=12)";
transitions[8] = "progid:DXImageTransform.Microsoft.Pixelate(maxSquare=10,duration=1)";
transitions[9] = "progid:DXImageTransform.Microsoft.RadialWipe(Duration=1,wipeStyle=clock)";
transitions[10] = "progid:DXImageTransform.Microsoft.RandomBars(Duration=1,orientation=vertical)";
transitions[11] = "progid:DXImageTransform.Microsoft.Slide(Duration=1,slideStyle=push)";
transitions[12] = "progid:DXImageTransform.Microsoft.RandomDissolve(Duration=1,orientation=vertical)";
transitions[13] = "progid:DXImageTransform.Microsoft.Spiral(Duration=1,gridSizeX=40,gridSizeY=40)";
transitions[14] = "progid:DXImageTransform.Microsoft.Stretch(Duration=1,stretchStyle=push)";
transitions[15] = "special case";
var transition_count = 15;

var _PRELOADRANGE = 5;

function preloadRange(intPic,intRange) {
        var divStr = "";
        for (var i=intPic; i<(intPic+intRange); i++) {
                arrPreload = new Image();
                arrPreload.src = xsImgs;       
        }
        return false;
}

function imgLoadNotify()
{
    imgIsLoaded = true;
}

function changeSlide(n)
{       
    if (document.all)
        {           
                var do_transition;
                if (current_transition == (transition_count))
                {
                        do_transition = Math.floor(Math.random() * transition_count);
                }
                else
                {
                        do_transition = current_transition;
                }
                document.all.slidearea.style.filter=transitions[do_transition];
                document.all.slidearea.filters[0].Apply();                       
    }
   
    imgIsLoaded = false;
       
        if (xsImgs.length !=0) {
                var slideImage = "<a href=\""+ xsImgLinks[curImg] +"\" target=\"_blank\"><img src=\"" + xsImgs[curImg] + "\" onload=\"imgLoadNotify();\" /><\/a>";
                document.getElementById("slidearea").innerHTML = slideImage ;
               
                if (xsImgTextheight != 0) {
                        var slideText = "<a href=\""+ xsImgLinks[curImg] +"\" target=\"_blank\">"+ xsImgTexts[curImg] +"<\/a>";
                        document.getElementById("slidetext").innerHTML = slideText ;
                }
       
                if (document.all)
                {                       
                        document.all.slidearea.filters[0].Play();               
                }
        }
}

function forward()
{
        imgIsLoaded = false;
        if (!arrPreload[curImg+1])
        {
                curImg++;
                if (curImg >= xsImgs.length)
                {
                        curImg = 0;
                }
        }
        else
        {
                curImg++;
                if (curImg >= xsImgs.length)
                {  
                        curImg = 0;
                }
        }
        changeSlide();
}

function rewind()
{
        curImg--;
        if (curImg < 0)
        {
                curImg = xsImgs.length-1;               
        }
        changeSlide();
}

function stop()
{
    window.clearInterval(timerId);
    timerId = -1;
    imgIsLoaded = true;
}

function play()
{
    if (timerId == -1)
                timerId = window.setInterval('forward();', interval);
}


init();
下一楼接着发另外2个文件代码

[ 本帖最后由 ccvsn.com 于 2007-7-9 02:49 编辑 ]
回复

使用道具 举报

ccvsn.com 发表于 2007-7-9 02:53:18 | 显示全部楼层
下面是toplist.php这个文件代码
<?php

/*
        [Discuz!] (C)2001-2006 Comsenz Inc.
        This is NOT a freeware, use is subject to license terms

        $RCSfile: index.php,v $
        $Revision: 1.23.2.3 $
        $Date: 2006/09/26 08:27:30 $
*/
//---------------hack Meminfo start
if(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "MSIE 6.0")) {
                $visitor_browser = "Internet Explorer 6.0";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "MSIE 5.5")) {
                $visitor_browser = "Internet Explorer 5.5";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "MSIE 5.0")) {
                $visitor_browser = "Internet Explorer 5.0";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "MSIE 4.01")) {
                $visitor_browser = "Internet Explorer 4.01";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "NetCaptor")) {
                $visitor_browser = "NetCaptor";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Netscape")) {
                $visitor_browser = "Netscape";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Lynx")) {
                $visitor_browser = "Lynx";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Opera")) {
                $visitor_browser = "Opera";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Konqueror")) {
                $visitor_browser = "Konqueror";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Mozilla")) {
                $visitor_browser = "Mozilla";
        } else {
                $visitor_browser = "其它";
        }
//上面的是浏览器//
        if(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "NT 5.1")) {
                $visitor_os = "Windows XP";
        }elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "NT 5.2")) {
                $visitor_os = "Windows Server 2003";
        }elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "NT 5")) {
                $visitor_os = "Windows 2000";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "4.9")) {
                $visitor_os = "Windows ME";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "NT 4")) {
                $visitor_os = "Windows NT 4.0";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "98")) {
                $visitor_os = "Windows 98";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "95")) {
                $visitor_os = "Windows 95";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Mac")) {
                $visitor_os = "Mac";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Linux")) {
                $visitor_os = "Linux";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Unix")) {
                $visitor_os = "Unix";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "FreeBSD")) {
                $visitor_os = "FreeBSD";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "SunOS")) {
                $visitor_os = "SunOS";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "BeOS")) {
                $visitor_os = "BeOS";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "OS/2")) {
                $visitor_os = "OS/2";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "PC")) {
                $visitor_os = "Macintosh";
        }elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "AIX")) {
                $visitor_os = "AIX";
        } else {
                $visitor_os = "其他";
        }
        //$mem_home = convertip($onlineip, $datadir = "./");
//---------------hack Meminfo start
if(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "MSIE 6.0")) {
                $visitor_browser = "Internet Explorer 6.0";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "MSIE 5.5")) {
                $visitor_browser = "Internet Explorer 5.5";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "MSIE 5.0")) {
                $visitor_browser = "Internet Explorer 5.0";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "MSIE 4.01")) {
                $visitor_browser = "Internet Explorer 4.01";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "NetCaptor")) {
                $visitor_browser = "NetCaptor";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Netscape")) {
                $visitor_browser = "Netscape";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Lynx")) {
                $visitor_browser = "Lynx";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Opera")) {
                $visitor_browser = "Opera";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Konqueror")) {
                $visitor_browser = "Konqueror";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Mozilla")) {
                $visitor_browser = "Mozilla";
        } else {
                $visitor_browser = "其它";
        }
//上面的是浏览器//
        if(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "NT 5.1")) {
                $visitor_os = "Windows XP";
        }elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "NT 5.2")) {
                $visitor_os = "Windows Server 2003";
        }elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "NT 5")) {
                $visitor_os = "Windows 2000";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "4.9")) {
                $visitor_os = "Windows ME";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "NT 4")) {
                $visitor_os = "Windows NT 4.0";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "98")) {
                $visitor_os = "Windows 98";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "95")) {
                $visitor_os = "Windows 95";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Mac")) {
                $visitor_os = "Mac";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Linux")) {
                $visitor_os = "Linux";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Unix")) {
                $visitor_os = "Unix";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "FreeBSD")) {
                $visitor_os = "FreeBSD";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "SunOS")) {
                $visitor_os = "SunOS";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "BeOS")) {
                $visitor_os = "BeOS";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "OS/2")) {
                $visitor_os = "OS/2";
        } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "PC")) {
                $visitor_os = "Macintosh";
        }elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "AIX")) {
                $visitor_os = "AIX";
        } else {
                $visitor_os = "其他";
        }
        //$mem_home = convertip($onlineip, $datadir = "./");
//info//
$colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
//新贴//
$hack_cut_str =25; //修改标题显示字数
$hack_cut_strauthor = 9;
$new_post_threadlist = array();
$nthread = array();
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fid ORDER BY t.dateline DESC LIMIT 0, 15");
while($nthread = $db->fetch_array($query)) {
        $nthread['forumname'] = $nthread['name'];
        $nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
        $nthread['view_author'] = cutstr($nthread['author'],$hack_cut_strauthor);
        $nthread['date']= gmdate("$dateformat $timeformat", $nthread['dateline'] + $timeoffset * 3600);
        $nthread['lastreplytime']= gmdate("$dateformat $timeformat", $nthread[lastpost] + ($timeoffset * 3600));
        if($nthread['highlight']) {
                $string = sprintf('%02d', $nthread['highlight']);
                $stylestr = sprintf('%03b', $string[0]);
                $nthread['highlight'] = 'style="';
                $nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $nthread['highlight'] .= '"';
        } else {
                $nthread['highlight'] = '';
        }
        $new_post_threadlist[] = $nthread;
}
//新贴//
//新回覆
$hack_cut_str = 25; //修改标题显示字数
$hack_cut_strauthor = 9;
$new_reply_threadlist = array();
$rthread = array();
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fid  AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 ORDER BY t.lastpost DESC LIMIT 0, 15");
while($rthread = $db->fetch_array($query)) {
        $rthread['forumname'] = $rthread['name'];
        $rthread['view_subject'] = cutstr($rthread['subject'],$hack_cut_str);
        $rthread['view_lastposter'] = cutstr($rthread['lastposter'],$hack_cut_strauthor);
$rthread['date']= gmdate("$dateformat $timeformat", $rthread['dateline'] + $timeoffset * 3600);
        $rthread['lastreplytime']= gmdate("$dateformat $timeformat", $rthread[lastpost] + ($timeoffset * 3600));
        if($rthread['highlight']) {
                $string = sprintf('%02d', $rthread['highlight']);
                $stylestr = sprintf('%03b', $string[0]);
                $rthread['highlight'] = 'style="';
                $rthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $rthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $rthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $rthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $rthread['highlight'] .= '"';
        } else {
                $rthread['highlight'] = '';
        }
        $new_reply_threadlist[] = $rthread;
}
//回覆//
//热帖
$hack_cut_str = 25; //修改标题显示字数
$hack_cut_strauthor = 9;
$new_hot_threadlist = array();
$mthread = array();
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fid  AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 ORDER BY t.views DESC LIMIT 0, 15");
while($mthread = $db->fetch_array($query)) {
        $mthread['forumname'] = $mthread['name'];
        $mthread['view_subject'] = cutstr($mthread['subject'],$hack_cut_str);
        $mthread['view_lastposter'] = cutstr($mthread['lastposter'],$hack_cut_strauthor);
$mthread['date']= gmdate("$dateformat $timeformat", $mthread['dateline'] + $timeoffset * 3600);
        $mthread['lastreplytime']= gmdate("$dateformat $timeformat", $mthread[lastpost] + ($timeoffset * 3600));
        if($mthread['highlight']) {
                $string = sprintf('%02d', $mthread['highlight']);
                $stylestr = sprintf('%03b', $string[0]);
                $mthread['highlight'] = 'style="';
                $mthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : '';
                $mthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : '';
                $mthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : '';
                $mthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : '';
                $mthread['highlight'] .= '"';
        } else {
                $mthread['highlight'] = '';
        }
        $new_hot_threadlist[] = $mthread;
}
//热帖//
?>

下面是toplist.htm这个文件代码
<table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="{TABLEWIDTH}" align="center" class="tableborder">
<tr class="altbg2" align="left">
  <td align="left" class="header"><b><img src={IMGDIR}/dot.gif border=0 />精彩影片欣赏</b></td>
  <td align="left" class="header"><b><img src={IMGDIR}/dot.gif border=0 />最新发表的主题</b></td>
  <td align="left" class="header"><b><img src={IMGDIR}/dot.gif border=0 />最新回复的主题</b></td>
  <td align="left" class="header"><b><img src={IMGDIR}/dot.gif border=0 />论坛最热的主题</b></td>
</tr>
<tr class="altbg2" align="left">
<td align="left" valign="top" style="border-right: 1px solid {INNERBORDERCOLOR}" width="255" height="235"><script src=http://www.vodone.com/bus/ownerjs/advjs_30/30926/30926_32218_p7_.js></script></td>
<td align="left" valign="top" style="border-right: 1px solid {INNERBORDERCOLOR}">
<!--#最新贴循环开始-->
<!--{loop $new_post_threadlist $nthread}-->
<img src="images/bullet.gif" border="0">
                                                                        <!--{if $nthread[replies]}-->
                                                                        <a href="viewthread.php?tid=$nthread[tid]" $nthread['highlight'] title="最新话题 {LF}所在论坛: $nthread[forumname]{LF}主题标题: $nthread[subject] {LF}主题作者: $nthread[author]{LF}发表时间: $nthread[date]{LF}浏览次数: $nthread[views] 次 {LF}回复次数: $nthread[replies] 次{LF}最后回复: $nthread[lastreplytime]{LF}{lang lastpost}: $nthread[lastposter]" >$nthread[view_subject]</a><br>
                                                                        <!--{else}-->
                                                                        <a href="viewthread.php?tid=$nthread[tid]" $nthread['highlight'] title="最新话题 {LF}所在论坛: $nthread[forumname]{LF}主题标题: $nthread[subject] {LF}主题作者: $nthread[author]{LF}发表时间{lang time}: $nthread[date]{LF}浏览次数: $nthread[views] 次 {LF}回复次数: $nthread[replies] 次{LF}{lang replies}: 暂时没有回复" >$nthread[view_subject]</a><br>
                                                                  <!--{/if}-->
                                                                   <!--{/loop}-->
                                                                  <!--#循环结束--></td>
<td align="left" valign="top" style="border-right: 1px solid {INNERBORDERCOLOR}">
<!--#最新贴循环开始-->
<!--{loop $new_reply_threadlist $rthread}-->
<img src="images/bullet.gif" border="0"><a href="viewthread.php?tid=$rthread[tid]" $rthread['highlight'] title="最新回复 {LF}所在论坛: $rthread[forumname]{LF}主题标题: $rthread[subject]{LF}主题作者: $rthread[author]{LF}发表时间: $rthread[date]{LF}浏览次数: $rthread[views] 次{LF}回复次数: $rthread[replies] 次{LF}最后回复: $rthread[lastreplytime]{LF}{lang lastpost}: $rthread[lastposter]" >$rthread[view_subject]</a><br>
<!--{/loop}-->
<!--#循环结束--></td>
<td align="left" valign="top">
<!--#最新贴循环开始-->
<!--{loop $new_hot_threadlist $mthread}-->
<img src="images/bullet.gif" border="0"><a href="viewthread.php?tid=$mthread[tid]" $mthread['highlight'] title="热门话题 {LF}所在论坛: $mthread[forumname]{LF}主题标题: $mthread[subject]{LF}主题作者: $mthread[author]{LF}发表时间: $mthread[date]{LF}浏览次数: $mthread[views] 次{LF}回复次数: $mthread[replies] 次{LF}最后回复: $mthread[lastreplytime]{LF}{lang lastpost}: $mthread[lastposter]" >$mthread[view_subject]</a><br>
<!--{/loop}-->
<!--#循环结束--></td></tr>
</table>

请习明大哥帮我看一下  另外我想把论坛最热的主题 改成论坛今日发帖排行 在次谢谢习明大哥帮我看一下
回复

使用道具 举报

 楼主| TaRot! 发表于 2007-7-9 09:04:09 | 显示全部楼层
toplist.php中的3个数据库查询
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fid ORDER BY t.dateline DESC LIMIT 0, 15");
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fid  AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 ORDER BY t.lastpost DESC LIMIT 0, 15");
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' AND f.fid=t.fid  AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 ORDER BY t.views DESC LIMIT 0, 15");
最后的15就代表条数.
回复

使用道具 举报

zzpthegreat 发表于 2007-7-9 19:35:45 | 显示全部楼层
怎么把四格改成2格?就简单的最新回复和最新主题就可以了?
不敢自己改,请教!
回复

使用道具 举报

习明 发表于 2007-7-9 19:44:44 | 显示全部楼层

回复 #126 zzpthegreat 的帖子

一个建议 本地安装个论坛做测试 弄好了再放到论坛上
回复

使用道具 举报

懒懒的猫 发表于 2007-7-9 20:45:38 | 显示全部楼层
怎么把调用的图片换成自己指定的图片啊?
安装的是这个版本https://discuz.dismall.com/thread-556195-1-1.html
翻了半天也没翻到怎么处理...
回复

使用道具 举报

习明 发表于 2007-7-9 21:14:06 | 显示全部楼层

回复 #128 懒懒的猫 的帖子

手工修改include/toplist_cache.php
  1. $query = $db->query("SELECT
  2. f.aid, f.attachment, f.isimage, f.filesize, t.dateline,t.tid,t.subject,t.author,t.highlight,t.authorid,t.views,t.replies,t.lastpost,t.lastposter FROM {$tablepre}attachments f LEFT JOIN {$tablepre}threads t ON t.tid=f.tid WHERE f.readperm='0' AND displayorder>='0' AND isimage='1' AND filesize>'10000' $picfids GROUP BY f.tid ORDER BY $picorderby DESC LIMIT $img_num");
复制代码

改为
  1. $query = $db->query("SELECT
  2. f.aid, f.attachment, f.isimage, f.filesize, t.dateline,t.tid,t.subject,t.author,t.highlight,t.authorid,t.views,t.replies,t.lastpost,t.lastposter FROM {$tablepre}attachments f LEFT JOIN {$tablepre}threads t ON t.tid=f.tid WHERE f.aid in (你要调用图片附件的AID) GROUP BY f.tid ORDER BY $picorderby DESC LIMIT $img_num");
复制代码

把“你要调用图片附件的AID” 用你所需图片的AID替换 多个aid之间用半角逗号分隔
回复

使用道具 举报

ccvsn.com 发表于 2007-7-9 22:58:57 | 显示全部楼层
原帖由 TaRot! 于 2007-7-9 09:04 发表
toplist.php中的3个数据库查询
最后的15就代表条数.


谢谢您的回复  我开始就是这么修改的 改成12以后确实显示12个主题了 但是整个论坛都成了乱码 全部都是正方形的小框框 不知道怎么回事
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-9-22 05:22 , Processed in 0.132035 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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