Baidu thieves: removes bids and advertisements. Functions are as follows. The rewrite rules are consistent with those of Wordpress. Compatible with IIS, Apache, and Nginx. Only one file implements all functions .? Phpif (isset ($ _ GET [wd]) {$ keywords $ _ GET [wd];} $ uri functions are as follows.
The rewrite rules are consistent with those of Wordpress.
Compatible with IIS, Apache, and Nginx.
Only one file implements all functions.
-
- If (isset ($ _ GET [wd]) {
- $ Keywords = $ _ GET [wd];
- }
- $ Uri = isset ($ _ SERVER [HTTP_X_REWRITE_URL])? $ _ SERVER [HTTP_X_REWRITE_URL]: $ _ SERVER [REQUEST_URI];
- $ Content = file_get_contents ("http://www.baidu.com". $ uri );
-
- If ($ uri =/| empty ($ uri )){
- Display ($ content );
- }
-
- // Delete the "laibaidu promotion" LINK
- $ Start = preg_quote ("
");
- $ Content = preg_replace ("/". $ start ."((?!
).)*
"."/Is ", $ content );
-
- // Delete the bid on the left
- $ Start =" ).) *> ";
- $ Content = preg_replace_callback ("/". $ start ."((?!).)*/Is "," search_result_filter ", $ content );
-
- // Delete the remaining multiple
- $ Content = str_ireplace ("
", $ Content );
- // Delete the remaining multiple
- $ Content = str_ireplace ("
", $ Content );
- // Delete the promotion link on the right
- $ Start = preg_quote ("
");
- $ Content = preg_replace ("/". $ start ."((?! ", $ Content );
-
- Display ($ content );
- /**
- * Search Result Filter
- */
- Function search_result_filter ($ matches ){
- // Background # f5f5f5 is an advertisement
- If (strpos ($ matches [0], "bgcolor =" # f5f5f5 "") return;
- // ID4-digit advertising
- If (preg_match ("/ ((?!).)*/Is ", $ matches [0]) {
- Return;
- }
- Return $ matches [0];
- }
-
- Function display ($ content ){
- Echo $ content;
- }
Bytes. The rewrite rules are consistent with those of Wordpress. Compatible with IIS, Apache, and Nginx. Only one file implements all functions. ? Php if (isset ($ _ GET [wd]) {$ keywords =$ _ GET [wd];} $ uri =...