/** * Sets a month's stats * @return boolean */ function stat_get_by_month() { $datePicked = $_POST['datePicked']; $year_month = substr($datePicked, 3, 7) . "-" . substr($datePicked, 0, 2); $resultTrd = threads_count_by_month($year_month); $resultCmt = comments_count_by_month($year_month); $result = array_merge($resultTrd, $resultCmt); if ($result[0]['nbTrd'] == "0") { unset($_SESSION['monthStats']); include_once 'month_stats.php'; return true; } $_SESSION['monthStats']['threadsCount'] = $result[0]['nbTrd']; $_SESSION['monthStats']['commentsCount'] = $result[1]['nbCmt']; $_SESSION['currentMonth'] = $datePicked; include_once template_getpath('div_stats_threads_month.php'); return true; }
print_r(comments_count_by_album($albumName)); echo '<br/><br/>' . "*************************************************************************" . '<br/>'; echo "testing comments_count_by_album_and_month" . '<br/>'; print_r(comments_count_by_album_and_month($albumName, $month)); echo '<br/><br/>' . "*************************************************************************" . '<br/>'; echo "testing threads_count_all" . '<br/>'; print_r(threads_count_all()); echo '<br/><br/>' . "*************************************************************************" . '<br/>'; echo "testing comments_count_all" . '<br/>'; print_r(comments_count_all()); echo '<br/><br/>' . "*************************************************************************" . '<br/>'; echo "testing threads_count_by_month" . '<br/>'; print_r(threads_count_by_month($year_month)); echo '<br/><br/>' . "*************************************************************************" . '<br/>'; echo "testing comments_count_by_month" . '<br/>'; print_r(comments_count_by_month($year_month)); echo '<br/><br/>' . "*************************************************************************" . '<br/>'; echo "testing threads_count_by_date_interval" . '<br/>'; print_r(threads_count_by_date_interval($earlier, $later)); echo '<br/><br/>' . "*************************************************************************" . '<br/>'; echo "testing comments_count_by_date_interval" . '<br/>'; print_r(comments_count_by_date_interval($earlier, $later)); echo '<br/><br/>' . "*************************************************************************" . '<br/>'; echo "testing comments_count_by_album_and_date_interval" . '<br/>'; var_dump(comments_count_by_album_and_date_interval($albumName, $earlier, $later)); echo '<br/><br/>' . "*************************************************************************" . '<br/>'; echo "testing date_select_oldest" . '<br/>'; print_r(date_select_oldest()); echo '<br/><br/>' . "*************************************************************************" . '<br/>'; echo "testing date_select_newest" . '<br/>'; print_r(date_select_newest());