Keep updating ~ To make a desired version, add a tree-type menu on the list page. The Post is last updated by the version xjl756213616 in 2013-06-0420: 00: 30, with an English name & nbsp; "Pursue", address: http: // www. keep updating ~ To make a desired version, add a tree menu on the list page
At the end of this post, xjl756213616 was edited and updated again at 20:00:30 on. The English name "Pursue" was obtained ",
Address: http://www.youyax.com/forum/
PHP open-source forum system-YouYaX Pursue version update
This update adds the tree menu function to the list page.
I wrote it directly on the list page.
The tree-like js code is plagiarized, and is mainly used to connect to the database.
Previously, the ztree plug-in with better results was used on the list page of the official website, but it was implemented based on jquery,
I still don't like jquery.
Update code
var data=[
$sql="select bid,count(distinct bid),max(ssort) as st from " .C('db_prefix'). "small_block group by bid order by st desc";
$query=mysql_query($sql);
$num=mysql_num_rows($query);
if($num>0){
while($arr=mysql_fetch_array($query)){
$ssql="select * from " .C('db_prefix'). "big_block where id=".$arr['bid'];
$squery=mysql_query($ssql);
$snum=mysql_num_rows($squery);
if($snum>0){
while($sarr=mysql_fetch_array($squery)){
?>
{t:'
',s:[
$ssql2="select * from " .C('db_prefix'). "small_block where bid=".$sarr['id'];
$squery2=mysql_query($ssql2);
$snum2=mysql_num_rows($squery2);
if($snum2>0){
while($sarr2=mysql_fetch_array($squery2)){
?>{t:'
',url:'{site}/index.php/List{url}index{url}f{url}
{shtml}'},
}
}
?>
]},
}
}
}
}
?>
];
var et=new Tree(data,'treediv');
var dts=document.getElementById("treediv").getElementsByTagName("dt");
for(var i=0;i
if(document.all) {dts[i].click();}
else {
var e = document.createEvent("MouseEvents");
e.initEvent("click", false, false);
dts[i].dispatchEvent(e);
}
}
var navH = document.getElementById("treediv").offsetTop;
window.onscroll=function(){
var scroH = window.pageYOffset|| document.documentElement.scrollTop || document.body.scrollTop;
if (scroH >= navH) {
document.getElementById("treediv").style.position="fixed";
document.getElementById("treediv").style.top=0;
} else if (scroH < navH) {
document.getElementById("treediv").style.position="absolute";
document.getElementById("treediv").style.top="30px";
}
}
《script》
Share with YouYaX:
------ Solution --------------------
It's really good. a newbie is here to support the landlord!
------ Solution --------------------