Discuz!NT 2.5 正式版 下载
beta、RC版升级补丁
Comsenz 招聘信息
首届Discuz!NT 模板大赛圆满结束
著名音乐网站SoGua网、分贝网
采用Discuz!NT搭建社区
FIFA Online2官网论坛使用Discuz!NT
游戏城寨论坛使用Discuz!NT搭建
第二届优秀版主评选揭晓
Discuz!NT 2.5正式开源 Discuz!NT文档中心
用户整合说明文档
Discuz!NT亮相微软Tech-Ed 2007
Discuz!NT情景搞笑短片抢先看
1/17页12345678» 跳转到查看:20674
发新话题 回复该主题

[下载] 我自己写了一个首页四格的调用

我自己写了一个首页四格的调用

效果演示:http://bbs.bshlg.com




将压缩包里的number文件夹放到论坛的images下
替换tools下的showtopics.aspx 将focus.swf放到tools下
修改 首页模板
在合适的位置加上以下代码,更新一下。

<script src="javascript/ajax.js"></script>
<DIV class="ntforumbox forumtopic">
<DIV class=titlebar>
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="line-height:25px;">
  <tr>
    <td width="32%" height="31" align="left" valign="middle"><h2>社区最新图片</h2></td>
    <td width="35%" align="left" valign="middle">
        <table width="100%" height="31" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td  width="40%"><h2>社区帖子排行</h2></td>
                <td width="60%" align="left" valign="bottom">
                <table width="100%" border="0" cellspacing="0" cellpadding="0" height="24">
          <tr>
            <td align="center" width="33.3%" id="topselect_1" onclick="javascript:topmenutagselect('1')" class="topselect_new"  valign="bottom">最新发布</td>
                <td align="center" width="33.3%" id="topselect_2" onclick="javascript:topmenutagselect('2')" class="topunselect_new" valign="bottom">最新回复</td>
                <td align="center" width="33.3%" id="topselect_3" onclick="javascript:topmenutagselect('3')"  class="topunselect_new" valign="bottom">社区精华</td>
          </tr>
        </table></td>
      </tr>
    </table></td>
    <td width="13%" align="left" valign="middle"><h2>发帖排行</h2></td>
        <td width="20%" align="left" valign="middle"><h2>社区书包最新经验</h2></td>
  </tr>
</table>
</DIV>

<table width="100%" height="190" border="0" cellpadding="2" cellspacing="0">
  <tr>
    <td width="32%" align="left" valign="top">
        <script type="text/javascript" src="http://bbs.bshlg.com/tools/showtopics.aspx?onlyimg=1&template=6&imgsize=300&type=1"></script>
    <script type="text/javascript" src="http://bbs.bshlg.com/tools/showtopics.aspx?onlyimg=1&template=7&order=3"></script>
<script type=text/javascript>
var pic_width=300; //图片宽度
var pic_height=220; //图片高度
var button_pos=4; //按扭位置 1左 2右 3上 4下
var stop_time=5000; //图片停留时间(1000为1秒钟)
var show_text=0; //是否显示文字标签 1显示 0不显示
var txtcolor="000000"; //文字色
var bgcolor="DDDDDD"; //背景色
var swf_height=show_text==1?pic_height+20:pic_height;
var texts="";

