solved Chart configuration

Bandwerkstatt
Bandwerkstatt
@bandwerkstatt
10 years ago
224 posts
I want to create chart listings for month "10" an year "2013".

I can choose start and end with chart_day_start and chart_day_end.
I want to do the same with month and year

In JR4 it was month="xx" and year="xxxx"

what is it in JR5?

greetings
updated by @bandwerkstatt: 12/27/14 01:21:14PM
Bandwerkstatt
Bandwerkstatt
@bandwerkstatt
10 years ago
224 posts
{assign var="x" value=$smarty.now|date_format:"%m"}
{assign var="y" value=$smarty.now|date_format:"%Y"}
{assign var="x" value=$x-1}
{if $x < 1}{assign var="x" value=$x1+12}{assign var="y" value=$y-1}{/if}
{assign var="x" value=$x|str_pad:2:0:$smarty.const.STR_PAD_LEFT}
{assign var="start_date" value="`$y``$x`01"}
{if $x1 == '01'}{assign var="end_date" value="`$y``$x`31"}{assign var="mon" value="Jan."}
{elseif $x == '02'}{assign var="end_date" value="`$y``$x`28"}{assign var="mon" value="Feb."}
{elseif $x == '03'}{assign var="end_date" value="`$y``$x`31"}{assign var="mon" value="Mar."}
{elseif $x == '04'}{assign var="end_date" value="`$y``$x`30"}{assign var="mon" value="Apr."}
{elseif $x == '05'}{assign var="end_date" value="`$y``$x`31"}{assign var="mon" value="May."}
{elseif $x == '06'}{assign var="end_date" value="`$y``$x`30"}{assign var="mon" value="Jun."}
{elseif $x == '07'}{assign var="end_date" value="`$y``$x`31"}{assign var="mon" value="Jul."}
{elseif $x == '08'}{assign var="end_date" value="`$y``$x`31"}{assign var="mon" value="Aug."}
{elseif $x == '09'}{assign var="end_date" value="`$y``$x`30"}{assign var="mon" value="Sep."}
{elseif $x == '10'}{assign var="end_date" value="`$y``$x`31"}{assign var="mon" value="Oct."}
{elseif $x == '11'}{assign var="end_date" value="`$y``$x`30"}{assign var="mon" value="Nov."}
{elseif $x == '12'}{assign var="end_date" value="`$y``$x`31"}{assign var="mon" value="Dec."}{/if}

Month Charts {$mon} {$y}


{jrCore_list 	module="jrAudio" 
                chart_field="audio_file_stream_count" 
                chart_day_start=$start_date 
                chart_day_end=$end_date
                template="charts_row.tpl" 
                pagebreak="10" 
                limit="100"}

updated by @bandwerkstatt: 11/22/14 02:57:53PM
brian
@brian
10 years ago
10,148 posts
You would do:

chart_day_start = 20131001
chart_day_end = 20131101

That would give you a chart for ALL of October, 2013.

Format is: YYYYMMDD

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Bandwerkstatt
Bandwerkstatt
@bandwerkstatt
10 years ago
224 posts
by the way.... what does it count in item.chart_count? i don't understand
brian
@brian
10 years ago
10,148 posts
$chart_count is the number of plays during the chart period.


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

updated by @brian: 11/23/14 10:13:29AM

Tags