返回列表 发帖

[LeadBBS相关] [蚂蚁]leadbbs 4.0模板荟粹

老话老提,老版老改,本代码为修改leadbbs4.0源码.

模板目录:
1:ssss模板
2:区间广告模板
3:双栏偶数模板
4:简易模板
一:ssss模板
演示:
此主题相关图片


function displayboard(boardid,boardassort,boardname,boardintro,lastwriter,lastwritetime,topicnum,announcenum,forumpass,lastannounceid,lasttopicname,masterlist,boardlimit,assortname,todayannounce,goodnum,boardimgurl,boardimgwidth,boardimgheight,onlineuser,lowerboard,assortmaster)
{
        var temp = 0;
        if(currentassosrt!=boardassort)
        {
                currentassosrt = boardassort
                if(flag == 1)
                {        document.write("</table>");
                        if(gbl_tablebottomstring != "")document.write("<table width=" + def_bbs_screenwidth + " border=0 cellspacing=0 cellpadding=0 align=center><tr><td>" + gbl_tablebottomstring + "</td></tr></table>");
                        document.write("<br>");
                }
                if(gbl_tableheadstring != "")document.write("<table width=" + def_bbs_screenwidth + " border=0 cellspacing=0 cellpadding=0 align=center><tr><td>" + gbl_tableheadstring + "</td></tr></table>");
                document.write("<table width=" + def_bbs_screenwidth + " border=0 cellspacing=1 cellpadding=3 align=center bgcolor=#cccccc class=tbone><tr bgcolor=#666699><td colspan=5 class=tbhead>");
                document.write("<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td><img src=images/null.gif width=2 height=3><br><a href=boards.asp?assort=" + boardassort + "><b><font color=white class=headfont>→" + assortname + "←</font></b></a></td><td align=right><img src=images/null.gif width=2 height=3><br><font color=white class=headfont>" + def_pointsname7 + ":");
                displayboardmastlist(assortmaster,5,1);
                document.write("</font></td></tr></table></td></tr>");
                document.write("<tr bgcolor=#f7f7f7 align=center class=tbbg9><td width=4% class=tbbg1></td><td width=48%>版块</td><td width=8%>帖情</td><td width=25%>详情</td><td width=15%>版主</td></tr>");
                flag = 1;
        }
        document.write("<tr bgcolor=#f7f7f7 align=center class=tbbg9><td width=25 bgcolor=eeeeee class=tbbg1><img src=images/" + gbl_defineimage + "boardtopic/");
        if(todayannounce > 0)document.write("_");
        if(forumpass!="")
        {
                document.write("lock.gif title=保密论坛");
        }
        else
        {
                if(boardlimit&(1<<(7-1)))
                {
                        document.write("lock3.gif title=" + def_pointsname8 + "专区");
                }
                else
                {
                        if((boardlimit&(1<<(4-1))) && (boardlimit&(1<<(3-1))) && (boardlimit&(1<<(6-1))))
                        {
                                document.write("readonly.gif title=只读论坛");
                        }
                        else
                        {
                                if(boardlimit&(1<<(2-1)))
                                {
                                        document.write("lock2.gif title=正式会员论坛");
                                }
                                else
                                {
                                        if(boardlimit&(1<<(1-1)))
                                        {
                                                document.write("lock1.gif title=注册认证论坛");
                                        }
                                        else
                                        {
                                                if(boardlimit&(1<<(9-1)))
                                                {
                                                        document.write("open.gif title=开放论坛");
                                                }
                                                else
                                                {
                                                        document.write("1.gif title=常规论坛");
                                                }
                                        }
                                }
                        }
                }
        }
        document.write("></td>");
        document.write("<td align=left>");
        if(boardimgurl != "" && boardimgurl != null)document.write("<a href=b/b.asp?b=" + boardid + "><img src=\"" + boardimgurl + "\" width=" + boardimgwidth + " height=" + boardimgheight + " border=0 align=right></a>");
        document.write("<a href=b/b.asp?b=" + boardid + ">※" + boardname + "※</a><br><br>");
        document.write(boardintro);
        document.write("</td>");
        document.write("<td align=left valign=top><img src=images/null.gif height=2 width=2><br>主题 <b>" + topicnum + "</b><br><img src=images/null.gif height=4 width=2><br>新帖 <b><font color=#666699 class=tbtwofont>" + todayannounce + "</font></b><br><img src=images/null.gif height=4 width=2><br>总量 <b>" + announcenum + "</b></td>");
        document.write("<td align=left valign=top><img src=images/null.gif height=2 width=2><br>");
        if(lasttopicname == "" || lasttopicname==null)
        {
                document.write("主题:无");
        }
        else
        {
                if(strlength(lasttopicname)>26)lasttopicname = lefttrue(lasttopicname,26-3) + "."
                lasttopicname = htmlencode(lasttopicname);
                if(forumpass != "" || (boardlimit&(1<<(15-1))) || (boardlimit&(1<<(2-1))) || (boardlimit&(1<<(7-1))))
                {
                        document.write("主题:已设置为隐藏");
                        temp = 1;
                }
                else
                {
                        if(parseint(lastannounceid)==0){document.write("主题:" + htmlencode(lasttopicname));}
                        else{document.write("主题:<a href=a/a.asp?b=" + boardid + "&id=" + lastannounceid + "&aupflag=1&anum=1>" + htmlencode(lasttopicname) + "</a>");}
                }
        }
        document.write("<br><img src=images/null.gif height=4 width=2><br>");
        if(lastwriter == "")
        {
                document.write("作者:");
                lastwriter="无";
                document.write(lastwriter);
                document.write("<br><img src=images/null.gif height=4 width=2><br>时间:无");
        }
        else
        {
                document.write("by:");
                if(lastwriter!="游客")
                {
                        if(temp == 1)
                        {
                                document.write("隐藏");
                        }
                        else
                        {
                                document.write("<a href=\"user/lookuserinfo.asp?name=" + htmlencode(lastwriter) + "\">" + htmlencode(lastwriter) + "</a>");
                        }
                }
                else
                {
                        document.write(htmlencode(lastwriter))
                }
                if(lastwritetime.length==14)
                {
                        lastwritetime = lastwritetime.substr(0,4) + "-" + lastwritetime.substr(4,2) + "-" + lastwritetime.substr(6,2) + " " + lastwritetime.substr(8,2) + ":" + lastwritetime.substr(10,2) + ":" + lastwritetime.substr(12,2)
                }
                else
                {
                        lastwritetime = "无"
                }
                document.write("<br><img src=images/null.gif height=4 width=2><br>时间:" + lastwritetime);
                document.write("</td>");
        document.write("<td>");
        document.write("<img src=images/null.gif height=2><br>");
        displayboardmastlist(masterlist,5,0);
                document.write("</td></tr>");
        }
}


