在ie6下,浮动的li里面文字在结尾出宽度不够,但是不自动换行,而是往下挤,使后面的li乱掉。
解决的方法是在li里面定义样式 white-space: nowrap;
在ie6下,浮动的li里面文字在结尾出宽度不够,但是不自动换行,而是往下挤,使后面的li乱掉。
解决的方法是在li里面定义样式 white-space: nowrap;
只要一句代码,可以实现设为首页,加入收藏的功能,并且通用其他网站,自动识别标题和链接,不用手动修改。但是只兼容ie浏览器。
<a href="#" onClick="this.style.behavior='url(#default#homepage)'; this.setHomePage(window.location.href);">设为首页</a> | <a href="#" onClick="window.external.addFavorite(window.location.href,document.title)">加入收藏</a>
以下代码实现删除指定文件夹所有文件
$cacheDir = '../cache/runtime';
$dh = opendir($cacheDir);
while ( $file = readdir($dh) ) {
if (($file == '.') || ($file == '..')) { continue; }
if (file_exists( $cacheDir . '/' .$file)) {
if (!unlink($cacheDir . '/' . $file)) {
break;
}
}
}
1,去除标题power by ecshop
在 include/lib_main.php 里面找到 function assign_ur_here($cat = 0, $str = ''){ ....} 大概在142行
$page_title = $GLOBALS['_CFG']['shop_title']. ' - ' . 'Powered by ECShop';
$ur_here = '<a href=".">' . $GLOBALS['_LANG']['home'] . '</a>';
把上面改成:
$page_title = $GLOBALS['_CFG']['shop_title';
$ur_here = '<a href=".">' . $GLOBALS['_LANG']['home'] . '</a>';
2,ECSHOP底部随机出现版权信息去除方法
第一步:删除该函数即可,该函数位置:js/common.js
第244行函数如下:
onload = function()
{
var link_arr = document.getElementsByTagName(String.fromCharCode(65));
var link_str;
var link_text;
var regg, cc;
var rmd, rmd_s, rmd_e, link_eorr = 0;
var e = new Array(97, 98, 99,
100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
120, 121, 122
);
try
{
for(var i = 0; i < link_arr.length; i++)
{
link_str = link_arr.href;
if (link_str.indexOf(String.fromCharCode(e[22], 119, 119, 46, e[4], 99, e[18], e[7], e[14],
e[15], 46, 99, 111, e[12])) != -1)
{
if ((link_text = link_arr.innerText) == undefined)
{
throw "noIE";
}
regg = new RegExp(String.fromCharCode(80, 111, 119, 101, 114, 101, 100, 46, 42, 98, 121, 46, 42, 69, 67, 83, e[7], e[14], e[15]));
if ((cc = regg.exec(link_text)) != null)
{
if (link_arr.offsetHeight == 0)
{
break;
}
link_eorr = 1;
break;
}
}
else
{
link_eorr = link_eorr ? 0 : link_eorr;
continue;
}
}
} // IE
catch(exc)
{
for(var i = 0; i < link_arr.length; i++)
{
link_str = link_arr.href;
if (link_str.indexOf(String.fromCharCode(e[22], 119, 119, 46, e[4], 99, 115, 104, e[14],
e[15], 46, 99, 111, e[12])) != -1)
{
link_text = link_arr.textContent;
regg = new RegExp(String.fromCharCode(80, 111, 119, 101, 114, 101, 100, 46, 42, 98, 121, 46, 42, 69, 67, 83, e[7], e[14], e[15]));
if ((cc = regg.exec(link_text)) != null)
{
if (link_arr.offsetHeight == 0)
{
break;
}
link_eorr = 1;
break;
}
}
else
{
link_eorr = link_eorr ? 0 : link_eorr;
continue;
}
}
} // FF
try
{
rmd = Math.random();
rmd_s = Math.floor(rmd * 10);
if (link_eorr != 1)
{
rmd_e = i - rmd_s;
link_arr[rmd_e].href = String.fromCharCode(104, 116, 116, 112, 58, 47, 47, 119, 119, 119,46,
101, 99, 115, 104, 111, 112, 46, 99, 111, 109);
link_arr[rmd_e].innerHTML = String.fromCharCode(
80, 111, 119, 101, 114, 101, 100,38, 110, 98, 115, 112, 59, 98,
121,38, 110, 98, 115, 112, 59,60, 115, 116, 114, 111, 110, 103,
62, 60,115, 112, 97, 110, 32, 115, 116, 121,108,101, 61, 34, 99,
111, 108, 111, 114, 58, 32, 35, 51, 51, 54, 54, 70, 70, 34, 62,
69, 67, 83, 104, 111, 112, 60, 47, 115, 112, 97, 110, 62,60, 47,
115, 116, 114, 111, 110, 103, 62);
}
}
catch(ex)
{
}
}
这是随机在底部产生版权的函数,删掉就可以了!!
直接把这个函数去掉,底部的Powered by ECShop 就没了
第二步,打开themes/default/library/ 这里default为你当前的主题,找到page_footer.lbi,里面内容全部删掉,添加上你想添加的代码。支持html代码的。完毕。
第三步,如果你只想简单的改下就弄第一步就行,然后去\languages\zh_cn 找common.php找到ecshop.com改成你网址,E CSho p对应改成你的网站名称就行,最后去themes\default\images里把logo1.gif改成你想要的图片,也就是左下角的那张.
修改ecshop后台的版权信息
在languages/zh_cn/admin/common.php文件修改
admin/templates/index.htm
Line 4
*/
<title>{$lang.cp_home}</title>
将下部版权修改为自己的
/*
admin/templates/login.htm
Line 4
*/
<title>{$lang.cp_home}</title>
删除<img src="images/login.png" width="178" height="256" border="0" alt="ECSHOP" />
/*
admin/templates/top.htm
Line 132
Line 135
*/
删除图片<img src=”images/ecshop_logo.gif” alt=”ECSHOP - power for e-commerce” />
删除<li><a href=”index.php?act=about_us” target=”main-frame”>{$lang.about}</a></li>
删除<li><a href="javascript:web_address();">{$lang.help}</a></li>
/*
admin/templates/start.htm
将{$lang.ecs_version}修改为:网站版本
Line 6
*/
<script type=”text/javascript” src=”http://api.ecshop.com/checkver.php?ver={$ecs_version}&lang={$ecs_lang}&release={$ecs_release}&php_ver={$sys_info.php_ver}&mysql_ver={$sys_info.mysql_ver}&ocount={$order.stats.oCount}&oamount={$order.stats.oAmount}&gcount={$goods.total}&charset={$ecs_charset}” ></script>
/*
Line 184-195
*/
<tr>
<td>{$lang.ecs_version}</td>
<td>{$ecs_version} RELEASE {$ecs_release}</td>
<td>{$lang.install_date}</td>
<td>{$install_date}</td>
</tr>
<tr>
<td>{$lang.ec_charset}</td>
<td>{$ecs_charset}</td>
<td></td>
<td></td>
</tr>
/*
admin/tempaltes/pageheader.htm
Line 24
*/
<span class=”action-span1″><a href=”index.php?act=main”>{$lang.cp_home}</a> {if $ur_here} - {$ur_here} {/if}</span>
/*
admin/templates/pagefooter.htm
Line 3
*/
{$lang.copyright}
/*
admin/templates/menu.htm
Line 143
*/
<script language=”JavaScript” src=”http://api.ecshop.com/menu_ext.php?charset={$charset}&lang={$help_lang}”></script>
admin/templates/filecheck.htm
将{$lang.filecheck_tips_step1}修改:为文件校验是针对 原始网站文件 为基础进行核对,点击下面按钮开始进行校验。
admin\includes\inc_menu.php
删除:
$modules['11_system']['shp_webcollect'] = 'webcollect.php';
$modules['11_system']['shop_authorized'] = 'license.php?act=list_edit';
也可以删除$modules['13_backup']['convert'] = 'convert.php?act=main';
admin\sms_url.php
将$url = 'http://service.shopex.cn/sms/index.php?certificate_id='.$certi_id.'&sess_id='.$sess_id.'&auth='.$auth.'&ac='.$ac;
的连接修改掉或删除 这个是申请短信连接的地址
includes\modules
下所有文件中的 ECSHOP TEAM 和其连接删除
ecshop 后台管理左侧菜单添加新栏目
先说几个相关文件admin 文件下admin/includes/inc_menu.php
languages\zh_cn\admin\common.php
admin/includes/common.php
接下来说添加的方法,首先
先在languages\zh_cn\admin\common.php添加栏目的名字,关于这个是添加后台在页面显示所需的文字的文件
打开看看,再看看模板就明白了
然后在admin/includes/common.php文件中添加一级栏目的数字名字就数组
再在admin/includes/inc_menu.php 文件中添加对应的二级栏目的数组链接
链接为一级的数组元素,不明白的话,最好先看看这两个文件
然后说怎样实现在分配权限里面管理它,
打开admin/includes/inc_priv.php文件
新建栏目权限数组 数组元素和admin/includes/inc_menu.php页面的数组相同,对应的值自定义
并比自定义的该值添加的表ecs_admin_action表中
首先在表中新建你的一级栏目parent_id 为0 action_code 为数组元素的名字
然后添加二级栏目的 信息 parent_id为你的一级菜单的action_id
action_code 为打开admin/includes/inc_priv.php文件中 自定义的值
好了,就样你就添加的一个后台管理栏目,并可在新建管理后进行权限管理
border-collapse 属性设置表格的边框是否被合并为一个单一的边框,还是象在标准的 HTML 中那样分开显示。
值 | 描述 |
---|---|
separate | 默认值。边框会被分开。不会忽略 border-spacing 和 empty-cells 属性。 |
collapse | 如果可能,边框会合并为一个单一的边框。会忽略 border-spacing 和 empty-cells 属性。 |
inherit | 规定应该从父元素继承 border-collapse 属性的值。 |
细边线table表格样式
table {width:100%; border:1px solid #ccc; border-collapse:collapse;}
table td {border:1px solid #ccc; border-collapse:collapse; padding:10px 15px; color:#999;}
prompt() 方法用于显示可提示用户进行输入的对话框。
prompt(text,defaultText)
text | 可选。要在对话框中显示的纯文本(而不是 HTML 格式的文本)。 |
defaultText | 可选。默认的输入文本。也可以不输入值,如果不输入值,则返回null。 |
如果用户单击提示框的取消按钮,则返回 null。如果用户单击确认按钮,则返回输入字段当前显示的文本。 在用户点击确定按钮或取消按钮把对话框关闭之前,它将阻止用户对浏览器的所有输入。在调用 prompt() 时,将暂停对 JavaScript 代码的执行,在用户作出响应之前,不会执行下一条语句。
以下的代码弹出一个对话框,用户输入密码,然后提交表单 function fn_check( theForm ) { var m = prompt ( "请输入新密码" , "" ) ; if ( m ) { m = trimString(m); if ( m != "" ) { theForm.newftppassword1.value = m; theForm.doftppasswordupdate.value = '1'; theForm.submit(); return true; } } return ; }<form id="frm_sitedetail" name="frm_sitedetail" action="siteadmin.php" method="POST"><input type="hidden" name="newftppassword1" value=""><input type="hidden" name="doftppasswordupdate" value=""> </form>
星号" * " :ie6 ie7支持 hirefox不支持
下划线"_":ie6支持 ie7 firefox不支持
!important; : firefox ie7支持 ,ie6部分支持
IE6支持重定义中的!important,例如: .yuanxin {color:#e00!important;} .yuanxin {color:#000;} 你将会发现定义了样式class="yuanxin"时,在IE下,字体显示为红色(#e00)。 但不支持同一定义中的!important。例如: .yuanxin {color:#e00!important;color:#000} 此时在IE6下不支持,你将会发现定义了样式class="yuanxin"时,字体显示为黑色(#000)。
HTML头部引用(if IE)Hack:针对所有IE:<!--[if IE]><!--您的代码--><![endif]-->,针对IE6及以下版本:<!--[if lt IE 7]><!--您的代码--><![endif]-->,这类Hack不仅对CSS生效,对写在判断语句里面的所有代码都 会生效。
选择器Hack:比如 IE6能识别*html .class{},IE7能识别*+html .class{}或者*:first-child+html .class{}。等等
浏览器优先级别:FF<IE7<IE6,CSS hack书写顺序一般为FF IE7 IE6
以: " #demo {width:100px;} "为例;
#demo {width:100px;} /*被FIREFOX,IE6,IE7执行.*/
* html #demo {width:120px;} /*会被IE6执行,之前的定义会被后来的覆盖,所以#demo的宽度在IE6就为120px; */
*+html #demo {width:130px;} /*会被IE7执行*/ ---------------
所以最后,#demo的宽度在三个浏览器的解释为:
FIREFOX:100px;
ie6:120px;
ie7:130px;
IE8 最新css hack:
"\9" 例:"border:1px \9;".这里的"\9"可以区别所有IE和FireFox.
"\0" IE8识别,IE6、IE7不能.
_background-color:#CDCDCD; /* ie 6*/
*background-color:#dddd00; /* ie 7*/
background-color:red\0; /* ie 8/9*/
background-color:blue\9\0;
使用绝对定位position: absolute;定义元素时,可以用top,bottom,left,right控制元素在页面上下左右的位置,有时我们需要元素无论页面大小都是显示在页面中间时,可以使用百分比来定义,如
#purr-container {
position: absolute;
top: 50%;
right: 50%;
z-index: 99999999 !important;
}
注: !important;ie7和FF可以识别,ie6不识别,可以用来区分火狐和ie6
1 概述
ab(ApacheBench)是Apache自带的超文本传输协议(HTTP)性能测试工具。 其设计意图是描绘当前所安装的Apache的执行性能, 主要是显示你安装的Apache每秒可以处理多少个请求。
2 使用
2.1 安装
Apache服务器套件自带ab,只要安装Apache即可,无需另行安装ab。ab位于%ApacheHome%/bin目录下(“%ApacheHome%”为Aapche安装路径),你也可以把ab.exe文件copy出来,独立使用。
2.2 参数列表
-A auth-username:password
:
"隔开,并将被以base64编码形式发送。无论服务器是否需要(即是否发送了401认证需求代码),此字符串都会被发送。 -c concurrency
-C cookie-name=value
Cookie:
"头行。其典型形式是 name=value
的一个参数对。此参数可以重复。 -d
-e csv-file
-g gnuplot-file
-h
-H custom-header
"Accept-Encoding: zip/zop;8bit"
)。 -i
HEAD
请求,而不是GET
。 -k
-n requests
-p POST-file
-P proxy-auth-username:password
:
"隔开,并将被以base64编码形式发送。无论服务器是否需要(即是否发送了407代理认证需求代码),此字符串都会被发送。 -q
ab
每处理大约10%或者100个请求时,会在stderr
输出一个进度计数。此 -q
标记可以屏蔽这些信息。 -s
ab -h
会告诉你)使用了SSL的受保护的https
,而不是http
协议的时候。此功能是实验性的,最好不要用。 -S
-t timelimit
-n 50000
"。它可以使对服务器的测试限制在一个固定的总时间以内。默认时,没有时间限制。 -T content-type
-v verbosity
4
或更大值会显示头信息,3
或更大值可以显示响应代码(404,200等),2
或更大值可以显示警告和其他信息。 -V
-w
-x <table>-attributes
<table>
属性的字符串。此属性被填入<table 这里 >
。 -X proxy[:port]
-y <tr>-attributes
<tr>
属性的字符串。 -z <td>-attributes
<td>
属性的字符串。 以上参数最常用的是-n 在测试会话中所执行的请求个数;和-c 一次同时产生的并发请求个数。
2.3 实例
假设我们要测试一下本网站,其中一个性能测试用例是:“同时处理50个并发请求并运行 100 次index.php 首页”,我们可以在cmd shell中输入 ab -n 1000 -c 50 http://www.zui88.com/index.php,运行结束后,ab会自动显示测试结果,如下:
C:\wamp\Apache2\bin>ab -n 100 -c 50 http://www.zui88.com/index.php
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/
Benchmarking www.zui88.com (be patient).....done
Server Software: Apache/2.0.52
Server Hostname: www.zui88.com
Server Port: 80
Document Path: /index.php
Document Length: 21380 bytes
Concurrency Level: 50
Time taken for tests: 66.328125 seconds
Complete requests: 100
Failed requests: 15
(Connect: 0, Length: 15, Exceptions: 0)
Write errors: 0
Non-2xx responses: 15
Total transferred: 1856980 bytes
HTML transferred: 1822145 bytes
Requests per second: 1.51 [#/sec] (mean)
Time per request: 33164.063 [ms] (mean)
Time per request: 663.281 [ms] (mean, across all concurrent requests)
Transfer rate: 27.33 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 31 41 8.5 46 62
Processing: 32 20242 9776.5 22015 43890
Waiting: 31 1637 1327.6 1156 6078
Total: 78 20283 9778.3 22046 43921
Percentage of the requests served within a certain time (ms)
50% 22046
66% 24812
75% 26656
80% 27796
90% 30421
95% 30734
98% 31921
99% 43921
100% 43921 (longest request)
C:\wamp\Apache2\bin>
以上结果指出,在并发50个请求的情况下,完成100次的访问请求,共花了66.328125秒,这个程序每秒可处理1.51个请求。
2.4 问题
在实际使用中,我发现-c 参数,即一次同时产生的并发请求个数最多设置成64,大于等于65就会报错,不知道为什么。