solved PHP CHarts

nate
@nate
11 years ago
917 posts
I am building a mobile music store app. I want to have one listing of top 100 songs. How would I query that in php?

I know how to query by stream count but not sure how charts would work.
updated by @nate: 01/03/15 11:56:01AM
brian
@brian
11 years ago
10,149 posts
Natedogg265:
I am building a mobile music store app. I want to have one listing of top 100 songs. How would I query that in php?

I know how to query by stream count but not sure how charts would work.

just add:

chart_days=# limit=100

to your jrCore_list call - change # to the number of days you want the chart to be for - i.e.

chart_days=30

would create a chart for the last 30 days.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
nate
@nate
11 years ago
917 posts
So basically just a jrCore_db_search() function with the chart_days parameters added to the order_by audio_file_stream_count and limit?

Thanks again.
brian
@brian
11 years ago
10,149 posts
Natedogg265:
So basically just a jrCore_db_search() function with the chart_days parameters added to the order_by audio_file_stream_count and limit?

Thanks again.

Almost - basically the charts module has a db_search_params listener where it watches for a "chart_days" parameter being passed in. When it sees that, it grabs the START and END history entries for the dates it needs to process for from the DB, then figures out the order the results need to be in and uses THAT as the order_by instead of what was passed in. The rest is the same as a normal jrCore_list call.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
nate
@nate
11 years ago
917 posts
Alrighty. I'll give a whirl and see how it works out.

Thanks x3.
brian
@brian
11 years ago
10,149 posts
Natedogg265:
Alrighty. I'll give a whirl and see how it works out.

Thanks x3.

No problem!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

Tags