近日看到网上流行的瀑布流,也参照改了下,但是网上的forumdisplay_list.htm都是全部替换form表单里的所有项,直接影响到的是非图片版帖子列表界面,其实没必要把form表单里的所有项都替换,仅替换“else if 图片部分+分页”部分即可。
9 E3 U$ r% ?4 r0 K( L; S/ D, z为了完整方法跟其他帖写的都一样,为方便新手,操作如下:
3 {$ N9 ~& s- n m* ~7 @& G3 s! n3 u0 c
1、将qing模板目录下\image\redef.js移动至正在使用模板的图片存放目录,同时将qing模板中的bg_waterfall.png、bg_pgbtn.png移动至当前模板图片目录。
( m8 [) t2 j( \- @3 S9 s. L. e
2、模板目录下增加common\extend_common.css,其内容如下:
- , C1 i* [7 y8 S& x
- /* 大分页按钮 by Pony 1203121325 */$ N- N0 \; N, {% `
- .pgbtn { margin: 5px 0 10px; }) \: ~: Z, w0 H2 y( ^* }
- .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; } [* U8 W3 E2 O1 p5 l
- .pgbtn a:hover { border-color: #BABABA; text-decoration: none; }3 m5 f" g" g: S' O! P9 e J
- .pgbtn a:active { background: #EEE; border-color: #D0D0D0; box-shadow: none; }
' ]( {+ Y E4 u, c( J+ V. I - 0 g& R1 `) O8 X) I7 c+ E$ E
- /* 瀑布流布局 by Pony 1204121803 */
0 M# P' }8 h5 X& C' ]! A; O - .waterfall { position: relative; margin-top: 15px; }# w: C7 U F" f5 u2 k
- .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%; }- w' i0 Y; R9 z2 s. k
- .waterfall .c, .waterfall h3 { padding: 10px; border: solid #EAEAEA; border-width: 0 1px; background-color: #F8F8F8; }
9 ?7 q3 F- }& v) e8 Y - .waterfall .c { overflow: hidden; padding-bottom: 0; max-height: 800px; }
+ {; h( C+ l, }/ G; x: o) m - .waterfall .c .nopic { display: block; background:{WRAPBG} url({IMGDIR}/nophototiny.png) no-repeat 50% 50%; cursor: pointer; }
- i3 j9 L/ L) J: s+ `$ e2 |+ M - .waterfall .auth { padding: 0 10px 10px; border-width: 0 1px 1px; border-style: solid; border-color: transparent #EAEAEA #B9B9B9; background: #F8F8F8; }
& q& W W( R5 y+ b+ c% r- |! q z - .waterfall .auth img { display: inline-block; margin: 0 1px; }
& B# v; X. |, F
复制代码3、拷贝qing\forum\forumdisplay_list.htm文件里的“else if 图片部分+分页”替换default里的forumdisplay_list.htm的相应图片部分(
即从<!-- end of table "forum_G[fid]" branch 2/3 --> 开始到</form>结束)。[code]
9 _+ N4 b2 w' R; T<!--{else}-->
7 r' X0 B% w; x1 g$ j5 {
</table><!-- end of table "forum_G[fid]" branch 2/3 -->
X3 D9 a. ?6 X$ c9 _2 d<ul id="waterfall" class="ml waterfall cl">
2 {: {- X9 E. m' c+ T
<!--{loop $_G['forum_threadlist'] $key $thread}-->
1 T/ h6 q: u( ?- p2 Q& E) S5 m<!--{if !$thread['forumstick'] && ($thread['isgroup'] == 1 || $thread['fid'] != $_G['fid'])}-->
' T. P- t& R/ N2 ]<!--{if $thread['related_group'] == 0 && $thread['closed'] > 1}-->
- b/ L$ R7 d6 h' r! L# J; k# \" R<!--{eval $thread[tid]=$thread[closed];}-->
' {0 l( x& H9 } T( U& o<!--{/if}-->
) v p7 I, s$ r
<!--{/if}-->
0 o& `: x2 ~% q2 [<!--{eval $waterfallwidth = $_G[setting][forumpicstyle][thumbwidth] + 24; }-->
0 r7 R/ F0 I& N- |- e0 B<li style="width:{$waterfallwidth}px;">
6 [ c. D- d j: v
<!--{if !$_GET['archiveid'] && $_G['forum']['ismoderator']}-->
, {9 `% ^/ w6 \7 t; y( j<div style="position:absolute;margin:1px;padding:2px;background:#FFF">
2 A) m" ~* l9 j: P2 K& F* v<!--{if $thread['fid'] == $_G[fid]}-->
: n+ O8 h: n, Z5 Z( Y9 r<!--{if $thread['displayorder'] <= 3 || $_G['adminid'] == 1}-->
' `% u; H* Y( T5 T7 Z<input onclick="tmodclick(this)" type="checkbox" name="moderate[]" value="$thread[tid]" />
# t! e1 F8 F6 p5 j
<!--{else}-->
+ \) a: g* o5 _; q9 h
<input type="checkbox" disabled="disabled" />
& A0 d5 q3 v$ i, h/ E8 l
<!--{/if}-->
0 ^ J( i& S( K3 Q( L2 Y: w+ m$ u<!--{else}-->
5 X0 i8 Q! O4 F x. a) T
<input type="checkbox" disabled="disabled" />
! h# u1 K: F0 I6 k<!--{/if}-->
; ~% U# f. ~1 r- n4 M/ T</div>
& A' A" H( o v0 X' a( a$ `<!--{/if}-->
" ~+ f/ W- h3 w: Z* H* X! D4 V
<div class="c cl">
1 K' _0 L, P, ?3 w# i3 m1 [
<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">
- o( s# @ e- S
<!--{if $thread['cover']}-->
2 q8 I; r4 o6 Y, @
<img src="$thread[coverpath]" alt="$thread[subject]" width="{$_G[setting][forumpicstyle][thumbwidth]}" />
A* e0 {: H. T+ h ^5 y
<!--{else}-->
3 w u8 R9 h" P) S
<span class="nopic" style="width:{$_G[setting][forumpicstyle][thumbwidth]}px; height:{$_G[setting][forumpicstyle][thumbwidth]}px;"></span>
0 n- _ C W$ C6 Y. J<!--{/if}-->
0 q+ B/ E: E& t( @# W</a>
& D0 q7 A1 W6 N& a( T& J
</div>
5 Z8 x% W7 g2 t1 T7 h: x<h3 class="xw0">
* `$ Q4 G5 R1 F
<!--{hook/forumdisplay_thread $key}-->
- D/ J7 _: u3 L& k0 D0 h9 j0 o
<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>
1 H9 X4 Z9 F1 ]- G6 S1 i4 j$ K
</h3>
2 B2 N7 n R4 |$ e+ q<div class="auth cl">
L/ n1 r8 x9 {8 z<cite class="xg1 y">
9 ~, O8 u- Q+ K: V$ ?, T
{echo '喜欢'}: <!--{if $thread[recommends]}-->$thread[recommends]<!--{else}-->0<!--{/if}-->
* X! C* e( ~) n6 H% {$ c4 }; T{lang reply}: <a href="forum.php?mod=viewthread&tid=$thread[tid]&extra=$extra" title="$thread[replies] {lang reply}">$thread[replies]</a>
4 Z2 b. x0 r2 G( s/ `* N
</cite>
% D2 t0 G: l, m) e/ K* m- t; j* z
<!--{hook/forumdisplay_author $key}-->
# x' S$ S* W, g8 `& r6 e
<!--{if $thread['authorid'] && $thread['author']}-->
' w1 p8 O1 `0 `2 u<a href="home.php?mod=space&uid=$thread[authorid]">$thread[author]</a><!--{if !empty($verify[$thread['authorid']])}--> $verify[$thread[authorid]]<!--{/if}-->
: E+ [( D5 @3 N& J4 f0 @; U, A
<!--{else}-->
' e# |" k$ T8 ^$_G[setting][anonymoustext]
; E$ W; x8 u5 |( `" c8 S' @
<!--{/if}-->
" W& u( F# u5 z1 V: R1 a</div>
+ Y5 b- b5 P6 l M</li>
# K$ V) @9 p; M' B! U- {" R8 M<!--{/loop}-->
9 }7 M8 p5 X T. k1 _% u* t0 y</ul>
! `; b1 e) e l( M4 J
<div id="tmppic" style="display: none;"></div>
+ u- D2 H3 h# W* j! ]* m( a5 `2 J<script type="text/javascript" src="$_G['style']['styleimgdir']/redef.js?{VERHASH}"></script>
2 Z" z% H- @, x: S7 k4 S
<script type="text/javascript" reload="1">
4 p, K$ P6 K) I8 Z; R0 p
var wf = {};
, Y# N8 y7 B9 W
# v% r4 K8 G( K0 d. E_attachEvent(window, "load", function () {
" w% u$ g# ^; n8 j& i9 S- N- j
if($("waterfall")) {
+ s: ]6 ?# K ?) _( zwf = waterfall();
# ~6 s/ g w/ D7 i" i$ a3 C
}
3 b# z" V% H( i
x3 \8 p8 e" A/ J
<!--{if $page < $_G['page_next'] && !$subforumonly}-->
2 w& N3 q6 e. B/ S6 Y' @6 F4 tvar page = $page + 1,
5 E7 I' ^* t: ?) u6 Z) qmaxpage = $page + 10,
/ v2 k# ]" ~$ K" t
stopload = 0,
/ W% ~' }! F; C4 @' qscrolltimer = null,
1 W# _; r; K0 T/ u" G7 a
tmpelems = [],
0 n% h2 a( F6 Q2 Y1 m! T
tmpimgs = [],
% H5 e! |' l; U$ E& X
markloaded = [],
; b; |" [' T7 w, R1 \3 f
imgsloaded = 0,
) _! k* s1 l0 `0 U' t) H! x) j
loadready = 0,
( c& v8 K' g2 R: ]1 mshowready = 1,
7 c$ F" V) e znxtpgurl = 'forum.php?mod=forumdisplay&fid={$_G[fid]}&filter={$filter}&orderby={$_GET[orderby]}{$forumdisplayadd