/** * Sets the stats from the last n days * @global array $input * @return boolean */ function stat_get_by_nDays() { global $input; $nDays = $input['nDays']; $todayTemp = date('Y-m-d H:i:s'); $today = $todayTemp; $nDaysDate = date('Y-m-d H:i:s', strtotime('-' . $nDays . ' days', strtotime($todayTemp))); $resultTrd = threads_count_by_date_interval($nDaysDate, $today); $resultCmt = comments_count_by_date_interval($nDaysDate, $today); $result = array_merge($resultTrd, $resultCmt); if ($result[0]['nbTrd'] == "0") { unset($_SESSION['nDaysStats']); include_once template_getpath('div_stats_threads_nDays.php'); return true; } $_SESSION['nDaysStats']['nDaysEarlier'] = $nDaysDate; $_SESSION['nDaysStats']['nDaysLater'] = $today; $_SESSION['nDaysStats']['threadsCount'] = $result[0]['nbTrd']; $_SESSION['nDaysStats']['commentsCount'] = $result[1]['nbCmt']; include_once template_getpath('div_stats_threads_nDays.php'); return true; }
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()); echo '<br/><br/>' . "*************************************************************************" . '<br/>'; echo "testing threads_count_all_by_asset" . '<br/>'; print_r(threads_count_all_by_asset()); die;