我想知道CSDN論壇中左邊的菜單是怎麼做的,最好有源代碼

jxhj 2004-01-26 03:42:26
我邮箱是jian.kang@163.com或kind.huang@tom.com
最少200分
...全文
36 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
minghui000 2004-01-30
  • 打赏
  • 举报
回复
学习
xeimm 2004-01-30
  • 打赏
  • 举报
回复
学习
dragonsdg3 2004-01-30
  • 打赏
  • 举报
回复
mark
study
hope1983 2004-01-27
  • 打赏
  • 举报
回复
to:jxhj
csdn的左边菜单不也是刷新后就恢复原样了吗?如果要用COOKIE保持刷新前的菜单哪不是很麻烦?
liyujie2000 2004-01-27
  • 打赏
  • 举报
回复
good!
minghui000 2004-01-27
  • 打赏
  • 举报
回复
UP
assiss 2004-01-27
  • 打赏
  • 举报
回复
想要刷新后保持,
那最好就是用COOKIE或者SESSION,
不然无状态的HTTP没办法满足你的要求
jxhj 2004-01-26
  • 打赏
  • 举报
回复
To:feel8(准备早起的鸟):我改过了dtree,可以显示第一层,当要打开下一层时却显示"_io为null或不是对象",在416行,可是查看源代码中却没有这一行,请帮忙,分好说....

<html>

<head>
<title></title>

<link rel="StyleSheet" href="dtree.css" type="text/css" />
<link rel="StyleSheet" href="cssmb.css" type="text/css" />
<script type="text/javascript" src="dtree.js"></script>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>

<body>

<div class="dtree">

<p><a href="javascript: d.openAll();">open all</a> | <a href="javascript: d.closeAll();">close all</a></p>

<?
echo "Part Number Admin";

$cm="select * from part_class order by id";
$result_class=mysql_db_query($db_name,$cm);

echo "<script type='text/javascript'>";

while($rs_class=mysql_fetch_object($result_class)){

echo "d = new dTree('d');";
echo "d.add(0,-1,'$rs_class->name');";

$cm="select * from part_db where class_id='$rs_class->id' order by part_no";
$result=mysql_db_query($db_name,$cm);
while($rs=mysql_fetch_object($result)){
echo "d.add($rs->id,$rs->prev_id,'$rs->part_no($rs->part_mess)','admin.php?id=$rs->id','','main');";
}
echo "document.write(d);";

}
echo "</script>";
?>
</div>

</body>

</html>
shg918 2004-01-26
  • 打赏
  • 举报
回复
mark
jxhj 2004-01-26
  • 打赏
  • 举报
回复
To:hope1983(亢龙有悔浪子回头):有一个问题,每次刷新后都会全部关闭,有没什么办法保持原样?

To:feel8(准备早起的鸟):收到了,可这个是一次全部从表中读出数据,对于20000个节点会太慢的.


我这也有一个,刷新后也是会全部关闭,有没办法?
<?php include("config.php"); ?>

<html>
<head>
<link rel="StyleSheet" href="cssmb.css" type="text/css" />
<script language="JavaScript">
function ShowMenu(MenuID){
if(MenuID.style.display=="none"){
MenuID.style.display="";
}else{
MenuID.style.display="none";
}
}
</script>
<style type="text/css">
<!--
TD {
FONT-FAMILY: "Arial", "Helvetica", "sans-serif"; FONT-SIZE: 12px; LINE-HEIGHT: 130%; letter-spacing:1px
}

.Menu {
COLOR:#000000; FONT-FAMILY: "Arial", "Helvetica", "sans-serif"; FONT-SIZE: 12px; CURSOR: hand
} -->
</style>
</head>
<body>
<?php
echo "<a href=admin.php target=main>Part Number Admin</a>";

$Con=mysql_connect($db_host,$db_user,$db_pwd);
mysql_select_db($db_name);

$sql="select * from part_class order by id";
$result_class=mysql_query($sql,$Con);

while($rs=mysql_fetch_array($result_class)){

$GLOBALS["ID"] =1;
$layer=1;

$Con=mysql_connect($db_host,$db_user,$db_pwd);
mysql_select_db($db_name);

$sql="select * from part_db where class_id='".$rs["id"]."' and prev_id=0";
$result=mysql_query($sql,$Con);

echo "<br>".$rs["name"];
if(mysql_num_rows($result)>0){
ShowTreeMenu($Con,$result,$layer,$ID);
}
}

function ShowTreeMenu($Con,$result,$layer){
$numrows=mysql_num_rows($result);

echo "<table cellpadding='0' cellspacing='0' border='0'>";

for($rows=0;$rows<$numrows;$rows++){
$menu=mysql_fetch_array($result);

$sql="select * from part_db where prev_id=$menu[id]";
$result_sub=mysql_query($sql,$Con);

echo "<tr>";
if(mysql_num_rows($result_sub)>0){
echo "<td width='20' class='Menu' onClick='javascript:ShowMenu(Menu".$GLOBALS["ID"].");'><img src='img/folder.gif' border='0'></td>";
echo "<td><a href='admin.php?id=$menu[id]' target='main'>$menu[part_no][$menu[part_mess]]</a>";
}else{
echo "<td width='20'><img src='img/page.gif' border='0'></td>";
echo "<td>$menu[part_no][$menu[part_mess]]";
}
/* if($menu[layer_id]>=3){
echo "<a href='admin.php?id=$menu[id]' traget='main'>$menu[part_no][$menu[part_mess]]</a>";
}else{
echo $menu[part_no]."[".$menu[part_mess]."]";
}*/
echo "</td></tr>";

if(mysql_num_rows($result_sub)>0){
echo "<tr id=Menu".$GLOBALS["ID"]++." style='display:none'>";
echo "<td width='20'> </td>";
echo "<td>";
$layer++;
ShowTreeMenu($Con,$result_sub,$layer);
$layer--;
echo "</td></tr>";
}
}
echo "</table>";
}
?>
</body>
</html>
feel8 2004-01-26
  • 打赏
  • 举报
回复
This is the Postfix program at host qs3.qq.com.

I'm sorry to have to inform you that the message returned
below could not be delivered to one or more destinations.

For further assistance, please send mail to <postmaster>

If you do so, please include this problem report. You can
delete your own text from the message returned below.

The Postfix program

<kind.huang@tom.com>: host tommx.163.net[202.108.255.210] said: 550 Domain in
Mail from user is illegal. (in reply to MAIL FROM command)
feel8 2004-01-26
  • 打赏
  • 举报
回复
发到你邮箱了,阿信写的那个
hope1983 2004-01-26
  • 打赏
  • 举报
回复
csdn树菜单php+mysql版.rar

http://goodmm.updays.com/csdn.rar

ydyd写的.好用的话,你另开贴谢他吧。
jxhj 2004-01-26
  • 打赏
  • 举报
回复
有没有PHP的,我想要这样的:开始显示第一层,点击后才读库中的数据,因为我的节点太多了,有两万左右
Jaron 2004-01-26
  • 打赏
  • 举报
回复
http://www.csdn.net/develop/Read_Article.asp?Id=20814
ib915 2004-01-26
  • 打赏
  • 举报
回复
去ASP版搜索一下,有几个版本哦,有阿信的,还有狼兄的

21,891

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