恭贺新禧 xuzuning (唠叨) 大哥,你准备干嘛? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <?phpclass Tree_control { function Tree_control( $sql ) { $this->tbl_struct = $sql; $this->tbl_name = $_GLOBAL['_CONFIG']['tbl_name']; $this->basenum= pow(2,16); } function Add( $deep ) { $sql = "SELECT max(ordernum) AS basenum FROM {$this->tbl_name}"; $this->query( $sql ); $basenum=$this->eof?$this->basenum:$this->fields->basenum; $sql = "INSERT INTO {$this->tbl_name} SET deep= $deep, ordernum= $basenum"; $this->query($sql); return $this->insertID(); } function AddChild( $parentID ) { $sql = "SELECT root_id, deep, ordernum FROM {$this->tbl_name} WHERE id>= $parentID LIMIT 2"; $this->query( $sql ); $root_id = empty( $deep ) ? $parentID : $this->fields->root_id; $ordernum= $this->fields->ordernum; $deep = $this->fields->deep + 1; $this->next(); $ordernum= ( ordernum + $this->fields->ordernum ) / 2; $sql = "INSERT INTO {$this->tbl_name} SET root_id=$root_id, deep=$deep,ordernum=$ordernum)"; $this->query( $sql ); return $this->insertID(); } functin AddFirst( $offsetID ) { $sql = "SELECT root_id, deep, ordernum FROM {$this->tbl_name} WHERE id <= $offsetID LIMIT 2"; $this->query( $sql ); $root_id = $this->fields->root_id; $ordernum= $this->fields->ordernum; $deep = $this->fields->deep; $this->next(); $ordernum2 = $this->eof ? 0 :$this->fields->ordernum; $ordernum= ( ordernum + ordernum2 ) / 2; $sql = "INSERT INTO {$this->tbl_name} SET root_id=$root_id, deep=$deep,ordernum=$ordernum)"; $this->query( $sql ); return $this->insertID(); } function AddLast( offsetID ) { $sql = "SELECT root_id, deep, ordernum FROM {$this->tbl_name} WHERE id >= $offsetID LIMIT 2"; $this->query( $sql ); $root_id = $this->fields->root_id; $ordernum= $this->fields->ordernum; $deep = $this->fields->deep; $this->next(); $ordernum2 = $this->eof ? $ordernum * 2 :$this->fields->ordernum; $ordernum= ( ordernum + ordernum2 ) / 2; $sql = "INSERT INTO {$this->tbl_name} SET root_id=$root_id, deep=$deep,ordernum=$ordernum)"; $this->query( $sql ); return $this->insertID(); }}?>不知道对不对,我还没测试move我还没想出来,好像只更改root_id不行吧? 一个php文件,如何设置默认包含? 正则表达式匹配问题 如何用PHP实现条码转换并打印? 求教 用JS验证邮箱格式是否正确 有关上传控制file的问题 送分送书 原版PHP新书 顶者有分 www.netvibes.com页面可以拖动的模块怎么实现的? 今天十点跟资本家吵一架,现在无业中。 请问,PHP中如何判断页面是首次刷新????????? PHP4.1源码结构? 哇哈哈,今晚公司吃年夜饭,我中了全公司唯一的一等奖,800元,散分同喜 求IIS+PHP详细配置
{
function Tree_control( $sql )
{
$this->tbl_struct = $sql;
$this->tbl_name = $_GLOBAL['_CONFIG']['tbl_name'];
$this->basenum= pow(2,16);
} function Add( $deep )
{
$sql = "SELECT max(ordernum) AS basenum FROM {$this->tbl_name}";
$this->query( $sql ); $basenum=$this->eof?$this->basenum:$this->fields->basenum; $sql = "INSERT INTO {$this->tbl_name}
SET deep= $deep, ordernum= $basenum";
$this->query($sql);
return $this->insertID();
} function AddChild( $parentID )
{
$sql = "SELECT root_id, deep, ordernum FROM {$this->tbl_name}
WHERE id>= $parentID LIMIT 2"; $this->query( $sql );
$root_id = empty( $deep ) ? $parentID : $this->fields->root_id;
$ordernum= $this->fields->ordernum;
$deep = $this->fields->deep + 1;
$this->next();
$ordernum= ( ordernum + $this->fields->ordernum ) / 2; $sql = "INSERT INTO {$this->tbl_name}
SET root_id=$root_id, deep=$deep,ordernum=$ordernum)";
$this->query( $sql );
return $this->insertID();
} functin AddFirst( $offsetID )
{
$sql = "SELECT root_id, deep, ordernum FROM {$this->tbl_name}
WHERE id <= $offsetID LIMIT 2";
$this->query( $sql ); $root_id = $this->fields->root_id;
$ordernum= $this->fields->ordernum;
$deep = $this->fields->deep;
$this->next();
$ordernum2 = $this->eof ? 0 :$this->fields->ordernum;
$ordernum= ( ordernum + ordernum2 ) / 2; $sql = "INSERT INTO {$this->tbl_name}
SET root_id=$root_id, deep=$deep,ordernum=$ordernum)";
$this->query( $sql );
return $this->insertID();
}
function AddLast( offsetID )
{
$sql = "SELECT root_id, deep, ordernum FROM {$this->tbl_name}
WHERE id >= $offsetID LIMIT 2";
$this->query( $sql ); $root_id = $this->fields->root_id;
$ordernum= $this->fields->ordernum;
$deep = $this->fields->deep;
$this->next();
$ordernum2 = $this->eof ? $ordernum * 2 :$this->fields->ordernum;
$ordernum= ( ordernum + ordernum2 ) / 2; $sql = "INSERT INTO {$this->tbl_name}
SET root_id=$root_id, deep=$deep,ordernum=$ordernum)";
$this->query( $sql );
return $this->insertID();
}}
?>
不知道对不对,我还没测试
move我还没想出来,好像只更改root_id不行吧?