登录
0 ]* d& w* o' e: L
<a href="member.php?mod=logging&action=login" title="登录">登录</a>
" i' M. U, i! O9 A# }* q% T1 o
; }4 s( C9 P0 M! w注册
" B! B( W( |% p! d" r. k# k Z
<a href="member.php?mod=register" title="立即注册">立即注册</a>
8 T' m; V1 X' M
% I' t8 {2 E2 T w6 M; C2 m2 v! a忘记密码
0 i0 ~5 d+ }& p" @' z6 _4 h<a href="javascript:;" title="找回密码">找回密码</a>
* ]: n& b* Y! \
& \- z) U0 G) Y; l: M3 g9 Z购买邀请码
; v ~ S7 b! A1 e
misc.php?mod=buyinvitecode
9 S+ f3 q( x0 ~$ y
+ N g r2 W+ K( w( w/ yJS跳转
/ o" m F2 F( p- @% l4 g: ]4 fonclick="window.location.href='home.php?mod=mobile&do=friend';"
7 C: P$ Y. y4 x+ Q7 q( @
* a& k% K' m$ f. v! wJS更换class的名称
: G. O: M: x5 v9 I3 U
document.getElementById('idname').className='a';
8 F' i+ {2 Z0 `1 _, n
document.getElementById('idname').style.display='block';
. p( L( |9 J, qdocument.getElementById("idname").style.marginTop="30px";
9 f& H* k" F* A. N+ N0 T, k
8 b) E9 J2 Y% V. W$ W批量替换超链接:
0 ^2 D. N7 P2 r8 J$ X/ {
href="[^"]*"
. x& \7 u" S8 S5 M+ i/ D0 a6 _- Z" ]- J2 m
过滤DZ代码:
3 I: o% f$ `/ D; B C0 l& [* `
preg_replace ("/\[[a-z][^\]]*\]|\[\/[a-z]+\]/i",'',preg_replace("/\[attach\]\d+\[\/attach\]/i",'',$message));
1 O) P8 p) m. b! m/ M. @
6 [8 F, p8 }4 P# }: `9 C p调用单个数据
# E7 e/ a' |, T$a = DB::result(DB::query("SELECT qi FROM ".DB::table('abc')." WHERE id = '1'"));
) n: L p9 `. x- Z4 s2 w+ e" t9 X4 y% E" L
调用统计数据
5 e* Z! S6 H/ _9 o
$a = DB::result(DB::query("SELECT count(*) FROM ".DB::table('abc')." WHERE id = '1'"));
+ W. L; m, R2 J3 R4 C# `' H
- f* Z/ t, o4 I- N; l* {
单数据表调用
, v: s- J% T# a$perpage = 20;
1 k( w% {7 w0 N5 |- I
$curpage = empty ( $_GET['page'] ) ? 1 : intval ( $_GET['page'] );
) |+ o+ P g# P9 c' ^
$start = ($curpage-1)*$perpage;
- b4 ?: n$ t+ _0 C% `$askcount = DB::result(DB::query("SELECT COUNT(*) FROM ".DB::table('forum_thread')." WHERE fid = '2' AND authorid > 1"));
) C9 }( ~" C) I
//$asklist
e$ D8 E- e9 X2 n" P
$asklist = array();
* ?: ?) K* Q+ z: W, `# {. Y& k O
if ($askcount) {
& b- m8 C: l7 k7 ~( G
$query = DB::query("SELECT * FROM ".DB::table('forum_thread')." WHERE fid = '2' AND displayorder > -1 ORDER BY tid ASC LIMIT $start,$perpage");
4 P3 j: F" A; L) q7 {8 I# A8 M while ($value = DB::fetch($query)) {
9 b' {2 V7 ^: l9 K! f7 J $asklist[] = $value;
: I' s( K& [! W# Y }
' \- X- G+ P A}
% k& E6 X" X1 L# {
$multi = multi($askcount, $perpage, $curpage, "这里填写跳转地址");
9 C" Q b0 P9 N- J4 W
8 \/ C# X3 Y4 O! a4 X! A$ I; H V' J4 ?. c( y# x
# w% d2 g# ~! [9 M% o# v7 _多数据表调用
4 K I; n. y: V0 x$perpage = 40;
3 x) l6 f/ t$ k$ c& N
$curpage = empty ( $_GET['page'] ) ? 1 : intval ( $_GET['page'] );
# P4 g' T+ o6 \) U0 ^. a+ Y# {$start = ($curpage-1)*$perpage;
1 U5 \: f2 R1 @2 i% |9 u$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 != ''"));
! t- w# R) c) r
//$alist
' N( u' o, B2 M
$alist = array();
. l. o) W7 \7 P+ sif ($acount) {
2 ^ Q- K* A. Z $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");
) W1 o$ M& ], D5 }6 `2 r5 [
while ($value = DB::fetch($query)) {
" x& a( _* b0 V, S8 f $alist[] = $value;
x b/ p5 _+ }$ M/ ?$ I
}
% {" @) e# P% N. R/ I
}
, Q" q& q7 e' a; g- ^+ f: H
$multi = multi($acount, $perpage, $curpage, "这里填写跳转地址");
: K5 w# y; ] B& M, J3 ?
$ F2 n( p0 b2 v. M. {/ I
, [- y) D2 D& F+ ?" z+ U) E7 l9 C2 M$ O$ R1 i
前台数据显示
' Y: R0 H5 ]) ~. p6 ]: x( }% \( x
<!--{loop $alist $key $value}-->
$ A7 T5 I) V6 x' T<!--{eval $tupianfm = DB::result(DB::query("SELECT attachment FROM ".DB::table('forum_threadimage')." WHERE tid = '$value[tid]'"));}-->
1 J' {. a+ z; E<img src="$tupianfm"><br>$value[authorid]
( L% ~: s' Z0 S" U; h4 L; r
<!--{/loop}-->
. d" ]/ t [% E( E
' J8 ~" F, k; a! i9 }
# q* B( c% Q! Q/ `- t$ A4 W取数据表中符合条件的第一条数据
; g/ B$ b4 q2 |
$app=array();
+ P9 V1 y/ p0 `4 o9 m
$app=DB::fetch_first("select * from ".DB::table('abc')." where id='{$id}'");
{5 w! |8 {! y! r( R1 }& K2 v# \* }
: ^5 r9 Z& A9 l4 m; S
3 M6 U7 Q6 N4 }) t
2 T9 N7 W% _' k
人性化时间戳
- t: p# W4 K2 \6 H<!--{echo dgmdate(这里填写时间参数, 'u', '9999', getglobal('setting/dateformat'))}-->
) H1 r5 h. X6 p9 {9 W2 L9 z
<!--{echo date("Y-m/d H:i:s",这里填写时间参数)}-->
) k7 p$ T3 X3 Z
# A. y4 {6 W2 W0 u
0 G( K4 X$ ]* U `# ]; e截取字符字数
z- l3 c2 {. j& ^9 U8 w( F
<!--{echo cutstr(这里填写参数,40)}-->
4 w, h, T3 n% j$ w
# e# l' \4 ?1 W4 K$ q, T
8 k, b0 x) n, C8 D* ~& ?# g过滤DISCUZ代码
$ R( R$ j6 t: N( n# {8 \9 apreg_replace ("/\[[a-z][^\]]*\]|\[\/[a-z]+\]/i",'',preg_replace("/\[attach\]\d+\[\/attach\]/i",'',$message));
( [3 }0 l. s3 e: v- b* n
4 Z( V( X, t" ?# q A
. p* h: l9 t) G+ U) N4 @. r写入数据库
3 f! d9 Z0 F; ?" X+ m0 z
if(submitcheck('tijiao')) {
0 N! U3 @2 i1 L5 q! q
$setarr = array(
' Q# Y% `6 P/ i+ w 'tid' => $_GET['topicid'],
* Q0 R0 X! d) H. V
'name' => $_POST['name'],
" [9 p- W" u G 'position' => $_GET['position'],
% N f. Y9 T9 c' [ 'dateline' => $_G['timestamp'],
/ o0 R* V' w7 d0 A );
$ M+ M' {! n2 F8 P0 ?$ r" e, F; m; P DB::insert('abc', $setarr, 1);
7 U7 T4 c; j5 {* M* ~ $query = DB::query("UPDATE ".DB::table('abc')." SET stickreply='1' WHERE tid='$tid'");
3 B3 P7 w' v: [* M. R! j
$query = DB::query("DELETE FROM ".DB::table('abc')." WHERE pid='$pid'");
* X( W9 q+ Q$ `' H/ v
showmessage('成功的提示信息', "跳转地址");
* g; b! [ \, y, q- J
}
# J4 f, h, a$ H3 ]% R' x/ h4 e8 d1 N+ Y/ C2 f3 H5 ^0 n/ N& G
# M" ^$ U" q* F4 }7 t" c! [$ X& G
) ^& G: _ S( N d/ |+ A+ T- s3 s1 m表单提交:
" [0 j1 J9 k7 n, S1 J+ `* ]<form action="do.php" method="post" autocomplete="off">
; P; p1 y, t" x <input type="hidden" value="{FORMHASH}" name="formhash" />
# ]8 ^2 f' ~/ G# R2 I
最低奖金:<input name="qi" type="text" value="" />
/ }( I) S' L# T; ]; Z$ d
最高奖金:<input name="end" type="text" value="" />
# f! g5 V1 w9 K& S <button value="true" name="tijiao" type="submit">提交设置</button>
& D' H- D1 s a- E
<input type="hidden" name="tijiao" value="true" />
7 b8 N+ `2 d. m p- N</form>
, \) H7 a I3 ^" u
6 _+ O. S* g' U, U; A
; V+ O. a9 h" N; b/ o9 ~( C! X0 W2 q3 Z
以下两个时间格式是对等关系
& ]9 y; a% [) e6 l. H1 d9 B# Pdate("Ymd",time()); 20150212
, _9 y4 j5 d7 D2 R, ~. b7 z, Q
FROM_UNIXTIME(dateline, '%Y%m%d')
6 a& Z' P v! E* g# }2 Y; [! l
" Y% m/ V g4 s! i
前者用于PHP,后者用于数据库调用的字段的格式化
1 j/ }8 } e5 c# g6 Z" [5 \% N$ ]" q, E8 r
调用图片附件
5 g% Y, Y$ [" X( U: o6 U; l' l2 u
<!--{eval $biaoid = substr($value[tid], -1); $cover = DB::result(DB::query("SELECT attachment FROM ".DB::table('forum_attachment_'.$biaoid.'')." WHERE tid = '$value[tid]'"));}-->
6 y4 u2 w4 l, j8 }8 z
; y% [1 H% K: G$ Q/ n4 S+ h
4 s% c' `8 u6 u% @ T/ }9 K数据库循环嵌套调用
3 x- |) _' { _: B, Y+ F<!--{eval $slides = DB::fetch_all("SELECT * FROM ".DB::table('a')." WHERE `uid`= $_G[uid] ORDER BY `id` DESC");}-->
, G( x) c- k( d2 ~; ~& e
<!--{loop $slides $slide}-->
* E7 W1 ~9 @* _# |$ x2 b
$slide[name]
8 A% O1 E! ]/ l/ D* B7 o<!--{/loop}-->
, x. ]& r4 F3 [, \
# R7 {& M8 x1 S0 V, A& p% w/ y
3 [- L& D# f5 l1 Q* ~, w) }' X/ {) z/ ?ucenter无法登录:
$ k" x( f4 ]) W6 [& I; ~% W
打开uc_server/model/admin.php
$ w' u7 Y% W; L3 s$ J; }6 n |: `
找到第22行的
( O9 g7 A. I: O+ f. z
$this->cookie_status = 0;
2 P+ c) P" j' n3 O6 I, j
2 a6 W* f& h: i8 x! h2 ]
) @; N! S& O. X/ @2 |: D* u
改成
. C: U" g$ U' @( _: |$ D( `$this->cookie_status = isset($_COOKIE['sid']) ? 1 : 0;
/ h! W0 G" d) J# q9 a' `; O( }* h
* c+ L1 c: W6 \7 @1 i
' X; u0 N8 o- G/ {
' {: C2 d& t" S2 v$ c& k3 r1 ?* C无刷新切换li标签并且同时加载框架页面:
. @' P& c( C$ b8 \ u4 Q! [" G& }<script type="text/javascript">
7 j% r& v, y& ^, Q1 p# jvar jq = jQuery.noConflict();
& i1 ^+ e, W6 ~1 ajq(function(){
# J0 K" E! d" s* b D
jq("#changemenu>li").mouseover(function(){
1 F. f+ S* S Bjq("#changemenu>li").each(function(i){
! U$ H, J, j- T( R4 j' _. i5 G
jq(this).removeClass("current");
5 T6 c. K& U$ {. x});
: \( O) z" l' `! c- Mjq(this).addClass("current");
L, j% K# Z0 U5 Y- X' e% s6 ?document.getElementById("changenr").innerHTML='<iframe src="do.php?id='+jq(this).attr('dataid')+'" height="350" width="1070" frameborder="0" scrolling="no"></iframe>';
" i8 D! R% E; r6 N; q
}).mouseout(function(){
5 T9 B) Y+ J7 Kjq(this).addClass("current");
; \4 Z0 m" S/ V& M});
0 h$ `) v/ u u, @1 W});
) X. q, W) _6 H</script>
# a, Y& X( A1 F, E
<ul id="changemenu">
( _' h& x2 z- m m. H <li class="current" dataid="1"></li>
% s0 x: i5 k* ~. ]0 x' { B
<li dataid="2"></li>
$ \- J9 s1 Z& \5 G, Q L
</ul>
( m1 q, e3 Z2 y: \8 V2 c<div id="changenr"></div>
. C, M; L$ P% D% p! o/ a! S4 E! {" s* F: A4 E7 x
L% b, C! s4 L# k* M! C+ i& y" j
! q1 B- C) b: | \; K( `' q快速发帖
9 ^* i: l9 U% S<a href="forum.php?mod=misc&action=nav">发布新话题</a>
6 j* J2 O) y6 g4 S" Y
- q! \! S0 B7 k$ g: l0 |; k/ h1 c# `0 \) }" f: d
# O2 V& I8 R4 X0 Q2 Q
DISCUZ JSON数据解析获取
7 l- c, a( _, V( B
$str = 'a:2:{s:8:"sitename";s:8:"源码哥";s:3:"pic";s:12:"ymg6.jpg";}';
8 b1 I' r1 a5 T$ ~7 P7 Z6 _$newstr = str_replace("\","",$str);
0 N+ x* D! c8 c5 n: V
$data = unserialize($newstr);
5 M; H9 r" B/ |5 L. [echo $data[sitename];//输出结果为源码哥
3 W+ t- }5 ^% s" g
8 h i$ ?1 Y) E7 q' u7 Z, d
5 p" K1 ?' g! L) E. c, c- n6 C# x& A
DISCUZ云平台站点同步提示DNS错误解决方法:打开source\plugin\manyou\Service\Client\Restful.php,找到代码:
7 @4 o. a3 ]' e) i$result = $this->_fsockopen($url, 0, $data, '', false, $ip, 5);
* g% W; c2 M7 {. i
' Y4 u' {. M h8 P( H5 i7 R
7 j1 Y r# j( U9 v
修改为:
/ w- @# Y: E+ B: I9 K" A8 K# b3 E, s' X$result = $this->_fsockopen($url, 0, $data, '', false, $ip, 30);
7 C+ K% R- ~; N8 t8 m
# ]# f! \2 ~/ x, ^# l1 e
7 z2 h) Z$ }+ Z0 D& N8 F5 Q, ] t; O9 k
LI标签列表自适应宽度JS实现代码(去除每行最后一个li标签的右边距):
1 a+ h9 u* w4 J7 }<script type="text/javascript" src="http://www.banban.so/new/bang/uploads/146383669567393.js"></script>
& u0 a2 s t3 T: k% b2 h
<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>
" a( s* `* i1 r9 e4 ^" ~
<div class="list">
2 P7 v5 ?/ n+ _5 G9 H <ul>
) a# b$ h! a5 b) ?1 M
<li>源码哥</li>
+ `( H9 K/ \0 h+ s- W
<li>源码哥</li>
: r7 K% G* Z+ ? <li>源码哥</li>
! i2 F; `; V- a <li>源码哥</li>
% a! U! S7 [& E7 s2 l7 s
<li>源码哥</li>
$ F1 Y& g; k* ?; v |, b
<li>源码哥</li>
9 A6 K( b+ k o </ul>
# E4 T# t$ O. ^" q5 Z
</div>
2 S( z% W5 T. ? g& X<script type="text/javascript">
2 j8 r- q7 }' d$ _2 p' {( d% x $('.list li:nth-child(3n)').css('marginRight', '0');
3 c* f( J9 h" X8 L
</script>
" P5 g( v0 q% i& |* L
/ J7 r+ V8 Q, K- ?, s
( h6 M M: p& c
3 Z6 v/ X) \+ E6 a3 B' N1 z常用词汇
3 T) X1 S) Q: A; D. F" h
select 选择
/ Y- ] U2 i2 A9 e6 o8 zcount 总数
7 Q& ?3 L# v' ?1 H, |+ {table 表
\, [% D1 m% O) ~3 T: Q
where 条件
" y1 c) S. T' Nresult 结果
! w: K: ?. ]3 b4 J [2 G& zperpage 每页
7 E8 y" y7 ~$ y9 r6 fcurpage 当前页
' ? m$ { l( ^7 j7 T5 ~
update 更新
" [; E7 a/ p' y) [
delete 删除
- {$ t2 L% _- x- Y4 d, T9 R. S D
insert 写入
+ X3 O1 c; q9 y+ tdateline 日期
, { J P- w8 Atime 时间
3 o m. e' M7 i7 Oecho 输出 <?php echo '123'; ?>
1 M0 [/ W; |3 s; ~" z" N! p. ?' bmulti 分页函数
, S7 E& H6 x5 a: E
if 如果
3 G& a& d! j2 m/ n$ }
else 否则
- Q2 i8 e- N& W7 S; {% ]elseif
: h8 p/ q+ ?+ ~6 p" q9 h, J+ K
start 起始
6 J; U% L$ g+ [7 }% D& z3 r
limit 限制 limit 10
2 C$ P7 }# E% h# }DESC 倒序
! O& s m! @# n8 z
ASC 正序
, Q* s1 P$ ?5 `( u9 w( t; W
% i9 R2 r3 Z0 ^6 L3 k
( e1 W1 ^( R% l: c& ~
8 J3 i8 o9 B4 i6 o; @活动帖发布页面核心处理文件:
Z( B; G/ _/ e; U% p3 l2 \source\class\extend\extend_thread_activity.php
7 ^) T5 J1 N* z; ~6 `9 n# q" D J
分类信息解析文件
h- }% Q5 F3 g C; osource\function\function_threadsort.php
: {: m: L7 J5 [; MDiscuz模版运行php代码
' r. J+ r; M1 ]4 n3 v
<!--{eval echo'源码哥';}-->
6 H# @( V8 p4 [或
. n! h2 N# }& X. N1 t6 @4 T4 D<!--{eval}-->
( h1 N; k* A7 Y6 N" g5 \echo'源码哥';
; U' f& ]* W: O<!--{/eval}-->
6 w9 V5 d2 E, s4 j! p
标签获得焦点后触发js
' Y. t0 ]% j6 `0 ~" [8 I( confocus="ymgcom()"
% b8 u' ?% N2 j# [* {! E" ?" b4 d$ A6 b0 b
0 _! u5 R' N l6 F Q9 x标签失去焦点后触发js
4 X- q: l( y1 B! p' E+ ^) v
, W+ b5 f* [$ F4 y% r( ~, Q; M' ~) honblur="ymgcom();"
9 G1 n; ^: ]5 H% w" d% U1 Z3 k2 p0 o, f0 [
1 I4 k1 o& l- M+ q7 k密码输出1*****6
) V( a! a6 y. o- t2 J/ D. k# {& J//原密码为$_GET['password']
/ W' M1 z2 j/ ^ H: M8 T- f$password = preg_replace("/^(.{".round(strlen($_GET['password']) / 4)."})(.+?)(.{".round(strlen($_GET['password']) / 6)."})$/s", "\\1***\\3", $_GET['password']);
& ?- o {8 ~# a
echo $password;
6 F; ^, f! w* j4 w