1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Download Counter?

Discussion in 'General Troubleshooting' started by blinger187, May 30, 2013.

  1. blinger187

    blinger187 New Member

    So currently, we can count views but what about downloads? My website is an mp3 sharing website where users can upload/stream/download music. We use a custom hotaru plugin that uploads the mp3 during post submission and then streams the song on the post page with an html5 mp3 player.

    Counting downloads is definitely possible, yes? I found a tutorial for a php/mysql download counter but i'm not the best with php :(
  2. newjobnow

    newjobnow New Member

    Basically you just need to insert a new column somewhere in your database to store an integer value. This new column will then be used to store the click count. You can then write a simple javascript that will update the database integer field when an onclick action is used in a download link.

    Take a look at the vote plugin for a starting point. The vote function in Hotaru uses javascript to update the database when a vote is clicked. That is the same functionality you'll need, you'll just need to customize it to whatever database column you add for storing a click count value for the post.
    Nick likes this.
  3. blinger187

    blinger187 New Member

    thank you! i've been wanting to learn more and this seems like a fun task!

    - - - Updated - - -

    thank you! i've been wanting to learn more and this seems like a fun task!

Share This Page