Guest User

Untitled

a guest
Jan 3rd, 2013
1,785
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. Tuto d'avertissement free #adgate
  2.  
  3. Installer superpopup
  4. http://wordpress.org/extend/plugins/wp-super-popup/
  5.  
  6. dans /wp-content/plugins/wp-super-popup/
  7. editer wp-super-popup.php
  8.  
  9. et rajouter la fonction :
  10. function smp_is_not_free(){
  11.  
  12. if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet
  13. {
  14. $ip=$_SERVER['HTTP_CLIENT_IP'];
  15. }
  16. elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy
  17. {
  18. $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
  19. }
  20. else
  21. {
  22. $ip=$_SERVER['REMOTE_ADDR'];
  23. }
  24.  
  25. $host = @gethostbyaddr($ip);
  26.  
  27. if(substr_count($host, 'proxad')) return false;
  28. return true;
  29. }
  30.  
  31. dans la fonction smp_is_page_allowed()
  32.  
  33. Ajouter la ligne
  34. if (smp_is_not_free() ) return false;
  35. juste avant $res = true;
  36.  
  37. configurer votre plugin dans l'admin wordpress et vous avez une joli popup pour les freenautes.
  38.  
  39. DΓ©solΓ©, j'aime bien free et les freenautes, mais la publicitΓ© permet de faire vivre mon blog.
Advertisement
Add Comment
Please, Sign In to add comment