Free 100 hits in

  • Thread starter Thread starter Blink70v
  • Start date Start date
B

Blink70v

Guest
Good morning.
But I feel that the code adds of hits every day ...
How can he adds just +100 hits the first days ?

Code source

PHP:
// Free 100 hits in
    $DB->query("UPDATE {$CONF['sql_prefix']}_stats SET
        unq_in_0_daily = unq_in_0_daily + 100,
        unq_in_max_daily = unq_in_max_daily + 100,
        tot_in_0_daily = tot_in_0_daily + 100,
        tot_in_max_daily = tot_in_max_daily + 100,
        unq_in_0_weekly = unq_in_0_weekly + 100,
        unq_in_max_weekly = unq_in_max_weekly + 100,
        tot_in_0_weekly = tot_in_0_weekly + 100,
        tot_in_max_weekly = tot_in_max_weekly + 100,
        unq_in_0_monthly = unq_in_0_monthly + 100,
        unq_in_max_monthly = unq_in_max_monthly + 100,
        tot_in_0_monthly = tot_in_0_monthly + 100,
        tot_in_max_monthly = tot_in_max_monthly + 100 WHERE username = '{$username}'", __FILE__, __LINE__);


I need to change like this ?

PHP:
// Free 100 hits in
    $DB->query("UPDATE {$CONF['sql_prefix']}_stats SET
        unq_in_0_daily = unq_in_0_daily + 100 HERE username = '{$username}'", __FILE__, __LINE__);
 
No, this code ads it just for today.
Like: if you add hits in today, you also need to update current week and month and overall and the totals of each of these and the max values

thinking of that it still misses something. Use this
Code:
// Free 100 hits in
    $DB->query("UPDATE {$CONF['sql_prefix']}_stats SET
        unq_in_0_daily = unq_in_0_daily + 100,
        unq_in_max_daily = unq_in_max_daily + 100,
        tot_in_0_daily = tot_in_0_daily + 100,
        tot_in_max_daily = tot_in_max_daily + 100,
        unq_in_0_weekly = unq_in_0_weekly + 100,
        unq_in_max_weekly = unq_in_max_weekly + 100,
        tot_in_0_weekly = tot_in_0_weekly + 100,
        tot_in_max_weekly = tot_in_max_weekly + 100,
        unq_in_0_monthly = unq_in_0_monthly + 100,
        unq_in_max_monthly = unq_in_max_monthly + 100,
        tot_in_0_monthly = tot_in_0_monthly + 100,
        tot_in_max_monthly = tot_in_max_monthly + 100,
        unq_in_overall = unq_in_overall + 100,
        tot_in_overall = tot_in_overall + 100 WHERE username = '{$username}'", __FILE__, __LINE__);

Remember to put this into a plugin. I suppose its for new members. then the code needs to be in a file called "join_insert_data.php"
 
I have a problem in my stats then! Total days is different from the total of the month.
 
On a new member? Which had zero hits in before? Thats not possible. As you might see, the code just adds 100 to what they had before.
If they had 5 before, then they will have 105 after
 
Well look at the difference on my site.
And I just remove the 100 hit
 
I looked at it. the newest member has 100 daily ( 4 days ), 201 monthly. But if you look at the daily stats he once had 101, thats from where the 201 comes.

So, 200 still misssing from monthly. I bet it comes because you used your second code in your first post before, which just updated daily, not the other stats

I can 1000% assure you, if you use my code it works as it should.
 
Back
Top