登录
% w7 |' [* F5 r' {, L
<a href="member.php?mod=logging&action=login" title="登录">登录</a>
. s- z% D3 ~0 s, p0 \( e( v) j# j5 O' } f# w
注册
0 M4 H( w8 R; P& }2 f* v
<a href="member.php?mod=register" title="立即注册">立即注册</a>
7 D: o/ q! ^) a' @' [+ f
6 w/ W2 w& J/ J7 t' g! w忘记密码
% Y Y2 D$ g9 x+ h
<a href="javascript:;" title="找回密码">找回密码</a>
$ V; ~/ b. L, Z9 j* T5 {
5 f, q5 v) |9 F" ?" Y U购买邀请码
$ ~, f: ]- ~% f7 q- I) nmisc.php?mod=buyinvitecode
" J0 l5 p3 O6 }! F+ b
6 {; M3 U; Q& W; i8 y: s% b
JS跳转
8 d7 U& C2 W3 R% p
onclick="window.location.href='home.php?mod=mobile&do=friend';"
' E7 p- v- Z/ @3 j6 E) W$ C2 ]& n. x" }; Y9 D- }( \0 `
JS更换class的名称
& k! e' D9 I6 ^$ [document.getElementById('idname').className='a';
4 S0 J; L, @, Bdocument.getElementById('idname').style.display='block';
- x7 X# S. m( W- l
document.getElementById("idname").style.marginTop="30px";
3 G; C6 k" Z( [
# }. j2 p* O2 `5 Q: `
批量替换超链接:
8 n. N1 n4 R! D/ w* f
href="[^"]*"
2 e. w8 Y; z# r9 T: ~' A; R, y4 |, @) g$ y7 a, g( K! \9 h4 c! Q
过滤DZ代码:
' @8 Z$ L( x; B2 E
preg_replace ("/\[[a-z][^\]]*\]|\[\/[a-z]+\]/i",'',preg_replace("/\[attach\]\d+\[\/attach\]/i",'',$message));
4 V, e5 [; C! O
4 A$ Y8 P3 `$ n' l, ?6 N0 d& W调用单个数据
5 X2 A5 E1 @' {; _0 b* v. I$a = DB::result(DB::query("SELECT qi FROM ".DB::table('abc')." WHERE id = '1'"));
5 p5 K& f4 b: R' b$ y7 _# @2 A
$ A) B" b! ^$ f+ F. l7 y调用统计数据
- B! j* w J4 Y) ~5 u, x$a = DB::result(DB::query("SELECT count(*) FROM ".DB::table('abc')." WHERE id = '1'"));
1 r6 z$ a' p, _9 s
$ g/ {% j8 g' K
单数据表调用
9 B G" r. \3 J* ~$perpage = 20;
: u- z/ k; H* Z% ?- X$curpage = empty ( $_GET['page'] ) ? 1 : intval ( $_GET['page'] );
& @* k% Q$ u3 F5 d- l' s
$start = ($curpage-1)*$perpage;
4 h0 B5 l4 P* {5 V
$askcount = DB::result(DB::query("SELECT COUNT(*) FROM ".DB::table('forum_thread')." WHERE fid = '2' AND authorid > 1"));
9 G- ^5 i- T. i5 h9 z: `' G: Y
//$asklist
* j1 t$ |, J; z$ Z1 ^- c
$asklist = array();
/ r, z: [5 f1 F# Y- mif ($askcount) {
7 D" C4 n1 b5 O! e8 ~ $query = DB::query("SELECT * FROM ".DB::table('forum_thread')." WHERE fid = '2' AND displayorder > -1 ORDER BY tid ASC LIMIT $start,$perpage");
! y8 c0 s" d+ d( ^. U$ ~
while ($value = DB::fetch($query)) {
! ^; L; w- X C9 c $asklist[] = $value;
( f2 f: i5 [0 ^. Y }
8 `: y8 V0 }; X [0 d
}
8 f3 N6 x9 b0 ^+ Y# n' S' E$multi = multi($askcount, $perpage, $curpage, "这里填写跳转地址");
3 x% j$ d2 b5 [9 Y x# b0 M1 Z# Z+ p
1 @( U* r/ e m7 E) x- w' H0 k5 E5 Y
4 L+ K. x. K% Z0 {
- j$ u6 x( {9 v5 q4 S5 @1 f
多数据表调用
! b/ k; \7 O0 z8 `2 x$perpage = 40;
' N# j# u0 \4 Q) N( l2 D
$curpage = empty ( $_GET['page'] ) ? 1 : intval ( $_GET['page'] );
5 r- U1 o3 L1 J/ s' P( u
$start = ($curpage-1)*$perpage;
3 b9 W: \/ A) p p5 F$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 != ''"));
6 b3 I% R) ~5 U
//$alist
3 n0 p% S2 u! w8 U
$alist = array();
& m+ T+ W; r: }7 j, [1 Dif ($acount) {
! f' H# U2 d! _2 k6 A, D B $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");
8 |( J8 ]6 k- h' X$ y) m7 J& F1 B( \
while ($value = DB::fetch($query)) {
' s$ n+ `3 }5 ^& A
$alist[] = $value;
- g: D D0 f C$ r3 H$ w }
# S) g: p) R% J! ]) p5 X. o
}
/ t. t$ b5 j* H8 Y7 c
$multi = multi($acount, $perpage, $curpage, "这里填写跳转地址");
7 U7 s' {4 D+ L2 k0 W. y9 C3 @* u2 n, \6 r0 z
% I' f( r- U. T; ^
3 j: o1 {+ ?7 _& m7 B3 q* k. e
前台数据显示
: `' N) j6 L1 F: R8 F7 b* G6 _9 S& R
<!--{loop $alist $key $value}-->
# m8 b0 ?" l' W! Y5 A n3 q
<!--{eval $tupianfm = DB::result(DB::query("SELECT attachment FROM ".DB::table('forum_threadimage')." WHERE tid = '$value[tid]'"));}-->
4 z1 ?/ V+ C! }$ C ^1 h
<img src="$tupianfm"><br>$value[authorid]
& P- }- N6 I. R9 A3 A
<!--{/loop}-->
- P! B/ J8 Z0 b
) S5 e) ~: {3 B, x2 i- _. X* [
' u% W/ q2 n2 M9 `. g% @取数据表中符合条件的第一条数据
' k* @- N! i. O& u
$app=array();
( z( K2 i4 T# @0 c" x" N9 w
$app=DB::fetch_first("select * from ".DB::table('abc')." where id='{$id}'");
" @2 M& S% \6 J7 d" [7 v
( s7 o& P0 m5 I; U$ v0 ^; C1 ?* E$ [% v: t0 ^$ L' V/ b; I3 y3 K
+ p' v |$ ~; Z" N- N% z7 V* Y$ w人性化时间戳
9 Z7 r7 n0 f! q/ T8 y m4 O<!--{echo dgmdate(这里填写时间参数, 'u', '9999', getglobal('setting/dateformat'))}-->
" L# w2 s& A2 k4 P3 W! n: A<!--{echo date("Y-m/d H:i:s",这里填写时间参数)}-->
$ M6 r; a5 W8 O( L; F, W8 A+ y# G& P( S) l9 y% b# J
( m; e+ w* R. d$ x% X: g
截取字符字数
: K) F: t5 g: @* f/ P4 _( E
<!--{echo cutstr(这里填写参数,40)}-->
- x9 s: A4 n: i5 m" S; H
) f$ a: k. {8 }' }
0 m a: }9 g6 g6 l: b: h过滤DISCUZ代码
5 U& r' y- ] F) k: T' B& [
preg_replace ("/\[[a-z][^\]]*\]|\[\/[a-z]+\]/i",'',preg_replace("/\[attach\]\d+\[\/attach\]/i",'',$message));
0 y4 u% I% i+ P0 P
' a/ N( P+ X7 s5 }9 x/ Q. x9 T
+ h; n: y( M% |6 o7 w1 Y3 k写入数据库
$ n# c! z, e# Q Aif(submitcheck('tijiao')) {
7 K" B3 i7 N! c2 B
$setarr = array(
1 G! u @( n& c7 ^$ o0 F# G9 N 'tid' => $_GET['topicid'],
) v! g; P0 U2 M1 _ I; E
'name' => $_POST['name'],
3 W2 d5 K$ d' t3 {3 e 'position' => $_GET['position'],
4 A. _( p) `# B4 c 'dateline' => $_G['timestamp'],
0 i L% _: D4 E/ m4 F6 { );
, X8 S6 ^1 a+ Z% F2 x4 g# m+ H3 r& a
DB::insert('abc', $setarr, 1);
* t1 P+ D1 K9 Y; r! g3 v
$query = DB::query("UPDATE ".DB::table('abc')." SET stickreply='1' WHERE tid='$tid'");
2 ~* r+ M9 h2 `& f1 a, q
$query = DB::query("DELETE FROM ".DB::table('abc')." WHERE pid='$pid'");
" Z" W# S' K$ O; q showmessage('成功的提示信息', "跳转地址");
- Y5 O# c& K( ~& T ~* B
}
# n3 J; @" y( s8 n
/ S' L3 r. y/ L1 E! n' b" v. B6 u" Z G1 O
7 k5 l. K4 o+ V8 F. h3 ^4 @. @; j4 E表单提交:
' H8 h* j9 m3 u- _) a4 x<form action="do.php" method="post" autocomplete="off">
+ k$ ~( C j9 }# B6 ]# j/ t
<input type="hidden" value="{FORMHASH}" name="formhash" />
3 T" P4 m# V/ G
最低奖金:<input name="qi" type="text" value="" />
* f# s4 f7 s- y0 r' o# r
最高奖金:<input name="end" type="text" value="" />
; m4 `8 T! T2 k( S+ ]( t
<button value="true" name="tijiao" type="submit">提交设置</button>
7 @: |0 ?$ A; G2 R3 [$ E D/ P <input type="hidden" name="tijiao" value="true" />
* M: O [( b% e5 Z9 ]! g</form>
5 ?9 @$ ~+ l: p- \
) y5 q% s" ?, _/ T0 p1 l2 e# k0 q# r, t
; U1 R2 U9 C0 a% }; q
以下两个时间格式是对等关系
% i3 [1 ? J2 O: z) I- w9 ?
date("Ymd",time()); 20150212
) k0 F6 D! M' {+ p) I2 S+ OFROM_UNIXTIME(dateline, '%Y%m%d')
6 g$ e- E8 A7 P/ X8 u( c/ f) o# h/ |
前者用于PHP,后者用于数据库调用的字段的格式化
, z! X* S$ H7 n! ?
/ F' R* |% T# V7 t1 ^" N2 j% J3 ^
调用图片附件
h; @" ^0 j: M1 W$ q: O
<!--{eval $biaoid = substr($value[tid], -1); $cover = DB::result(DB::query("SELECT attachment FROM ".DB::table('forum_attachment_'.$biaoid.'')." WHERE tid = '$value[tid]'"));}-->
2 M& K, v4 }% e, N% f/ J
/ G8 y, D& d' G6 A: Z% }+ U3 y
: w- R! Q) ?! l* I数据库循环嵌套调用
* x$ m9 m( F4 j7 M0 h& c' n<!--{eval $slides = DB::fetch_all("SELECT * FROM ".DB::table('a')." WHERE `uid`= $_G[uid] ORDER BY `id` DESC");}-->
`2 q- Y' E f- K" A, F! e
<!--{loop $slides $slide}-->
$ {! V7 J" }6 ~# T
$slide[name]
4 ? m, A) }3 ?& t' S6 n
<!--{/loop}-->
# Z; k& \9 [9 A9 e6 l
4 ~8 n8 V! b& \3 Q+ d
+ ^% {/ M' X! t/ ~, ]* x' Pucenter无法登录:
$ ^; k, x1 \ x. A: F
打开uc_server/model/admin.php
3 O" Z% B% q! e: U" M" O找到第22行的
3 p, r4 t5 G' c' c w* W( {! ~9 {
$this->cookie_status = 0;
7 o2 y9 r" V* ~3 x
3 I7 }5 F) T/ k1 X
' D$ v, k0 |/ V# n3 b2 y; ^0 A! Q) B& J改成
5 |3 `( n* \' Y: Z6 B3 `: c* R, p
$this->cookie_status = isset($_COOKIE['sid']) ? 1 : 0;
# q8 d! N. {9 C$ H Z) }6 s
4 L4 _8 X X& b! L) D8 {$ T
( T0 n. Y* k9 {$ B! z/ J1 i; F i" _* s
无刷新切换li标签并且同时加载框架页面:
`6 Y3 N# C* v0 f<script type="text/javascript">
5 ?. i+ b3 @6 s$ W
var jq = jQuery.noConflict();
8 B+ R, R5 e6 H' X* @jq(function(){
# F& A- [$ ?$ |( H9 u
jq("#changemenu>li").mouseover(function(){
* e5 j: S9 k3 E1 ljq("#changemenu>li").each(function(i){
$ i- F1 e9 f5 u' G' h( N
jq(this).removeClass("current");
' c5 y' {/ M6 ?8 J# g; p8 \! |
});
1 P4 C3 W, \& u, s- Y- O
jq(this).addClass("current");
% z+ z7 W/ Q$ I6 }! l' y t
document.getElementById("changenr").innerHTML='<iframe src="do.php?id='+jq(this).attr('dataid')+'" height="350" width="1070" frameborder="0" scrolling="no"></iframe>';
% L' I# X% l7 z: T}).mouseout(function(){
, \/ l: C1 s, g# F* f
jq(this).addClass("current");
! F% J2 W( T. E
});
+ y' h/ ^( Y9 c* N});
; C" | ^ w- C% V</script>
8 l6 J7 H, `# V6 B- [
<ul id="changemenu">
Q7 `( E4 m* @7 h% v
<li class="current" dataid="1"></li>
, }' o# w, t3 Q7 m7 F/ k% q& @2 } <li dataid="2"></li>
4 b0 C* F2 q7 a: s0 C! }
</ul>
1 e; t# W7 R# k/ N6 ]+ ~
<div id="changenr"></div>
& l- @" s* M V: q# h. ?
+ P* [/ o K7 d- G$ x2 N/ i$ [' E z/ B
! Z5 Z& o: Y# [8 M
快速发帖
: x* U y, o9 F+ n<a href="forum.php?mod=misc&action=nav">发布新话题</a>
) C; `8 ^2 S# y* Y8 |, k# e
1 N5 P: H+ L6 E* {
4 g; T+ w( ^+ n1 I- W
; |5 n& A' ?2 F$ ^" U9 r, dDISCUZ JSON数据解析获取
! N. d& y4 c6 ]: I$str = 'a:2:{s:8:"sitename";s:8:"源码哥";s:3:"pic";s:12:"ymg6.jpg";}';
3 l `- X0 T. C( Y4 u S9 K5 d. K
$newstr = str_replace("\","",$str);
% b [+ ?, ?9 Z X6 b8 w$data = unserialize($newstr);
) m4 \; i. Z; g+ u0 k/ L' T4 recho $data[sitename];//输出结果为源码哥
: B( \$ l. T% v
2 |, G7 k4 N: ?% P7 r2 p7 X
( M! Y2 Z: E( I+ N, D0 M& n. t9 V7 n; ^% N* K
DISCUZ云平台站点同步提示DNS错误解决方法:打开source\plugin\manyou\Service\Client\Restful.php,找到代码:
2 {* i4 Z! O0 y, r; z1 U
$result = $this->_fsockopen($url, 0, $data, '', false, $ip, 5);
* f% f! l$ e; g `# ]
6 G" U9 q* k# ?' T' l n0 |: C+ v. o, x
修改为:
; f; u8 v& D) Q' g7 s
$result = $this->_fsockopen($url, 0, $data, '', false, $ip, 30);
$ W: ^$ k4 A; C+ ~* y8 @2 K
1 t5 t' @ w) t1 a/ t
+ j* I( R8 l, G+ g5 C, f+ H) Z5 q) o; E- Y9 u
LI标签列表自适应宽度JS实现代码(去除每行最后一个li标签的右边距):
* Q/ P3 E$ X0 W2 A4 G# G" y9 l7 I
<script type="text/javascript" src="http://www.banban.so/new/bang/uploads/146383669567393.js"></script>
" y/ l' Q. V* Y2 n% r
<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>
. `* E9 w& @9 i4 b6 Z/ N5 R/ Q<div class="list">
# B5 t8 [+ }( f* a! @
<ul>
/ b: E$ f U! e9 `( G+ B7 K <li>源码哥</li>
1 [7 M3 u* f" z <li>源码哥</li>
' Q- N& {$ ~0 c# T$ X1 z7 o `
<li>源码哥</li>
8 A* l7 Q% {) s( n3 o
<li>源码哥</li>
& e4 N8 v9 N5 p <li>源码哥</li>
! N6 d% }4 a3 a1 ^* D( F+ m3 Q/ n <li>源码哥</li>
6 h3 i: |, Y% Z0 u( ]( \, G9 Q4 M
</ul>
' n& J2 u" n3 d' U6 s3 t4 S
</div>
& @ Z# ?8 [, L( r: ?
<script type="text/javascript">
, d, j n: z- a7 U4 U
$('.list li:nth-child(3n)').css('marginRight', '0');
# e5 z8 u( i$ v2 A5 M</script>
% R- }& F6 V; U
6 b; J% U9 f9 A( z t# f" g, z8 g$ v. G5 J0 {; d8 ? f. K
8 Y! R! u6 E2 d
常用词汇
- z7 d7 |2 [# d. z4 H
select 选择
( n0 U: I* n; e- F" L( [! _
count 总数
( A. I1 O( W) X3 i! v: S' R
table 表
L. K/ @2 E6 u# c& [: ~
where 条件
& o5 j& x/ p1 x/ }
result 结果
. j: s6 L2 V- Y6 [$ O; ?
perpage 每页
8 v& X2 ^( q& j& Ncurpage 当前页
3 a3 w7 g' C4 r% Bupdate 更新
: q7 B9 _7 J. J
delete 删除
3 g1 }5 q, e, |* B. [: |1 qinsert 写入
" c! Q2 p: ]( rdateline 日期
h- S$ O2 X3 ^% l- m+ {6 ntime 时间
" j$ x7 b# g4 U% Techo 输出 <?php echo '123'; ?>
$ H# r7 F' c/ z( ~4 h" ^& Xmulti 分页函数
" U6 L7 v# H- s) Aif 如果
8 y: |* k' T' Nelse 否则
5 H: D _8 q: z, I0 Relseif
& x, J6 @4 k& \% N6 O0 @
start 起始
2 f0 h# K# n1 i+ A+ b' G
limit 限制 limit 10
7 i# R) I7 d# X" y0 t
DESC 倒序
# c; H) X7 Q# Y6 CASC 正序
* g6 D$ m5 x! U$ W9 O$ R, ?" Q3 [# _8 j2 g A3 A8 `& S% X
6 K" C6 g. c' j* e! `6 f' O1 e
0 g4 B: @* D- E1 C
活动帖发布页面核心处理文件:
+ A/ m+ W6 \$ v/ e! S' O6 ^8 u, [source\class\extend\extend_thread_activity.php
: z# O- J: k4 L, [2 ]; c
Q. J; e6 C, ^2 D$ y分类信息解析文件
; g, j0 F) f! J* Y9 ?2 ?
source\function\function_threadsort.php
! J0 y# l. @5 w4 P1 P' i) r- n
Discuz模版运行php代码
/ S. [/ A3 S. a
<!--{eval echo'源码哥';}-->
3 n, d" }( F) d5 Q. {
或
4 M. A' I8 P4 w: o<!--{eval}-->
# G* b( z$ K Y/ }7 ^# uecho'源码哥';
X' W+ o$ Q8 u5 E, R: C) H, V4 l
<!--{/eval}-->
' m* b/ w) V% D4 V
标签获得焦点后触发js
( U$ d$ D4 s1 @" k1 c9 h
onfocus="ymgcom()"
4 K, _/ w# N+ c0 ?
/ P( M- q0 e! ~! J
& o+ N# e5 V9 F& c标签失去焦点后触发js
8 R$ Z3 L6 {& Z0 i
0 W7 ?; a; x2 _1 t0 p5 Wonblur="ymgcom();"
+ k9 Z4 Q3 P1 f, H2 \; \$ x5 g- _' |& t2 x; ~+ g! Z' Q c
9 b; B `* T' H密码输出1*****6
/ n& A% D3 l t8 U//原密码为$_GET['password']
7 f, c: \) j( |. T+ k$password = preg_replace("/^(.{".round(strlen($_GET['password']) / 4)."})(.+?)(.{".round(strlen($_GET['password']) / 6)."})$/s", "\\1***\\3", $_GET['password']);
0 m& O6 i7 G w- O/ d3 ]5 ^9 m- Eecho $password;
2 F) d' }5 ]' P, V& y( e1 \" \( M }