BBS(php & mysql)完整版(五)


Posted in PHP onOctober 09, 2006

//下面为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 +' </DIV>n<DIV ID="menuItemHilite'+ countItems +'" STYLE="' + textProps + 'top:1;color:'+ menu.fontColorHilite +';visibility:hidden;">'+ item +' </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

PHP 相关文章推荐
PHP set_time_limit(0)长连接的实现分析
Mar 02 PHP
nginx+php-fpm配置文件的组织结构介绍
Nov 07 PHP
PHP Error与Logging函数的深入理解
Jun 03 PHP
DOM XPATH获取img src值的query
Sep 23 PHP
php实现的获取网站备案信息查询代码(360)
Sep 23 PHP
浅析echo(),print(),print_r(),return之间的区别
Nov 27 PHP
ubuntu12.04使用c编写php扩展模块教程分享
Dec 25 PHP
php检索或者复制远程文件的方法
Mar 13 PHP
PHP实现的简单网络硬盘
Jul 29 PHP
php rmdir使用递归函数删除非空目录实例详解
Oct 20 PHP
PHP中16个高危函数整理
Sep 19 PHP
浅谈laravel框架与thinkPHP框架的区别
Oct 23 PHP
BBS(php &amp; mysql)完整版(七)
Oct 09 #PHP
用PHP实现小型站点广告管理(修正版)
Oct 09 #PHP
BBS(php &amp; mysql)完整版(二)
Oct 09 #PHP
BBS(php &amp; mysql)完整版(三)
Oct 09 #PHP
将数字格式的计算结果转为汉字格式
Oct 09 #PHP
透析PHP的配置文件php.ini
Oct 09 #PHP
一个简单的自动发送邮件系统(三)
Oct 09 #PHP
You might like
关于mysql 字段的那个点为是定界符
2007/01/15 PHP
PHP+FLASH实现上传文件进度条相关文件 下载
2007/07/21 PHP
php中通过curl smtp发送邮件
2012/06/05 PHP
跟我学Laravel之请求与输入
2014/10/15 PHP
DOM 脚本编程中的兄弟节点
2009/10/31 Javascript
javascript时区函数介绍
2012/09/14 Javascript
js写一个弹出层并锁屏效果实现代码
2012/12/07 Javascript
JavaScript编程的单例设计模讲解
2015/11/10 Javascript
JavaScript构造函数详解
2015/12/27 Javascript
jquery基础知识第一讲之认识jquery
2016/03/17 Javascript
jQuery内容折叠效果插件用法实例分析(附demo源码)
2016/04/28 Javascript
纯JS代码实现气泡效果
2016/05/04 Javascript
详解vue嵌套路由-params传递参数
2017/05/23 Javascript
react系列从零开始_简单谈谈react
2017/07/06 Javascript
以BootStrap Tab为例写一个前端组件
2017/07/25 Javascript
详解webpack中的hash、chunkhash、contenthash区别
2018/01/05 Javascript
如何手动实现es5中的bind方法详解
2018/12/07 Javascript
使用jQuery如何写一个含验证码的登录界面
2019/05/13 jQuery
通过图带你深入了解vue的响应式原理
2019/06/21 Javascript
layui 点击重置按钮, select 并没有被重置的解决方法
2019/09/03 Javascript
JavaScript多种滤镜算法实现代码实例
2019/12/10 Javascript
Python实现的查询mysql数据库并通过邮件发送信息功能
2018/05/17 Python
python 对类的成员函数开启线程的方法
2019/01/22 Python
Python进度条的制作代码实例
2019/08/31 Python
Django自带的加密算法及加密模块详解
2019/12/03 Python
PyTorch学习:动态图和静态图的例子
2020/01/06 Python
Python 序列化和反序列化库 MarshMallow 的用法实例代码
2020/02/25 Python
基于Python绘制个人足迹地图
2020/06/01 Python
CSS3 制作绽放的莲花采用效果叠加实现
2013/01/31 HTML / CSS
欧缇丽美国官网:Caudalie美国
2016/12/31 全球购物
小学毕业感言300字
2014/02/19 职场文书
公司总经理工作职责管理办法
2014/02/28 职场文书
学习演讲稿范文
2014/05/10 职场文书
营销计划书
2015/01/17 职场文书
转让协议书
2015/01/27 职场文书
Python测试框架pytest核心库pluggy详解
2022/08/05 Golang