近日看到网上流行的瀑布流,也参照改了下,但是网上的forumdisplay_list.htm都是全部替换form表单里的所有项,直接影响到的是非图片版帖子列表界面,其实没必要把form表单里的所有项都替换,仅替换“else if 图片部分+分页”部分即可。
" `- s) Q/ Q9 C1 V8 C为了完整方法跟其他帖写的都一样,为方便新手,操作如下:
9 ]" X$ V; |6 p, G
5 S. Y$ [0 P o5 }1 w% J; ?1、将qing模板目录下\image\redef.js移动至正在使用模板的图片存放目录,同时将qing模板中的bg_waterfall.png、bg_pgbtn.png移动至当前模板图片目录。
9 U1 f+ E) p; ~. }4 t7 ~2、模板目录下增加common\extend_common.css,其内容如下:
4 H' j8 D3 H V! H, D- /* 大分页按钮 by Pony 1203121325 */: N/ V: T" e0 C' E! r( ]
- .pgbtn { margin: 5px 0 10px; }
3 _, S! N6 F: j- l - .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; }
% W. N# m+ E* S8 r4 W9 F% k - .pgbtn a:hover { border-color: #BABABA; text-decoration: none; }
# O0 Q- ?; N1 n. w3 x& L - .pgbtn a:active { background: #EEE; border-color: #D0D0D0; box-shadow: none; }
1 b! ?, W3 g1 H8 h: n1 s - % {4 }" r( q6 D4 }. E7 P
- /* 瀑布流布局 by Pony 1204121803 */3 E/ s9 F" \ s* g9 d0 q0 S6 R2 }
- .waterfall { position: relative; margin-top: 15px; }
- u3 K5 u! \) [3 L; k5 s6 X - .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%; }3 t' L1 F: I( r
- .waterfall .c, .waterfall h3 { padding: 10px; border: solid #EAEAEA; border-width: 0 1px; background-color: #F8F8F8; }4 x+ D: g3 W- }1 a9 m3 ~- p
- .waterfall .c { overflow: hidden; padding-bottom: 0; max-height: 800px; }
1 \. D% ~- M3 q% C- ^( Z& J - .waterfall .c .nopic { display: block; background:{WRAPBG} url({IMGDIR}/nophototiny.png) no-repeat 50% 50%; cursor: pointer; }
* h8 @% s" |% H7 m, \! `7 P( |" W - .waterfall .auth { padding: 0 10px 10px; border-width: 0 1px 1px; border-style: solid; border-color: transparent #EAEAEA #B9B9B9; background: #F8F8F8; }
4 W# I: A' m: h8 B8 e* V2 N - .waterfall .auth img { display: inline-block; margin: 0 1px; }! @5 `% z' J1 x# \" U
复制代码3、拷贝qing\forum\forumdisplay_list.htm文件里的“else if 图片部分+分页”替换default里的forumdisplay_list.htm的相应图片部分(
即从<!-- end of table "forum_G[fid]" branch 2/3 --> 开始到</form>结束)。[code]
' S* i3 h% P% @2 q7 K
<!--{else}-->
& D6 i5 j: o3 _6 G" A( D</table><!-- end of table "forum_G[fid]" branch 2/3 -->
* @9 D; U- @& j+ L7 e<ul id="waterfall" class="ml waterfall cl">
% k3 N* S! q3 S4 P4 r# N6 W: H& j<!--{loop $_G['forum_threadlist'] $key $thread}-->
/ D* ^0 K6 O1 J, B* ^: U$ q5 Y4 G" b
<!--{if !$thread['forumstick'] && ($thread['isgroup'] == 1 || $thread['fid'] != $_G['fid'])}-->
+ c }, ?) S3 P% w# S<!--{if $thread['related_group'] == 0 && $thread['closed'] > 1}-->
+ x0 @ g; q7 a<!--{eval $thread[tid]=$thread[closed];}-->
% O4 M" L6 s+ V& y: g" N* ?# }5 H<!--{/if}-->
" @5 h$ Z _% m<!--{/if}-->
: Y* y( D$ S. m* y' z4 W) F<!--{eval $waterfallwidth = $_G[setting][forumpicstyle][thumbwidth] + 24; }-->
4 n3 ~% }2 U' E# E1 ?/ p o
<li style="width:{$waterfallwidth}px;">
- y4 n; p& Q6 ?/ h& R% h2 I" a' i/ |<!--{if !$_GET['archiveid'] && $_G['forum']['ismoderator']}-->
4 v; J# B# b' A2 h# ^" m S" @1 W
<div style="position:absolute;margin:1px;padding:2px;background:#FFF">
8 j1 L8 i* r; f) d4 r, u8 K4 |<!--{if $thread['fid'] == $_G[fid]}-->
$ }0 b# L$ I) o+ |8 @
<!--{if $thread['displayorder'] <= 3 || $_G['adminid'] == 1}-->
" Q! a0 Y, |! B
<input onclick="tmodclick(this)" type="checkbox" name="moderate[]" value="$thread[tid]" />
# z) O! G4 N; i6 Q( @) L<!--{else}-->
9 H% K% D* P, `- d% Q* u6 m( j<input type="checkbox" disabled="disabled" />
, d% m1 D" |1 L x8 E
<!--{/if}-->
. s; m4 D( N) [8 @' T
<!--{else}-->
: Q8 i8 X# R$ d; W& c
<input type="checkbox" disabled="disabled" />
7 D9 D% a3 P" ?2 o7 O/ t% l$ \: h+ l<!--{/if}-->
7 Y/ @' C/ Y9 j0 _/ K! X</div>
$ L8 F+ c/ i* U/ T4 c1 s
<!--{/if}-->
& i) R; B2 U2 {: U
<div class="c cl">
$ j" S6 L: P _4 q. A6 P, r<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">
4 l, O* I" p$ s- i/ W+ B) d3 Q
<!--{if $thread['cover']}-->
6 P/ z8 i1 O4 U8 F
<img src="$thread[coverpath]" alt="$thread[subject]" width="{$_G[setting][forumpicstyle][thumbwidth]}" />
$ S3 {/ D: }) C* m$ k7 k$ [4 Y
<!--{else}-->
, f5 ~; s) Q! g G$ _3 F
<span class="nopic" style="width:{$_G[setting][forumpicstyle][thumbwidth]}px; height:{$_G[setting][forumpicstyle][thumbwidth]}px;"></span>
/ e0 g$ w3 @/ X% x
<!--{/if}-->
7 P: V" {7 m0 s3 Z G
</a>
- v4 U4 o/ ^& y* r9 L
</div>
. g' z( F! A8 J! P<h3 class="xw0">
( q% R& e @4 [7 m
<!--{hook/forumdisplay_thread $key}-->
2 y$ y: c$ R5 w2 @( j4 a2 U5 s! J
<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>
' {7 Z0 I, j5 W0 d1 W) g1 |+ E$ R
</h3>
! g4 n1 Z" K/ [& l5 s<div class="auth cl">
; y2 U& O7 M. b& d; U+ M" j! W) g* K4 H
<cite class="xg1 y">
" y5 v: y- b- _8 i
{echo '喜欢'}: <!--{if $thread[recommends]}-->$thread[recommends]<!--{else}-->0<!--{/if}-->
9 V* U2 s0 K. M/ I/ ]/ |{lang reply}: <a href="forum.php?mod=viewthread&tid=$thread[tid]&extra=$extra" title="$thread[replies] {lang reply}">$thread[replies]</a>
1 t) E; r! x- M5 J$ j
</cite>
: b4 t+ @" n5 X6 p$ K5 ?8 v
<!--{hook/forumdisplay_author $key}-->
; c! `- ?8 k) ~( Y
<!--{if $thread['authorid'] && $thread['author']}-->
$ m7 v; `9 B( Y9 ^, p: s
<a href="home.php?mod=space&uid=$thread[authorid]">$thread[author]</a><!--{if !empty($verify[$thread['authorid']])}--> $verify[$thread[authorid]]<!--{/if}-->
+ X& \; g( l" f6 d4 G. U) S
<!--{else}-->
' \* e- g) V5 r+ B: O- y7 a
$_G[setting][anonymoustext]
/ Y; Z" j/ |5 A9 g+ O, R$ M% m( H<!--{/if}-->
# c& u% x/ ?& _- B; b
</div>
! t: u7 l4 C5 R& `, K* Z</li>
, _) E) X: L2 x0 B1 ?% h8 D
<!--{/loop}-->
: g, W; E5 w% v. Z% A3 L</ul>
$ v, s% C$ n7 B9 r
<div id="tmppic" style="display: none;"></div>
0 q" V3 Z8 ]+ n6 E2 ^
<script type="text/javascript" src="$_G['style']['styleimgdir']/redef.js?{VERHASH}"></script>
7 o$ a# w- b, V. r1 @9 w<script type="text/javascript" reload="1">
. R' n2 X# W# {
var wf = {};
( G r( M9 g8 ~) k$ B
C6 G* b( H* [
_attachEvent(window, "load", function () {
/ |+ U( H; s& N. Z+ i+ b7 f) W9 h
if($("waterfall")) {
$ b3 M& s8 u! I0 `% F* J1 owf = waterfall();
S) d9 M j# m
}
0 w6 \+ T8 w2 C9 W% g) `
) ?+ P2 c3 S% b7 ~ @<!--{if $page < $_G['page_next'] && !$subforumonly}-->
, d. I6 c Y0 q! t" p8 R- ?var page = $page + 1,
) G! @/ T2 q9 s& C" Y cmaxpage = $page + 10,
8 q6 k3 M) {* c, C' D4 \5 {4 cstopload = 0,
/ Z1 q( H H% S2 m
scrolltimer = null,
4 q9 J' C2 r+ D! Ntmpelems = [],
# t+ Q6 M. I# Rtmpimgs = [],
$ w% ]/ Q* ~5 a0 N2 Imarkloaded = [],
$ F4 T- l/ o5 o9 Z
imgsloaded = 0,
2 H7 G" Y7 c9 h0 u: I4 Y' m1 E
loadready = 0,
3 J+ J$ v! w& W0 t: c: pshowready = 1,
0 e6 Q1 E- K2 S# [% ]* ]nxtpgurl = 'forum.php?mod=forumdisplay&fid={$_G[fid]}&filter={$filter}&orderby={$_GET[orderby]}{$forumdisplayadd