Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Limit amount of clicks per day (http://www.mysidiaadoptables.com/forum/showthread.php?t=2544)

SilverDragonTears 11-24-2011 08:28 PM

Limit amount of clicks per day
 
I need to put a limit on the amount of times an adopt's level up link can be clicked. This is because some of my members are using Yarolds and leveling up their pets in a ridiculous amount of time ie: 5 minutes after catching an egg, their adopt becomes an adult. I don't want to increase the amount of clicks it takes to level up because most of my users do not use Yarolds.

Can anyone help me out with this? :)

Slix 11-24-2011 11:47 PM

You could do what I did and simply block incoming traffic from Yarold's.

SilverDragonTears 11-24-2011 11:58 PM

Oh please tell me how!! i'm not sure I'll go that route... but if I have to...

Csar 11-25-2011 07:58 AM

Quote:

Originally Posted by SilverDragonTears (Post 19782)
Oh please tell me how!! i'm not sure I'll go that route... but if I have to...

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#

SilverDragonTears 11-25-2011 10:29 AM

I'm not sure exactly where to put these?

Nemesis 11-25-2011 01:51 PM

lol wow so i wonder if people would be willing to pay for clicks. $0.10 cpm lol that i can actually provide. Though this doesn't help SDT's situation lol.

Hall of Famer 11-27-2011 10:38 PM

Quote:

Originally Posted by Csar (Post 19784)
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.

SilverDragonTears 11-28-2011 03:22 PM

How can I do this HoF?

Hall of Famer 11-28-2011 11:14 PM

Well this can be achieved by adding these lines somewhere in levelup.php:

PHP Code:

$result runquery("SELECT * FROM {$prefix}vote_voters WHERE adoptableid='{$id}' and date = '{$date}'");
$num mysql_num_rows($result);
if(
$num >= 10){
$article_content .= "An error has occurred, this adoptable has been leveled up 10 times already today. " 
}
else{
// codes to execute if the adoptable can be leveled up



SilverDragonTears 11-28-2011 11:17 PM

HoF... have I mentioned how awesome you are? Will this still allow them to get money for clicking on it? I'd want them to be able to.


All times are GMT -5. The time now is 04:40 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.