statsimage.php:
save this image as images/userstatsbg.jpg:
place the font in backend/fonts:[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=2287"]verdanab.zip[/url]
screenshot:
and add a link to userstats.php in navigate_block.php
<?
// User Stats Image
// Author: TorrentialStorm
// Modified for TT v2.xx by TorrentialStorm (13/4/08 at 00:49)
// If you do edit the script please leave the original credits.
$id = (int)$_GET["id"];
if ($id <= 0) die;
require_once("backend/functions.php");
dbconn(false);
/* *** CONFIG *** */
$bg = "images/userstatsbg.jpg"; // Path to background image
$cachedir = './cache/statsimages/'; // Directory to store cache files in
$cachetime = 30; // Minutes to cache images for
$usecaching = false; // true to use caching, false to draw new image at each page load
$font = "backend/fonts/verdanab.ttf"; // path to TrueType font
$size = 10; // Font size, if you change it you'll probably want to change the imagettftext lines to fix the line spacing
// Font Colour
$colour["R"] = 255;
$colour["G"] = 165;
$colour["B"] = 0;
/* *** END CONFIG *** */
if ($usecaching) {
$cachefile = "$cachedir$id.cache";
$cachefile_created = @filemtime($cachefile);
@clearstatcache();
$cachetime = $cachetime * 60;
if (time() - $cachetime < $cachefile_created) {
header("Content-Type: image/png");
@readfile($cachefile);
die;
}
}
/* ***** DEFINITELY DON'T EDIT BELOW THIS LINE ****** */
$res = mysql_query("SELECT username, level, uploaded, downloaded, COUNT(distinct torrents.id) as torrents FROM users LEFT JOIN torrents ON users.id=torrents.owner LEFT JOIN groups ON groups.group_id=users.class WHERE users.id = $id GROUP BY users.id") or die(mysql_error());
$row = mysql_fetch_array($res) or die;
// Determine the Ratio
if ($row[downloaded] == 0 && $row[uploaded] > 0)
$ratio = "Inf.";
elseif ($row[downloaded] == 0 && $row[uploaded] == 0)
$ratio = "N/A";
else
$ratio = number_format($row["uploaded"] / $row["downloaded"],3);
$im = imagecreatefromjpeg($bg);
$colour = imagecolorallocate($im, $colour["R"], $colour["G"], $colour["B"]);
/* First Column */
imagettftext($im, $size, 0, 10, 20, $colour, $font, "Username: $row[username]");
imagettftext($im, $size, 0, 10, 40, $colour, $font, "Uploaded: ".mksize($row["uploaded"]));
imagettftext($im, $size, 0, 10, 60, $colour, $font, "Ratio: $ratio");
/* End */
/* Second Column */
imagettftext($im, $size, 0, 60, 80, $colour, $font, $site_config["SITEURL"]);
/* End */
/* Third Column */
imagettftext($im, $size, 0, 170, 20, $colour, $font, "Class: $row[level]");
imagettftext($im, $size, 0, 170, 40, $colour, $font, "Downloaded: ".mksize($row["downloaded"]));
imagettftext($im, $size, 0, 170, 60, $colour, $font, "Torrents Posted: ".number_format($row["torrents"]));
/* End */
header("Content-Type: image/png");
if ($usecaching) {
imagepng($im, $cachefile);
readfile($cachefile);
} else
imagepng($im);
?>userstats.php:<?
require("backend/functions.php");
dbconn();
loggedinonly();
stdhead("Userstats Image");
$SITEURL = $site_config["SITEURL"];
$SITENAME = $site_config["SITENAME"];
echo "<table align=center>";
echo "<div align=center><a href=$SITEURL/userstats/$CURUSER[id].png><img src=$SITEURL/userstats/$CURUSER[id].png></a></div><hr>";
echo "<tr>
<td><div align='center'><br>
Copy BB Code:<br>
<textarea cols='90' rows='2'>[url=$SITEURL][img=$SITEURL/userstats/$CURUSER[id].png][/url]</textarea>
</div></td></tr><tr>
<td><div align='center'><br>
Copy HTML:<br>
<textarea cols='90' rows='2'><a href='$SITEURL'><img src='$SITEURL/userstats/$CURUSER[id].png' title='$SITENAME' border=0></a></textarea>
</div></td>
</tr></table>";
stdfoot();
?>
add the following to your .htaccess:
RewriteEngine On
RewriteRule ^userstats/([0-9]+).png$ statsimage.php?id=$1save this image as images/userstatsbg.jpg:

place the font in backend/fonts:[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=2287"]verdanab.zip[/url]
screenshot:

and add a link to userstats.php in navigate_block.php