二:区间广告模板
注释中间的代码可加到任意模板中。
演示:
此主题相关图片


function displayboard(boardid,boardassort,boardname,boardintro,lastwriter,lastwritetime,topicnum,announcenum,forumpass,lastannounceid,lasttopicname,masterlist,boardlimit,assortname,todayannounce,goodnum,boardimgurl,boardimgwidth,boardimgheight,onlineuser,lowerboard,assortmaster)
{
        var temp = 0;
        if(currentassosrt!=boardassort)
        {
                currentassosrt = boardassort
                if(flag == 1)
                {        document.write("</table>");
                        if(gbl_tablebottomstring != "")document.write("<table width=" + def_bbs_screenwidth + " border=0 cellspacing=0 cellpadding=0 align=center><tr><td>" + gbl_tablebottomstring + "</td></tr></table>");
//——广告代码修改开始,需多个显广告,可无限循环。该代码可加任意模板——
                        if(boardassort == 3){//广告位置位于区号3上
                        document.write("<table width=" + def_bbs_screenwidth + " border=0 cellspacing=1 cellpadding=2 align=center class=tbone><tr class=tbbg9><td><font color=red><b>区间广告</b></font>■■■■■广告a■■■■■</td></tr></table>");
                 }else if(boardassort == 4){//广告位置位于区号4上
                        document.write("<table width=" + def_bbs_screenwidth + " border=0 cellspacing=1 cellpadding=2 align=center class=tbone><tr class=tbbg9><td><font color=red><b>区间广告</b></font>■■■■■广告b■■■■■</td></tr></table>");
                 }else{
                        document.write("<br>");
                 }
           }
//——广告代码结束——
                if(gbl_tableheadstring != "")document.write("<table width=" + def_bbs_screenwidth + " border=0 cellspacing=0 cellpadding=0 align=center><tr><td>" + gbl_tableheadstring + "</td></tr></table>");
                document.write("<table width=" + def_bbs_screenwidth + " border=0 cellspacing=1 cellpadding=3 align=center bgcolor=#cccccc class=tbone><tr bgcolor=#666699><td colspan=5 class=tbhead>");
                document.write("<table width=100% border=0 cellspacing=0 cellpadding=0><tr><td><img src=images/null.gif width=2 height=3><br><a href=boards.asp?assort=" + boardassort + "><b><font color=white class=headfont>→" + assortname + "←</font></b></a></td><td align=right><img src=images/null.gif width=2 height=3><br><font color=white class=headfont>" + def_pointsname7 + ":");
                displayboardmastlist(assortmaster,5,1);
                document.write("</font></td></tr></table></td></tr>");
                document.write("<tr bgcolor=#f7f7f7 align=center class=tbbg9><td width=4% class=tbbg1></td><td width=48%>版块</td><td width=8%>帖情</td><td width=25%>详情</td><td width=15%>版主</td></tr>");
                flag = 1;
        }
        document.write("<tr bgcolor=#f7f7f7 align=center class=tbbg9><td width=25 bgcolor=eeeeee class=tbbg1><img src=images/" + gbl_defineimage + "boardtopic/");
        if(todayannounce > 0)document.write("_");
        if(forumpass!="")
        {
                document.write("lock.gif title=保密论坛");
        }
        else
        {
                if(boardlimit&(1<<(7-1)))
                {
                        document.write("lock3.gif title=" + def_pointsname8 + "专区");
                }
                else
                {
                        if((boardlimit&(1<<(4-1))) && (boardlimit&(1<<(3-1))) && (boardlimit&(1<<(6-1))))
                        {
                                document.write("readonly.gif title=只读论坛");
                        }
                        else
                        {
                                if(boardlimit&(1<<(2-1)))
                                {
                                        document.write("lock2.gif title=正式会员论坛");
                                }
                                else
                                {
                                        if(boardlimit&(1<<(1-1)))
                                        {
                                                document.write("lock1.gif title=注册认证论坛");
                                        }
                                        else
                                        {
                                                if(boardlimit&(1<<(9-1)))
                                                {
                                                        document.write("open.gif title=开放论坛");
                                                }
                                                else
                                                {
                                                        document.write("1.gif title=常规论坛");
                                                }
                                        }
                                }
                        }
                }
        }
        document.write("></td>");
        document.write("<td align=left>");
        if(boardimgurl != "" && boardimgurl != null)document.write("<a href=b/b.asp?b=" + boardid + "><img src=\"" + boardimgurl + "\" width=" + boardimgwidth + " height=" + boardimgheight + " border=0 align=right></a>");
        document.write("<a href=b/b.asp?b=" + boardid + ">※" + boardname + "※</a><br><br>");
        document.write(boardintro);
        document.write("</td>");
        document.write("<td align=left valign=top><img src=images/null.gif height=2 width=2><br>主题 <b>" + topicnum + "</b><br><img src=images/null.gif height=4 width=2><br>新帖 <b><font color=#666699 class=tbtwofont>" + todayannounce + "</font></b><br><img src=images/null.gif height=4 width=2><br>总量 <b>" + announcenum + "</b></td>");
        document.write("<td align=left valign=top><img src=images/null.gif height=2 width=2><br>");
        if(lasttopicname == "" || lasttopicname==null)
        {
                document.write("主题:无");
        }
        else
        {
                if(strlength(lasttopicname)>26)lasttopicname = lefttrue(lasttopicname,26-3) + "."
                lasttopicname = htmlencode(lasttopicname);
                if(forumpass != "" || (boardlimit&(1<<(15-1))) || (boardlimit&(1<<(2-1))) || (boardlimit&(1<<(7-1))))
                {
                        document.write("主题:已设置为隐藏");
                        temp = 1;
                }
                else
                {
                        if(parseint(lastannounceid)==0){document.write("主题:" + htmlencode(lasttopicname));}
                        else{document.write("主题:<a href=a/a.asp?b=" + boardid + "&id=" + lastannounceid + "&aupflag=1&anum=1>" + htmlencode(lasttopicname) + "</a>");}
                }
        }
        document.write("<br><img src=images/null.gif height=4 width=2><br>");
        if(lastwriter == "")
        {
                document.write("作者:");
                lastwriter="无";
                document.write(lastwriter);
                document.write("<br><img src=images/null.gif height=4 width=2><br>时间:无");
        }
        else
        {
                document.write("by:");
                if(lastwriter!="游客")
                {
                        if(temp == 1)
                        {
                                document.write("隐藏");
                        }
                        else
                        {
                                document.write("<a href=\"user/lookuserinfo.asp?name=" + htmlencode(lastwriter) + "\">" + htmlencode(lastwriter) + "</a>");
                        }
                }
                else
                {
                        document.write(htmlencode(lastwriter))
                }
                if(lastwritetime.length==14)
                {
                        lastwritetime = lastwritetime.substr(0,4) + "-" + lastwritetime.substr(4,2) + "-" + lastwritetime.substr(6,2) + " " + lastwritetime.substr(8,2) + ":" + lastwritetime.substr(10,2) + ":" + lastwritetime.substr(12,2)
                }
                else
                {
                        lastwritetime = "无"
                }
                document.write("<br><img src=images/null.gif height=4 width=2><br>时间:" + lastwritetime);
                document.write("</td>");
        document.write("<td>");
        document.write("<img src=images/null.gif height=2><br>");
        displayboardmastlist(masterlist,5,0);
                document.write("</td></tr>");
        }
}

