心灵天空 Free My Soul To Reach The Sky.放飞我的心灵去触摸天空。

Z-Blog2.0 自建插件-自动文章别名

Z-blog1.8有个自动文章别名的插件比较好使,升级到2.0后没有这个插件了。每次发表文章都要手动输入一个别名也挺费事。索性参考1.8的自动文章别名插件试着写了个适用于Z-blog2.0的。

2020-12-30 | 发布:标哥 | 分类:技术收藏 | 评论:1

kindeditor上传图片,丢失session的问题解决

    这两天遇到一个问题,在网站使用kindeditor上传控件上传图片时,单图上传没有问题,但是一旦使用多个图片上传,就会出现Session丢失的情况,简单来说就是你的管理员登录信息丢失,网页自动跳转到登录页面了。网上原因,是上传控件使用了flash的原因,按如下方法解决:

    

打开kindeditor/plugins/multiimage/image.js文件,找到以下内容:

url : K.addParam(uploadJson, 'dir=image')

将其改为:

url : K.addParam(uploadJson, 'dir=image') + "&" + encodeURIComponent($("[name='csrf-param']").attr("content")) + "=" + encodeURIComponent($("[name='csrf-token']").attr("content"))

问题解决

2020-08-20 | 发布:标哥 | 分类:技术收藏 | 评论:1

网页自动关闭的代码

<script language="javascript">
window.opener=null; 
window.open('', '_self', '');//模拟自己打开自己
window.close();//再关闭就没有对话框了
</script>

--------------------------以下是过多少秒自动关闭网页,弹窗

<html>
<head>
<title>JS定时关闭当前网页窗口_网页代码站</title>
</head>
<body>
<script LANGUAGE="JavaScript">
setTimeout('window.close();', 5000); 
</script>
<p align="center">5秒后关闭</p>
<br />
</body>
</html>

--------------------------以下是过多少秒自动关闭网页,不弹窗
 
<body onload='setTimeout("mm()",5000)'>
<script>
function mm()
{
     window.opener=null;
     window.close();
} 
</script>
</body>


2019-03-13 | 发布:标哥 | 分类:技术收藏 | 评论:0

使用javascript点击添加或删除一行

<pre name="code" class="html">
<html>
 
<head>
<title>js-sample</title>
 
<script type="text/javascript">
<!--
var count = 1;
function add() {
  var tbl = document.all.ci;
  var rows = tbl.rows.length;
  var tr = tbl.insertRow(rows);
   
  var name = tr.insertCell(0);
  name.innerHTML = '<input type="text">';
  var tel = tr.insertCell(1);
  tel.innerHTML = '<input type="text">';
  var rdo = tr.insertCell(2);
  rdo.innerHTML = '<input type="radio" value="0" name="rdo' + count + '">Yes <input type="radio" value="1" name="rdo' + count + '">No';
  var chk = tr.insertCell(3);
  chk.innerHTML = '<input type="checkbox" value="0" name="chk' + count + '">Modify <input type="checkbox" value="1" name="chk' + count + '">Delete';
  var del = tr.insertCell(4);
  del.innerHTML = '<input type="button" onclick="del(this)" value="Delete">';
  count++;
}
 
function del(btn) {
  var tr = btn.parentElement.parentElement;
  var tbl = tr.parentElement;
  tbl.deleteRow(tr.rowIndex-1);
}
//-->
</script>
</head>
 
<body>
 
<input type="button" onClick="add()" value="Add-Customer">
 
<table border="1" style="width:100%" id="ci" name="ci">
  <caption>customer information</caption>
  <thead>
  <tr>
  <th>Name</th>
  <th>Tel</th>
  <th>Radio</th>
  <th>CheckBox</th>
  <th>?</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td><input type="text" value="Zhang San"></td>
  <td><input type="text" value="111"></td>
  <td>
  <input type="radio" value="0" name="rdo">Yes <input type="radio" value="1" name="rdo">No
  </td>
  <td>
  <input type="checkbox" value="0" name="chk">Modify <input type="checkbox" value="1" name="chk">Delete
  </td>
  <td>
  <input type="button" onClick="del(this)" value="Delete">
  </td>
  </tr>
  </tbody>
</table>
 
</body>
</html>

TIM截图20190114161229.jpg

2018-08-16 | 发布:标哥 | 分类:技术收藏 | 评论:0

windows【上帝模式】,你没见过的完全控制面板

    上帝模式,即"God Mode”,或称为“完全控制面板”。是Windows Vista/7系统中隐藏的一个简单的文件夹窗口,但包含了几乎所有Windows系统的设置,如控制面板的功能、界面个性化、辅助功能选项等方方面面的控制设置,用户只需通过这一个窗口就能实现所有的操控,而不必再去为调整一个小小的系统设置细想半天究竟该在什么地方去打开设置窗口。此功能同样适用于所有NT6.0以上(包括6.0)的操作系统。GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}”的秘密就在于“.”后面的函数指令,通过它可以调用Windows中的内置功能。

2018-03-10 | 发布:标哥 | 分类:技术收藏 | 评论:2

网页中表格的各种换行方式

    在对表格的排版中经常要遇到换行或者不换行的处理;

    不换行:在<td>中加上nowrap,则单元格中的内容总不换行;

    换行:

    1。按字符换行:在<td>中加上

    style="word-break:break-all"

    如

2014-10-23 | 发布:标哥 | 分类:技术收藏 | 评论:0

SQL查询当前数据上一条和下一条的记录

SQL查询当前数据上一条和下一条的记录

    id是指当前数据news_id参数

    方法一:
    string preSql = "select top 1 * from news where news_id < " + id + " order by news_id DESC"
    string nextSql = "select top 1 * from news where news_id > " + id + " order by news_id ASC"
    方法二:
    string preSql = "select * from [news] where news_id = (select MAX(news_id) from [news] where news_id<"+ id + ")";
    string nextSql = "select * from [news] where news_id = (select MIN(news_id) from [news] where news_id>"+ id + ")";
2014-09-24 | 发布:标哥 | 分类:技术收藏 | 评论:0