近日看到网上流行的瀑布流,也参照改了下,但是网上的forumdisplay_list.htm都是全部替换form表单里的所有项,直接影响到的是非图片版帖子列表界面,其实没必要把form表单里的所有项都替换,仅替换“else if 图片部分+分页”部分即可。
1 z# a+ ~' ~& Z! R6 v为了完整方法跟其他帖写的都一样,为方便新手,操作如下:
& d2 t1 i; y6 ]. S& Q
7 C0 [8 G: `) f! w1、将qing模板目录下\image\redef.js移动至正在使用模板的图片存放目录,同时将qing模板中的bg_waterfall.png、bg_pgbtn.png移动至当前模板图片目录。
7 ?8 \6 o, A" l2 n' f2、模板目录下增加common\extend_common.css,其内容如下:
- 2 x8 L& n/ |- H2 C
- /* 大分页按钮 by Pony 1203121325 */; M- F7 F) c) m$ O# |: R
- .pgbtn { margin: 5px 0 10px; }
$ r! a' v4 b; {" u - .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; }5 P5 [8 m4 O7 I6 d$ Q6 T
- .pgbtn a:hover { border-color: #BABABA; text-decoration: none; }
! }3 J% R% V* X - .pgbtn a:active { background: #EEE; border-color: #D0D0D0; box-shadow: none; }$ S8 R+ h; g% h0 t- `
/ E1 ?; D; z( t8 `- /* 瀑布流布局 by Pony 1204121803 */5 S/ R! j) J- U2 j4 x
- .waterfall { position: relative; margin-top: 15px; }
. t# z) t7 D1 q# 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%; } o0 C j, |& ^( s6 A+ |/ v% e
- .waterfall .c, .waterfall h3 { padding: 10px; border: solid #EAEAEA; border-width: 0 1px; background-color: #F8F8F8; }
# F5 G" M! |( u$ r' N9 U - .waterfall .c { overflow: hidden; padding-bottom: 0; max-height: 800px; }" k2 g/ b: _& _9 r0 s5 B9 E" H' P' M
- .waterfall .c .nopic { display: block; background:{WRAPBG} url({IMGDIR}/nophototiny.png) no-repeat 50% 50%; cursor: pointer; }
% [4 z# [# l. O9 e% T% B1 M - .waterfall .auth { padding: 0 10px 10px; border-width: 0 1px 1px; border-style: solid; border-color: transparent #EAEAEA #B9B9B9; background: #F8F8F8; }+ Y* h O. \* a# R
- .waterfall .auth img { display: inline-block; margin: 0 1px; }% B5 h6 s: x, ]2 E2 n
复制代码3、拷贝qing\forum\forumdisplay_list.htm文件里的“else if 图片部分+分页”替换default里的forumdisplay_list.htm的相应图片部分(
即从<!-- end of table "forum_G[fid]" branch 2/3 --> 开始到</form>结束)。[code]
9 P- `' V1 f! y4 }6 i7 f" e" w
<!--{else}-->
Z' @ y' Y. c! `- A) g$ ?" V( V* G: b
</table><!-- end of table "forum_G[fid]" branch 2/3 -->
4 `& m- o+ |; D/ X
<ul id="waterfall" class="ml waterfall cl">
) y! i5 n9 {: c& E3 ~
<!--{loop $_G['forum_threadlist'] $key $thread}-->
, n# W* o! X1 R$ J<!--{if !$thread['forumstick'] && ($thread['isgroup'] == 1 || $thread['fid'] != $_G['fid'])}-->
9 x+ `" W3 u2 N/ J+ Y% I
<!--{if $thread['related_group'] == 0 && $thread['closed'] > 1}-->
" X# k6 H( p9 P) n$ S% z
<!--{eval $thread[tid]=$thread[closed];}-->
* W- ~1 O( v/ o! [: s9 x
<!--{/if}-->
) V: c" A5 I! k* ^
<!--{/if}-->
# B( B2 x3 [9 o: `' F7 t3 G' P& w
<!--{eval $waterfallwidth = $_G[setting][forumpicstyle][thumbwidth] + 24; }-->
: I- \5 B0 T0 X/ Q; b<li style="width:{$waterfallwidth}px;">
0 Z4 s: K$ H4 Y5 I8 @4 E6 {
<!--{if !$_GET['archiveid'] && $_G['forum']['ismoderator']}-->
0 X9 }# d* r! U+ ~# I) e( Y" w( q<div style="position:absolute;margin:1px;padding:2px;background:#FFF">
& C6 y9 j& |) R6 ]; z e5 G" T0 u
<!--{if $thread['fid'] == $_G[fid]}-->
' F7 k% ~ \* f7 a
<!--{if $thread['displayorder'] <= 3 || $_G['adminid'] == 1}-->
4 Z: M, T+ b" C6 y I8 g5 z& T* P4 @<input onclick="tmodclick(this)" type="checkbox" name="moderate[]" value="$thread[tid]" />
; `3 K8 \. s1 w2 N8 \<!--{else}-->
3 T7 K5 W* L" N! Z* F<input type="checkbox" disabled="disabled" />
# m/ b, ^5 H4 i! }, y" {* v
<!--{/if}-->
9 Y) g) p1 V8 A
<!--{else}-->
. L6 P! t, K" p1 z6 b' e0 c! ~<input type="checkbox" disabled="disabled" />
0 H- p7 P% o \<!--{/if}-->
{: J0 m) g& X+ F: O5 g6 i) N</div>
9 o# ~9 q9 L: y9 v6 q/ H7 Q) Z( V
<!--{/if}-->
) k" N" v) H. g
<div class="c cl">
5 A) b2 y" U7 v
<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">
`. J& N: S0 V2 `8 M! u
<!--{if $thread['cover']}-->
9 p8 R5 Z; ?- K7 |( A/ B
<img src="$thread[coverpath]" alt="$thread[subject]" width="{$_G[setting][forumpicstyle][thumbwidth]}" />
. I- u9 O( g i; D, |<!--{else}-->
[2 Y; O/ r" O7 _0 ?6 j' k<span class="nopic" style="width:{$_G[setting][forumpicstyle][thumbwidth]}px; height:{$_G[setting][forumpicstyle][thumbwidth]}px;"></span>
( I4 |5 w5 U7 a' e! E<!--{/if}-->
5 C$ p3 H2 c5 ?- Y9 Y</a>
3 o/ C$ D/ u) S2 z3 ~, {4 `</div>
7 f9 ^. R& t3 p% o6 _8 O1 D; k<h3 class="xw0">
% K8 P; Y' d: I1 ^
<!--{hook/forumdisplay_thread $key}-->
; C+ ]; V$ }7 [% \* f# r5 r
<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>
& g1 V/ ~" z; y' D# t/ e</h3>
9 j% v2 R( v( {6 m+ e
<div class="auth cl">
, }, \( y o. K* I! T4 c& _<cite class="xg1 y">
9 t1 v0 H" D+ Y( v& s {2 ]{echo '喜欢'}: <!--{if $thread[recommends]}-->$thread[recommends]<!--{else}-->0<!--{/if}-->
r& ?7 B4 z7 e
{lang reply}: <a href="forum.php?mod=viewthread&tid=$thread[tid]&extra=$extra" title="$thread[replies] {lang reply}">$thread[replies]</a>
0 e/ j7 R) ^; |; g3 I
</cite>
* X7 X* C( H$ p% P3 o4 W
<!--{hook/forumdisplay_author $key}-->
% ]( m$ G$ w+ w1 z2 G2 y<!--{if $thread['authorid'] && $thread['author']}-->
( T; ~; r- b. U7 `! v1 O
<a href="home.php?mod=space&uid=$thread[authorid]">$thread[author]</a><!--{if !empty($verify[$thread['authorid']])}--> $verify[$thread[authorid]]<!--{/if}-->
0 _+ X* m+ r" b/ a( x, J<!--{else}-->
0 W1 t; D( H9 M8 _- q9 e$_G[setting][anonymoustext]
3 f0 m& n) Y* l/ l; x1 m6 t<!--{/if}-->
# i5 @* R" [2 c8 ]/ u
</div>
1 l/ I9 m3 w# j. C$ }: K% Y/ n
</li>
0 j- }9 n- ]. |: u' P
<!--{/loop}-->
6 O4 d( m v0 A</ul>
/ c0 @: b, c0 J" U3 {# \<div id="tmppic" style="display: none;"></div>
+ E0 ^7 B( j% |' k<script type="text/javascript" src="$_G['style']['styleimgdir']/redef.js?{VERHASH}"></script>
1 h' Y1 [% l6 _% m; X
<script type="text/javascript" reload="1">
: [2 c# J- M$ a; Svar wf = {};
; T7 U! i+ p- q4 D; I5 L4 L' Q0 S; h
# ^& g: f4 Z( K1 Z4 F3 C
_attachEvent(window, "load", function () {
8 ?9 Q( u) \# J( J1 G( M+ i: e
if($("waterfall")) {
" h% }; k$ U) T7 I k" M5 U
wf = waterfall();
- J# X5 O. N% |" d3 [
}
" k6 J% ^- |7 q. G
, x, d* {) H9 Z* ~<!--{if $page < $_G['page_next'] && !$subforumonly}-->
2 q6 S# `# V5 n, z. |7 l5 Svar page = $page + 1,
: X" k( p2 w7 W% G0 K [; vmaxpage = $page + 10,
! L# p, e# ]2 H6 I9 V+ Dstopload = 0,
, W c3 ~8 ~& s( X; K: Q6 Z( V
scrolltimer = null,
7 k/ d& W! s/ @1 p
tmpelems = [],
- |3 P: }% ]# x: m& }tmpimgs = [],
4 j$ ?& g( m& x! M- i
markloaded = [],
* \1 b! B! k! v0 |: Y, l2 ~imgsloaded = 0,
$ E% r" [ m; \! C# g" ]loadready = 0,
% I% |; t6 R3 Z0 [1 Q, E
showready = 1,
1 `0 ]. D2 q. f* ~
nxtpgurl = 'forum.php?mod=forumdisplay&fid={$_G[fid]}&filter={$filter}&orderby={$_GET[orderby]}{$forumdisplayadd