|
本帖最后由 初缘Cvps小站 于 2019-3-9 14:53 编辑
最近用某N1折腾了一个博客。然后用的是Dux非常开心的主题。
然后自己用Begin的to.php?ulr= 这个跳转不错,还加密了。
然后就移植一下吧。好像还有点小bug? 反正也看不懂多少代码。。。欢迎各位大佬指出并提供解决方案!这里非常感激!
总结就是:将to.php代码复制到dux主题去,然后在主题中的functions.php调用就行了。更多的?度娘都有,参考改改吧,我也不会改,就这样用吧。
附上移植方法:
1.直接将begin主题目录中的to.php内容复制到dux新建的to.php内存中。
附:to.php内容
[ol]">加载中body{overflow:hidden;background:#f1f1f1}.container{display:flex;justify-content:center;align-items:center;height:100vh;overflow:hidden;animation-delay:1s}.item-1{width:20px;height:20px;background:#f583a1;border-radius:50%;background-color:#eed968;margin:7px;display:flex;justify-content:center;align-items:center}@keyframes scale{0%{transform:scale(1)}50%,75%{transform:scale(2.5)}78%,100%{opacity:0}}.item-1:before{content:'';width:20px;height:20px;border-radius:50%;background-color:#eed968;opacity:.7;animation:scale 2s infinite cubic-bezier(0,0,0.49,1.02);animation-delay:200ms;transition:.5s all ease;transform:scale(1)}.item-2{width:20px;height:20px;background:#f583a1;border-radius:50%;background-color:#eece68;margin:7px;display:flex;justify-content:center;align-items:center}@keyframes scale{0%{transform:scale(1)}50%,75%{transform:scale(2.5)}78%,100%{opacity:0}}.item-2:before{content:'';width:20px;height:20px;border-radius:50%;background-color:#eece68;opacity:.7;animation:scale 2s infinite cubic-bezier(0,0,0.49,1.02);animation-delay:400ms;transition:.5s all ease;transform:scale(1)}.item-3{width:20px;height:20px;background:#f583a1;border-radius:50%;background-color:#eec368;margin:7px;display:flex;justify-content:center;align-items:center}@keyframes scale{0%{transform:scale(1)}50%,75%{transform:scale(2.5)}78%,100%{opacity:0}}.item-3:before{content:'';width:20px;height:20px;border-radius:50%;background-color:#eec368;opacity:.7;animation:scale 2s infinite cubic-bezier(0,0,0.49,1.02);animation-delay:600ms;transition:.5s all ease;transform:scale(1)}.item-4{width:20px;height:20px;background:#f583a1;border-radius:50%;background-color:#eead68;margin:7px;display:flex;justify-content:center;align-items:center}@keyframes scale{0%{transform:scale(1)}50%,75%{transform:scale(2.5)}78%,100%{opacity:0}}.item-4:before{content:'';width:20px;height:20px;border-radius:50%;background-color:#eead68;opacity:.7;animation:scale 2s infinite cubic-bezier(0,0,0.49,1.02);animation-delay:800ms;transition:.5s all ease;transform:scale(1)}.item-5{width:20px;height:20px;background:#f583a1;border-radius:50%;background-color:#ee8c68;margin:7px;display:flex;justify-content:center;align-items:center}@keyframes scale{0%{transform:scale(1)}50%,75%{transform:scale(2.5)}78%,100%{opacity:0}}.item-5:before{content:'';width:20px;height:20px;border-radius:50%;background-color:#ee8c68;opacity:.7;animation:scale 2s infinite cubic-bezier(0,0,0.49,1.02);animation-delay:1000ms;transition:.5s all ease;transform:scale(1)} [/ol]复制代码
2.调用。
发现我那个正版的begin调用代码全在inc/inc.php中了。所以直接找到引用代码,复制的dux主题中的functions.php这个去。
附:调用代码!
[ol]// 外链跳转add_filter('the_content','wl_the_content_to',999);function wl_the_content_to($content){ preg_match_all('/href="(http.*?)"/',$content,$matches); if($matches){ foreach($matches[1] as $val){ if( strpos($val,home_url())===false && !preg_match('/\.(jpg|jepg|png|ico|bmp|gif|tiff)/i',$val) && !preg_match('/(ed2k|thunder|Flashget|flashget|qqdl):\/\//i',$val)) $content=str_replace("href="$val"", "rel="external nofollow" target="_blank" href="" .get_template_directory_uri(). "/to.php?url=" .base64_encode($val). """,$content); } } return $content;}// 评论者链接跳转add_filter('get_comment_author_link', 'comment_author_link_to');function comment_author_link_to() { $encodeurl = get_comment_author_url( $comment_ID ); $url = get_template_directory_uri().'/to.php?url=' . base64_encode($encodeurl); $author = get_comment_author( $comment_ID ); if ( empty( $encodeurl ) || 'http://' == $encodeurl ) return $author; else return "$author";}// 网址跳转function sites_nofollow($url) { $url = str_replace($url, get_template_directory_uri()."/to.php?url=".$url,$url); return $url;}[/ol]复制代码
如果不喜欢to的跳转,自己就改个go的跳转,,然后张戈大佬博客也有这方面的文章参考!
以上就是我移植的笨方法了。不知道有木有Bug什么鬼。欢迎各位大佬指出并提供解决方案!!感谢,感激!
最后丢个演示站:http://strongma.com
原本N1的,现在是闲置旧主机,vm虚拟化centos系统搭建的网站。
穿透就是ZeroTier.......用法,坛子搜下N1,里面有说明的。不会再留言或私信吧。 |
|