插件编写:
http://www.kindsoft.net/ke4/examples/custom-plugin.html
查看顺序:配置(items)>脚本(对应的目录,单击是直接调用目录下的脚本)>样式(主要显示图标)
this 变量的指针指向 当前的editor
弹出dialog:
http://www.kindsoft.net/docs/dialog.html
两种,这种直接显示,不用通过对像
缺点,不支持指定对象显示。可以尝试 $(“obj”).html()插入 Y(^_^)Y
天道酬勤,知足常乐
插件编写:
http://www.kindsoft.net/ke4/examples/custom-plugin.html
查看顺序:配置(items)>脚本(对应的目录,单击是直接调用目录下的脚本)>样式(主要显示图标)
this 变量的指针指向 当前的editor
弹出dialog:
http://www.kindsoft.net/docs/dialog.html
两种,这种直接显示,不用通过对像
缺点,不支持指定对象显示。可以尝试 $(“obj”).html()插入 Y(^_^)Y
http://www.cnblogs.com/keepfool/archive/2011/12/21/2295335.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>KF富文本编辑器</title>
<script type="text/javascript" src="http://common.cnblogs.com/script/jquery.js">
</script>
<script type="text/javascript">
$(function(){
$d = $("#editor")[0].contentWindow.document; // IE、FF都兼容
$d.designMode="on";
$d.contentEditable= true;
$d.open();
$d.close();
$("body", $d).append("<div>A</div><div>B</div><div>C</div>");
$('#insert_img').click(function(){
// 在iframe中插入一张图片
var img = '<img src="' + $('#path').val() +'" />';
$("body", $d).append(img);
});
$('#preview').click(function(){
// 获取iframe的body内容,用于显示或者插入到数据库
alert($('#editor').contents().find('body').html());
$('#preview_area').html($('#editor').contents().find('body').html());
});
});
</script>
</head>
<body>
<p><iframe id="editor" width="600px" height="200px" style="border:solid 1px;"></iframe></p>
<input type="text" id="path" value="http://www.google.com/images/errors/robot.png"/>
<input type="button" id="insert_img" value="插入图片" />
<input type="button" id="preview" value="预览" />
<p style="border: 1px dashed #ccc;" id="preview_area"></p>
</body>
</html>
配色:
http://www.peise.net/
设计欣赏:
http://www.itdream.com.cn/design-graphic/13587_2.html
javascript 效果:
http://blog.163.com/guoqiang_s/blog/static/1678978712010112761646744/
禁止:root
confgi.inc.php
$cfg['Servers'][$i]['AllowRoot'] = false;
评分:
星星评分
滚动插件
http://www.gmarwaha.com/jquery/jcarousellite/?#doc
visible:6,
自定义滚动条
http://www.net-kit.com/jquery-custom-scrollbar-plugins/?1365058929
分享
www.bshare.cn
分享(猜你喜欢,推荐,分享)
http://www.jiathis.com/
easyui带来的便利性不言而喻,但是相对的,如果一些叼难的问题和一些冲突问题,很可能让人抓狂。本篇只做简单记录,主要针对脚本的兼容和冲突。其它不考虑。
ie6中的变量名的注意。首先要说的一点就是ie有个很奇怪的地方,或者说。ie本身就是怪异的存在 。。
js中变量名尽量不要用可能是系统的变量名。如state length 这些。具体原因不名。只是做个小记,用了这些名,程序很可能会运行异常,但是又不知道为什么。
关于异常的处理。
try{
//error
}catch(e){
}
跳过。或者跟据浏览器做单独的特殊处理。
上次就搞个360,很吐血的,它用ie6的内核但是usergent竟然显示ie8.这么坑爹有没有。
针对ie6的问题还差点成绝症,最后还是直接用这招。。
与 thickbox.js的冲突问题。
关闭图片时,全屏变白
function tb_remove() {
$("#TB_imageOff").unbind("click");
$("#TB_closeWindowButton").unbind("click");
$("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();});
$("#TB_load").remove();
if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
$("body","html").css({height: "auto", width: "auto"});
$("html").css("overflow","");
}
document.onkeydown = "";
document.onkeyup = "";
return false;
}
去掉
$("body","html").css({height: "auto", width: "auto"});
kindEditor 全屏异常
kindeditor.js 4862行,把’height’ : ‘1px’, 给注释掉
http://deerchao.net/tutorials/regex/regex.htm#metacode
http://www.php100.com/html/webkaifa/zhengzebiaodashi/2011/0213/7513.html
php提供的原生处理编码的正则
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
$string=" (包含首月600分钟区内语音、300M流量、100条短信、免6元手机邮箱)";
mb_regex_encoding("UTF-8");
mb_ereg_search_init($string);
//mb_ereg_search("(d+)(分钟|M|条|元)");
echo "<pre>";
while($match = mb_ereg_search_regs ("(d+)(分钟|M|条|元)([^、)]+)")){
var_export($match);
};
exit;
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><pre><?php
// 零宽断言,需要理解的是间隙
//特别注意零,这种是间隙,表示匹配但不包括
preg_match_all("/ab(?=c)/", "abc abd",$data);
print_r($data);
/**
* Array
(
[0] => Array
(
[0] => ab
)
)
*/
//间隙后不是什么
preg_match_all("/ab(?!c)/", "abc abd",$data);
print_r($data);
/**
* Array
(
[0] => Array
(
[0] => ab
)
)
*/
//括号不包括
preg_match_all("/ab(?:c)/", "abc abd",$data);
print_r($data);
/**
* //这个和上面是没有关系的,只是顺便做补充
Array
(
[0] => Array
(
[0] => abc
)
)
*/
//包括间隙
preg_match_all("/ab(?>c)/", "abc abd",$data);
print_r($data);
echo "负向0宽断言<BR>";
preg_match_all("/(?<=c)ab/", "cab dab",$data);
print_r($data);
/**
* Array
(
[0] => Array
(
[0] => ab
)
)
*/
preg_match_all("/(?<=c)ab/", "<=cab dab",$data);
print_r($data);
/**
* Array
(
[0] => Array
(
[0] => <=cab
)
)
*/
preg_match_all("/(?<!c)ab/", "<=cab dab",$data);
print_r($data);
/**
* Array
(
[0] => Array
(
[0] => <=dab
)
)
*/
preg_match_all("/(?:<=c)ab/", "<=cab dab",$data);
print_r($data);
/**
* Array
(
[0] => Array
(
[0] => <=cab
)
)
*/
exit;
匹配多个不相同字正则 ,有人说无解呀~
$s = "abcd1231daaa23abcxde23abcdeef3abcdefg3abcdefgh3abcdefghi3abccdefghij"; $flag = preg_match_all ( '/([a-z])(?!1)([a-z])(?!1|2)([a-z])(?!1|2|3)([a-z])(?!1|2|3|4)([a-z])(?!1|2|3|4|5)([a-z])/', $s, $result ); var_export ( $flag ); var_export ( $result ); /** * array ( * 0 => 'abcdef', * 1 => 'abcdef', * 2 => 'abcdef', * 3 => 'abcdef', * 4 =>'cdefgh', ) */
补充替换反斜杠 =>
$value=preg_replace("/\\/", "", $value);
好记性不如烂笔头。。。
1.main.php 丢失
原因:配置正确,就是读不到main.php。
解决方式:经排查,发现是有一个类的常量没有上传。。导致异常。但是又不报错,还能返回。但是返回的就只有view 没有main.php这个页面的内容。补上常量。正常
最近接了个单子做处理。
不过朋友要求将2.0升级到2.5。但一般应用,升级或多或少都会出问题。本地准备,出问题再解决问题Y(^_^)Y,做事最要紧的是信心,如是自己都不相信自己,又怎么让别人相信你呢?
各种准备是必要的:
1.svn备份项目
2.备份数据库
3.因为担心项目内部做过小修改。所以上官方原版下载最新版本,通过svn比对,检查项目的差异性。因为如果做过特殊处理,必要是得还原的。
4.关闭原平台的应用通讯和云平台的链接,形成独立状态,这样修改过程中,出意外也不会影响到别的应用
注:同服务器修改过程,ip可用的情况下。要修改配置文件,取消登录
uc_clientdatacacheapps.php
5.升级前的相关了解
7.使用dz原版项目测试更新和检查。了解下具体的流程,出问题也好判断哪里不同
实际操作
使用实际项目更新和检查
公司之前做的一个基于YII的系统让别人去检测,结果各种有的没的挑毛病。
因为这个原因,考虑到系统的健壮性,需要对这些企图通过各种暴力破解的鸟蛋进行隔离。
实现流程思考:
为了不让小黑察觉,又不影响用户。考虑伪装系统原来的提示方式。然后如果限制的时间内,达到某个值。封ip(当然是n小时什么的不能访问啦)。
再研究系统默认异常处理机制。因为一个合格的框架这个最基本的处理浏览肯定是有滴。虽然平时有看源代码,但整体把握肯定是没有绝对到位的。不会不要紧。google下。
yii error handle 果然一堆。
配置如下:
'components'=>array(
'errorHandler' => array(
'errorAction' => 'errormsg/error',
),)
伪装提示页面(这个简单研究下yii的源代码,猜到在哪处理):
Y(^_^)Y 直接复制yii的东西来用,一点都不用改:
framework1.1.10viewszh_cn 下的就是国际化的提示页面。咋就简单提取。
Controller操作:
function actionError() {
$error = Yii::app ()->errorHandler->error;
if ($error) {
$error=Errorinfo::model()->record($error);
if($error['code']=='500'){
die("系统繁忙中!");
}
$this->renderPartial( 'error'.$error['code'], array (
'data' => $error
) );
} else {
js_alert ( "error page", "", url ( 'site/index' ) );
}
}
强化升级:
1. 考虑文件的读取,如 图片,脚本,样式文件等这些,会造成异常的值偏高。所以要根据相关的后缀进行过滤。当然,为了防止别人是在暴力查询控制器的函数。所以最后限制下目录前缀。
转发请注明出处http://blog.martoo.cn
如有漏缺,请联系我 QQ 243008827