mini-track should be in it's own plugin folder under my-plugins
that error message shows it's in the main folder?
line 334 deals with the statistics functions, it can't find any days
I recently improved the function but I have not released it yet.
You can try editing the file and replacing the function with this:
function mini_track_graphs() {
add_action('bb_head','mini_track_graphs_header',100);
global $bbdb, $mini_track, $mini_track_today;
$time=time();
$gmt_offset=bb_get_option("gmt_offset")*3600;
$today=gmdate("n/j",$time+$gmt_offset);
$monthago=$time+$gmt_offset-(31*24*3600);
$maxheight=100;
$label[1]=__("Daily Peak Users Online At Once");
$label[2]=__("Daily Total Page Views");
$label[3]=__("Daily Total Posts");
$label[4]=__("Daily Total Registrations");
$day=$time+gmt_offset; // $monthago;
do { // for ($i=1; $i<=31; $i++) { // prep zero fill for empty days
$empty[date('Y-m-d',$day)]->time=$day;
$empty[date('Y-m-d',$day)]->posts=0;
$empty[date('Y-m-d',$day)]->views=0;
$empty[date('Y-m-d',$day)]->users=0;
$day=$day-24*3600;
} while ($day>$monthago);
$empty=array_reverse($empty);
bb_get_header();
echo '<h3 class="bbcrumb"><a href="'.bb_get_option('uri').'">'.bb_get_option('name').'</a> » '.__('Statistics').'</h3>';
for ($loop=1; $loop<=4; $loop++) {
if ($loop==1) {
$query="SELECT <code>time</code>,<code>data</code> FROM mini_track WHERE <code>time</code> > $monthago ORDER BY <code>time</code> ASC LIMIT 31";
@$days=$bbdb->get_results($query);
foreach ($days as $day) {
$result->time=$day->time; // must be first
$day=unserialize($day->data);
$result->users=$day->users;
$result->views=array_sum($day->views);
$results[]=$result;
}
unset($days); // clear old data, then add today's stats
$result->time=$mini_track_today->time;
$result->users=$mini_track_today->users;
$result->views=array_sum($mini_track_today->views);
$results[]=$result;
}
elseif ($loop==3) {
// posts per day
$query="SELECT count(*) as posts, UNIX_TIMESTAMP(post_time) as time FROM $bbdb->posts WHERE post_status=0 AND UNIX_TIMESTAMP(post_time)>$monthago GROUP BY DATE(post_time) ORDER BY post_time ASC LIMIT 31";
@$results=$bbdb->get_results($query);
}
elseif ($loop==4) {
// registrations per day
$query="SELECT count(*) as users, UNIX_TIMESTAMP(user_registered) as time FROM $bbdb->users WHERE user_status=0 AND UNIX_TIMESTAMP(user_registered)>$monthago GROUP BY DATE(user_registered) ORDER BY user_registered ASC LIMIT 31";
@$results=$bbdb->get_results($query);
}
// make missing days have zero results
unset($fill); foreach ($results as $result) {$fill[date('Y-m-d',$result->time)]=$result;} $results=array_merge($empty,$fill);
$count=0; unset($values); unset($labels); unset($colors);
foreach ($results as $result) {
if ($loop==1) {$values[$count]=$result->users;}
elseif ($loop==2) {$values[$count]=$result->views;}
elseif ($loop==3) {$values[$count]=$result->posts;}
elseif ($loop==4) {$values[$count]=$result->users;}
$labels[$count]=gmdate("n/j",$result->time+$gmt_offset);
if ($labels[$count]==$today) {$colors[$count]="#bbb";} // #7799aa
$count++;
}
$peak=$values; arsort($peak); $peak=array_keys($peak);
$colors[$peak[0]]="#cc0000";
$colors[$peak[1]]="#0000cc";
$colors[$peak[2]]="#00cc00";
$multiply=round($maxheight/(0.0001+$values[$peak[0]]),2);
$width=round(100/($count+0.0001),2); if ($width<1) {$width=1;} elseif ($width>100) {$width=50;}
$output= "<br clear='both'><h3 align='center'>$label[$loop]</h3>\n<table class='mini_track_graph'>";
$output.="<tr valign='bottom'>";
foreach (array_keys($values) as $count) {
$output.="<td width='$width%'>";
// if ($values[$count]>$values[$peak[20]]) {$output.="$values[$count]<div";} else {$output.="<div title='$values[$count]'";}
if ($values[$count]) {$output.="$values[$count]";}
$output.="<div style='height:".(1+$multiply*$values[$count])."px;"; //
if (isset($colors[$count])) {$output.="background:$colors[$count];";}
$output.="'> </div></td>";
}
$output.="</tr>";
$output.="<tr class='alt'>";
foreach (array_keys($values) as $count) {
// if ($values[$count]>$values[$peak[20]]) {$output.="<td>$labels[$count]</td>";} else {$output.="<td title='$labels[$count]'> </td>";}
$output.="<td>$labels[$count]</td>";
}
$output.="</tr>";
$output.= "</table><br clear='both'>\n";
echo $output;
} // end graph loops
/*
// start "countries visiting"
$query="SELECT min(time) FROM user_track WHERE type<>'stats'";
@$oldest=$gmt_offset+$bbdb->get_var($query);
$query="SELECT count(*) as count,ut1.cc,cc2.country FROM <code>user_track</code> ut1 LEFT JOIN cc2country cc2 ON ut1.cc = cc2.cc WHERE ut1.type<>'stats' group by ut1.cc ORDER BY cc2.country ASC";
@$results=$bbdb->get_results($query);
$maxheight=190; $count=0; unset($values); unset($labels); unset($colors);
foreach ($results as $result) {
if ($result->count>1) { // just one visitor is a fluke
$values[$count]=$result->count;
$labels[$count]=" $result->country </td><td> <img title='$result->cc' class='ut_flag' src='/images/flags/".strtolower($result->cc).".png'>";
$count++;
}
}
$peak=$values; arsort($peak); $peak=array_keys($peak);
$colors[$peak[0]]="#cc0000";
$colors[$peak[1]]="#0000cc";
$colors[$peak[2]]="#00cc00";
$multiply=$maxheight/$values[$peak[2]];
// $width=floor(100/($count+1)); if ($width<1) {$width=1;} elseif ($width>100) {$width=50;}
$half=intval($count/2); $alt=0;
$output= "<br clear='both'><h3 align='center'>$count Countries Visiting Since <span title='".gmdate("r",$oldest)."' class='ut_time'>".ucwords(ut_since($oldest))."</span></h3>";
$output.= "<table class='mini_track_graph mini_track_graph2'>";
foreach (array_keys($values) as $count) {
if ($count==$half) {$output.="</table><table class='mini_track_graph mini_track_graph2' style='float:right;'>"; $alt=0;}
$alt++; $output.="<tr".(($alt % 2) ? " class='alt'" : "").">";
$output.="<td>$labels[$count]</td>";
$height=$multiply*$values[$count]; if ($height>$maxheight) {$height=$maxheight;}
$output.="<td><span><div style='width:".$height."px;";
if (isset($colors[$count])) {$output.="background:$colors[$count];";}
$output.="'> </div> $values[$count]</span></td></tr>";
}
$output.= "</table><br clear='both'>";
echo $output;
*/
bb_get_footer();
exit();
}