仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1526|回复: 19
打印 上一主题 下一主题

[学习教程] PHP网页设计BBS(php & mysql)完全版(五)

[复制链接]
第二个灵魂 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-2-4 00:06:15 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
刚开始因为习惯于ASP格式的写法,总是在这些方面出现问题,自己还总是找不到问题所在,这就提醒了自己,在写代码的时候一定要认真,不能粗心地老是少个“;”或者字母大小写不分,要不然很可能找半天都找不到错误。   //上面为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;" >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 + ';" 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;" > </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.onmou搜索引擎优化ut = mou搜索引擎优化utMenu;
        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.onmou搜索引擎优化ver = 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
另外要叮嘱各位的是,抵御诱惑,ASP/PHP/JSP/.NET的对比也许会让你无所适从,你也许学了一半PHP,又开始打C#的主意,或者有人说JAVA很强,这个时候的你绝对不能动摇,哪怕你真想学。
兰色精灵 该用户已被删除
沙发
发表于 2015-2-4 08:50:19 | 只看该作者
如果你可以写完像留言板这样的程序,那么你可以去一些别人的代码了,
变相怪杰 该用户已被删除
板凳
发表于 2015-2-9 20:48:58 | 只看该作者
学好程序语言,多些才是王道,写两个小时代码的作用绝对超过看一天书,这个我是深有体会(顺便还能练打字速度)。
分手快乐 该用户已被删除
地板
发表于 2015-2-9 23:30:46 | 只看该作者
Apache不是非得用80或者8080端口的,我刚开始安得时候就是80端口老占用,就用了个 81端口,结果照常,就是输localhost的时候,应该输入为 localhost:81
飘灵儿 该用户已被删除
5#
发表于 2015-2-10 02:28:48 | 只看该作者
使用 jquery 等js框架的时候,要随时注意浏览器的更新情况,不然很容易发生框架不能使用。
精灵巫婆 该用户已被删除
6#
发表于 2015-2-28 15:38:37 | 只看该作者
开发工具也会慢慢的更专业,每个公司的可能不一样,但是zend studio是个大伙都会用的。
admin 该用户已被删除
7#
发表于 2015-3-1 20:10:57 | 只看该作者
遇到出错的时候,我经常把错误信息直接复制到 google的搜索栏,一般情况都是能搜到结果的,不过有时候会搜出来一大片英文的出来,这时候就得过滤一下,吧中文的弄出来,挨着式方法。
海妖 该用户已被删除
8#
发表于 2015-3-10 22:59:54 | 只看该作者
使用 jquery 等js框架的时候,要随时注意浏览器的更新情况,不然很容易发生框架不能使用。
冷月葬花魂 该用户已被删除
9#
发表于 2015-3-17 12:10:41 | 只看该作者
学习php的目的往往是为了开发动态网站,phper就业的要求也涵盖了很多。我大致总结为:精通php和mysql
老尸 该用户已被删除
10#
发表于 2015-3-24 09:49:49 | 只看该作者
写的比较杂,因为我也是个新手,不当至于大家多多指正。
简单生活 该用户已被删除
11#
发表于 2015-3-27 06:11:09 | 只看该作者
实践是检验自己会不会的真理。
小魔女 该用户已被删除
12#
发表于 2015-4-12 18:39:15 | 只看该作者
我学习了一段时间后,我发现效果并不好(估计是我自身的问题)。因为一个人的精力总是有限的,同时学习这么多,会导致每个的学习时间都得不到保证。
深爱那片海 该用户已被删除
13#
发表于 2015-4-14 16:43:40 | 只看该作者
说php的话,首先得提一下数组,开始的时候我是最烦数组的,总是被弄的晕头转向,不过后来呢,我觉得数组里php里最强大的存储方法,所以建议新手们要学好数组。
小妖女 该用户已被删除
14#
发表于 2015-4-17 13:09:13 | 只看该作者
因为blog这样的可以让你接触更多要学的知识,可以接触用到类,模板,js ,ajax
谁可相欹 该用户已被删除
15#
发表于 2015-4-26 01:48:23 | 只看该作者
Ps:以上纯属原创,如有雷同,纯属巧合
莫相离 该用户已被删除
16#
发表于 2015-5-11 15:06:01 | 只看该作者
不禁又想起那些说php是草根语言的人,为什么认得差距这么大呢。
飘飘悠悠 该用户已被删除
17#
发表于 2015-6-12 11:31:46 | 只看该作者
Ps:以上纯属原创,如有雷同,纯属巧合
只想知道 该用户已被删除
18#
发表于 2015-6-18 08:45:46 | 只看该作者
对于懒惰的朋友,我推荐php的集成环境xampp或者是wamp。这两个软件安装方便,使用简单。但是我还是强烈建议自己动手搭建开发环境。
小女巫 该用户已被删除
19#
发表于 2015-7-11 19:49:31 | 只看该作者
为了以后维护的方便最好是代码上都加上注释,“予人方便,自己方便”。此外开发文档什么的最好都弄齐全。我觉得这是程序员必备的素质。虽然会消耗点很多的时间。但是确实是非常有必要的。
乐观 该用户已被删除
20#
发表于 2015-7-12 12:44:11 | 只看该作者
在我安装pear包的时候老是提示,缺少某某文件,才发现 那群extension 的排列是应该有一点的顺序,而我安装的版本的排序不是正常的排序。没办法我只好把那群冒号加了上去,只留下我需要使用的扩展。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-5-7 11:35

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表