登录
9 F# s& z D6 C9 S* P- U4 J' x
<a href="member.php?mod=logging&action=login" title="登录">登录</a>
: h9 ~7 r2 J- H( a/ H p( T
9 b1 X( |1 q/ G2 h
注册
# f2 J, n/ m3 \' z' ]0 B
<a href="member.php?mod=register" title="立即注册">立即注册</a>
. w; q, w) b5 q1 C; I
H! a# I0 K3 }/ Z
忘记密码
( \8 s* O" r8 m8 u8 C; Y* D- r
<a href="javascript:;" title="找回密码">找回密码</a>
) o- h1 `, J6 H) e) x1 x" H
3 ?% P! |8 W. r购买邀请码
E+ S1 y$ Y$ R
misc.php?mod=buyinvitecode
P- f' K2 q# ~2 S) U! l" R5 r- j5 T/ }
JS跳转
; V# B* f8 ]; T2 R H+ t4 oonclick="window.location.href='home.php?mod=mobile&do=friend';"
3 h, f( f* y* z! `% L, }
( e. e$ m8 u/ l! [) l9 M9 q
JS更换class的名称
7 a4 c4 p5 B' }/ m+ K
document.getElementById('idname').className='a';
' l" f! E9 j0 e" z8 Qdocument.getElementById('idname').style.display='block';
6 ]; g; n8 X7 J/ m
document.getElementById("idname").style.marginTop="30px";
Q2 w8 `% f7 B4 I, W& k
; {% p! |7 z) J" U4 l批量替换超链接:
/ V8 F. a9 O" j0 h2 m n
href="[^"]*"
$ \1 a; Y* l4 N* W! d& h; k' \7 M0 o8 G8 M& b2 b" H
过滤DZ代码:
/ }# g- y: c) [0 r7 [/ v' zpreg_replace ("/\[[a-z][^\]]*\]|\[\/[a-z]+\]/i",'',preg_replace("/\[attach\]\d+\[\/attach\]/i",'',$message));
% f" t4 _+ v l/ Q) [6 ?
" j3 A9 `+ }& c; K8 [: O! F
调用单个数据
7 D2 R2 d9 [& c( ? u5 v$a = DB::result(DB::query("SELECT qi FROM ".DB::table('abc')." WHERE id = '1'"));
7 u9 S9 w% W& \, a( o6 l7 H0 b. x a, r, s
调用统计数据
3 E. H- h0 N! H5 n/ S4 ?$a = DB::result(DB::query("SELECT count(*) FROM ".DB::table('abc')." WHERE id = '1'"));
8 m" k" R! _9 r* v1 I* H G m# f* ~9 A# O5 A, V
单数据表调用
3 r; }7 { p3 N9 ` A5 D/ ~$perpage = 20;
) o+ t5 U' }0 M& G# W% X
$curpage = empty ( $_GET['page'] ) ? 1 : intval ( $_GET['page'] );
) w, K" [/ d7 W1 A' I$start = ($curpage-1)*$perpage;
, h% L5 S' B3 F0 H4 g& ^4 h$askcount = DB::result(DB::query("SELECT COUNT(*) FROM ".DB::table('forum_thread')." WHERE fid = '2' AND authorid > 1"));
K1 D5 _: q8 X. V* J
//$asklist
* Q% {# G' N* T, @2 X8 f" r+ ]$asklist = array();
" E& m, c+ B4 M: k; m+ w1 D
if ($askcount) {
- v$ o) u/ G ~; p
$query = DB::query("SELECT * FROM ".DB::table('forum_thread')." WHERE fid = '2' AND displayorder > -1 ORDER BY tid ASC LIMIT $start,$perpage");
7 ~! u" w7 n3 W4 n t( z/ W while ($value = DB::fetch($query)) {
/ Q* |+ O3 F- ]8 K( F* x% } $asklist[] = $value;
) B0 P2 s* J$ A$ A& { }
3 e" b0 g: X" s. g: t}
6 X: ?7 ~2 t# l" P
$multi = multi($askcount, $perpage, $curpage, "这里填写跳转地址");
8 i: _7 X: C W/ K0 J
' [6 E9 i- q0 w, B- K! ~/ Q/ n& E( ]; v' c5 i' L
- s/ m2 x3 w& z' T$ W
多数据表调用
% h# A6 p( w$ {7 t- y- }9 A# x$perpage = 40;
% L* z" M& r: P
$curpage = empty ( $_GET['page'] ) ? 1 : intval ( $_GET['page'] );
$ R6 f6 V5 a" ]8 p+ \8 l$start = ($curpage-1)*$perpage;
4 _4 r' s# E6 i# i \3 U/ c- k3 Q3 A$acount = DB::result(DB::query("SELECT count(*) FROM ".DB::table('forum_forum')." b LEFT JOIN ".DB::table('forum_forumfield')." bf ON bf.fid=b.fid WHERE b.type='sub' AND b.status = 3 AND bf.icon != ''"));
. ~% I7 {8 h7 x0 a0 p
//$alist
* J+ z& `6 t' u. F
$alist = array();
- a4 L+ d" N3 B' Rif ($acount) {
2 H! ^9 u/ \0 ~) S: X; a5 C; X) U
$query = DB::query("SELECT bf.*, b.* FROM ".DB::table('forum_forum')." b LEFT JOIN ".DB::table('forum_forumfield')." bf ON bf.fid=b.fid WHERE b.type='sub' AND b.status = 3 AND bf.icon != '' ORDER BY bf.shoplevel DESC, b.commoncredits DESC, bf.fid DESC LIMIT $start,$perpage");
* D2 s4 M: n; [2 ~5 I; d3 z while ($value = DB::fetch($query)) {
3 A- @ A1 ?2 ?( D% ~! I
$alist[] = $value;
) s0 K1 G8 @ ] T: }4 k: d
}
% t" D2 E; p" y3 {0 G7 ~}
* h1 |" y/ {8 M; t' S, F% {7 g$multi = multi($acount, $perpage, $curpage, "这里填写跳转地址");
2 C6 P' w6 A3 J3 n+ ^& t8 y s, a {2 J/ h" T
5 y4 C' `2 i- P; w/ }* ?4 N7 ^' Y0 ~$ @7 D
前台数据显示
1 l$ H- ?3 U( W2 U4 S- y
<!--{loop $alist $key $value}-->
. c& U/ u0 K* T* Q' T U
<!--{eval $tupianfm = DB::result(DB::query("SELECT attachment FROM ".DB::table('forum_threadimage')." WHERE tid = '$value[tid]'"));}-->
; R) h7 I* P5 r. t' d+ {1 A, E; O
<img src="$tupianfm"><br>$value[authorid]
( M7 Z0 N8 n! i6 u v8 h" k
<!--{/loop}-->
: A+ s9 u- K% d3 L
9 D3 _2 T) ~ w
; _+ ^9 p8 k d/ `. V
取数据表中符合条件的第一条数据
" f+ \, X4 E" r, B% ~0 n$app=array();
: n2 c/ _1 f7 b$ ^# H3 u f$app=DB::fetch_first("select * from ".DB::table('abc')." where id='{$id}'");
2 X" r3 A9 {, F; w1 k% U% {, B$ X0 P7 x: ~% E0 C3 Q/ ^8 Q
1 y: o( s! L9 h
0 T7 O8 X% N) m) E人性化时间戳
& { t% o# k: J0 l6 \- K<!--{echo dgmdate(这里填写时间参数, 'u', '9999', getglobal('setting/dateformat'))}-->
4 U, l' Y: @/ L; N/ u& ]! _
<!--{echo date("Y-m/d H:i:s",这里填写时间参数)}-->
/ \- Z, c4 t2 {( r* V$ g- Q
6 V9 }' }$ I i; B4 A& Z' p3 B3 W
截取字符字数
* h2 ?: M9 a+ `+ u F9 _<!--{echo cutstr(这里填写参数,40)}-->
6 Y" k- T/ m; p" ]; ?
9 s. l c0 O8 ^3 e3 G, e# G# p& P' x7 `! a5 w+ S% e
过滤DISCUZ代码
) Z7 F2 U. ^. I+ c# n/ N! g( epreg_replace ("/\[[a-z][^\]]*\]|\[\/[a-z]+\]/i",'',preg_replace("/\[attach\]\d+\[\/attach\]/i",'',$message));
1 X! \) x1 w! l/ M1 ]0 |3 E/ _
( J( ?' \# u& }" Z" s
% b8 }& ~6 J& h; @6 o4 E6 i3 ~写入数据库
9 h3 J5 X( C; z1 e
if(submitcheck('tijiao')) {
3 T' H5 f" |+ Q( F $setarr = array(
- H/ Z; c: V3 ~8 V8 ?6 X
'tid' => $_GET['topicid'],
" ^: D3 ~& j4 r; o" C3 p9 N* O/ O 'name' => $_POST['name'],
$ e6 v1 O5 @+ N/ F$ L. k2 M4 J& w 'position' => $_GET['position'],
1 b; P2 W/ K( O 'dateline' => $_G['timestamp'],
O }$ B2 h4 Z
);
# _% M1 ^/ I' V7 K, L DB::insert('abc', $setarr, 1);
/ x& I X* x4 L4 e; i$ Q# |+ I $query = DB::query("UPDATE ".DB::table('abc')." SET stickreply='1' WHERE tid='$tid'");
3 W) H3 E8 w9 o+ R) c" E9 D/ `, @
$query = DB::query("DELETE FROM ".DB::table('abc')." WHERE pid='$pid'");
& Z- n, J$ g9 m showmessage('成功的提示信息', "跳转地址");
; `( t& g. f' R3 Y
}
1 _9 Y0 w3 w. Z. h) H' L) @0 d
; k$ ^+ H9 N8 d4 e: X5 F5 \- @ j1 C- |6 l+ |# z5 _
+ K2 T1 E( H$ W+ h表单提交:
6 ~7 S) r2 w Y# O& f1 b2 {<form action="do.php" method="post" autocomplete="off">
# ^% c% `3 q$ B' S. x N <input type="hidden" value="{FORMHASH}" name="formhash" />
3 f6 g8 D4 W$ w( \
最低奖金:<input name="qi" type="text" value="" />
8 S Q: m5 e2 j6 O& T; {
最高奖金:<input name="end" type="text" value="" />
) ?/ h! q6 O, c4 |: r4 E: ^' \$ q <button value="true" name="tijiao" type="submit">提交设置</button>
6 u- a' H0 v1 p, a6 C8 h- A. o8 j- M <input type="hidden" name="tijiao" value="true" />
0 _& v# B6 `/ ]
</form>
4 a' ^* r9 K6 A2 W7 _. T. n" T7 {+ D/ v- C/ `
* n, u' {4 `+ n. D
; k, B* X% u* ^9 d, G2 {+ G以下两个时间格式是对等关系
0 H8 W& M/ ?5 {4 T: b
date("Ymd",time()); 20150212
1 H9 X# t5 z5 [: k# B" T
FROM_UNIXTIME(dateline, '%Y%m%d')
/ r. r# G+ ?- N$ |) o" s# j
2 c! }2 ~$ w: J
前者用于PHP,后者用于数据库调用的字段的格式化
$ F, K3 l4 h2 o9 ` E) n% L: x/ H3 w3 ~% V$ T7 ^4 q0 u
调用图片附件
0 D+ l G" ^% a4 u9 c4 b<!--{eval $biaoid = substr($value[tid], -1); $cover = DB::result(DB::query("SELECT attachment FROM ".DB::table('forum_attachment_'.$biaoid.'')." WHERE tid = '$value[tid]'"));}-->
4 J1 [2 P+ \+ J
! r& V: k9 D8 X: e) Q8 j9 g7 @3 L: U2 R# b! ?- a( i2 F
数据库循环嵌套调用
) z) o; ~: C9 i2 K: F
<!--{eval $slides = DB::fetch_all("SELECT * FROM ".DB::table('a')." WHERE `uid`= $_G[uid] ORDER BY `id` DESC");}-->
2 e+ o( y3 |* L* G) E* {# V7 G3 n
<!--{loop $slides $slide}-->
' e' p8 j& t& Y) J9 d
$slide[name]
& g* R0 V% v8 c4 ]- Z. ]; u; {<!--{/loop}-->
0 q" D5 U& g1 }
: h3 y- e! A4 P: Y' ]6 t. L- |0 |' U0 ?' W
ucenter无法登录:
) k$ i4 E5 v9 \' @: ]# W. B+ t4 [打开uc_server/model/admin.php
: H' g c) L" ]1 j0 T找到第22行的
3 a5 z" }7 u4 A6 h% ?8 ^& U4 U* m$this->cookie_status = 0;
! b% y0 j8 ?, h
' }. m9 G8 y0 K+ J$ {' q% u% A) p
改成
: I, l/ z, \# e( B
$this->cookie_status = isset($_COOKIE['sid']) ? 1 : 0;
7 i0 c `- c z, M `" h1 v0 d; b7 z s( L+ G6 H1 K6 j4 ^. B6 f
1 W0 r. Q! ]1 O' \) f+ s5 ~' r. q i; C+ |. G i: \' L) j$ T; w
无刷新切换li标签并且同时加载框架页面:
. ~3 X& {+ I* {2 C<script type="text/javascript">
* c3 `3 }( p) j, q' E" }var jq = jQuery.noConflict();
! T! d' _3 L2 njq(function(){
5 R# E' m) x/ |8 |# R3 l# a; o" R+ ?
jq("#changemenu>li").mouseover(function(){
# k0 P. w: U1 }2 m2 ?) xjq("#changemenu>li").each(function(i){
% B' h, ^1 l) Ojq(this).removeClass("current");
, O4 [3 e. n! c" R# ^2 `$ e
});
3 o2 k8 N& |4 l6 N/ Y2 e: jjq(this).addClass("current");
" i% J( L# x8 W3 }
document.getElementById("changenr").innerHTML='<iframe src="do.php?id='+jq(this).attr('dataid')+'" height="350" width="1070" frameborder="0" scrolling="no"></iframe>';
) C' L3 e7 [) a
}).mouseout(function(){
( w/ l) s* @1 Z& Q" b2 q
jq(this).addClass("current");
/ }6 Q9 r; }2 t; h% p9 g2 m4 j
});
" Y) A9 Z/ n4 C. V: {});
; O. [3 \" J, M. f/ {7 Z/ K
</script>
: S2 O4 r- L0 S2 Z! @
<ul id="changemenu">
: j8 D# d$ h5 }7 S* W <li class="current" dataid="1"></li>
6 K/ C, O- }3 W8 G <li dataid="2"></li>
\+ r2 |6 g- j8 `. H0 @' T
</ul>
+ s8 q/ `( k" h' v<div id="changenr"></div>
- m( H* _ D. k7 q$ ]
: x* E: y# E, f+ n
9 G3 j7 Y9 u4 K1 _" A* ]8 A( q0 Y* E: w+ V; w/ G
快速发帖
?# {6 J8 ~8 t& z
<a href="forum.php?mod=misc&action=nav">发布新话题</a>
) P. W: I# e# A' `. k. n. J' J/ k; v( j0 g$ u
1 }2 H6 L0 \/ h; c5 G5 I# V- `6 N7 k7 Z, N
DISCUZ JSON数据解析获取
3 Y( `) w# A4 h: H6 ]" h& e$str = 'a:2:{s:8:"sitename";s:8:"源码哥";s:3:"pic";s:12:"ymg6.jpg";}';
7 t+ P- v7 @; w- X! e$ O$newstr = str_replace("\","",$str);
3 |$ H* _3 j' A0 ~$ g$data = unserialize($newstr);
8 R& {3 z1 G. M' h# U9 ^
echo $data[sitename];//输出结果为源码哥
" ]1 R" {( l* l; }" T
; q: F0 Y- T, o
5 V: ~: ]# e( m6 P# V+ l3 S
) l0 V) J6 d# A( [! N9 @: hDISCUZ云平台站点同步提示DNS错误解决方法:打开source\plugin\manyou\Service\Client\Restful.php,找到代码:
+ q6 s* l. n d# n
$result = $this->_fsockopen($url, 0, $data, '', false, $ip, 5);
$ H& r# J8 E0 O) ]6 b4 i4 B9 ]! {' T q, ^; m
- N# K4 T0 g; G0 u
修改为:
' r5 `+ E, l6 H$ d$result = $this->_fsockopen($url, 0, $data, '', false, $ip, 30);
; _0 E) t# r% x' }7 X, j1 D9 {' C8 e2 {# l
, i3 V4 ^& }4 t# M* D5 F
, c2 |+ t2 ]5 i5 T5 ?5 j+ W
LI标签列表自适应宽度JS实现代码(去除每行最后一个li标签的右边距):
6 Y& [$ x( k9 t1 _8 ]<script type="text/javascript" src="http://www.banban.so/new/bang/uploads/146383669567393.js"></script>
% e& |4 O4 ~6 T<style>ul,li{margin:0; padding:0; list-style:none;}.list{width:100%; margin:0 auto;}.list li{width:32%; float:left; margin-right:2%; background:#0092B9; text-align:center; color:#fff; height:300px; line-height:300px; margin-bottom:10px;}</style>
9 g0 n( F8 g8 L1 y
<div class="list">
! I6 R# v: G( Y <ul>
6 W3 w2 }* d' m/ d <li>源码哥</li>
! x9 a" | v* O$ u
<li>源码哥</li>
2 F2 t; ~0 ]4 ?* q7 ^$ Z <li>源码哥</li>
- ?. g5 a) f, z <li>源码哥</li>
6 W5 c, }7 d' Y# }2 C <li>源码哥</li>
9 o2 z) X% N6 z- i. d8 [
<li>源码哥</li>
+ V' z8 @# O$ F; D0 p9 N4 a4 ~
</ul>
' K" ?7 x+ O2 D: b6 y</div>
3 L9 R, l3 Q$ P! l, y U8 \<script type="text/javascript">
4 A! ]# C/ E, R( Z; v $('.list li:nth-child(3n)').css('marginRight', '0');
/ ?8 ?: s) ?# c8 R/ t) `% {
</script>
U- \7 z% \6 d% t- R4 G
* k' o4 S% k; v0 l
: t" F; j9 O& }; b( G' {# B) H! I$ K
常用词汇
' e0 P' H( I4 N Qselect 选择
) I7 r4 L; i% v
count 总数
0 p4 g- \; j% F8 k, a2 o7 \$ K1 Ntable 表
) j! x {* D0 {; E3 i# N
where 条件
/ M6 w8 d; B4 {3 wresult 结果
6 _& a& B+ `4 A# s' z& mperpage 每页
- M* @* Y5 I& K8 \; Q8 [curpage 当前页
/ Q8 }& E1 a1 U: t4 q$ aupdate 更新
0 e e' U; W: y3 b1 x+ }4 A1 _2 E9 Idelete 删除
6 e% l7 U% @+ W3 c0 n
insert 写入
% }" | J. C& y5 D! w, Udateline 日期
$ F8 f# m1 m' T5 c
time 时间
6 A0 P) v3 G; Recho 输出 <?php echo '123'; ?>
. |0 `& b" v* w$ E( w8 nmulti 分页函数
- ]4 _) R4 E" w f
if 如果
, P3 K2 p- z+ g) n' melse 否则
) [4 O* l8 ~1 `1 }. delseif
7 z$ Y1 R+ t( d, g+ m6 q+ Vstart 起始
% m( J) B! v) l& i- X
limit 限制 limit 10
6 F1 S& |* M8 L
DESC 倒序
5 h, N( F, j& ~+ H
ASC 正序
1 B, U+ r# ]5 \+ p* B! A" M
) I7 G4 f0 C" B3 A* E2 N0 |6 W
% {: n& w$ |- W4 u
9 D4 H8 i& |) h- F活动帖发布页面核心处理文件:
% o- ` Z( w P: V6 Z9 ^source\class\extend\extend_thread_activity.php
# z8 {# F( ?" J# k ^" Y$ A
$ j! H5 H, A5 U8 C1 E+ n: o2 Q
分类信息解析文件
V! H* Z$ r8 O1 q
source\function\function_threadsort.php
- |4 x. p2 P5 A+ t) y+ m
Discuz模版运行php代码
4 k1 a8 ]+ a9 i, S; F) _
<!--{eval echo'源码哥';}-->
. F& M. K2 V& L8 M/ q( o! k或
{. U* T3 e% z' b<!--{eval}-->
- D" u& W5 s$ N( b
echo'源码哥';
0 k9 W7 a) u" e<!--{/eval}-->
, B/ ~0 j! b% S F标签获得焦点后触发js
9 F, y4 P+ ]5 M4 M3 w z& z3 F
onfocus="ymgcom()"
& r- @. x5 v5 h4 ?8 M; u m
$ h# ]. ?2 ]- n2 u% s& s1 w
4 |( z& t0 f. k5 G8 p8 U6 E1 h
标签失去焦点后触发js
+ _, E; [ i7 d; ~0 z i& d( t
) C: I9 C; `* \) r& |: gonblur="ymgcom();"
: \( x3 m! M1 e. W7 e
+ H# O, _$ @% x4 `1 C5 C
0 g& `4 T9 t6 Y. ?. U) f密码输出1*****6
3 v" V$ ~7 L3 @: o4 ]//原密码为$_GET['password']
8 y* \' h) S! ~- N$password = preg_replace("/^(.{".round(strlen($_GET['password']) / 4)."})(.+?)(.{".round(strlen($_GET['password']) / 6)."})$/s", "\\1***\\3", $_GET['password']);
3 @% q: W3 p: `% x2 ^% \6 lecho $password;
" v" U: \* }' Q8 {9 V& y) y, z