if (${'do_' . $graph} == true) { $display = ${'display_' . $graph} === true ? 'display:block' : 'display:none'; echo "<div id='stat_line_{$graph}' class='stats_line line' style='{$display}'>"; echo '<h3>' . yourls_s('Number of hits : %s', $graphtitle) . '</h3>'; switch ($graph) { case '24': yourls_stats_line($last_24h, "stat_line_{$graph}"); break; case '7': case '30': $slice = array_slice($list_of_days, intval($graph) * -1); yourls_stats_line($slice, "stat_line_{$graph}"); unset($slice); break; case 'all': yourls_stats_line($list_of_days, "stat_line_{$graph}"); break; } echo "</div>\n"; } } ?> </td> <td valign="top"> <h3><?php yourls_e('Historical click count'); ?> </h3> <?php $ago = round((date('U') - strtotime($timestamp)) / (24 * 60 * 60));
break; case 'all': // get "yy-mm" foreach ($list_of_days as $k => $v) { $labels_1[] = preg_replace('/\\d\\d(\\d\\d)-(\\d\\d)-\\d\\d/', '$1-$2', $k); } // take out duplicates $labels_1 = array_unique($labels_1); // now get "mm" only so we have all different month foreach ($labels_1 as $k => $v) { $labels_1[$k] = preg_replace('/\\d\\d-(\\d\\d)/', '$1', $v); } echo "<h3>Number of hits : {$title}</h3>"; $labels_1 = yourls_array_granularity($labels_1, 30, false); $labels_2 = yourls_array_granularity($list_of_years, 30, false); yourls_stats_line($list_of_days, $labels_1, $labels_2); break; } echo "</div>\n"; } } ?> </td> <td valign="top"> <h3>Historical click count</h3> <?php $ago = round((date('U') - strtotime($timestamp)) / (24 * 60 * 60)); if ($ago <= 1) { $daysago = ''; } else {