Posts by pbr

    Okay, that helped me quite a lot. After digging a bit deeper, are the following observations all correct?

    • currentcap_current & cap_current store actual adjustments
    • decay_current keeps track of the decay in the member's apa_points only
    • decay_ria keeps track of the decay on a per item/raid/adjustment basis in its respective apa_value field

    Then, the get_last_run for the decay APAs is still a bit cryptic to me.

    In particular, I am not sure about the difference between $exectime and ($decay_start%86400).

    Is it something about timezones? Both seem to be the number of seconds from midnight in one form or another.

    Finally, I seem to be missing something about the zero time and I'm wondering about the following check: (($refdate - $intZeroMonths*2592000) > $last_run).

    Isn't $last_run calculated from the same timestamp as $refdate (which is also equal to $data['date'])?

    If so, as $last_run is continuously increasing with $refdate, how can it ever evaluate to true?

    Okay, $refdate is not necessarily equal to $data['date'] when the get_value is called recursively.

    However, decay current uses $refdate for the check, while decay ria uses $data['date'].

    As I said, I am probably missing something here and hope you can spot it easily. :)

    Thanks so much!


    I was looking at adding functionality that resembles how most point collection programmes (such as airline mileage programmes) work:

    You get awarded points and they decay at a certain date in the future if not spent until then.

    By skimming over the code base and the wiki, I found that APAs might be the closest thing to that idea.

    I'm currently assessing what would need to be done for implementing such functionality as an APA.

    It seems that the magic is happening in the `get_value` function of the APAs.

    Thus, my main question here is what parameters is this function called with and when?

    As far as I can see, it seems to be called per member id, but I am unsure about the event id and various other parameters supplied in the data field.

    Thank you so much for your support. :)