三:双栏偶数模板
指一个区包含的版块数。之所以要偶数,是为了界面搭配,如果是奇数,会有空的地方显得不协调,也就是常说的“空虚”。

演示:
此主题相关图片


function displayboard(boardid,boardassort,boardname,boardintro,lastwriter,lastwritetime,topicnum,announcenum,forumpass,lastannounceid,lasttopicname,masterlist,boardlimit,assortname,todayannounce,goodnum,boardimgurl,boardimgwidth,boardimgheight,onlineuser,lowerboard,assortmaster)
{
        var n;
        if(currentassosrt!=boardassort)
        {
                currentassosrt = boardassort
                if(flag == 1)
                {
                        if(num>0){for(n=num;n<2;n++)document.write("<td width=50%></td>");}
                        document.write("</table>");
                        document.write("<br>");
                }
                else
                {
                        if(gbl_tableheadstring != "")document.write("<table width=" + def_bbs_screenwidth + " border=0 cellspacing=0 cellpadding=0 align=center><tr><td>" + gbl_tableheadstring + "</td></tr></table>");
                }
                document.write("<table width=" + def_bbs_screenwidth + " border=0 cellspacing=1 cellpadding=5 align=center bgcolor=#cccccc class=tbbg9><tr bgcolor=#666699> <td colspan=2 class=tbhead><table width=100% border=0 cellspacing=0 cellpadding=0><tr><td><img src=images/null.gif width=2 height=3><br><a href=boards.asp?assort=" + boardassort + "><b><font color=white class=headfont>→" + assortname + "←</font></b></a></td><td align=right><img src=images/null.gif width=2 height=3><br><font color=white class=headfont>" + def_pointsname7 + ":");
                displayboardmastlist(assortmaster,5,1);
                document.write("</font></td></tr></table></td></tr>");
                flag = 1;
                num=0;
        }
        if((num%2)==0)document.write("<tr bgcolor=#f7f7f7>");
        document.write("<td width=50% class=tbbg9 style=\"border:1px solid #cccccc\">");
        if(boardimgurl != "" && boardimgurl != null)document.write("<a href=b/b.asp?b=" + boardid + "><img src=\"" + boardimgurl + "\" width=" + boardimgwidth + " height=" + boardimgheight + " border=0 align=right></a>");

        document.write("<font color=#483d8b>版名</font>:<a href=board/board.asp?boardid=" + boardid + "><u><font color=red>" + boardname + "</font></u></a>主题 <b>" + topicnum + "</b>新帖 <b><font color=#666699 class=tbtwofont>" + todayannounce + "</font></b>总量 <b>" + announcenum + "</b><br><font color=green>版规</font>:");
        document.write(boardintro);
        document.write("<br>");
        if(lasttopicname == "" || lasttopicname==null)
        {
                document.write("<font color=#ffcc00>主题</font>:无");
        }
        else
        {
                if(strlength(lasttopicname)>40)lasttopicname = lefttrue(lasttopicname,40-3) + "."
                lasttopicname = htmlencode(lasttopicname);
                if(forumpass != "" || (boardlimit&(1<<(15-1))) || (boardlimit&(1<<(2-1))) || (boardlimit&(1<<(7-1))))
                {
                        document.write("<font color=#ffcc00>主题</font>:已设置为隐藏");
                        temp = 1;
                }
                else
                {
                        if(parseint(lastannounceid)==0){document.write("<font color=#ffcc00>主题</font>:" + htmlencode(lasttopicname));}
                        else{document.write("<font color=#ffcc00>主题</font>:<a href=a/a.asp?b=" + boardid + "&id=" + lastannounceid + "&aupflag=1&anum=1><u>" + htmlencode(lasttopicname) + "</u></a>");}
                }
        }
        document.write("<br><font color=#8b0000>版主</font>:");
        displayboardmastlist(masterlist,5,0);
        document.write("</td>");
        num+=1;
        if(num>20)num=0;
}

