首页4格调用美化版
使用本插件需要增加的文件有:<BR><BR><BR><BR><UL type=1>
<LI>pic.php//调用论坛图片<SPAN class=t_tag onclick=tagshow(event) href=\"tag.php?name=%CA%FD%BE%DD\">数据</SPAN>,
<LI>list.gif 和listbg.gif //标题处的图片
<LI>focus.swf //调用图片的flash [此swf 与以往的大不相同,个人觉得更不错]</LI></UL>需修改的文件有:<BR>
<UL type=1>
<LI>index.php
<LI>discuz.htm</LI></UL><FONT color=navy>=======================开始增加和修改============================</FONT><BR>步骤:共分4步<BR>
<UL type=1>
<LI>将pic.php / list.gif / listbg.gif / focus.swf 按下载到的附件结构传到FTP(网站)<BR>其中:pic.php 在论坛根目录<BR>list.gif / listbg.gif / focus.swf 在images文件夹下
<LI>打开 index.php <BR>查找:
<DIV class=blockcode><SPAN class=headactions onclick=\"copycode($(\'code2\'));\">复制内容到剪贴板</SPAN>
<H5>代码:</H5><CODE id=code2>$rsshead = $rssstatus</CODE></DIV><FONT color=red>在之上加:</FONT>
<DIV class=blockcode><SPAN class=headactions onclick=\"copycode($(\'code3\'));\">复制内容到剪贴板</SPAN>
<H5>代码:</H5><CODE id=code3>//----首页四格代码开始<BR>$colorarray = array(\'\', \'red\', \'orange\', \'yellow\', \'green\', \'cyan\', \'blue\', \'purple\', \'gray\');<BR>//新贴<BR>$hack_cut_str = 26; //标题字数<BR>$hack_cut_strauthor = 9;<BR>$new_post_threadlist = array();<BR>$nthread = array();<BR>$query = $db->query(\"SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>\'$fid\' AND f.fid=t.fid AND f.fid not in (0) AND t.displayorder not in (-1,-2) ORDER BY t.dateline DESC LIMIT 0, 10\");<BR>while($nthread = $db->fetch_array($query)) {<BR>$nthread[\'forumname\'] = ereg_replace(\'<[^>]*>\',\'\',$nthread[\'name\']);<BR>$nthread[\'view_subject\'] = cutstr($nthread[\'subject\'],$hack_cut_str);<BR>$nthread[\'view_author\'] = cutstr($nthread[\'author\'],$hack_cut_strauthor);<BR>$nthread[\'date\']= gmdate(\"$dateformat $timeformat\", $nthread[\'dateline\'] + $timeoffset * 3600);<BR>$nthread[\'lastreplytime\']= gmdate(\"$dateformat $timeformat\", $nthread + ($timeoffset * 3600));<BR>if($nthread[\'highlight\']) {<BR> $string = sprintf(\'%02d\', $nthread[\'highlight\']);<BR> $stylestr = sprintf(\'%03b\', $string);<BR> $nthread[\'highlight\'] = \'style=\"\';<BR> $nthread[\'highlight\'] .= $stylestr ? \'font-weight: bold;\' : \'\';<BR> $nthread[\'highlight\'] .= $stylestr ? \'font-style: italic;\' : \'\';<BR> $nthread[\'highlight\'] .= $stylestr ? \'text-decoration: underline;\' : \'\';<BR> $nthread[\'highlight\'] .= $string ? \'color: \'.$colorarray[$string] : \'\';<BR> $nthread[\'highlight\'] .= \'\"\';<BR>} else {<BR> $nthread[\'highlight\'] = \'\';<BR>}<BR>$new_post_threadlist[] = $nthread;<BR>}<BR>//新回复<BR>$hack_cut_str = 26; //标题字数<BR>$hack_cut_strauthor = 9;<BR>$new_reply_threadlist = array();<BR>$rthread = array();<BR>$query = $db->query(\"SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>\'$fid\' AND f.fid=t.fidAND t.closed NOT LIKE \'moved|%\' AND t.replies !=0 AND f.fid not in (0) AND t.displayorder not in (-1,-2) ORDER BY t.lastpost DESC LIMIT 0, 10\");<BR>while($rthread = $db->fetch_array($query)) {<BR>$rthread[\'forumname\'] = ereg_replace(\'<[^>]*>\',\'\',$rthread[\'name\']);<BR>$rthread[\'view_subject\'] = cutstr($rthread[\'subject\'],$hack_cut_str);<BR>$rthread[\'view_lastposter\'] = cutstr($rthread[\'lastposter\'],$hack_cut_strauthor);<BR>$rthread[\'date\']= gmdate(\"$dateformat $timeformat\", $rthread[\'dateline\'] + $timeoffset * 3600);<BR>$rthread[\'lastreplytime\']= gmdate(\"$dateformat $timeformat\", $rthread + ($timeoffset * 3600));<BR>if($rthread[\'highlight\']) {<BR> $string = sprintf(\'%02d\', $rthread[\'highlight\']);<BR> $stylestr = sprintf(\'%03b\', $string);<BR> $rthread[\'highlight\'] = \'style=\"\';<BR> $rthread[\'highlight\'] .= $stylestr ? \'font-weight: bold;\' : \'\';<BR> $rthread[\'highlight\'] .= $stylestr ? \'font-style: italic;\' : \'\';<BR> $rthread[\'highlight\'] .= $stylestr ? \'text-decoration: underline;\' : \'\';<BR> $rthread[\'highlight\'] .= $string ? \'color: \'.$colorarray[$string] : \'\';<BR> $rthread[\'highlight\'] .= \'\"\';<BR>} else {<BR> $rthread[\'highlight\'] = \'\';<BR>}<BR>$new_reply_threadlist[] = $rthread;<BR>}<BR>//热帖<BR>$hack_cut_str = 26; //标题字数<BR>$hack_cut_strauthor = 9;<BR>$new_hot_threadlist = array();<BR>$mthread = array();<BR>$ctime=$timestamp-3600*24*7;//最后7是天数为本周<BR>$query = $db->query(\"SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>\'$fid\' AND f.fid=t.fidAND t.closed NOT LIKE \'moved|%\' AND t.replies !=0 AND t.dateline>$ctime AND f.fid not in (0) AND t.displayorder not in (-1,-2) ORDER BY t.replies DESC LIMIT 0, 10\");<BR>while($mthread = $db->fetch_array($query)) {<BR>$mthread[\'forumname\'] = ereg_replace(\'<[^>]*>\',\'\',$mthread[\'name\']);<BR>$mthread[\'view_subject\'] = cutstr($mthread[\'subject\'],$hack_cut_str);<BR>$mthread[\'view_lastposter\'] = cutstr($mthread[\'lastposter\'],$hack_cut_strauthor);<BR>$mthread[\'date\']= gmdate(\"$dateformat $timeformat\", $mthread[\'dateline\'] + $timeoffset * 3600);<BR>$mthread[\'lastreplytime\']= gmdate(\"$dateformat $timeformat\", $mthread + ($timeoffset * 3600));<BR>if($mthread[\'highlight\']) {<BR> $string = sprintf(\'%02d\', $mthread[\'highlight\']);<BR> $stylestr = sprintf(\'%03b\', $string);<BR> $mthread[\'highlight\'] = \'style=\"\';<BR> $mthread[\'highlight\'] .= $stylestr ? \'font-weight: bold;\' : \'\';<BR> $mthread[\'highlight\'] .= $stylestr ? \'font-style: italic;\' : \'\';<BR> $mthread[\'highlight\'] .= $stylestr ? \'text-decoration: underline;\' : \'\';<BR> $mthread[\'highlight\'] .= $string ? \'color: \'.$colorarray[$string] : \'\';<BR> $mthread[\'highlight\'] .= \'\"\';<BR>} else {<BR> $mthread[\'highlight\'] = \'\';<BR>}<BR>$new_hot_threadlist[] = $mthread;<BR>}<BR>//----首页四格代码结束</CODE></DIV>
<LI>打开 templates/default/discuz.htm <BR>查找:
<DIV class=blockcode><SPAN class=headactions onclick=\"copycode($(\'code4\'));\">复制内容到剪贴板</SPAN>
<H5>代码:</H5><CODE id=code4><div id=\"ad_text\"></div></CODE></DIV><FONT color=green>在之下加:</FONT>
<DIV class=blockcode><SPAN class=headactions onclick=\"copycode($(\'code5\'));\">复制内容到剪贴板</SPAN>
<H5>代码:</H5><CODE id=code5><!-- 首页四格代码开始 --><BR><div class=\"mainbox forumlist\" style=\"padding:0;\"><BR><table cellspacing=\"0\" cellpadding=\"0\"><BR><thead class=\"category\"><BR><tr><BR> <td align=\"center\" style=\"padding:0 1px 0 0\"><h3>≡ 论坛图片 ≡</h3></td><BR> <td align=\"center\" style=\"padding:0\"><h3>≡ 最新帖子 ≡</h3></td><BR> <td align=\"center\" style=\"padding:0 1px 0 1px\"><h3>≡ 最新回复 ≡</h3></td><BR> <td align=\"center\" style=\"padding:0\"><h3>≡ 本周热门 ≡</h3></td><BR></tr><BR></thead><BR><tr><BR> <td width=\"25%\"><BR><script type=\"text/javascript\" src=\"pic.php\"></script><BR> </td><BR> <td width=\"25%\"><BR><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><BR> <tr valign=\"top\"><BR><td width=\"24\" style=\"padding:0;border-top:0px;\"><img src=\"images/list.gif\" border=\"0\" /></td><BR><td background=\"images/listbg.gif\" style=\"line-height:20px;padding:0;border-top:0px;background-repeat: repeat-y\" width=\"100%\"><BR><!--{loop $new_post_threadlist $nthread}--><BR> <!--{if $nthread}--><BR><div style=\"overflow: hidden;height: 20px;width: 100%;\"><a href=\"viewthread.php?tid=$nthread\" $nthread[\'highlight\'] title=\'最新帖子 {LF}所在论坛: $nthread{LF}主题标题: $nthread {LF}主题作者: $nthread{LF}发表时间: $nthread{LF}浏览次数: $nthread 次 {LF}回复次数: $nthread 次{LF}最后回复: $nthread{LF}{lang lastpost}: $nthread\'>$nthread</a></div><BR> <!--{else}--><BR><div style=\"overflow: hidden;height: 20px;width: 100%;\"><a href=\"viewthread.php?tid=$nthread\" $nthread[\'highlight\'] title=\'最新帖子 {LF}所在论坛: $nthread{LF}主题标题: $nthread {LF}主题作者: $nthread{LF}发表时间: $nthread{LF}浏览次数: $nthread 次 {LF}回复次数: $nthread 次{LF}最后回复: 暂时没有回复\'>$nthread</a></div><BR> <!--{/if}--><BR><!--{/loop}--><BR></td><BR> </tr><BR></table><BR> </td><BR> <td width=\"25%\"><BR><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><BR> <tr valign=\"top\"><BR><td width=\"24\" style=\"padding:0;border-top:0px;\"><img src=\"images/list.gif\" border=\"0\" /></td><BR><td background=\"images/listbg.gif\" style=\"line-height:20px;padding:0;border-top:0px;background-repeat: repeat-y\" width=\"100%\"><BR><!--{loop $new_reply_threadlist $rthread}--><BR> <div style=\"overflow: hidden;height: 20px;width: 100%;\"><a href=\"viewthread.php?tid=$rthread\" $rthread[\'highlight\'] title=\'最新回复 {LF}所在论坛: $rthread{LF}主题标题: $rthread{LF}主题作者: $rthread{LF}发表时间: $rthread{LF}浏览次数: $rthread 次{LF}回复次数: $rthread 次{LF}最后回复: $rthread{LF}{lang lastpost}: $rthread\'>$rthread</a></div><BR><!--{/loop}--><BR></td><BR> </tr><BR></table><BR> </td><BR> <td width=\"25%\"><BR><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><BR> <tr valign=\"top\"><BR><td width=\"24\" style=\"padding:0;border-top:0px;\"><img src=\"images/list.gif\" border=\"0\" /></td><BR><td background=\"images/listbg.gif\" style=\"line-height:20px;padding:0;border-top:0px;background-repeat: repeat-y\" width=\"100%\"><BR><!--{loop $new_hot_threadlist $mthread}--><BR> <div style=\"overflow: hidden;height: 20px;width: 100%;\"><a href=\"viewthread.php?tid=$mthread\" $mthread[\'highlight\'] title=\'本周热门 {LF}所在论坛: $mthread{LF}主题标题: $mthread{LF}主题作者: $mthread{LF}发表时间: $mthread{LF}浏览次数: $mthread 次{LF}回复次数: $mthread 次{LF}最后回复: $mthread{LF}{lang lastpost}: $mthread\'>$mthread</a></div><BR><!--{/loop}--><BR></td><BR> </tr><BR></table><BR> </td><BR></tr><BR></table><BR></div><BR><!-- 首页四格代码结束 --></CODE></DIV>
<LI>上传刚才修改过的 index.php 及 discuz.htm</LI></UL>
<P></P>
页:
[1]
2