澳门新葡萄京娱乐场基于mysql的论坛(6)

灵动标签调用栏目导航技巧: 例一:灵动标签显示栏目导航

# post.php ?php require(config.inc.php); $sql=select * from boardinfo
where name=’$board’; $sql_result=mysql_query($sql);
$sql_row=mysql_fetch_array($sql_result); ? html head
title发新贴子/title link rel=stylesheet type=text/css href=css/index.css
/head body bgcolor=#666666 ?php include ad.php;?br hr noshade width=80%
size=1 table width=80% border=1 cellspacing=0 cellpadding=0 align=center
bordercolorlight=#686898 bordercolordark=#FFFFFF tr align=center
valign=top bgcolor=#666699tdfont size=3 color=#336699bfont
color=#CCFFFF发 贴 子/font/b/fontbr /td /tr tr bgcolor=#ffffeftd/td
/tr tr bgcolor=#e8eee0tdbr 您的贴子将被发表在b?php echo
$sql_row[chinesename];?/b版块 /td /tr /table br form method=post
action=read.php table width=98% border=1 cellspacing=0 cellpadding=0
align=center bordercolorlight=#336699 bordercolordark=#FFFFFF
bgcolor=#666699 trtd width=89 bgcolor=#acc0fa align=right用户名:/td
td width=224input type=text name=name style=font-size: 9pt;
background-color: #FFFFFF; color: #3366FF; border: 1 solid #000000
value=?php echo $jl_forum[name];? size=17 maxlength=16 font
color=#FF0000* /font /td td width=63 bgcolor=#acc0fa
align=right密码:/td td width=160input type=password name=password
size=10 maxlength=16 style=font-size: 9pt; background-color: #FFFFFF;
color: #FF0000; border: 1 solid #000000 font color=#FF0000*/font
font color=#FF0000 /font /td /tr trtd colspan=4font
color=#FFFFFF主题:/fontinput type=text name=title size=50 maxlength=50
style=font-size: 9pt; background-color: #FFFFFF; color: ##3366FF;
border: 1 solid #000000 font color=#FF0000* /font/td /tr trtd
colspan=4 font color=#FFFFFF内容:/fontbr textarea name=cont cols=70
rows=12 wrap=VIRTUAL/textarea br input type=button name=Submit2
value=取消 onclick=window.close() input type=submit name=add value=提交
input type=checkbox name=qm value=qm checked font
color=#FFFFFF使用签名/fontinput type=hidden name=board value=?php echo
$board;? /td /tr /table /form ?php include footer.php;?br /body /html #
query.php ?php require(func.php); $sql=select * from boardinfo;
$sql_result=mysql_query($sql); ? html head titlemain/title meta
content=text/html; charset=gb2312 link rel=stylesheet type=text/css
href=css/page.css /head body bgcolor=#FFFFFF background=image/bg.gif
table width=90% border=1 cellspacing=0 cellpadding=0 align=center
bordercolorlight=#FFCC99 bordercolordark=#FFCC99 tr bgcolor=#CCFF99td
div align=centerb论坛贴子查询/b/div /td /tr tr align=centertd form
method=post action=query_list.php 在select name=board option
selected请选择版面/option ?php
while($sql_row=mysql_fetch_array($sql_result)){ ?option value=?php
echo $sql_row[name];??php echo $sql_row[chinesename];?/option ?php
} ? /select 中查询br input type=text name=query_str size=40
maxlength=40 br input type=submit name=title value=按主题查询 input
type=submit name=cont value=按内容查询 input type=submit name=writer
value=按作者查询 /form /td /tr tr bgcolor=#CCFF99td div
align=centerb论坛信息/b/div /td /tr tr td ?php include info.php;? /td
/tr /table /body /html # query_list.php ?php require(func.php); if
(!empty($query_str)) { if(!is_board_exits($board)){ $board=computer;
} if ($title){ $submit=title; } elseif ($cont) { $submit=cont; } elseif
($writer) { $submit=writer; } else { $submit=title; } $sql=select *
from $board where ($submit like ‘%$query_str%’);
$temp=mysql_query($sql); $sum=mysql_num_rows($temp); if ($sum!=0) {
$sql=select * from boardinfo where name=’$board’;
$sql_result=mysql_query($sql);
$sql_row=mysql_fetch_array($sql_result);
$chinesename=$sql_row[chinesename]; setcookie
(jl_forum[chinesename],$chinesename); $sql=select name from user
where slaveboard=’$board’; $sql_result=mysql_query($sql); ? html head
titleList/title meta content=text/html; charset=gb2312 link
rel=stylesheet type=text/css href=css/index.css script
language=javascript function
openwin(board,id){window.open(good_read.php?board=+board+&id=+id,,height=460,width=600,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no);
} function
post(board){window.open(post.php?board=+board,,height=500,width=600,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no);
} /script /head body bgcolor=#FFFFFF background=image/bg.gif ?php
include header.php;? br table width=100% border=1 cellspacing=0
cellpadding=0 bordercolorlight=#000000 bordercolordark=#FFFFFF tr td
height=20 width=22% bgcolor=#E8E8E8版面:?php echo $chinesename; ?/td
td height=20 width=29% bgcolor=#E8E8E8版主:?php while
($sql_row=mysql_fetch_array($sql_result)) { echo $sql_row[name].;
} # 选择出留言纪录; $totalpage=ceil($sum/$pagesize); # 分页 if($page1
or empty($page)){ $page=1; } elseif ($page$totalpage){ $page=$totalpage;
} elseif ($totalpage==0) { $page=0; } $offset=($page-1)*$pagesize;
$sql=select * from $board where ($submit like ‘%$query_str%’) order by
id desc limit $offset,$pagesize; $sql_result=mysql_query($sql); ? /td
td height=20 width=17% bgcolor=#E8E8E8查询到?php echo $sum; ?条纪录/td
td height=20 colspan=2 width=32%a href=’javascript:post(?php echo
$board;?)’img src=image/newtopic.jpg width=92 height=21 border=0
alt=发新贴子/a/td /tr /table br table width=100% border=1 cellspacing=0
cellpadding=1 bordercolorlight=#CCCCCC bordercolordark=#eeeeee tr
bgcolor=#995100 align=center td width=6%font color=#FFFFFF回应/font/td
td width=67% bgcolor=#995100font color=#FFFFFF主 题/font/td td
width=20%font color=#FFFFFF时 间/font/td td width=7%font
color=#FFFFFF人气/font/td /tr tr bgcolor=#FFCC99 td colspan=5
height=2/td /tr ?php while ($sql_row=mysql_fetch_array($sql_result))
{ echotr; echotd width=6% bgcolor=#E8E8E8 align=center; echo [*];
echo/td; echotd bgcolor=#E8FDEE width=56%font face=宋体a
href=’javascript:openwin($board,$sql_row[id])’
title=作者:$sql_row[writer]
大小:$sql_row[size]字节$sql_row[title]/a/font/td; echotd width=18%
bgcolor=#FFF5DD align=center$sql_row[writetime]/td; echotd width=6%
bgcolor=#E8FDEE align=center$sql_row[hits]/td; echo/tr; } ? tr
bgcolor=#FFCC99 td colspan=5 align=center height=2/td /tr /table div
align=right form method=post action=?php echo $php_self;? input
type=hidden name=?php echo $submit;? value=y input type=hidden
name=query_str value=?php echo $query_str;? 共b?php echo
$totalpage;?/b页 第b?php echo $page;?/b页・?php if ($page!=1){
$back=$page-1; echoa
href=$php_self?board=$board&page=1&$submit=y&query_str=$query_str首页/a
a
href=$php_self?board=$board&page=$back&$submit=y&query_str=$query_str/a;
} if ($page==1){ echo首页 ; } if($page!=$totalpage){ $next=$page+1; echo
a
href=$php_self?board=$board&page=$next&$submit=y&query_str=$query_str/a
a
href=$php_self?board=$board&page=$totalpage&$submit=y&query_str=$query_str尾页/a;
} if($page==$totalpage){ echo 尾页; } ?・转到input type=submit name=goto
value=转到 input type=text name=page size=2 页/form /div ?php include
footer.php;? /body /html ?php } else { show_error(10); } } else {
show_error(9); } # read.php ?php require (func.php); if ($re){
$sql=select slaveid from $board where id=$id;
$sql_result=mysql_query($sql);
$sql_row=mysql_fetch_array($sql_result);
if($sql_row[slaveid]!=0){ show_error(1); $founderr=1; } if
(!check_user_password($name,$password)){ show_error(4); $founderr=1;
} if (empty($title)){ show_error(2); $founderr=1; } if ($qm){
$qm=expl_qm($name); } if(!$founderr){ re_doc($board,$id); setcookie
(jl_forum[name],$name); $sql=select * from $board where id=$id;
$sql_result=mysql_query($sql);
$sql_row=mysql_fetch_array($sql_result); $title=$sql_row[title];
$writer=$sql_row[writer]; $cont=$sql_row[cont];
$writetime=$sql_row[writetime]; $hits=$sql_row[$hits];
$fromip=$sql_row[fromip]; $sql=select * from $board where
slaveid=$id; $sql_result=mysql_query($sql); #
$sql_row=mysql_fetch_array($sql_result); } } elseif ($add){ if
(!is_board_exits($board)){ show_error(7); $founderr=1; } if
(empty($title)){ show_error(2); $founderr=1; } if
(!check_user_password($name,$password)){ show_error(4); $founderr=1;
} if ($qm){ $qm=expl_qm($name); } if (!$founderr){ add_doc($board);
$add=1; setcookie (jl_forum[name],$name); } } else { if
(!is_board_exits){ show_error(7); } add_one_hit($board,$id);
$sql=select * from $board where id=$id;
$sql_result=mysql_query($sql);
$sql_row=mysql_fetch_array($sql_result); $title=$sql_row[title];
$writer=$sql_row[writer]; $cont=$sql_row[cont];
$writetime=$sql_row[writetime]; $hits=$sql_row[$hits];
$fromip=$sql_row[fromip]; $sql=select * from $board where
slaveid=$id; $sql_result=mysql_query($sql);
#$sql_row=mysql_fetch_array($sql_result); } ? html head title?php
echo $title;?/title meta content=text/html; charset=gb2312 link
rel=stylesheet type=text/css href=css/index.css script
language=javascript function
sendmsg(name){window.open(sendmsg.php?name=+name,,height=200,width=500,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no);
} /script /head body bgcolor=#666699 ?php include ad.php;?br hr noshade
width=98% size=1 table width=98% border=1 cellspacing=0 cellpadding=2
align=center bordercolorlight=#CCCCCC bordercolordark=#FFFFFF tr
bgcolor=#666666 tdfont color=#FFcc00b标题:?php echo
$title;?/b/font/td /tr tr td bgcolor=#eeeeee作者:?php echo
$writer;?(?php echo $writetime;?) a href=javascript:sendmsg(‘?php echo
$writer;?’)img src=image/icon1.gif width=18 height=17 alt=给作者留言
border=0/a a href=userinfo.php?name=?php echo $writer;?img
src=image/profile.gif width=16 height=15 alt=察看用户资料 border=0/a/td
/tr tr bgcolor=#ffffeftd?php echo $cont;?/td /tr tr bgcolor=#e8eee0
td※ 来源:?php echo $jl_forum[chinesename];? [◆FROM:?php echo
$fromip;?]/td /tr /table br ?php if ($add!=1){
while($sql_row=mysql_fetch_array($sql_result)) { ? table width=98%
border=1 cellspacing=0 cellpadding=2 align=center
bordercolorlight=#CCCCCC bordercolordark=#FFFFFF tr bgcolor=#015C71
tdfont color=#ffffff标题:?php echo $sql_row[title];?/font/td /tr tr
bgcolor=#eeeeee td作者:?php echo $sql_row[writer];?(?php echo
$sql_row[writetime];?) a href=javascript:sendmsg(‘?php echo
$sql_row[writer];?’)img src=image/icon1.gif width=18 height=17
alt=给作者留言 border=0/a a href=userinfo.php?name=?php echo
$sql_row[writer];?img src=image/profile.gif width=17 height=15
alt=察看用户资料 border=0/a/td /tr tr bgcolor=#ffffeftd?php echo
$sql_row[cont];?/td /tr tr bgcolor=#e8eee0 td※ 来源:?php echo
$jl_forum[chinesename];? [◆FROM:?php echo
$sql_row[fromip];?]/td /tr /table ?php } ? form method=post
action=read.php table width=98% border=0 cellspacing=0 cellpadding=0
align=center tr td table width=40 border=1 cellspacing=0 cellpadding=0
height=20 bordercolorlight=#000099 bordercolordark=#FFFFFF tr
valign=middle align=center bgcolor=#acc0fa td height=17回复/td /tr
/table /td /tr /table table width=98% border=1 cellspacing=0
cellpadding=0 align=center bordercolorlight=#686898
bordercolordark=#CCCCCC tr td width=8% align=right
bgcolor=#acc0fa用户名/td td width=33% input type=text name=name size=17
maxlength=16 value=?php echo $jl_forum[name];? font color=#FFFFFF*
/font/td td width=7% bgcolor=#acc0fa align=center密码/td td width=52%
input type=password name=password size=17 maxlength=16 font
color=#FFFFFF* /font/td /tr tr td width=8% align=right
bgcolor=#acc0fa标题:/td td colspan=3 input type=text name=title
size=40 maxlength=50 font color=#FFFFFF * /font/td /tr tr td width=8%
align=right bgcolor=#acc0fa内容:/td td colspan=3 textarea name=cont
cols=60 rows=3 wrap=VIRTUAL/textarea /td /tr tr td width=8% align=right
bgcolor=#acc0fa/td td colspan=3 input type=button name=clear
value=关闭窗口 onclick=window.close() input type=submit name=re
value=提交 input type=checkbox name=qm value=qm checked font
color=#FFFFFF使用签名 input type=hidden name=board value=?php echo
$board;? input type=hidden name=id value=?php echo $id;? /font/td /tr
/table ?php } ? br /form ?php includefooter.php;?br /body /html

