Posts Tagged ‘完整’

当标题不能显示完整的解决方法

星期三, 06月 4th, 2008

其实建议用css控制超出隐藏显示
也就是标题因为设计de宽度问题所以没有显示全,看样子是使用程序来截字de.我想很多网站都遇到这样de情况.为了视觉效果不得不进行截字显示以满足网站de整体视觉效果.通常我采用截字de方法是两种,一种是通过后台输出时来事先设定一定de字符数量.另一种是通过CSS或是JS来对已经输出de完整de内容进行视觉剪截.
在网页标准没有兴起de时候基本上是采用第一种方式来解决这个问题,直到现在这种方式依然被广泛地使用着.这种方式de好处就是可以准确de剪截字数,而不足可能就是因为剪截de工作在后台已经完成,所以输出de内容是残缺de.而第二种是通过CSS或是JS做出de一种障眼法.把一定长度以外de内容隐藏掉.以达到需要de视觉效果,好处就是他可以保留完整de数据内容,不足之处可能是非IE浏览器截de字并不完美.比如Firefox常常会有截半个字de尴尬现象.
我想提出de问题是:”标题de不完整是否会影响用户de点击动机?”我斗胆提出这样de论断:标题de不完整将在很大层度上影响用户是否会点击该条信息de动机.我这里就用优艾网中de一条新闻标题来作分析.网站中有这样一条新闻标题”美国发明用户界面新技术 对着吹”,这是一句被机械性截掉de标题.面对这样de标题我de好奇心是否被勾引起来,当然有可能.但是我de理解可能是这样de:”美国发明了用户界面de新技术,对着吹……这是个打假新闻.可能是两家公司在吹牛.”如果是这样那么这种八卦de新闻我就没兴趣了.然而这个完整de标题应该是:”美国发明用户界面新技术 对着吹气就能操作计算机”对于这样de标题我就比较有兴趣,我想知道这个吹气为什么就能操作计算机呢,这是我从来没想到过de事.这样我就会有极大de兴趣去点击查看这条新闻.我可以比较发现,其实最容易勾起我好奇心de其实是”吹气操作”.这是新技术de核心.也是这个新闻de核心内容.
当然有时候截字是必需de,否则整个网站就会显得很杂乱.那么现在一般de解决方法就是在链接上加入”title”属性.遇到这种语义不清楚de标题时我通常是鼠标悬停查看提示区中de文字以获得比较完整de标题信息.从而完成我是否点击该新闻de判断.但是可惜de是优艾网标题链接中detitle属性与标题内容是一样de,如此一来title属性de意义大减.
我在设计de时候当然是尽可能de把标题显示完整,如果因为特需原因没办法显示完整de时候要尽可能de使title属性是完整de.还有虽然CSSde截字在Firefox中是有缺陷de,但是我还是觉得截字de事应该由CSS来完成.至少这样我可以得到一个完整deHTML信息文档.当无CSSde时候至少我同样可以看得到完整de信息内容.

很实用的一个完整email发送程序

星期一, 06月 2nd, 2008

很实用de一个完整email发送程序,很简单,把下列相关代码复制到一个空白文本页面,如index.php,运行就行了.具体实例:http://zsvalley.uhome.net/email/index.php.
以下是完整de源相关代码:(有任何问题请email:zsvalley@cmmail.com)
<?
if ($ok==’yes’){
// SetCookie("yname", $yname);
// SetCookie("yemail", $yemail);
if (!eregi("^[_.0-9a-z-] @([0-9a-z][0-9a-z-] .) [a-z]{2,3}$",$yemail)){
echo "请正确填写您deEMAIL地址! <A HREF=’javascript:history.go(-1)’>返回</A>";
}elseif(!eregi("^[_.0-9a-z-] @([0-9a-z][0-9a-z-] .) [a-z]{2,3}$",$femail)){
echo "请正确填写您好友deEMAIL地址! <A HREF=’javascript:history.go(-1)’>返回</A>";
}else{
$message=$fname.",您好:nn您de朋友".$yname."特地来信想对向您说:n———————————–n".$comments."n———————————–nnn提供服务:http://zsvalley.uhome.net/email/nn◆◆◆ valley网络无界限 http://valley.coc.cc ◆◆◆n─────────────────────────n";
//email发送
mail($femail, $title, $message,"From: $yemail");
//echo nl2br($message);
$ok=’no’;
echo "<html><body>".nl2br($message)."<BR><BR><A HREF=index.php>回到发送页面</A></body></html><script language="javascript"> alert("发送成功!"); </script>";
}
exit();
}
?>
<html>
<head>
<TITLE>将网页推荐给好友</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<STYLE type=text/css>BODY {
FONT-SIZE: 14px; LINE-HEIGHT: 18px
}
TD {
FONT-SIZE: 14px; LINE-HEIGHT: 18px
}
.st1 {
BACKGROUND-COLOR: #ffcc66; BORDER-BOTTOM: #ffcc66 1px solid; BORDER-LEFT: #ffcc66 1px solid; BORDER-RIGHT: #ffcc66 1px solid; BORDER-TOP: #ffcc66 1px solid; COLOR: #aa0000; FONT-SIZE: 9pt
}
.st2 {
BACKGROUND-COLOR: #ffcc66; BORDER-BOTTOM: #ec9f00 1px solid; BORDER-LEFT: #ffffff 1px solid; BORDER-RIGHT: #ec9f00 1px solid; BORDER-TOP: #ffffff 1px solid; COLOR: #aa0000; FONT-SIZE: 9pt; HEIGHT: 20px; WIDTH: 60px
}
</STYLE>
<script language=JavaScript runat=Server>
function check()
{
if (document.frmSend.yname.value.length<1)
{
alert("请填写您de姓名!");
}
else if (document.frmSend.yemail.value.length<1)
{
alert("请填写您deEMAIL地址!");
}
else if (document.frmSend.fname.value.length<1)
{
alert("请填写您好友de姓名!");
}
else if (document.frmSend.femail.value.length<1)
{
alert("请填写您好友deEMAIL地址!");
}
else document.frmSend.submit();
}
//=====================DRAGON CODE===============================
function forHtmlSpecialChars(str){ //将HTML中de特殊字符替换成相关代码
str=strReplace(str,"&","&");
str=strReplace(str,""",""");
str=strReplace(str,"<","<");
str=strReplace(str,">",">");
str=strReplace(str," "," ");
return str;
}
function strReplace(str,str1,str2){ //将str中de所有str1替换城str2
while(str.search(str1)>-1)
str=str.replace(str1,str2);
return str;
}
function getParentTitle(){ //获取父页de标题
str=location.href;
str=str.substring(str.indexOf("parentTitle"),str.indexOf("parentTitleEnd"));
str=str.substring(12,str.length);
return str;
}
//======================================================
</script>
<META content="MSHTML 5.00.2920.0" name=GENERATOR>
</head>
<body bgColor=white link=#ec9f00 text=#aa0000>
<center> <H3>快速email系统!</H3><FORM name=frmSend ACTION=index.php METHOD=POST onsubmit="return check();">
<INPUT TYPE="hidden" NAME="referer" value="<?echo $referer;?>"><INPUT TYPE="hidden" NAME="ok" VALUE="yes"><INPUT TYPE="hidden" NAME="title" VALUE="<?echo $parentTitle;?>"><table bgColor=#e99b0a border=0 cellPadding=2 cellSpacing=1>
<tr> <td width="40%" height="22" bgColor=#fdf4db>主题:</td><td width="40%" height="22" bgcolor=#fdf4db>
<input class=st1 name="title" size="20" >
</td></tr> <tr> <td width="40%" height="10" bgColor=#fdf4db></td><td width="60%" height="10" bgcolor="#fdf4db"></td></tr>
<tr> <td width="40%" height="22" bgColor=#fdf4db>您de姓名:</td><td width="60%" height="22" bgcolor=#fdf4db><input class=st1 name="yname" size="20" value=<?echo $yname?>></td></tr>
<tr> <td width="40%" height="10" bgcolor=#fdf4db></td><td width="60%" height="10" bgcolor=#fdf4db></td></tr>
<tr> <td width="40%" height="22" bgcolor=#fdf4db>邮件地址:</td><td width="60%" height="22" bgcolor=#fdf4db><input class=st1 name="yemail" size="20" value=<?echo $yemail?>></td></tr>
<tr> <td width="40%" height="10" bgcolor=#fdf4db></td><td width="60%" height="10" bgcolor=#fdf4db></td></tr>
<tr> <td width="40%" height="22" bgcolor=#fdf4db>朋友de姓名:</td><td width="60%" height="22" bgcolor=#fdf4db><input class=st1 name="fname" size="20" value=></td></tr>
<tr> <td width="40%" height="10" bgcolor=#fdf4db></td><td width=60%height="10" bgcolor=#fdf4db></td></tr>
<tr> <td width="40%" height="22" bgcolor=#fdf4db>邮件地址:</td><td width=60%height="22" bgcolor=#fdf4db><input class=st1 name="femail" size="20" value=></td></tr>
<tr> <td width="40%" height="10" bgcolor=#fdf4db></td><td width=60%height="10" bgcolor=#fdf4db></td></tr>
<tr> <td width="100%" height="22" bgcolor=#fdf4db colspan="2">您想说de话:</td></tr>
<tr> <td width="100%" bgcolor=#fdf4db height="10" colspan="2"><textarea class=st1 rows="6" name="comments"
cols="36"></textarea></td></tr> <tr> <td width="100%" colspan="2" bgcolor=#fdf4db><div align="center"><INPUT TYPE=button CLASS=st2
VALUE="发送" NAME="send" ONCLICK=check()></div></td></tr> </table></form></center><BR><!–#51Net –>
</body>
</html>
【本文版权归作者与奥索网共同拥有,如需转载,请注明作者及出处】

