近日看到网上流行的瀑布流,也参照改了下,但是网上的forumdisplay_list.htm都是全部替换form表单里的所有项,直接影响到的是非图片版帖子列表界面,其实没必要把form表单里的所有项都替换,仅替换“else if 图片部分+分页”部分即可。
$ {! C9 k M* J. g9 k8 o
为了完整方法跟其他帖写的都一样,为方便新手,操作如下:
( A5 s5 W+ h6 b8 w% i+ S* u# n2 d: I; B9 N7 s2 ~8 q- Q
1、将qing模板目录下\image\redef.js移动至正在使用模板的图片存放目录,同时将qing模板中的bg_waterfall.png、bg_pgbtn.png移动至当前模板图片目录。
/ D9 a' y% k1 S2 O2、模板目录下增加common\extend_common.css,其内容如下:
6 \* e, P1 U. z, _5 r( H/ T- /* 大分页按钮 by Pony 1203121325 */( o9 H% i- X+ v4 O* B
- .pgbtn { margin: 5px 0 10px; }0 J& Z; }. [# I& f5 c& M% M/ T
- .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; }
. ]0 U6 `$ B" Q9 A - .pgbtn a:hover { border-color: #BABABA; text-decoration: none; }
$ ]3 _+ C5 l8 ]' w" R" U# u d - .pgbtn a:active { background: #EEE; border-color: #D0D0D0; box-shadow: none; }3 A3 m! Q, d. P5 a
- U$ ~% N" ^+ @
- /* 瀑布流布局 by Pony 1204121803 */( V$ t$ Q+ g% e* h% |/ U
- .waterfall { position: relative; margin-top: 15px; }: W9 R5 M1 j0 U, u+ Q
- .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%; }
4 U6 [7 x8 |/ n! d5 C! I - .waterfall .c, .waterfall h3 { padding: 10px; border: solid #EAEAEA; border-width: 0 1px; background-color: #F8F8F8; }
, S2 z: F" x$ S6 I - .waterfall .c { overflow: hidden; padding-bottom: 0; max-height: 800px; } [/ T% x8 N0 I! I% z1 a8 F
- .waterfall .c .nopic { display: block; background:{WRAPBG} url({IMGDIR}/nophototiny.png) no-repeat 50% 50%; cursor: pointer; }8 [( ]! ~* }' ~9 |2 v
- .waterfall .auth { padding: 0 10px 10px; border-width: 0 1px 1px; border-style: solid; border-color: transparent #EAEAEA #B9B9B9; background: #F8F8F8; }2 {% H( Z6 V' `8 C
- .waterfall .auth img { display: inline-block; margin: 0 1px; }
6 G* M h7 c# Z2 W) O; s
复制代码3、拷贝qing\forum\forumdisplay_list.htm文件里的“else if 图片部分+分页”替换default里的forumdisplay_list.htm的相应图片部分(
即从<!-- end of table "forum_G[fid]" branch 2/3 --> 开始到</form>结束)。[code]
7 g$ {9 t; [: G, w9 \3 Z$ H3 h% a
<!--{else}-->
% u+ j# M$ n5 O7 W' c: h+ _, y</table><!-- end of table "forum_G[fid]" branch 2/3 -->
# |! t/ g1 G9 U. I7 i( ]& F<ul id="waterfall" class="ml waterfall cl">
+ H5 i" F3 N! v' t1 x1 N; [* i, I
<!--{loop $_G['forum_threadlist'] $key $thread}-->
1 _9 v7 D0 M) V+ D<!--{if !$thread['forumstick'] && ($thread['isgroup'] == 1 || $thread['fid'] != $_G['fid'])}-->
- y: S( j0 R4 J* _, C<!--{if $thread['related_group'] == 0 && $thread['closed'] > 1}-->
' }& _) `0 x r a<!--{eval $thread[tid]=$thread[closed];}-->
- f& w, [* |0 f
<!--{/if}-->
4 u: ]6 E) c' K) {$ R<!--{/if}-->
1 _+ k0 g8 g( D* H/ Y9 D' f% M
<!--{eval $waterfallwidth = $_G[setting][forumpicstyle][thumbwidth] + 24; }-->
; `1 G2 \ F7 u- Q) L, z% h: h: ~3 r5 ~
<li style="width:{$waterfallwidth}px;">
. |7 Z6 [# t* U+ H9 ~5 c" F, G! ]<!--{if !$_GET['archiveid'] && $_G['forum']['ismoderator']}-->
) Z+ Z5 o* a3 ~$ }, ?% u( K
<div style="position:absolute;margin:1px;padding:2px;background:#FFF">
% { C( O7 ?$ ~1 u) k0 f$ ? c, w
<!--{if $thread['fid'] == $_G[fid]}-->
" R1 C# J; P% q) t% @ \. U<!--{if $thread['displayorder'] <= 3 || $_G['adminid'] == 1}-->
' E3 j0 n/ e2 b' Y! j
<input onclick="tmodclick(this)" type="checkbox" name="moderate[]" value="$thread[tid]" />
+ ~. v! S G Q1 o8 q
<!--{else}-->
2 U8 r7 L, o# `: x+ w* w
<input type="checkbox" disabled="disabled" />
1 w8 Q8 ^9 F. m0 A: f* \<!--{/if}-->
! Y, A+ S8 O# \7 k
<!--{else}-->
* M: }, J% _; E
<input type="checkbox" disabled="disabled" />
' I8 |" r! o6 \5 `
<!--{/if}-->
5 R% p, u3 [7 u( X# g; a
</div>
# g+ J/ `+ Z' |) _1 v0 J
<!--{/if}-->
+ l7 N% B3 Z: y9 t7 l. G/ h: m
<div class="c cl">
( f5 B0 @ h! c G$ A! q8 V5 m<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">
! ~ ] I' L2 E. v& S6 ]
<!--{if $thread['cover']}-->
7 v) W2 f8 M, ?4 K: |* {' t<img src="$thread[coverpath]" alt="$thread[subject]" width="{$_G[setting][forumpicstyle][thumbwidth]}" />
9 G( ]& }7 e; U2 v% g8 Y<!--{else}-->
& _( U' e3 p9 U2 |# h
<span class="nopic" style="width:{$_G[setting][forumpicstyle][thumbwidth]}px; height:{$_G[setting][forumpicstyle][thumbwidth]}px;"></span>
, x* b# U7 Q8 F: m# p
<!--{/if}-->
2 ~. f. f, {, Q: U8 ]</a>
8 v ~, J: |% B; [2 [& V b: N6 y7 G
</div>
8 X5 M4 p6 U5 ^6 N9 n
<h3 class="xw0">
/ |/ b" [9 d. y% t1 v, @: M<!--{hook/forumdisplay_thread $key}-->
4 V4 s0 w0 n* h+ n0 y
<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>
) k% e l& o! _</h3>
/ V# Q# Z# E! M4 X
<div class="auth cl">
]) R6 x% e: m7 F# ] E8 S( \<cite class="xg1 y">
2 ?' J, q' u' \3 V4 @. f
{echo '喜欢'}: <!--{if $thread[recommends]}-->$thread[recommends]<!--{else}-->0<!--{/if}-->
# ^ d) V9 ?& Y4 }
{lang reply}: <a href="forum.php?mod=viewthread&tid=$thread[tid]&extra=$extra" title="$thread[replies] {lang reply}">$thread[replies]</a>
% k2 {) X$ I B; `* T: [
</cite>
3 G- U3 m( l" j3 u) D0 h. A9 o
<!--{hook/forumdisplay_author $key}-->
: n; m* k U' U1 b# K* W2 ]<!--{if $thread['authorid'] && $thread['author']}-->
1 ^8 W! ]& n4 V: t( ^
<a href="home.php?mod=space&uid=$thread[authorid]">$thread[author]</a><!--{if !empty($verify[$thread['authorid']])}--> $verify[$thread[authorid]]<!--{/if}-->
+ h3 R, d: N7 u. Z, O- a: w
<!--{else}-->
4 @+ L/ E5 ] a/ V
$_G[setting][anonymoustext]
4 V" a8 ]' l/ W _* I7 i# B% y<!--{/if}-->
: U6 T2 H' f6 U
</div>
( f5 r' T# i$ N& N p</li>
: U$ S+ I, {7 l5 l; a
<!--{/loop}-->
/ U9 P6 Y4 g) m7 \
</ul>
8 P# v) D( R6 l3 M. e: G<div id="tmppic" style="display: none;"></div>
7 M% d$ x) q2 ]' r4 v<script type="text/javascript" src="$_G['style']['styleimgdir']/redef.js?{VERHASH}"></script>
" F& Z4 {) t" Y
<script type="text/javascript" reload="1">
! k% O$ p# o' H) h/ lvar wf = {};
4 m$ a+ C! W; Q' B/ \7 q4 t) O) t
_attachEvent(window, "load", function () {
' q, ^4 C+ P; l* e- }if($("waterfall")) {
) E6 w) a, @. O+ A4 D4 l2 ?* |
wf = waterfall();
4 V; d3 P$ Y+ W- g$ ?}
5 p2 p' i9 `; X, h& z
. j# p& F3 y* U4 w7 U l<!--{if $page < $_G['page_next'] && !$subforumonly}-->
/ |1 i: i4 h7 L1 c. [1 ?9 Hvar page = $page + 1,
4 o4 p1 T" I) r" e0 Vmaxpage = $page + 10,
& L9 [4 w8 [: o5 c4 e& R
stopload = 0,
* R1 h1 d. D9 ` H1 F" Q( Y
scrolltimer = null,
% R& D7 T% x' K2 m7 V( V
tmpelems = [],
$ @/ i6 ^3 S& t( X8 d8 e- L ltmpimgs = [],
& ]' H/ M& e# N5 g/ Dmarkloaded = [],
7 w, k: E! I) j$ u% ~( g
imgsloaded = 0,
' w" o+ r( |- D3 J0 w+ c% v$ P
loadready = 0,
1 `& B) r! X3 Y
showready = 1,
& n" B- e8 Y4 p2 m- b7 B; U, Anxtpgurl = 'forum.php?mod=forumdisplay&fid={$_G[fid]}&filter={$filter}&orderby={$_GET[orderby]}{$forumdisplayadd