if((pics == "" && links == "") || (pics == null && links == null)){
                            document.write('暂无数据');
                        }else{
                                               
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cabversion=6,0,0,0" width="'+ pic_width +'" height="'+ swf_height +'">');
document.write('<param name="movie" value="tools/focus.swf">');
document.write('<param name="quality" value="high"><param name="wmode" value="opaque">');
document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&pic_width='+pic_width+'&pic_height='+pic_height+'&show_text='+show_text+'&txtcolor='+txtcolor+'&bgcolor='+bgcolor+'&button_pos='+button_pos+'&stop_time='+stop_time+'">');
document.write('<embed src="tools/focus.swf" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&pic_width='+pic_width+'&pic_height='+pic_height+'&show_text='+show_text+'&txtcolor='+txtcolor+'&bgcolor='+bgcolor+'&button_pos='+button_pos+'&stop_time='+stop_time+'" quality="high" width="'+ pic_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
}
</script>
        </td>
    <td width="35%" align="left" valign="top">
                <div id="topselect_body"></div>
        </td>
    <td width="13%" align="left" valign="top" style="padding-left:4px;">
                <div id="topusers">
                        <ul>
                                <script type="text/javascript" src="http://bbs.bshlg.com/tools/showtopics.aspx?isTopUser=1"></script>
                        </ul>
                </div>
        </td>
        <td width="20%" align="left" valign="top" style="padding-left:4px;">
                <script src="http://box.bshlg.com/code/index.aspx?flag=bbs_topnew&size=12&num=9"></script>
        </td>
  </tr>
</table>
</DIV>
<script>topmenutagselect("1")</script>


修改 dnt.css 增加样式

/*新增加的*/
.topselect_new
{
        font-size:12px; font-weight:bold; color:#009900; background-color:#FFFFFF; padding-bottom:3px;
}
.topunselect_new
{
        font-size:12px; font-weight:bold;padding-bottom:3px;
        color:#7C8332;
        cursor:hand;
}
#topselect_body,#topusers
{
        margin:0px;
        padding-left:5px;
}
#topselect_body ul,#topusers ul
{
        margin:0px;
        list-style:none;
}
#topselect_body ul li,#topselect_body ul li a
{
        list-style:none;
        line-height:23px;
        height:23px;
        width:320px;
        white-space:nowrap;
        text-overflow:ellipsis;
        overflow: hidden;
}
#topselect_body ul li a:hover
{
        list-style:none;
        line-height:23px;
        width:320px;
        white-space:nowrap;
        text-overflow:ellipsis;
        overflow: hidden;
        background-color:#89C27E;
        color:#FFFFFF;
        text-align:left;
        text-decoration:none;
        font-weight:bold;
}
,#topusers ul li,#topusers ul li a,#topusers ul li a:hover
{
        list-style:none;
        line-height:23px;
        height:23px;
        width:110px;
        white-space:nowrap;
        text-overflow:ellipsis;
        overflow: hidden;
        padding-left:5px;
}
/*新增加的结束*/


修改JAVASCRIPT/AJAX.JS  增加以下代码
var mainURL=http://bbs.bshlg.com/;改成自己网站

var xhp;
function topmenutagselect(val)
{
        var mainURL="http://bbs.bshlg.com/";
        for(i=1;i<=3;i++)
        {
                document.getElementById("topselect_"+i).className="topunselect_new";
        }
        document.getElementById("topselect_"+val).className="topselect_new";
        var url="";
        switch(val)
        {
                case "1"://最新发布
                        url=mainURL+"tools/showtopics.aspx?template=8&order=0";
                        break;
                case "2"://最新回复
                        url=mainURL+"tools/showtopics.aspx?template=8&order=2";
                        break;
                case "3"://社区精华
                        url=mainURL+"tools/showtopics.aspx?template=8&order=1&digest=1&time=3";
                        break;
        }
        xhp=createXMLHttp();
        xhp.onreadystatechange=topmenutagselect_stu;
        xhp.open("GET",url,true);
        xhp.send(null);       
}
function topmenutagselect_stu()
{
        if(xhp.readyState==1)
        {
        }
        else if(xhp.readyState==4)
        {
                if(xhp.status==200)
                {
                        var data=xhp.responseText;
                        data=data.substring(16,data.length-3);
                        data="<ul>"+data+"</ul>";
                        if(typeof(eval("document.all.topselect_body"))!= "undefined")
                        {
                                document.getElementById("topselect_body").innerHTML=data;
                        }
                        else
                        {
                                topmenutagselect("1");//继续加载
                        }
                }
                else
                {
                        document.getElementById("topselect_body").innerHTML="加载过程出错";
                }
        }       
}


***** 该内容需会员回复才可浏览 *****
本帖被评分 1 次
最后编辑shuimu 最后编辑于 2008-01-08 11:56:58

TOP

 

回复:我自己写了一个首页四格的调用

试试看············

TOP

 

回复:我自己写了一个首页四格的调用

学习研究
最后编辑atlolo 最后编辑于 2008-01-07 15:47:26

TOP

 

回复:我自己写了一个首页四格的调用

还行吧!
欢迎访问广东高考政治网:http://www.gkzzgd.cn

TOP

 

回复:我自己写了一个首页四格的调用

怎么下不了啊

TOP

 

回复:我自己写了一个首页四格的调用

支持一下

TOP

 

回复:我自己写了一个首页四格的调用

支持个~

TOP

 

回复:我自己写了一个首页四格的调用

gg

TOP

 

回复:我自己写了一个首页四格的调用

好的,要参考一下

TOP

 

回复: 我自己写了一个首页四格的调用

yao  le    le  ``

TOP

 
1/17页12345678» 跳转到
发表新主题 回复该主题