Hello I'm having some trouble getting my tallied clicks to expire... Please see the website here: http://www.bigfreelinks.com
As you can see, I would like the highest visited websites in our directory to get pushed up to the top of the list on our homepage; and the lifetime of any website clicks should lasts for only 12 hours, but I've not been able to get the clicks to expire, they only continue to add up!
Any help with achieving this would be great! :) thankyou to anyone who may be able to help!
Comments
Comment #1
HanleyDesigns commentedCan anybody help me please???
Comment #2
Scott Reynolds commentedYou are going to have to implement hook_cron(). Call votingapi_select_votes() with a timestamp (time() - 12 * 3600). loop through the returned value collecting the content_ids. Call votingapi_delete_votes($result_from_votingapi_select_votes()), and then call votingapi_recalculate_results() for each content_id collected previously.
Comment #3
HanleyDesigns commentedsorry this is probably a silly question, but are you saying I need to hack the Voting API module?
And where would I enter these values for implementing the hook_cron(). ???? I'm pretty new to these type of instructions... I thank you for your help!
Comment #4
Scott Reynolds commentedHahah no. Im saying you have to write code in your own custom module. http://api.drupal.org/api/function/hook_cron/6
Comment #5
HanleyDesigns commentedthanks for the link scott! I'll see how I go! ;) haha
Comment #6
HanleyDesigns commentedHey, just wondering if anyone would be willing to build me this module? it sounds like a simple job if you know what you're doing! I don't... LOL
If you require some kind of payment for it I can certainly arrange that too...
Appreciate any takers help! :) thanks!!!
Comment #7
HanleyDesigns commentedcan anybody help me write this cron job please? I have done some searching but there doesn't seem to be any instructions as such... Help! :) Do I just edit what's in my /cron.php file??? how is it meant to be coded?
THIS IS MY CRON.PHP CODE
Comment #8
Scott Reynolds commentedYou have to create a module and implement hook_cron. Here read up on this: http://drupal.org/developing/modules
Also take a look at: http://drupal.org/project/examples
Comment #9
HanleyDesigns commentedYou don't know if 'Poormanscron' will be able to do this?
http://drupal.org/project/poormanscron
Comment #10
torotil commentedAs this is a rather special requirement I don't think that making it part of this module is a good idea. Also the support request has been inactive for the past 2.5 years.