BBS(php

星期一, 06月 2nd, 2008

//此页面为 top.php
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript1.2" src="js/fw_menu.js"></script>
<script language="JavaScript1.2" src="js/menu_comment.js"></script>
</head>
<body bgcolor="#FFFFFF" text="#000000">

<div id="Layer1" style="position:absolute; left:151px; top:81px; width:558px; height:48px; z-index:1">
<script language="JavaScript1.2">fwLoadMenus();</script>
<img name="phpd" src="pic/phpd.gif" width="600" height="28" border="0" usemap="#m_phpd">
<!– fwtable fwsrc="phpd.png" fwbase="phpd" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" –>
<map name="m_phpd">
<area shape="rect" coords="378,-6,464,18" href="#" onMouseOut="parent.mainFrame.FW_startTimeout();" onMouseOver="parent.mainFrame.window.FW_showMenu(window.fw_menu_0,381,0);" >
<area shape="rect" coords="265,0,343,21" href="#" onMouseOut="parent.mainFrame.FW_startTimeout();" onMouseOver="parent.mainFrame.window.FW_showMenu(window.fw_menu_1,266,0);" >
<area shape="rect" coords="142,-6,227,20" href="#" onMouseOut="parent.mainFrame.FW_startTimeout();" onMouseOver="parent.mainFrame.window.FW_showMenu(window.fw_menu_2,149,0);" >
<area shape="rect" coords="31,-7,114,21" href="#" onMouseOut="parent.mainFrame.FW_startTimeout();" onMouseOver="parent.mainFrame.window.FW_showMenu(window.fw_menu_3,40,0);" >
<area shape="rect" coords="31,-7,580,21" href="sturecord.php" target="_blank" >
</map>
</div>
<div id="Layer2" style="position:absolute; left:4px; top:3px; width:148px; height:98px; z-index:2"><a href="aboutme.php" target="_blank"><img src="pic/FD_03Sd.gif" width="133" height="100" border="0" align="left" alt="站长自我介绍!!"></a></div>
</body>
</html>

//此页面为 index.php
<?
header("Expires: Sun, 28 Dec 1997 09:32:45 GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");

?>

<html>
<head>
<title>::: xiaoyang :::</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
<!–
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// –>
</script>
</head>
<frameset rows="103,*" frameborder="NO" border="0" framespacing="0" cols="*">
<frame name="topFrame" scrolling="NO" noresize src="top.php" >
<frameset cols="128,*" frameborder="NO" border="0" framespacing="0" rows="*">
<frame name="leftFrame" scrolling="no" noresize src="right.php">
<frame name="mainFrame" scrolling="auto" noresize src="left.php">
</frameset>
</frameset>
<noframes>
<body bgcolor="#FFFFFF" text="#000000">

</body>
</noframes>

</html>

BBS(php

星期一, 06月 2nd, 2008

//此页面为say.php
<?
include "signup/mysql.inc";
if($id1){
$sql="select * from $table where id=’$id1′"; //显示回复题目
$result=mysql_query($sql)or die(mysql_error());
$row=mysql_fetch_array($result);
$title="RE:".$row["title"];
}
$ip=$REMOTE_ADDR;
$sql="select * from user_stus where ip=’$ip’"; //查询当前用户名
$result=mysql_query($sql)or die(mysql_error());
$row=mysql_fetch_array($result);
if(!$row) //判断用户是否登陆
{
echo "<html><div id=Layer2 align=center z-index:1><BR><BR><BR><BR>";
echo" <div id=Layer3 align=center z-index:2><img src=pic/3.gif width=15 height=15></div>";
echo" <div align=center>";
echo" <p><font size=2 color=#FF33CC>嘻嘻!! 请先登陆</font></p>";
echo"<p><font size=2 color=#FF33CC><a href=’".$PHP_SELF."?p=1&&table=$table’>返回</a></font></p> </div> </html>";
exit();
}
else $userid=$row["userid"];

if($ok)
{
if($title==""||$content=="")
{
echo "<BR> 请您添完整后提交";
}
else{
$id=time(); //提交文章
$date1=date("Y/m/d");
$title=htmlspecialchars($title);
$content=htmlspecialchars($content);
$sql="select * from ".$table;
$result=mysql_query($sql)or die(mysql_error());
$row1=mysql_num_rows($result);
$row1 ;
if($id1){
$sql="insert into bbs_re (id,userid,date1,title,content)values(’$id’,'$userid’,'$date1′,’$title’,'$content’)";
mysql_query($sql)or die(mysql_error());
$sql="select * from ".$table." where id=’$id1′";
$result=mysql_query($sql)or die(mysql_error());
$lin=mysql_fetch_array($result);
for($i=1;$i<6;$i )
{
$re="r".$i;
if(!$lin["$re"])
break;
}
$sql="update ".$table." set ".$re."=’$id’ where id=’$id1′";
}
else
$sql="insert into ".$table." (id,userid,date1,title,content,row)values(’$id’,'$userid’,'$date1′,’$title’,'$content’,'$row1′)";
$result=mysql_query($sql)or die(mysql_error());

if($result)
{
header("Location:php3.php?p=1&&table=$table");
exit ;
}
}
}

?>

<html>
<head>
<title>xiaoyang</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript1.2" src="js/menu_comment.js"></script>
<script language="JavaScript1.2" src="js/fw_menu.js"></script>
<script language="JavaScript">
<!–
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// –>
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="Layer1" style="position:absolute; left:31px; top:1px; width:560px; height:46px; z-index:10">
<script language="JavaScript1.2">fwLoadMenus();</script></div>

<div id="Layer6" style="position:absolute; left:409px; top:29px; width:118px; height:17px; z-index:6"></div>
<div id="Layer5" style="position:absolute; left:86px; top:63px; width:464px; height:303px; z-index:7">
<form name="form1" method="post" action="<? echo $PHP_SELF ?>">
<table width="98%" border="1" cellspacing="0" cellpadding="0" bordercolor="#FF99FF">
<tr>
<td width="26%" height="42">
<div align="center"><font size="2" color="#FF33FF">题目</font></div>
</td>
<td width="74%" height="42">
<input type="text" name="title" size="40" value="<?echo $title ;?>" onMouseover="this.document.form1.title.focus();return true">
<input type="hidden" name="table" value="<?echo $table ;?>">
<input type="hidden" name="id1" value="<? echo $id1 ;?>">
<br>
</td>
</tr>
<tr>
<td width="26%" height="172">
<div align="center"><font size="2" color="#FF33FF">内容</font></div>
</td>
<td width="74%" height="172">
<textarea name="content" cols="40" rows="10" wrap="physical" value="<?echo $content ;?>" onMouseOver="this.document.form1.content.focus()"></textarea>
</td>
</tr>
<tr>
<td width="26%">
<div align="center">
<input type="reset" name="Submit2" value="重写">
</div>
</td>
<td width="74%">
<div align="center">
<input type="submit" name="ok" value="发表">
</div>
</td>
</tr>
</table>
<p> </p>
</form>
</div>
<div id="back" style="position:absolute; left:455px; top:30px; width:85px; height:3px; z-index:8">
<hr color="#ff9999" noshade>
</div>
<div id="goback" style="position:absolute; left:461px; top:23px; width:120px; height:16px; z-index:9">
<div align="center"><a href="php3.php?p=1&&table=<?echo $table ;?>" target="_self" onMouseover="window.status=” ;return true"><font size="2" color="#FF33FF">返回</font></a></div>
</div>
<p> </p>
<p> </p>
</body>
</html>

BBS(php

星期一, 06月 2nd, 2008

//完毕 wish you sucess!!
# phpMyAdmin MySQL-Dump
# http://phpwizard.net/phpMyAdmin/
#
# 主机: localhost:3306 数据库 : database
# ——————————————————–
#
# 数据表de结构 ‘bbs_html’
#
CREATE TABLE bbs_html (
id int(15) DEFAULT ‘0′ NOT NULL,
userid varchar(20) NOT NULL,
date1 varchar(20) NOT NULL,
title varchar(40) NOT NULL,
content text NOT NULL,
r1 int(15) DEFAULT ‘0′ NOT NULL,
r2 int(15) DEFAULT ‘0′ NOT NULL,
number tinyint(4) DEFAULT ‘0′ NOT NULL,
row tinyint(5) DEFAULT ‘0′ NOT NULL,
r3 int(15) DEFAULT ‘0′ NOT NULL,
r4 int(15) DEFAULT ‘0′ NOT NULL,
r5 int(15) DEFAULT ‘0′ NOT NULL,
UNIQUE id (id)
);

# ——————————————————–
#
# 数据表de结构 ‘bbs_js’
#
CREATE TABLE bbs_js (
id int(15) DEFAULT ‘0′ NOT NULL,
userid varchar(20) NOT NULL,
date1 varchar(20) NOT NULL,
title varchar(40) NOT NULL,
content text NOT NULL,
r1 int(15) DEFAULT ‘0′ NOT NULL,
r2 int(15) DEFAULT ‘0′ NOT NULL,
number tinyint(4) DEFAULT ‘0′ NOT NULL,
row tinyint(5) DEFAULT ‘0′ NOT NULL,
r3 int(15) DEFAULT ‘0′ NOT NULL,
r4 int(15) DEFAULT ‘0′ NOT NULL,
r5 int(15) DEFAULT ‘0′ NOT NULL,
UNIQUE id (id)
);

# ——————————————————–
#
# 数据表de结构 ‘bbs_mysql
#
CREATE TABLE bbs_mysql (
id int(15) DEFAULT ‘0′ NOT NULL,
userid varchar(20) NOT NULL,
date1 varchar(20) NOT NULL,
title varchar(40) NOT NULL,
content text NOT NULL,
r1 int(15) DEFAULT ‘0′ NOT NULL,
r2 int(15) DEFAULT ‘0′ NOT NULL,
number tinyint(4) DEFAULT ‘0′ NOT NULL,
row tinyint(5) DEFAULT ‘0′ NOT NULL,
r3 int(15) DEFAULT ‘0′ NOT NULL,
r4 int(15) DEFAULT ‘0′ NOT NULL,
r5 int(15) DEFAULT ‘0′ NOT NULL,
UNIQUE id (id)
);

# ——————————————————–
#
# 数据表de结构 ‘bbs_php’
#
CREATE TABLE bbs_php (
id int(15) DEFAULT ‘0′ NOT NULL,
userid varchar(20) NOT NULL,
date1 varchar(20) NOT NULL,
title varchar(40) NOT NULL,
content text NOT NULL,
r1 int(15) DEFAULT ‘0′ NOT NULL,
r2 int(15) DEFAULT ‘0′ NOT NULL,
number tinyint(4) DEFAULT ‘0′ NOT NULL,
row tinyint(5) DEFAULT ‘0′ NOT NULL,
r3 int(15) DEFAULT ‘0′ NOT NULL,
r4 int(15) DEFAULT ‘0′ NOT NULL,
r5 int(15) DEFAULT ‘0′ NOT NULL,
UNIQUE id (id)
);

# ——————————————————–
#
# 数据表de结构 ‘bbs_re’
#
CREATE TABLE bbs_re (
id int(15) DEFAULT ‘0′ NOT NULL,
userid varchar(20) NOT NULL,
title varchar(40) NOT NULL,
content text NOT NULL,
date1 varchar(30) NOT NULL
);

# ——————————————————–
#
# 数据表de结构 ‘user’
#
CREATE TABLE user (
id int(15) DEFAULT ‘0′ NOT NULL,
userid varchar(20) NOT NULL,
name varchar(20) NOT NULL,
passwd varchar(20) NOT NULL,
sex varchar(5) NOT NULL,
age char(3) NOT NULL,
question varchar(20) NOT NULL,
answer varchar(20) NOT NULL,
birthday varchar(20) NOT NULL,
oicq varchar(10) NOT NULL,
height varchar(4) NOT NULL,
myphoto char(3) NOT NULL,
email varchar(30) NOT NULL,
homepage varchar(40) NOT NULL,
hobby varchar(40) NOT NULL,
number varchar(10) NOT NULL,
room varchar(20) NOT NULL,
department varchar(20) NOT NULL,
phone varchar(20) NOT NULL,
ready1 varchar(10) NOT NULL,
ready2 varchar(10) NOT NULL,
ready3 varchar(10) NOT NULL,
UNIQUE userid (userid),
KEY id (id, userid)
);

# ——————————————————–
#
# 数据表de结构 ‘user_stus’
#
CREATE TABLE user_stus (
id int(15) DEFAULT ‘0′ NOT NULL,
status varchar(6) NOT NULL,
userid varchar(15) DEFAULT ‘0′ NOT NULL,
ip varchar(20) NOT NULL,
r2 char(2) NOT NULL,
r3 char(2) NOT NULL,
r4 char(2) NOT NULL,
PRIMARY KEY (userid)
);

BBS(php

星期一, 06月 2nd, 2008

proto.menuBorder;
var focusItem = body.document.layers[n];
focusItem.clip.width = body.clip.width;
focusItem.Menu = l.Menu;
focusItem.top = -30;
focusItem.captureEvents(Event.MOUSEDOWN);
focusItem.onmousedown = onMenuItemDown;
menu.document.bgColor = proto.menuBorderBgColor;
var lite = menu.document.layers[0];
lite.document.bgColor = proto.menuLiteBgColor;
lite.clip.width = body.clip.width 1;
lite.clip.height = body.clip.height 1;
menu.clip.width = body.clip.width (proto.menuBorder * 3) ;
menu.clip.height = body.clip.height (proto.menuBorder * 3);
}
} else {
if ((!document.all) && (container.hasChildNodes)) {
container.innerHTML=content;
} else {
container.document.open("text/html");
container.document.writeln(content);
container.document.close();
}
if (!FIND("menuLayer0")) return;
var menuCount = 0;
for (var x=0; x<container.menus.length; x ) {
var menuLayer = FIND("menuLayer" x);
container.menus[x].menuLayer = "menuLayer" x;
menuLayer.Menu = container.menus[x];
menuLayer.Menu.container = "menuLayer" x;
menuLayer.style.zIndex = 1;
var s = menuLayer.style;
s.top = s.pixelTop = -300;
s.left = s.pixelLeft = -300;
var menu = container.menus[x];
menu.menuItemWidth = menu.menuWidth || menu.menuIEWidth || 140;
menuLayer.style.backgroundColor = menu.menuBorderBgColor;
var top = 0;
for (var i=0; i<container.menus[x].items.length; i ) {
var l = FIND("menuItem" menuCount);
l.Menu = container.menus[x];
if (l.addEventListener) { // ns6
l.style.width = menu.menuItemWidth;
l.style.height = menu.menuItemHeight;
l.style.top = top;
l.addEventListener("mouseover", onMenuItemOver, false);
l.addEventListener("click", onMenuItemAction, false);
l.addEventListener("mouseout", mouseoutMenu, false);
} else { //ie
l.style.pixelWidth = menu.menuItemWidth;
l.style.pixelHeight = menu.menuItemHeight;
l.style.pixelTop = top;
}
top = top menu.menuItemHeight menu.menuItemBorder;
l.style.fontSize = menu.fontSize;
l.style.backgroundColor = menu.menuItemBgColor;
l.style.visibility = "inherit";
l.saveColor = menu.menuItemBgColor;
l.menuHiliteBgColor = menu.menuHiliteBgColor;
l.action = container.menus[x].actions[i];
l.hilite = FIND("menuItemHilite" menuCount);
l.focusItem = FIND("focusItem" x);
l.focusItem.style.pixelTop = l.focusItem.style.top = -30;
var childItem = FIND("childMenu" menuCount);
if (childItem) {
l.childMenu = container.menus[x].items[i].menuLayer;
childItem.style.pixelLeft = childItem.style.left = menu.menuItemWidth -11;
childItem.style.pixelTop = childItem.style.top =(menu.menuItemHeight /2) -4;
//childItem.style.pixelWidth = 30 || 7;
//childItem.style.clip = "rect(0 7 7 3)";
l.Menu.childMenus[l.Menu.childMenus.length] = l.childMenu;
}
var sep = FIND("menuSeparator" menuCount);
if (sep) {
sep.style.clip = "rect(0 " (menu.menuItemWidth - 3) " 1 0)";
sep.style.width = sep.style.pixelWidth = menu.menuItemWidth;
sep.style.backgroundColor = menu.bgColor;
sep = FIND("menuSeparatorLite" menuCount);
sep.style.clip = "rect(1 " (menu.menuItemWidth - 3) " 2 0)";
sep.style.width = sep.style.pixelWidth = menu.menuItemWidth;
sep.style.backgroundColor = menu.menuLiteBgColor;
l.style.height = l.style.pixelHeight = menu.menuItemHeight/2;
l.isSeparator = true
top -= (menu.menuItemHeight - l.style.pixelHeight)
} else {
l.style.cursor = "hand"
}
menuCount ;
}
menu.menuHeight = top-1;
var lite = FIND("menuLite" x);
var s = lite.style;
s.height = s.pixelHeight = menu.menuHeight (menu.menuBorder * 2);
s.width = s.pixelWidth = menu.menuItemWidth (menu.menuBorder * 2);
s.backgroundColor = menu.menuLiteBgColor;
var body = FIND("menuFg" x);
s = body.style;
s.height = s.pixelHeight = menu.menuHeight menu.menuBorder;
s.width = s.pixelWidth = menu.menuItemWidth menu.menuBorder;
s.backgroundColor = menu.bgColor;
s = menuLayer.style;
s.width = s.pixelWidth = menu.menuItemWidth (menu.menuBorder * 4);
s.height = s.pixelHeight = menu.menuHeight (menu.menuBorder*4);
}
}
if (document.captureEvents) {
document.captureEvents(Event.MOUSEUP);
}
if (document.addEventListener) {
document.addEventListener("mouseup", onMenuItemOver, false);
}
if (document.layers && window.innerWidth) {
window.onresize = NS4resize;
window.NS4sIW = window.innerWidth;
window.NS4sIH = window.innerHeight;
}
document.onmouseup = mouseupMenu;
window.fwWroteMenu = true;
status = "";
}
function NS4resize() {
if (NS4sIW < window.innerWidth ||
NS4sIW > window.innerWidth ||
NS4sIH > window.innerHeight ||
NS4sIH < window.innerHeight )
{
window.location.reload();
}
}
function onMenuItemOver(e, l) {
FW_clearTimeout();
l = l || this;
a = window.ActiveMenuItem;
if (document.layers) {
if (a) {
a.document.bgColor = a.saveColor;
if (a.hilite) a.hilite.visibility = "hidden";
if (a.Menu.bgImageOver) {
a.background.src = a.Menu.bgImageUp;
}
a.focusItem.top = -100;
a.clicked = false;
}
if (l.hilite) {
l.document.bgColor = l.menuHiliteBgColor;
l.zIndex = 1;
l.hilite.visibility = "inherit";
l.hilite.zIndex = 2;
l.document.layers[1].zIndex = 1;
l.focusItem.zIndex = this.zIndex 2;
}
if (l.Menu.bgImageOver) {
l.background.src = l.Menu.bgImageOver;
}
l.focusItem.top = this.top;
l.Menu.hideChildMenu(l);
} else if (l.style && l.Menu) {
if (a) {
a.style.backgroundColor = a.saveColor;
if (a.hilite) a.hilite.style.visibility = "hidden";
if (a.Menu.bgImageUp) {
a.style.background = "url(" a.Menu.bgImageUp ")";;
}
}
if (l.isSeparator) return;
l.style.backgroundColor = l.menuHiliteBgColor;
l.zIndex = 1; // magic IE 4.5 mac happy doohicky. jba
if (l.Menu.bgImageOver) {
l.style.background = "url(" l.Menu.bgImageOver ")";
}
if (l.hilite) {
l.style.backgroundColor = l.menuHiliteBgColor;
l.hilite.style.visibility = "inherit";
}
l.focusItem.style.top = l.focusItem.style.pixelTop = l.style.pixelTop;
l.focusItem.style.zIndex = l.zIndex 1;
l.Menu.hideChildMenu(l);
} else {
return; // not a menu - magic IE 4.5 mac happy doohicky. jba
}
window.ActiveMenuItem = l;
}
function onMenuItemAction(e, l) {
l = window.ActiveMenuItem;
if (!l) return;
hideActiveMenus();
if (l.action) {
eval("" l.action);
}
window.ActiveMenuItem = 0;
}
function FW_clearTimeout()
{
if (fwHideMenuTimer) clearTimeout(fwHideMenuTimer);
fwHideMenuTimer = null;
fwDHFlag = false;
}
function FW_startTimeout()
{
fwStart = new Date();
fwDHFlag = true;
fwHideMenuTimer = setTimeout("fwDoHide()", 1000);
}
function fwDoHide()
{
if (!fwDHFlag) return;
var elapsed = new Date() - fwStart;
if (elapsed < 1000) {
fwHideMenuTimer = setTimeout("fwDoHide()", 1100-elapsed);
return;
}
fwDHFlag = false;
hideActiveMenus();
window.ActiveMenuItem = 0;
}
function FW_showMenu(menu, x, y, child) {
if (!window.fwWroteMenu) return;
FW_clearTimeout();
if (document.layers) {
if (menu) {
var l = menu.menuLayer || menu;
l.left = 1;
l.top = 1;
hideActiveMenus();
if (this.visibility) l = this;
window.ActiveMenu = l;
} else {
var l = child;
}
if (!l) return;
for (var i=0; i<l.layers.length; i ) {
if (!l.layers[i].isHilite)
l.layers[i].visibility = "inherit";
if (l.layers[i].document.layers.length > 0)
FW_showMenu(null, "relative", "relative", l.layers[i]);
}
if (l.parentLayer) {
if (x != "relative")
l.parentLayer.left = x || window.pageX || 0;
if (l.parentLayer.left l.clip.width > window.innerWidth)
l.parentLayer.left -= (l.parentLayer.left l.clip.width - window.innerWidth);
if (y != "relative")
l.parentLayer.top = y || window.pageY || 0;
if (l.parentLayer.isContainer) {
l.Menu.xOffset = window.pageXOffset;
l.Menu.yOffset = window.pageYOffset;
l.parentLayer.clip.width = window.ActiveMenu.clip.width 2;
l.parentLayer.clip.height = window.ActiveMenu.clip.height 2;
if (l.parentLayer.menuContainerBgColor) l.parentLayer.document.bgColor = l.parentLayer.menuContainerBgColor;
}
}
l.visibility = "inherit";
if (l.Menu) l.Menu.container.visibility = "inherit";
} else if (FIND("menuItem0")) {
var l = menu.menuLayer || menu;
hideActiveMenus();
if (typeof(l) == "string") {
l = FIND(l);
}
window.ActiveMenu = l;
var s = l.style;
s.visibility = "inherit";
if (x != "relative")
s.left = s.pixelLeft = x || (window.pageX document.body.scrollLeft) || 0;
if (y != "relative")
s.top = s.pixelTop = y || (window.pageY document.body.scrollTop) || 0;
l.Menu.xOffset = document.body.scrollLeft;
l.Menu.yOffset = document.body.scrollTop;
}
if (menu) {
window.activeMenus[window.activeMenus.length] = l;
}
}
function onMenuItemDown(e, l) {
var a = window.ActiveMenuItem;
if (document.layers) {
if (a) {
a.eX = e.pageX;
a.eY = e.pageY;
a.clicked = true;
}
}
}
function mouseupMenu(e)
{
hideMenu(true, e);
hideActiveMenus();
return true;
}
function mouseoutMenu()
{
hideMenu(false, false);
return true;
}

function hideMenu(mouseup, e) {
var a = window.ActiveMenuItem;
if (a && document.layers) {
a.document.bgColor = a.saveColor;
a.focusItem.top = -30;
if (a.hilite) a.hilite.visibility = "hidden";
if (mouseup && a.action && a.clicked && window.ActiveMenu) {
if (a.eX <= e.pageX 15 && a.eX >= e.pageX-15 && a.eY <= e.pageY 10 && a.eY >= e.pageY-10) {
setTimeout(’window.ActiveMenu.Menu.onMenuItemAction();’, 2);
}
}
a.clicked = false;
if (a.Menu.bgImageOver) {
a.background.src = a.Menu.bgImageUp;
}
} else if (window.ActiveMenu && FIND("menuItem0")) {
if (a) {
a.style.backgroundColor = a.saveColor;
if (a.hilite) a.hilite.style.visibility = "hidden";
if (a.Menu.bgImageUp) {
a.style.background = "url(" a.Menu.bgImageUp ")";;
}
}
}
if (!mouseup && window.ActiveMenu) {
if (window.ActiveMenu.Menu) {
if (window.ActiveMenu.Menu.hideOnMouseOut) {
FW_startTimeout();
}
return(true);
}
}
return(true);
}
function PxToNum(pxStr)
{ // pxStr == 27px, we want 27.
if (pxStr.length > 2) {
n = Number(pxStr.substr(0, pxStr.length-2));
return(n);
}
return(0);
}
function hideChildMenu(hcmLayer) {
FW_clearTimeout();
var l = hcmLayer;
for (var i=0; i < l.Menu.childMenus.length; i ) {
var theLayer = l.Menu.childMenus[i];
if (document.layers) {
theLayer.visibility = "hidden";
} else {
theLayer = FIND(theLayer);
theLayer.style.visibility = "hidden";
}
theLayer.Menu.hideChildMenu(theLayer);
}
if (l.childMenu) {
var childMenu = l.childMenu;
if (document.layers) {
l.Menu.FW_showMenu(null,null,null,childMenu.layers[0]);
childMenu.zIndex = l.parentLayer.zIndex 1;
childMenu.top = l.top l.parentLayer.top l.Menu.menuLayer.top l.Menu.menuItemHeight/3;
if (childMenu.left childMenu.clip.width > window.innerWidth) {
childMenu.left = l.parentLayer.left - childMenu.clip.width l.Menu.menuLayer.left 15;
l.Menu.container.clip.left -= childMenu.clip.width;
} else {
childMenu.left = l.parentLayer.left l.parentLayer.clip.width l.Menu.menuLayer.left -5;
}
var w = childMenu.clip.width childMenu.left-l.Menu.container.clip.left;
if (w > l.Menu.container.clip.width)
l.Menu.container.clip.width = w;
var h = childMenu.clip.height childMenu.top-l.Menu.container.clip.top;
if (h > l.Menu.container.clip.height) l.Menu.container.clip.height = h;
l.document.layers[1].zIndex = 0;
childMenu.visibility = "inherit";
} else if (FIND("menuItem0")) {
childMenu = FIND(l.childMenu);
var menuLayer = FIND(l.Menu.menuLayer);
var s = childMenu.style;
s.zIndex = menuLayer.style.zIndex 1;
if (document.all) { // ie case.
s.pixelTop = l.style.pixelTop menuLayer.style.pixelTop l.Menu.menuItemHeight/3;
s.left = s.pixelLeft = (menuLayer.style.pixelWidth) menuLayer.style.pixelLeft -5;
} else { // zilla case
var top = PxToNum(l.style.top) PxToNum(menuLayer.style.top) l.Menu.menuItemHeight/3;
var left = (PxToNum(menuLayer.style.width)) PxToNum(menuLayer.style.left) -5;
s.top = top;
s.left = left;
}
childMenu.style.visibility = "inherit";
} else {
return;
}
window.activeMenus[window.activeMenus.length] = childMenu;
}
}
function hideActiveMenus() {
if (!window.activeMenus) return;
for (var i=0; i < window.activeMenus.length; i ) {
if (!activeMenus[i]) continue;
if (activeMenus[i].visibility && activeMenus[i].Menu) {
activeMenus[i].visibility = "hidden";
activeMenus[i].Menu.container.visibility = "hidden";
activeMenus[i].Menu.container.clip.left = 0;
} else if (activeMenus[i].style) {
var s = activeMenus[i].style;
s.visibility = "hidden";
s.left = -200;
s.top = -200;
}
}
if (window.ActiveMenuItem) {
hideMenu(false, false);
}
window.activeMenus.length = 0;
}

BBS(php

星期一, 06月 2nd, 2008

//下面是 top.js
function KB_keepItInIE(theName,theWantTop,theWantLeft) {
theRealTop=parseInt(document.body.scrollTop)
theTrueTop=theWantTop theRealTop
document.all[theName].style.top=theTrueTop
theRealLeft=parseInt(document.body.scrollLeft)
theTrueLeft=theWantLeft theRealLeft
document.all[theName].style.left=theTrueLeft
}
function KB_keepItInNN(theName,theWantX,theWantY) {
theRealLay=document.layers[theName]
theBadX=self.pageYOffset
theBadY=self.pageXOffset
theRealX=theBadX theWantX
theRealY=theBadY theWantY
theRealLay.moveTo(theRealY,theRealX)
}
IE4=(document.all)?1:0
NN4=(document.layers)?1:0
//if (IE4)
//setInterval(’KB_keepItInIE("KBStatic",0,0)’,1)
//if (NN4)
//setInterval(’KB_keepItInNN("KBStatic",0,0)’,1)

//下面是menu.php
<div id="Layer1" style="position:absolute; left:31px; top:1px; width:560px; height:46px; z-index:5">
<script language="JavaScript1.2">fwLoadMenus();
</script></div>

<SCRIPT LANGUAGE="JavaScript">
<!–
if (IE4)
setInterval(’KB_keepItInIE("Layer1",0,31)’,1)
if (NN4)
setInterval(’KB_keepItInNN("Layer1",0,31)’,1)
//–>
</SCRIPT>
//下面是 menuhead.php
<?
echo "<script language=JavaScript1.2 src=’js/menu_comment.js’></script><script language=JavaScript1.2 src=’js/fw_menu.js’></script><script language=JavaScript1.2 src=’js/top.js’></script>";
?>

//下面为mysql.inc
<?
$link=mysql_pconnect("localhost","xiaoyang","xiaoyang")or die(mysql_error());
$link1=mysql_select_db("database")or die(mysql_error());

?>

BBS(php

星期一, 06月 2nd, 2008

//下面为menu_comment.js
function fwLoadMenus() {
if (window.fw_menu_0) return;
window.fw_menu_0 = new Menu("root",92,20,"Verdana, Arial, Helvetica, sans-serif",12,"#6666ff","#ffffff","#FF9999","#6666ff");
fw_menu_0.addMenuItem("Javascript","window.open(’left.php’, ‘_self’);");
fw_menu_0.addMenuItem("Css快速入门","window.open(’left.php’, ‘_self’);");
fw_menu_0.addMenuItem("JS在线资源","window.open(’left.php’, ‘_self’);");
fw_menu_0.addMenuItem("相关论坛","window.open(’php3.php?part=4&&p=1′, ‘_self’);");
fw_menu_0.fontWeight="solid";
fw_menu_0.hideOnMouseOut=true;
window.fw_menu_1 = new Menu("root",92,20,"Verdana, Arial, Helvetica, sans-serif",12,"#6666ff","#ffffff","#FF9999","#6666ff");
fw_menu_1.addMenuItem("Dreamwaver","window.open(’left.php’, ‘_self’);");
fw_menu_1.addMenuItem("Firework","window.open(’left.php’, ‘_self’);");
fw_menu_1.addMenuItem("Flash入门","window.open(’left.php’, ‘_self’);");
fw_menu_1.addMenuItem("Html教程","window.open(’left.php’, ‘_self’);");
fw_menu_1.addMenuItem("相关论坛","window.open(’php3.php?part=3&&p=1′, ‘_self’);");
fw_menu_1.fontWeight="solid";
fw_menu_1.hideOnMouseOut=true;
window.fw_menu_2 = new Menu("root",86,20,"Verdana, Arial, Helvetica, sans-serif",12,"#6666ff","#ffffff","#FF9999","#6666ff");
fw_menu_2.addMenuItem("Mysql介绍","window.open(’mysql1.php’, ‘_self’);");
fw_menu_2.addMenuItem("在线下载","window.open(’mysql2.php’, ‘_self’);");
fw_menu_2.addMenuItem("学习教程","window.open(’mysql4a.php’, ‘_self’);");
fw_menu_2.addMenuItem("Mysql论坛","window.open(’php3.php?part=2&&p=1′, ‘_self’);");
fw_menu_2.fontWeight="solid";
fw_menu_2.hideOnMouseOut=true;
window.fw_menu_3 = new Menu("root",76,20,"Verdana, Arial, Helvetica, sans-serif",12,"#6666ff","#ffffff","#FF9999","#6666ff");
fw_menu_3.addMenuItem("安装配置","window.open(’php1.php?id1=1&&id2=1′, ‘_self’);");
fw_menu_3.addMenuItem("程序相关代码","window.open(’php2.php?id1=2&&id2=1′, ‘_self’);");
fw_menu_3.addMenuItem("学习教程","window.open(’php4.php?id1=4&&id2=1′, ‘_self’);");
fw_menu_3.addMenuItem("PHP论坛","window.open(’php3.php?part=1&&p=1′, ‘_self’);");
fw_menu_3.fontWeight="solid";
fw_menu_3.hideOnMouseOut=true;
fw_menu_3.writeMenus();
} // fwLoadMenus()
//下面是fw_menu.js
function Menu(label, mw, mh, fnt, fs, fclr, fhclr, bg, bgh) {
this.version = "990702 [Menu; menu.js]";
this.type = "Menu";
this.menuWidth = mw;
this.menuItemHeight = mh;
this.fontSize = fs||12;
this.fontWeight = "plain";
this.fontFamily = fnt||"arial,helvetica,verdana,sans-serif";
this.fontColor = fclr||"#000000";
this.fontColorHilite = fhclr||"#ffffff";
this.bgColor = "#555555";
this.menuBorder = 1;
this.menuItemBorder = 1;
this.menuItemBgColor = bg||"#cccccc";
this.menuLiteBgColor = "#ffffff";
this.menuBorderBgColor = "#777777";
this.menuHiliteBgColor = bgh||"#000084";
this.menuContainerBgColor = "#cccccc";
this.childMenuIcon = "arrows.gif";
this.items = new Array();
this.actions = new Array();
this.childMenus = new Array();
this.hideOnMouseOut = true;
this.addMenuItem = addMenuItem;
this.addMenuSeparator = addMenuSeparator;
this.writeMenus = writeMenus;
this.FW_showMenu = FW_showMenu;
this.onMenuItemOver = onMenuItemOver;
this.onMenuItemAction = onMenuItemAction;
this.hideMenu = hideMenu;
this.hideChildMenu = hideChildMenu;
if (!window.menus) window.menus = new Array();
this.label = label || "menuLabel" window.menus.length;
window.menus[this.label] = this;
window.menus[window.menus.length] = this;
if (!window.activeMenus) window.activeMenus = new Array();
}
function addMenuItem(label, action) {
this.items[this.items.length] = label;
this.actions[this.actions.length] = action;
}
function addMenuSeparator() {
this.items[this.items.length] = "separator";
this.actions[this.actions.length] = "";
this.menuItemBorder = 0;
}
// For NS6.
function FIND(item) {
if (document.all) return(document.all[item]);
if (document.getElementById) return(document.getElementById(item));
return(false);
}
function writeMenus(container) {
if (window.triedToWriteMenus) return;
if (!container && document.layers) {
window.delayWriteMenus = this.writeMenus;
var timer = setTimeout(’delayWriteMenus()’, 250);
container = new Layer(100);
clearTimeout(timer);
} else if (document.all || document.hasChildNodes) {
document.writeln(’<SPAN ID="menuContainer"></SPAN>’);
container = FIND("menuContainer");
}
window.fwHideMenuTimer = null;
if (!container) return;
window.triedToWriteMenus = true;
container.isContainer = true;
container.menus = new Array();
for (var i=0; i<window.menus.length; i )
container.menus[i] = window.menus[i];
window.menus.length = 0;
var countMenus = 0;
var countItems = 0;
var top = 0;
var content = ”;
var lrs = false;
var theStat = "";
var tsc = 0;
if (document.layers) lrs = true;
for (var i=0; i<container.menus.length; i , countMenus ) {
var menu = container.menus[i];
if (menu.bgImageUp) {
menu.menuBorder = 0;
menu.menuItemBorder = 0;
}
if (lrs) {
var menuLayer = new Layer(100, container);
var lite = new Layer(100, menuLayer);
lite.top = menu.menuBorder;
lite.left = menu.menuBorder;
var body = new Layer(100, lite);
body.top = menu.menuBorder;
body.left = menu.menuBorder;
} else {
content = ”
‘<DIV ID="menuLayer’ countMenus ‘" STYLE="position:absolute;z-index:1;left:10;top:’ (i * 100) ‘;visibility:hidden;">n’
‘ <DIV ID="menuLite’ countMenus ‘" STYLE="position:absolute;z-index:1;left:’ menu.menuBorder ‘;top:’ menu.menuBorder ‘;visibility:hide;" onMouseOut="mouseoutMenu();">n’
‘ <DIV ID="menuFg’ countMenus ‘" STYLE="position:absolute;left:’ menu.menuBorder ‘;top:’ menu.menuBorder ‘;visibility:hide;">n’
”;
}
var x=i;
for (var i=0; i<menu.items.length; i ) {
var item = menu.items[i];
var childMenu = false;
var defaultHeight = menu.fontSize 6;
var defaultIndent = menu.fontSize;
if (item.label) {
item = item.label;
childMenu = true;
}
menu.menuItemHeight = menu.menuItemHeight || defaultHeight;
menu.menuItemIndent = menu.menuItemIndent || defaultIndent;
var itemProps = ‘font-family:’ menu.fontFamily ‘;font-weight:’ menu.fontWeight ‘;fontSize:’ menu.fontSize ‘;’;
if (menu.fontStyle) itemProps = ‘font-style:’ menu.fontStyle ‘;’;
if (document.all)
itemProps = ‘font-size:’ menu.fontSize ‘;" onMouseOver="onMenuItemOver(null,this);" onClick="onMenuItemAction(null,this);’;
else if (!document.layers) {
itemProps = ‘font-size:’ menu.fontSize ‘px;’; // zilla wants 12px.
}
var l;
if (lrs) {
l = new Layer(800,body);
}
var dTag = ‘<DIV ID="menuItem’ countItems ‘" STYLE="position:absolute;left:0;top:’ (i * menu.menuItemHeight) ‘;’ itemProps ‘">’;
var dClose = ‘</DIV>’
if (menu.bgImageUp) {
menu.menuBorder = 0;
menu.menuItemBorder = 0;
dTag = ‘<DIV ID="menuItem’ countItems ‘" STYLE="background:url(’ menu.bgImageUp ‘);position:absolute;left:0;top:’ (i * menu.menuItemHeight) ‘;’ itemProps ‘">’;
if (document.layers) {
dTag = ‘<LAYER BACKGROUND="’ menu.bgImageUp ‘" ID="menuItem’ countItems ‘" TOP="’ (i * menu.menuItemHeight) ‘" style="’ itemProps ‘">’;
dClose = ‘</LAYER>’;
}
}
var textProps = ‘position:absolute;left:’ menu.menuItemIndent ‘;top:1;’;
if (lrs) {
textProps =itemProps;
dTag = "";
dClose = "";
}
var dText = ‘<DIV ID="menuItemText’ countItems ‘" STYLE="’ textProps ‘color:’ menu.fontColor ‘;">’ item ‘&nbsp</DIV>n<DIV ID="menuItemHilite’ countItems ‘" STYLE="’ textProps ‘top:1;color:’ menu.fontColorHilite ‘;visibility:hidden;">’ item ‘&nbsp</DIV>’;
if (item == "separator") {
content = ( dTag ‘<DIV ID="menuSeparator’ countItems ‘" STYLE="position:absolute;left:1;top:2;"></DIV>n<DIV ID="menuSeparatorLite’ countItems ‘" STYLE="position:absolute;left:1;top:2;"></DIV>n’ dClose);
} else if (childMenu) {
content = ( dTag dText ‘<DIV ID="childMenu’ countItems ‘" STYLE="position:absolute;left:0;top:3;"><IMG SRC="’ menu.childMenuIcon ‘"></DIV>n’ dClose);
} else {
content = ( dTag dText dClose);
}
if (lrs) {
l.document.open("text/html");
l.document.writeln(content);
l.document.close();
content = ”;
theStat = "-";
tsc ;
if (tsc > 50) {
tsc = 0;
theStat = "";
}
status = theStat;
}
countItems ;
}
if (lrs) {
// focus layer
var focusItem = new Layer(100, body);
focusItem.visiblity="hidden";
focusItem.document.open("text/html");
focusItem.document.writeln(" ");
focusItem.document.close();
} else {
content = ‘ <DIV ID="focusItem’ countMenus ‘" STYLE="position:absolute;left:0;top:0;visibility:hide;" onClick="onMenuItemAction(null,this);"> </DIV>n’;
content = ‘ </DIV>n </DIV>n</DIV>n’;
}
i=x;
}
if (document.layers) {
container.clip.width = window.innerWidth;
container.clip.height = window.innerHeight;
container.onmouseout = mouseoutMenu;
container.menuContainerBgColor = this.menuContainerBgColor;
for (var i=0; i<container.document.layers.length; i ) {
proto = container.menus[i];
var menu = container.document.layers[i];
container.menus[i].menuLayer = menu;
container.menus[i].menuLayer.Menu = container.menus[i];
container.menus[i].menuLayer.Menu.container = container;
var body = menu.document.layers[0].document.layers[0];
body.clip.width = proto.menuWidth || body.clip.width;
body.clip.height = proto.menuHeight || body.clip.height;
for (var n=0; n<body.document.layers.length-1; n ) {
var l = body.document.layers[n];
l.Menu = container.menus[i];
l.menuHiliteBgColor = proto.menuHiliteBgColor;
l.document.bgColor = proto.menuItemBgColor;
l.saveColor = proto.menuItemBgColor;
l.onmouseover = proto.onMenuItemOver;
l.onclick = proto.onMenuItemAction;
l.action = container.menus[i].actions[n];
l.focusItem = body.document.layers[body.document.layers.length-1];
l.clip.width = proto.menuWidth || body.clip.width proto.menuItemIndent;
l.clip.height = proto.menuItemHeight || l.clip.height;
if (n>0) l.top = body.document.layers[n-1].top body.document.layers[n-1].clip.height proto.menuItemBorder;
l.hilite = l.document.layers[1];
if (proto.bgImageUp) l.background.src = proto.bgImageUp;
l.document.layers[1].isHilite = true;
if (l.document.layers[0].id.indexOf("menuSeparator") != -1) {
l.hilite = null;
l.clip.height -= l.clip.height / 2;
l.document.layers[0].document.bgColor = proto.bgColor;
l.document.layers[0].clip.width = l.clip.width -2;
l.document.layers[0].clip.height = 1;
l.document.layers[1].document.bgColor = proto.menuLiteBgColor;
l.document.layers[1].clip.width = l.clip.width -2;
l.document.layers[1].clip.height = 1;
l.document.layers[1].top = l.document.layers[0].top 1;
} else if (l.document.layers.length > 2) {
l.childMenu = container.menus[i].items[n].menuLayer;
l.document.layers[2].left = l.clip.width -13;
l.document.layers[2].top = (l.clip.height / 2) -4;
l.document.layers[2].clip.left = 3;
l.Menu.childMenus[l.Menu.childMenus.length] = l.childMenu;
}
}
body.document.bgColor = proto.bgColor;
body.clip.width = l.clip.width proto.menuBorder;
body.clip.height = l.top l.clip.height

BBS(php

星期一, 06月 2nd, 2008

//此页面为php3.php
<?
include "signup/mysql.inc";
switch($part){
case "1" :$table="bbs_php";break;
case "2" :$table="bbs_mysql";break;
case "3" :$table="bbs_html";break;
case "4" :$table="bbs_js";
}
//echo $part;
?>
<html>
<head>
<title>xiaoyang</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript1.2" src="js/menu_comment.js"></script>
<script language="JavaScript1.2" src="js/fw_menu.js"></script>
<script language="JavaScript">
<!–
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// –>
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div id="Layer1" style="position:absolute; left:31px; top:1px; width:560px; height:46px; z-index:10">
<script language="JavaScript1.2">fwLoadMenus();</script></div>

<div id="Layer2" style="position:absolute; left:27px; top:41px; width:600px; height:15px; z-index:2">
<hr color="#ff9999">
</div>
<div id="Layer3" style="position:absolute; left:73px; top:10px; width:2px; height:330px; z-index:3; background-color: #ff9999; layer-background-color: #ff9999; border: 1px none #000000"></div>
<div id="Layer4" style="position:absolute; left:560px; top:10px; width:2px; height:330px; z-index:4; background-color: #ff9999; layer-background-color: #ff9999; border: 1px none #000000"></div>
<div id="Layer5" style="position:absolute; left:86px; top:58px; width:464px; height:273px; z-index:5">
<table width="100%" border="0" cellspacing="1" cellpadding="0" height="20">
<tr>
<td width="10%">
<div align="center"><font color="#CC33CC" size="2">人气</font></div>
</td>
<td width="38%">
<div align="center"><font color="#CC33CC" size="2">文章题目</font></div>
</td>
<td width="26%">
<div align="center"><font size="2" color="#CC33CC">作者</font></div>
</td>
<td width="26%">
<div align="center"><font color="#CC33CC" size="2">日期</font></div>
</td>
</tr>
<?
$sql="select * from ".$table." order by row DESC";
$result=mysql_query($sql)or die(mysql_error());
$row1=mysql_num_rows($result);

$row_max_page=12; //分页计算
$page=ceil($row1/$row_max_page);
$left_row=$row1-$p*$row_max_page;
$pre_left_row=$left_row 12;
$start_row=$left_row $row_max_page 1;
if($left_row<=0)
{
$start_row=$pre_left_row 1;
$left_row=0;
}

$sql="select * from ".$table." where row<’$start_row’ and row>’$left_row’ order by row DESC";
$result=mysql_query($sql)or die(mysql_error());
while($row=mysql_fetch_array($result)){
static $i=0;
$i ;
if($i%2)
$color="CCCCFF";
else $color="FFCCFF";
echo "<tr>";
echo " <td width=10% bgcolor=#".$color."> ";
echo " <div align=center><font size=2 color=#3333FF>".$row["number"]."</font></div>";
echo " </td>";
echo " <td width=38% bgcolor=#".$color."> ";
echo " <div align=center><font size=2 color=#3333FF><a href=’look.php?id=".$row["id"]."&&table=".$table."’>".$row["title"]."</a></font></div>";
echo " </td>";
echo " <td width=26% bgcolor=#".$color."> ";
echo " <div align=center><font size=2 color=#3333FF>".$row["userid"]."</font></div>";
echo " </td>";
echo " <td width=26% bgcolor=#".$color."> ";
echo " <div align=center><font size=2 color=#3333FF>".$row["date1"]."</font></div>";
echo " </td> </tr>";
}
echo"</table>";
echo "<BR><div align=center><table><tr><td><FONT SIZE=2 >";
for($i=1;$i<=$page;$i )
{
echo "<a href=’".$PHP_SELF."?p=".$i."&&table=".$table."’>[".$i."]</a> ";
}
?>
</FONT></td></tr>
</table></div>
</div>
<div id="Layer6" style="position:absolute; left:409px; top:29px; width:118px; height:17px; z-index:6"></div>
<div id="Layer7" style="position:absolute; left:451px; top:28px; width:65px; height:12px; z-index:8">
<a href="say.php?table=<?echo $table ;?>" target="_self" onMouseOver="window.status=”;return true"><font size="2" color="#FF33FF">我要发言</font></a></div>
<p> </p>
<p> </p>
</body>
</html>

BBS(php

星期一, 06月 2nd, 2008

//此页面为look.php
<?
include "signup/mysql.inc";
$sql="select * from ".$table." where id=’$id’";
$result=mysql_query($sql)or die(mysql_error());
$row=mysql_fetch_array($result);
$number= $row["number"];
$sql="update $table set number=’$number’ where id=’$id’";
mysql_query($sql)or die(mysql_error());

?>
<html>
<head>
<title>xiaoyang</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<?
include "js/menuhead.php"
?>
<script language="JavaScript">
<!–
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// –>
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<?
include "js/menu.php";
?>

<div id="Layer6" style="position:absolute; left:409px; top:29px; width:118px; height:17px; z-index:1"></div>
<div id="Layer5" style="position:absolute; left:63px; top:61px; width:464px; height:303px; z-index:2">
<table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolor="#FFCCFF">
<tr>
<td width="22%" height="17">
<div align="center"><font color="#FF3399" size="2">题目</font></div>
</td>
<td width="78%" height="17">
<div align="center"><font size="2" color="#9966FF"><?echo $row["title"] ;?></font> </div>
</td>
</tr>
<tr>
<td width="22%" height="24">
<div align="center"><font color="#FF3399" size="2">作者</font></div>
</td>
<td width="78%" height="24">
<div align="center"><font size="2" color="#9966FF"><?echo $row["userid"] ;?></font> </div>
</td>
</tr>
<tr>
<td width="22%">
<div align="center"><font color="#FF3399" size="2">内容</font></div>
</td>
<td width="78%">
<div align="left"><font size="2" color="#9966FF"><? $file=explode("n",$row["content"]); $num=count($file);
for($i=0 ;$i<$num;$i ) echo " ".$file[$i]."<BR>";?></font></div>
</td>
</tr>
</table>

<?

for($j=1;$j<6;$j ) //显示回复内容
{
$re="r".$j;
if($row["$re"])
{
$id2=$row["$re"];
$sql="select * from bbs_re where id=’$id2′";
$result=mysql_query($sql)or die(mysql_error());
$row8=mysql_fetch_array($result);
echo "<BR>";
echo " <table width=100% border=1 cellspacing=0 cellpadding=0 bordercolor=#FFCCFF> <tr>";
echo " <td width=22% height=17> <div align=center><font color=#FF3399 size=2>题目</font></div>";
echo " </td> <td width=78% height=17>";
echo " <div align=center><font size=2 color=#9966FF>".$row8["title"]."</font> </div> </td> </tr> <tr>";
echo "<td width=22% height=24>";
echo "<div align=center><font color=#FF3399 size=2>作者</font></div></td>";
echo " <td width=78% height=24>";
echo "<div align=center><font size=2 color=#9966FF>".$row8["userid"]." </font> </div></td> </tr><tr>";
echo " <td width=22%><div align=center><font color=#FF3399 size=2>内容</font></div>";
echo "</td> <td width=78%>";
echo "<div align=left><font size=2 color=#9966FF>"; $file=explode("n",$row8["content"]);
$num=count($file);
for($i=0 ;$i<$num;$i ) echo " ".$file[$i]."<BR>";
echo "</font></div>";
echo " </td> </tr> </table>";
}
}
?>
<BR><BR>
</div>
<div id="back" style="position:absolute; left:455px; top:30px; width:85px; height:3px; z-index:3">
<hr color="#ff9999" noshade>
</div>
<div id="goback" style="position:absolute; left:461px; top:23px; width:120px; height:16px; z-index:2">
<div align="center"><a href="php3.php?p=1&&table=<?echo $table ;?>" target="_self" onMouseOver="window.status=”; return true"><font size="2" color="#FF33FF">返回</font></a></div>
</div>
<div id="Lay" style="position:absolute; left:70px; top:30px; width:85px; height:3px; z-index:4">
<hr noshade color="#ff9999">
</div>
<div id="Laye" style="position:absolute; left:78px; top:23px; width:120px; height:16px; z-index:1">
<div align="center"><a href="say.php?id1=<? echo $id."&&table=".$table ;?>" target="_self" onMouseOver="window.status=”;return true"><font size="2" color="#FF33FF">回复</font></a></div>
</div>
<p> </p>
<p> </p>
</body>
</html>