Hello guys.
I am using posts (just like in blog example) in my projects which contains some external files that is to be downloaded. Now I want to keep the record of the downloaded files in my database. So that I can show it on the post detail page.
I have used the savecounter() method with afterfind() method in Post model
protected function afterFind() {
parent::afterFind();
$this->_oldTags = $this->tags;
$this->saveCounters(array('views'=>1));
$this->saveCounters(array('hits'=>1));
}
but it increased it once a post is viewed or loaded. but I want it to restrict it to only downloads. that I a post external file is downloaded then increase the post’s hit value. and one more thing that the savecounter() method increases the value by 6 nor by 1, so how to restrict it to 1 ?
How can I save the downloaded files record in my database ?
Thanks in advance.