I wonder how the charts work. i have set a start date and an end date. following is my problem:
in example today is wednesday
my charts are updated on monday, so the start date is on last monday and the enddate is the sunday. But if today is wednesday and yesterday were some songs uploaded, this songs are shown in the chart listing from last week too.
this is my code:
{* SET END_DAY : su=0 mo=1 tu=2 we=3 th=4 fr=5 sa=6 *}
{assign var="end_day" value="0"}
{assign var="x" value=$smarty.now|date_format:"%w"}
{if $x == $end_day}{assign var="x" value=$x+7}{/if}
{assign var="difference" value=$x-$end_day}
{if $difference < 0}{assign var="difference" value=$difference+7}{/if}
{assign var="start_date" value=$smarty.now-$difference*86400}
{assign var="start_date" value=$start_date-518400}
{assign var="start_date" value=$start_date|date_format:"%Y%m%d"}
{assign var="end_date" value=$smarty.now-$difference*86400}
{assign var="release_date" value=$end_date+86400}
{assign var="end_date" value=$end_date|date_format:"%Y%m%d"}
{jrCore_list module="jrAudio"
chart_field="audio_file_stream_count"
template="charts_row.tpl"
chart_day_start=$start_date
chart_day_end=$end_date
pagebreak="50"
show="50"}
The Code to get the right date is working correctly. But the results in the chart listings aren't correct.
updated by @bandwerkstatt: 12/22/14 08:50:13PM