叶测试 发布的文章

PHP根据城市名获取经纬度

/**

public function get_geo($city){

$url = "http://api.map.baidu.com/geocoder/v2/?ak=wfVfdMthZRL9vjaeyFKiBhLmUth60bbZ&output=json&address=$city";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
$result = curl_exec($ch);
/* if(curl_errno($ch)){
 print_r(curl_error($ch));
} */
curl_close($ch);
return json_decode($result,TRUE);

}

JS标准时间格式化处理 格林尼治时间GMT

项目中使用到fullcalender插件,其中插入数据获取的start值为标准时间格式,转化为时间字符串插入。转化方式:

var d = new Date(start);
newStart=d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();

之后才发现fullcalender的自带formatDate函数来解决:

newStart = $.fullCalendar.formatDate(start, "yyyy-MM-dd");

fullcalender插件使用方式待整理~

Thinkphp设置仅在调试模式关闭时显示404页面

常见thinkphp设置404页面为建一个空控制器;里面然后通过_empty()再$this->display跳转到404页面;
thinkphp的配置项里面是有设置错误页面模板的:
'TMPL_EXCEPTION_FILE' => APP_DEBUG ? THINK_PATH.'Tpl/think_exception.tpl' : './Template/default/Home/Public/404.html',

css各种手型集合(css禁止手型)

比较齐全的鼠标手型css

.auto { cursor: auto; }
.deafult { cursor: default; }
.none { cursor: none; }
.context-menu { cursor: context-menu; }
.help { cursor: help; }
.pointer { cursor: pointer; }
.progress { cursor: progress; }
.wait { cursor: wait; }
.cell { cursor: cell; }
.crosshair { cursor: crosshair; }
.text { cursor: text; }
.vertical-text { cursor: vertical-text; }
.alias { cursor: alias; }
.copy { cursor: copy; }
.move { cursor: move; }
.no-drop { cursor: no-drop; }
.not-allowed { cursor: not-allowed; }
.all-scroll { cursor: all-scroll; }
.col-resize { cursor: col-resize; }
.row-resize { cursor: row-resize; }
.n-resize { cursor: n-resize; }
.e-resize { cursor: e-resize; }
.s-resize { cursor: s-resize; }
.w-resize { cursor: w-resize; }
.ns-resize { cursor: ns-resize; }
.ew-resize { cursor: ew-resize; }
.ne-resize { cursor: ne-resize; }
.nw-resize { cursor: nw-resize; }
.se-resize { cursor: se-resize; }
.sw-resize { cursor: sw-resize; }
.nesw-resize { cursor: nesw-resize; }
.nwse-resize { cursor: nwse-resize; }