query_first("SELECT COUNT(threadid) FROM " . TABLE_PREFIX . "thread"); $totalthreads = implode(",",$totalthreads); $totalposts = $db->query_first("SELECT COUNT(postid) FROM " . TABLE_PREFIX . "post"); $totalposts = implode(",",$totalposts); $totalusers = $db->query_first("SELECT COUNT(userid) FROM " . TABLE_PREFIX . "user"); $totalusers = implode(",",$totalusers); // Loads a PNG image function LoadPNG($imgname) { $im = @imagecreatefrompng($imgname); /* Attempt to open */ if (!$im) { /* See if it failed */ $im = imagecreatetruecolor(150, 30); /* Create a blank image */ $bgc = imagecolorallocate($im, 255, 255, 255); $tc = imagecolorallocate($im, 0, 0, 0); imagefilledrectangle($im, 0, 0, 150, 30, $bgc); /* Output an errmsg */ imagestring($im, 1, 5, 5, "Error loading $imgname", $tc); } return $im; } // Actually Loads the image $im = @LoadPNG('base.png'); //Adds the Header header("Content-type: image/png"); //Defines Colors $background_color = imagecolorallocate($im, 255, 255, 255); $text_color = imagecolorallocate($im, 0, 0, 0); // Adds Text //imagestring($im, 1, 5, 5, $forumname . " Statistics", $text_color); imagestring($im, 3, 140, 25, "Utenti Iscritti: " . $totalusers, $text_color); imagestring($im, 3, 140, 50, "Discussioni: " . $totalthreads, $text_color); imagestring($im, 3, 140, 75, "Messaggi: " . $totalposts, $text_color); //Outputs the image imagepng($im); imagedestroy($im); ?>