织梦DEDECMS文件保存目录直接转英文的方法 有的朋友喜欢把dedecms文件保存目录直接用英文,那么可以通过以下方法。 修改文件:dede/templets/catalog_add.htm function CheckTypeDir() 在这个函数下方增加 function Checkgoogle(){ var google = document.getElementById('google'); var tpobj = document.getElementById('typedir'); var upinyin = document.getElementById('pinyin'); if(google.checked) tpobj.style.display = "none"; else tpobj.style.display = "block"; if(google.checked) upinyin.style.display = "none"; else upinyin.style.display = "block"; } 搜索 [i, 替换为 [i,拼音 [i,英文 dede/catalog_add.php 搜索 //用拼音命名 在其下方增加 //用谷歌翻译英文 if($google==1 || $typedir=='') { $typedir = googleTran(stripslashes($typename)); } /include/extend.func.php 最末尾增加 function googleTran($text){ if(empty($text)) return ""; $wf=@file_get_contents('https://translate.google.cn/?sl=zh-CN&tl=en&text& if (false===$wf||empty($wf)) { return false; } $return = ""; $star="style.backgroundColor='\#fff'\">"; ...
内容已隐藏,请关注公众号输入验证码查看
本帖支持关注公众号查看
【无套路 无套路 无套路 扫描二维码关注公众号发送【验证码】收到验证码 在上面输入点击提交查看即可显示隐藏内容】
|