四:简易模板:
这是好玩做的个模板。这里限制了版块图片宽高为81x29。

演示:
此主题相关图片


function displayboard(boardid,boardassort,boardname,boardintro,lastwriter,lastwritetime,topicnum,announcenum,forumpass,lastannounceid,lasttopicname,masterlist,boardlimit,assortname,todayannounce,goodnum,boardimgurl,boardimgwidth,boardimgheight,onlineuser,lowerboard,assortmaster)
{
        var temp = 0;
        if(currentassosrt!=boardassort)
        {
                currentassosrt = boardassort
                if(flag == 1)
                {        document.write("</table>");
                }
                document.write("<table width=" + def_bbs_screenwidth + " border=0 cellspacing=0 cellpadding=3 align=center bgcolor=#cccccc class=tbone>");
                flag = 1;
        }
        document.write("<tr bgcolor=#f7f7f7 align=center class=tbbg9><td align=left>");
        document.write("<fieldset><legend><font color=green><b><a href=b/b.asp?b=" + boardid + ">" + boardname + "</a></b></font></legend>");
        if(boardimgurl != "" && boardimgurl != null)document.write("<a href=b/b.asp?b=" + boardid + "><img src=\"" + boardimgurl + "\" width=88 height=29 border=0 align=right></a>");//这里限制了版块图片宽高为81x29
        document.write("<img align=absmiddle src=images/" + gbl_defineimage + "boardtopic/");
        if(todayannounce > 0)document.write("_");
        if(forumpass!="")
        {
                document.write("lock.gif title=保密论坛");
        }
        else
        {
                if(boardlimit&(1<<(7-1)))
                {
                        document.write("lock3.gif title=" + def_pointsname8 + "专区");
                }
                else
                {
                        if((boardlimit&(1<<(4-1))) && (boardlimit&(1<<(3-1))) && (boardlimit&(1<<(6-1))))
                        {
                                document.write("readonly.gif title=只读论坛");
                        }
                        else
                        {
                                if(boardlimit&(1<<(2-1)))
                                {
                                        document.write("lock2.gif title=正式会员论坛");
                                }
                                else
                                {
                                        if(boardlimit&(1<<(1-1)))
                                        {
                                                document.write("lock1.gif title=注册认证论坛");
                                        }
                                        else
                                        {
                                                if(boardlimit&(1<<(9-1)))
                                                {
                                                        document.write("open.gif title=开放论坛");
                                                }
                                                else
                                                {
                                                        document.write("1.gif title=常规论坛");
                                                }
                                        }
                                }
                        }
                }
        }
        document.write("   <br>");
        if(lasttopicname == "" || lasttopicname==null)
        {
                document.write("主题:无");
        }
        else
        {
                if(strlength(lasttopicname)>50)lasttopicname = lefttrue(lasttopicname,50-3) + "."
                lasttopicname = htmlencode(lasttopicname);
                if(forumpass != "" || (boardlimit&(1<<(15-1))) || (boardlimit&(1<<(2-1))) || (boardlimit&(1<<(7-1))))
                {
                        document.write("主题:已设置为隐藏");
                        temp = 1;
                }
                else
                {
                        if(parseint(lastannounceid)==0){document.write("主题:" + htmlencode(lasttopicname));}
                        else{document.write("<font color=red>主题</font>:<a href=a/a.asp?b=" + boardid + "&id=" + lastannounceid + "&aupflag=1&anum=1><u>" + htmlencode(lasttopicname) + "</u></a>");}
                }
        }
        document.write("<font color=green>版归</font>:");
        document.write(boardintro);
                document.write("</fieldset></td></tr>");
}

原帖地址:http://www.leadbbs.com/a/a.asp?b=10&id=2520013
欢迎光临:逐梦论坛

TOP

sql////////////////

TOP

返回列表

Powered by Discuz! 7.2   论坛QQ群:逐梦论坛群

© 2001-2021 Comsenz Inc. 鲁公网安备 37120302000001号