Yesterday, I modified the external links in my blog's comments, and changed the external links to the internal links. I threw myself into my blog and checked whether the results were good. I would like to share them below.
Add the following code to the function. php template:
/** External links to internal links in blog comments **/
Add_filter ('Get _ comment_author_link ', 'Add _ redirect_comment_link', 5 );
Add_filter ('comment _ text', 'Add _ redirect_comment_link ', 99 );
Function add_redirect_comment_link ($ text = ''){
$ Text = str_replace ('href = "', 'href ="'. get_option ('Home'). '/goto. php? Url = ', $ text );
$ Text = str_replace ("href = '", "href ='". get_option ('Home'). "/goto. php? Url = ", $ text );
Return $ text;
}
The above code is actually the page display link are modified to http://www.111cn.net/goto. php? Url = [Website Link]
Create a new goto. php file and put it in the directory with the same name.
<! Doctype html>
<Html lang = "en">
<Head>
<Meta charset = "UTF-8">
<Meta name = "Author" content = "">
<Meta name = "Keywords" content = "">
<Meta name = "Description" content = "">
<Meta name = "robots" content = "noindex, nofollow">
<Meta http-equiv = "refresh" content = "3; url = <? Php $ url = $ _ GET ['URL']; echo htmlspecialchars ($ url);?> ">
<Title> Jump page </title>
<Style>
. Spinner {
Margin: 100px auto 0;
Width: 150px;
Text-align: center;
}
. Spinner> div {
Width: 30px;
Height: 30px;
Border-radius: 100%;
Display: inline-block;
-Webkit-animation: bouncedelay 1.4 s infinite embedded-in-out;
Animation: bouncedelay 1.4 s infinite injection-in-out;
/* Prevent first frame from flickering when animation starts */
-Webkit-animation-fill-mode: both;
Animation-fill-mode: both;
}
. Spinner. bounce1 {
-Webkit-animation-delay:-0.32 s;
Animation-delay:-0.32 s;
Background-color: # 428bca;
}
. Spinner. bounce2 {
-Webkit-animation-delay:-0.16 s;
Animation-delay:-0.16 s;
Background-color: # Dd534F;
}
. Spinner. Bounc4 {
-Webkit-animation-delay:-0.01 s;
Animation-delay:-0.01 s;
Background-color: #67CF22;
}
@-Webkit-keyframes bouncedelay {
0%, 80%, 100% {-webkit-transform: scale (0.0 )}
40% {-webkit-transform: scale (1.0 )}
}
@ Keyframes bouncedelay {
0%, 80%, 100% {
Transform: scale (1, 0.0 );
-Webkit-transform: scale (0.0 );
} 40% {
Transform: scale (1, 1.0 );
-Webkit-transform: scale (1.0 );
}
}
</Style>
</Head>
<Body>
<Div class = "spinner">
<Div class = "bounce1"> </div>
<Div class = "bounce2"> </div>
<Div class = "boune3"> </div>
</Div>
</Body>
</Html>
Okay. Leave a message if you have any questions.