本帖最后由 weblove26 于 2012-6-2 17:11 编辑
近日看到网上流行的瀑布流,也参照改了下,但是网上的forumdisplay_list.htm都是全部替换form表单里的所有项,直接影响到的是非图片版帖子列表界面,其实没必要把form表单里的所有项都替换,仅替换“else if 图片部分+分页”部分即可。
为了完整方法跟其他帖写的都一样,为方便新手,操作如下:
1、将qing模板目录下\image\redef.js移动至正在使用模板的图片存放目录,同时将qing模板中的bg_waterfall.png、bg_pgbtn.png移动至当前模板图片目录。
2、模板目录下增加common\extend_common.css,其内容如下:- /* 大分页按钮 by Pony 1203121325 */
- .pgbtn { margin: 5px 0 10px; }
- .pgbtn a { display: block; height: 40px; line-height: 40px; letter-spacing: 5px; text-align: center; border: 1px solid #DCDCDC; background: #F5F5F5 url({STYLEIMGDIR}/bg_pgbtn.png) repeat-x 0 0; font-size: 14px; outline: none; border-radius: 5px; box-shadow: 0 1px 0 #F5F5F5; }
- .pgbtn a:hover { border-color: #BABABA; text-decoration: none; }
- .pgbtn a:active { background: #EEE; border-color: #D0D0D0; box-shadow: none; }
- /* 瀑布流布局 by Pony 1204121803 */
- .waterfall { position: relative; margin-top: 15px; }
- .waterfall li { margin: 0 10px 10px 0; padding: 0 0 3px; text-align: left; border-width: 1px 0 0; border-top: 1px solid #EAEAEA; background: url({STYLEIMGDIR}/bg_waterfall.png) no-repeat 100% 100%; }
- .waterfall .c, .waterfall h3 { padding: 10px; border: solid #EAEAEA; border-width: 0 1px; background-color: #F8F8F8; }
- .waterfall .c { overflow: hidden; padding-bottom: 0; max-height: 800px; }
- .waterfall .c .nopic { display: block; background:{WRAPBG} url({IMGDIR}/nophototiny.png) no-repeat 50% 50%; cursor: pointer; }
- .waterfall .auth { padding: 0 10px 10px; border-width: 0 1px 1px; border-style: solid; border-color: transparent #EAEAEA #B9B9B9; background: #F8F8F8; }
- .waterfall .auth img { display: inline-block; margin: 0 1px; }
复制代码 3、拷贝qing\forum\forumdisplay_list.htm文件里的“else if 图片部分+分页”替换default里的forumdisplay_list.htm的相应图片部分(即从<!-- end of table "forum_G[fid]" branch 2/3 --> 开始到</form>结束)。[code]<!--{else}-->
</table><!-- end of table "forum_G[fid]" branch 2/3 -->
<ul id="waterfall" class="ml waterfall cl">
<!--{loop $_G['forum_threadlist'] $key $thread}-->
<!--{if !$thread['forumstick'] && ($thread['isgroup'] == 1 || $thread['fid'] != $_G['fid'])}-->
<!--{if $thread['related_group'] == 0 && $thread['closed'] > 1}-->
<!--{eval $thread[tid]=$thread[closed];}-->
<!--{/if}-->
<!--{/if}-->
<!--{eval $waterfallwidth = $_G[setting][forumpicstyle][thumbwidth] + 24; }-->
<li style="width:{$waterfallwidth}px;">
<!--{if !$_GET['archiveid'] && $_G['forum']['ismoderator']}-->
<div style="position:absolute;margin:1px;padding:2px;background:#FFF">
<!--{if $thread['fid'] == $_G[fid]}-->
<!--{if $thread['displayorder'] <= 3 || $_G['adminid'] == 1}-->
<input onclick="tmodclick(this)" type="checkbox" name="moderate[]" value="$thread[tid]" />
<!--{else}-->
<input type="checkbox" disabled="disabled" />
<!--{/if}-->
<!--{else}-->
<input type="checkbox" disabled="disabled" />
<!--{/if}-->
</div>
<!--{/if}-->
<div class="c cl">
<a href="forum.php?mod=viewthread&tid=$thread[tid]&{if $_GET['archiveid']}archiveid={$_GET['archiveid']}&{/if}extra=$extra" {if $thread['isgroup'] == 1 || $thread['forumstick'] || CURMODULE == 'guide'} target="_blank"{else} onclick="atarget(this)"{/if} title="$thread[subject]" class="z">
<!--{if $thread['cover']}-->
<img src="$thread[coverpath]" alt="$thread[subject]" width="{$_G[setting][forumpicstyle][thumbwidth]}" />
<!--{else}-->
<span class="nopic" style="width:{$_G[setting][forumpicstyle][thumbwidth]}px; height:{$_G[setting][forumpicstyle][thumbwidth]}px;"></span>
<!--{/if}-->
</a>
</div>
<h3 class="xw0">
<!--{hook/forumdisplay_thread $key}-->
<a href="forum.php?mod=viewthread&tid=$thread[tid]&{if $_GET['archiveid']}archiveid={$_GET['archiveid']}&{/if}extra=$extra"$thread[highlight]{if $thread['isgroup'] == 1 || $thread['forumstick']} target="_blank"{else} onclick="atarget(this)"{/if} title="$thread[subject]">$thread[subject]</a>
</h3>
<div class="auth cl">
<cite class="xg1 y">
{echo '喜欢'}: <!--{if $thread[recommends]}-->$thread[recommends]<!--{else}-->0<!--{/if}-->
{lang reply}: <a href="forum.php?mod=viewthread&tid=$thread[tid]&extra=$extra" title="$thread[replies] {lang reply}">$thread[replies]</a>
</cite>
<!--{hook/forumdisplay_author $key}-->
<!--{if $thread['authorid'] && $thread['author']}-->
<a href="home.php?mod=space&uid=$thread[authorid]">$thread[author]</a><!--{if !empty($verify[$thread['authorid']])}--> $verify[$thread[authorid]]<!--{/if}-->
<!--{else}-->
$_G[setting][anonymoustext]
<!--{/if}-->
</div>
</li>
<!--{/loop}-->
</ul>
<div id="tmppic" style="display: none;"></div>
<script type="text/javascript" src="$_G['style']['styleimgdir']/redef.js?{VERHASH}"></script>
<script type="text/javascript" reload="1">
var wf = {};
_attachEvent(window, "load", function () {
if($("waterfall")) {
wf = waterfall();
}
<!--{if $page < $_G['page_next'] && !$subforumonly}-->
var page = $page + 1,
maxpage = $page + 10,
stopload = 0,
scrolltimer = null,
tmpelems = [],
tmpimgs = [],
markloaded = [],
imgsloaded = 0,
loadready = 0,
showready = 1,
nxtpgurl = 'forum.php?mod=forumdisplay&fid={$_G[fid]}&filter={$filter}&orderby={$_GET[orderby]}{$forumdisplayadd |