? multisite_fix.patch Index: graphstat.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/graphstat/graphstat.module,v retrieving revision 1.6.2.4 diff -u -F^f -r1.6.2.4 graphstat.module --- graphstat.module 26 Jun 2006 10:16:26 -0000 1.6.2.4 +++ graphstat.module 11 Nov 2006 21:39:14 -0000 @@ -17,14 +17,14 @@ function graphstat_help($section = '') { return t('Creates graphs based on data recorded by the statistics, node, user and comment modules.'); case 'admin/logs/graphs': case 'admin/logs/graphs/daily': - $output = t('

Daily graphs are based on data recorded by the statistics module. They show average statistics for one particular day at a time. The available dates depend on your %discard settings.

', array('%discard' => l(t('Discard access logs'), 'admin/settings/statistics'))); + $output = '

'. t('Daily graphs are based on data recorded by the statistics module. They show average statistics for one particular day at a time. The available dates depend on your %discard settings.', array('%discard' => l(t('Discard access logs'), 'admin/settings/statistics'))) .'

'; if (variable_get('configurable_timezones', 1)) { global $user; - $output .= t('

Dates and times shown in the graphs, correspond to your %timezone.

', array('%timezone' => l(t('local timezone'), 'user/'.$user->uid.'/edit'))); + $output .= '

'. t('Dates and times shown in the graphs, correspond to your %timezone.', array('%timezone' => l(t('local timezone'), 'user/'.$user->uid.'/edit'))) .'

'; } return $output; case 'admin/logs/graphs/history': - return t('

History graphs are based on data recorded by the node, user and comment modules. They show statistics from the day the first node, user or comment was created, until today. If comment module is disabled, or no nodes or comments exist, the graphs concerned will not be displayed.

'); + return '

'. t('History graphs are based on data recorded by the node, user and comment modules. They show statistics from the day the first node, user or comment was created, until today. If comment module is disabled, or no nodes or comments exist, the graphs concerned will not be displayed.') .'

'; } } @@ -55,7 +55,9 @@ function graphstat_menu($may_cache) { * Menu callback. Generates daily graphs page. */ function graphstat_graphs() { - if (module_exist('statistics')) { + if (!module_exist('statistics')) { + return '

'. t('Statistics module should be enabled in order to view these graphs.') .'

'; + } $path = drupal_get_path('module', 'graphstat'); $edit = $_POST['edit']; global $user; @@ -89,7 +91,7 @@ function graphstat_graphs() { $local_timestamp_min = $gm_timestamp_min; $local_timestamp_now = $gm_timestamp_now; } - + // build the select form with all dates $select[0] = t('Select a date'); while ($local_timestamp_min < $local_timestamp_now) { @@ -109,10 +111,10 @@ function graphstat_graphs() { $int = $start + 7200; // use this line if you want standard errors // $stats = db_fetch_object(db_query('SELECT AVG(timer) AS avg, (STDDEV(timer) / SQRT(COUNT(timer))) AS se FROM {accesslog} WHERE timestamp > %d AND timestamp <= %d', $start, $int)); - + // use this line if you want standard deviations $stats = db_fetch_object(db_query('SELECT AVG(timer) AS avg, STDDEV(timer) AS se FROM {accesslog} WHERE timestamp > %d AND timestamp <= %d', $start, $int)); - + $avg[] = $stats->avg ? round($stats->avg, 0) : 0; $se[] = $stats->se ? round($stats->se, 0) : 0; $start = $start + 7200; @@ -128,7 +130,7 @@ function graphstat_graphs() { $output .= '
'; $output .= t('Error bars indicate standard deviations.'); $output .= ''; - + $start = $edit['stat_date']; while ($start < $stop) { $int = $start + 7200; @@ -144,7 +146,7 @@ function graphstat_graphs() { $output .= '
'; $output .= t('Total number of pages served.'); $output .= '
'; - + $start = $edit['stat_date']; while ($start < $stop) { $int = $start + 7200; @@ -160,7 +162,7 @@ function graphstat_graphs() { $output .= '
'; $output .= t('Number of unique pages served.'); $output .= '
'; - + $start = $edit['stat_date']; while ($start < $stop) { $int = $start + 7200; @@ -176,11 +178,7 @@ function graphstat_graphs() { $output .= '
'; $output .= t('Unique visitors.'); $output .= '
'; - } - } - else { - $output = t('

Statistics module should be enabled in order to view these graphs.

'); - } + } return $output; } @@ -201,7 +199,7 @@ function graphstat_graphs_history() { $time = $min[$key]; for ($i = 0; $i < 12; $i++) { $id = drupal_substr($key, 0, 1).'id'; - $data[$key][$time] = db_result(db_query("SELECT COUNT(%s) FROM {%s} WHERE %s <= %d AND %s != 0", $id, $key, $key == 'comments' ? 'timestamp' : 'created', $time, $id)); + $data[$key][$time] = db_result(db_query('SELECT COUNT(%s) FROM {'. $key .'} WHERE %s <= %d AND %s != 0', $id, $key == 'comments' ? 'timestamp' : 'created', $time, $id)); $time = $time + $int; } $points[$key] = implode(',', $data[$key]); @@ -222,7 +220,7 @@ function graphstat_graphs_history() { $output .= ''; $output .= '
'; $output .= t('Number of nodes.'); - $output .= '
'; + $output .= ''; } if ($data['users']) { $output .= '
'; @@ -231,7 +229,7 @@ function graphstat_graphs_history() { $output .= '
'; $output .= '
'; $output .= t('Number of users.'); - $output .= '
'; + $output .= ''; } if ($data['comments']) { $output .= '
'; @@ -240,7 +238,7 @@ function graphstat_graphs_history() { $output .= '
'; $output .= '
'; $output .= t('Number of comments.'); - $output .= '
'; + $output .= ''; } return $output; }