----------------更新------------------
我对@Rizier123提供的代码做了一些更改
Now it will accept to add a link in the citation varibale
您需要更改preg_match (感谢@Rizier123)通过以下方式:
if(!preg_match("/" . preg_quote($citation_string, "/") . "/", $footer_contents))
最后的代码如下:
add_action(\'template_redirect\', \'foobar_explode_if_no_citation\');
function foobar_explode_if_no_citation(){
#Get the absolute server path to footer.php
$footer_path = locate_template(\'footer.php\');
#Store the footer file contents in a var
$footer_contents = file_get_contents($footer_path);
#The required string
$citation_string = \'Designed by Foo Bar <a href="http://YourLink.com">anchor</a>\';
#Set off the nuclear bomb if there is an egregious offense
if(!preg_match("/" . preg_quote($citation_string, "/") . "/", $footer_contents))
exit(\'All your websitez are belong to me. Make sure this string "Designed by Foo Bar" is included in footer.php\');
}
? Who will work with this code ?
编码人员
worked days and night 提供精彩内容,并将引用词或链接作为版权。。不想让脚本的用户
remove it or replace it 用他自己的
without permission...
it\'s just a simple way to respect the copyright! respect coders.