View Single Post
  #7  
Old 11-27-2011, 10:38 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 586,303
Hall of Famer is on a distinguished road
Default

Quote:
Originally Posted by Csar View Post
Well, you wouldn't need to "block" the users but simply not count if they're eing referred, If I'm right you could use something like this:

PHP Code:
<?php
    $blacklist 
Aray(/*Terms that identify banned sites for example:*/ 'yarolds''google');
    
$click_allowed true;
    foreach (
$blacklist as $disallowedpage
        if (
strpos($_SERVER['HTTP_REFERRER'], $disallowedpage) !== false$click_allowed=false;
?>
Later you can just check against your prohibited pages, something like this
PHP Code:
<?php
    
if ($click_allowed) echo 'This is a normal user';
    else echo 
'You should not use any click services';
?>
If you would like to limit the number of clicks everyday you would need to add an extra table to your MySQL.

Hope it helped

C#
This looks cool, but seems that you made a typo here:

PHP Code:
    $blacklist Aray(/*Terms that identify banned sites for example:*/ 'yarolds''google'); 
It should be this if I am correct:

PHP Code:
    $blacklist = Array(/*Terms that identify banned sites for example:*/ 'yarolds''google'); 
But anyway I do not recommend the approach to block incoming traffic, since even without Yarold they can still find other ways to level up quickly. A better approach is to write a code that count how many clicks this very adoptable has received during the day and generates an error message if the number is above 10.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote