Subtract points for not visiting

front page Forums Community Subtract points for not visiting

Viewing 1 post (of 1 total)
  • Author
  • #33157
    AvatarAslan Guseinov

    First of all sorry for my English, if everything I wrote is doesn’t make sense.

    I have an idea to subtract points for not visiting.
    Gabriel once said that this is very complicated and will eat a lot of resources.
    And I think I found way for you programmers to make it happen.

    I have a BuddyPress installed in my project. And just noticed that there is a table in mySQL named “bp_activity”.
    And there is a column named “date_recorded”. As I understand this is where last activity is recorded. Right?
    If yes, then you guys can make a function, that can subtract points for not visiting!

    How? When user logins function checks if account have some points or not. If there is no points, function stops.
    But if there is some points on a balance, function checks last activity in “date_recorded” in “bp_activity”.
    And if period from last visit till now is more then 172799 seconds, it will subtract desired amount.
    If last visit were in 172799 second frame, do nothing.
    If its more than 172799 seconds, function should divide time in 86400, and round up the number without decimals or use with decimals (option to choose).
    And finally subtract needed amount. If balance is lower than we need it should take everything user have, or balance can go negative (option to choose).

    So I think this can be done, but it will work for those cases where BuddyPress is used.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.