客人主页:class/guest.php HTML HEAD meta content=text/html;
charset=gb2312 TITLE欢迎来到94级1班同学录/TITLE style type=text/css !–
.deepblue10 {font-family: 宋体; font-size: 10pt; color: #3333FF;
text-decoration: none} A.purple:hover {font-size: 9pt; color: #3366FF;
background-color: #99FFFF; text-decoration: none} A.purple:link
{font-size: 10pt; text-decoration: none} a:hover {text-decoration: none}
a:visited {text-decoration: none} A.purple {font-size: 10pt; color:
#CC00FF; text-decoration: none} .white12 {font-size: 12pt; color:
#FFFFFF; text-decoration: none} .purple {color: #CC00FF;
text-decoration: none; font-size: 10pt} .brown9 {font-size: 10pt; color:
#6600CC; text-decoration: none} .black9 {font-size: 9pt;
text-decoration: none} .yellow12 {font-size: 12px; color: #9900CC;
text-decoration: none; font-weight: normal} .redlarge {font-size: 18px;
font-weight: bolder; color: #FF00CC} .grey9 {font-size: 9pt; color:
#CCCCCC} — /style /HEAD BODY BGCOLOR=#FFFFFF table width=755 border=1
height=65 cellpadding=0 cellspacing=0 bordercolorlight=#FF33CC
bordercolordark=#FFFFFF trtddiv align=rightimg src=image/classlogo.gif
width=224 height=60 alt=同学录/div /td tdobject
classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000
codebase=#version=4,0,2,0 width=478 height=60 align=right param
name=movie value=image/2.swf param name=quality value=high embed
src=image/2.swf quality=high pluginspage=_Prod_Version=ShockwaveFlash
type=application/x-shockwave-flash width=478 height=60 align=right
/embed/object/td /tr /table table width=755 border=0 cellspacing=0
cellpadding=0 trtd class=black9 width=302 北京时间? echo
date(Y年m月d日);? /td td class=black9
width=453您好,客人!您目前只能浏览班级照片和校园风光。请到访客留言留下您的祝福。/td
/tr /table table width=755 border=0 cellpadding=0 cellspacing=0 tr td
width=19% bgcolor=#FFeeFF valign=toptable width=100% border=0
cellspacing=0 cellpadding=0 trtd height=20
background=image/redbar.gifdiv align=center class=yellow12 同学录/div
/td /tr trtd height=19 div align=center class=purple/div /td /tr trtd
height=19div align=center class=purple /div /td /tr trtd height=19div
align=centerclass=purple/div /td /tr trtd height=19div align=center a
href=classphoto.php title=毕业照 class=purple target=_blank /a/div /td
/tr trtd height=19div align=center class=purple/div /td /tr trtd
height=19div align=centera href=shoolphoto.php title=唤起你美好回忆
class=purple target=_blank /a/div /td /tr trtd height=19div
align=center class=purple/div /td /tr trtd height=19div align=center
class=purple/div /td /tr tr bgcolor=#FF99CCtd height=20
bgcolor=#FF99CC background=image/redbar.gif div align=center
class=yellow12/div /td /tr trtd height=19div align=center
class=purple/div /td /tr trtd div align=center class=purple/div /td /tr
trtd height=20 background=image/redbar.gifdiv align=center
class=yellow12 友情链接/div /td /tr trtddiv align=centera href=
title=neo的个人主页 target=_blankimg src=image/logo2.gif width=82
height=31 border=0/a/div /td /tr trtddiv align=centera href=
target=_blankimg src=image/a31.gif width=81 height=33 border=0
alt=国内最好的同学录/a/div /td /tr tr td height=24div align=center
class=purplea href= class=purpletarget=_blank杏林医疗在线/a/div /td /tr
trtd height=22div align=center a href= class=purple奥索网/a/div /td /tr
trtd height=22div align=centera href= title=非常有特色的同学录
class=purple target=_blank ChinaRen校友录/a/div /td /tr tr
bgcolor=#FFCCCCtd height=22 bgcolor=#FFCCCCdiv align=center
class=purplea href=mailto:webmaster@medguider.51.net
class=purple与我联系/a/div /td /tr /table /td td width=61% height=308div
align=centerimg src=image/821036.jpg width=400 height=166/div table
width=87% border=1 cellspacing=0 cellpadding=0 align=center height=109
bordercolorlight=#9999FF bordercolordark=#FFFFFF trtddiv align=center
class=redlargeb祝贺词/b/div /td /tr trtd class=brown9 height=21img
src=image/bz.gif width=15 height=161.欢迎使用杏林同学录。/td /tr trtd
class=brown9img src=image/bz.gif width=15 height=16
2.如果发现bug,请尽快通知我。/td /tr trtd class=brown9 img
src=image/bz.gif width=15 height=163.技术支持: a
href=mailto:webmaster@medguider.51.net
class=purplewebmaster@medguider.51.net/a/td /tr trtddiv align=center
class=redlarge 最新访客留言/div /td /tr trtd class=brown9?php include
config.php; $result = mysql_query(SELECT * FROM notebookg,$db);
$row=mysql_num_rows($result);//查看结果有多少行 if ($row=1) {$x=$row;}
else {$x=2;} $result = mysql_query(select * from notebookg ORDER BY
time DESC limit 0,$x,$db);//读取最近2条留言 for ($i=0;$i=($x-1);$i++) {
$name=mysql_result($result,$i,’name’);
$time=mysql_result($result,$i,’time’);
$title=mysql_result($result,$i,’title’);
$nnote=mysql_result($result,$i,’nnote’); echo ◆留言人:$name 时间 $time
BR主题:$titleBR内容:$nnoteBR; } mysql_close($db); ? /td /tr /table /td
td valign=top width=20%table border=0 cellspacing=0 cellpadding=0
width=150 trtd background=image/yellowbar3.gif class=white12
height=19div align=center悄悄话/div /td /tr trtd bgcolor=#FFFEEFFdiv
align=center class=brown9 对不起,您不是本班同学/div /td /tr trtd
bgcolor=#FFCC66 class=white12 height=20div align=center最新加入/div /td
/tr trtd class=brown9 height=77
bgcolor=#FFFEEFF对不起,您不是本班同学/td /tr trtdtable border=0
cellspacing=0 cellpadding=0 bgcolor=#CFBD9B width=150 trtd height=24
colspan=3img src=image/noticebar.gif width=150 height=25/td /tr trtd
height=182 width=6%/td td width=88% bgcolor=#FFFFFF
background=image/fanhor01-1.jpg class=deepblue10marquee direction=up
scrollamount=1 scrolldelay=130 font
color=#FFCC66★/font本网站已被搜狐、新浪收录br font
color=#FFCC66★/font感谢leo为我们做的新动画logo.br font
color=#FFCC66★/font经过数日的努力,终于用php和mysql数据库将新版同学录做好。特点:用户可在线修改资料;上传照片;悄悄话,oicq头像。br
font color=#FFCC66★/font5460中国同学录上我们班已有14人加入。br font
color=#FFCC66★/font 如果您有漂亮的扫描好的个人照片,请尽快上传。br
/marqee /td td height=182 width=6%/td /tr trtd colspan=3 height=4/td /tr
/table/td /tr /table /td /tr /table div align=centerp
class=black9您是第?php $fs = fopen(counter.txt,r+);$hit =
fgets($fs,10);$hit+=1;rewind($fs);fwrite($fs,$hit,10);$hit =
number_format($hit);fclose($fs); echo font color=’#33FF00’$hit/font; ?
位来访者!br 主页制作: a href= class=black9医学导航网/abr span
class=grey9本页使用了flash,如果不能正常浏览,请安装a href=插件/a/span/p
/div /BODY /HTML

table width=200 border=0 cellpadding=3 cellspacing=1 bgcolor=#4FB4DE tr
td height=25strongfont color=#FFFFFF栏目导航/font/strong/td /tr
[e:loop={select classid,classname from {$dbtbpre}enewsclass where
bclassid=父栏目id order by myorder,classid desc,0,24,0}] ?php
$classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址 ? tr td
height=25 bgcolor=#FFFFFFa href=?=$classurl??=$bqr[classname]?/a/td
/tr [/e:loop] /table

显示效果:
例二:灵动标签显示栏目导航,且给当前终极栏目的背景设为蓝色

table width=200 border=0 cellpadding=3 cellspacing=1 bgcolor=#4FB4DE tr
td height=25strongfont color=#FFFFFF栏目导航/font/strong/td /tr
[e:loop={select classid,classname from {$dbtbpre}enewsclass where
bclassid=父栏目id order by myorder,classid desc,0,24,0}] ?php
$classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址
$bgcolor=#FFFFFF;
if($bqr[classid]==$GLOBALS[navclassid])//当前栏目ID {
$bgcolor=#C3EFFF; } ? tr td height=25 bgcolor=?=$bgcolor?a
href=?=$classurl??=$bqr[classname]?/a/td /tr [/e:loop] /table

$GLOBALS[navclassid]为当前栏目ID。
例三:灵动标签显示一级栏目导航,且在子栏目时也给当前一级栏目的背景设为蓝色

table width=200 border=0 cellpadding=3 cellspacing=1 bgcolor=#4FB4DE tr
td height=25strongfont color=#FFFFFF栏目导航/font/strong/td /tr
[e:loop={select classid,classname from {$dbtbpre}enewsclass where
bclassid=0 order by myorder,classid desc,0,24,0}] ?php
$classurl=sys_ReturnBqClassname($bqr,9);//取得栏目地址
$bgcolor=#FFFFFF; if($GLOBALS[navclassid]) {
$fcr=explode(‘|’,$class_r[$GLOBALS[navclassid]][featherclass]);
$topbclassid=$fcr[1]?$fcr[1]:$GLOBALS[navclassid];//取得当前栏目的一级栏目ID
if($bqr[classid]==$topbclassid) { $bgcolor=#C3EFFF; } } ? tr td
height=25 bgcolor=?=$bgcolor?a
href=?=$classurl??=$bqr[classname]?/a/td /tr [/e:loop] /table

发表评论

电子邮件地址不会被公开。 必填项已用*标注