自动拼音什么的感觉还不如直接用当前时间呢。。
刚接触 TE,插件什么的不会弄。。直接改的程序文件——把下边代码复制到 admin\common-js.php 末尾。。
新建文章/页面时自动填写缩略名为当前日期和时间(通过载入页面时判断 slug 文本框是否为空)
<script type="text/javascript">
if (document.getElementById('slug').value == '') {
var oDate = new Date();
var month = oDate.getMonth() + 1;
if (month <= 9) month = "0" + month;
var day = oDate.getDate();
if (day <= 9) day = "0" + day;
var hour = oDate.getHours();
if (hour <= 9) hour = "0" + hour;
var Minute = oDate.getMinutes();
if (Minute <= 9) Minute = "0" + Minute;
var Second = oDate.getSeconds();
if (Second <= 9) Second = "0" + Second;
var sDate = oDate.getFullYear() + month + day + hour + Minute + Second;
document.getElementById('slug').value = sDate
}
</script>
输出结果:20120512231329
js-date · 沉冰浮水/水水的旧代码合集 - 码云 - 开源中国:
https://gitee.com/wdssmq/StaleCode/tree/master/js-date
留言网址默认屏蔽 临时查看 认领以解除屏蔽