Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
[MOD] User Stats Image
Nothing found.
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2008-04-12 23:55:10
statsimage.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=$1


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
userstatsbg.jpg
userstatsbg.jpg
verdanab.zip
Download
statsimage.png
statsimage.png
Unknown User
2008-04-14 18:12:44
Hawt... thanks.
Unknown User
2008-04-15 16:42:08
thanks very good for sign
Unknown User
2008-04-16 12:35:27
thanks , but where i found .htacces ?
Unknown User
2008-04-16 13:23:05
in your root directory!
Unknown User
2008-04-16 14:53:11
thanks  :)  work number one !
Unknown User
2008-04-16 16:23:34
hi , its me again h
Unknown User
2008-04-16 16:32:45
[url="http://uk3.php.net/imagettftext"]http://uk3.php.net/imagettftext[/url]

add about 40 to the x position and 30 to y
Unknown User
2008-04-16 18:59:35
For example...

/* First Column */

imagettftext($im, $size, 0, 145, 15, $colour, $font, "User: $row[username]");

imagettftext($im, $size, 0, 145, 35, $colour, $font, "Up: ".mksize($row["uploaded"]));

imagettftext($im, $size, 0, 145, 55, $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, 290, 15, $colour, $font, "Class: $row[level]");

imagettftext($im, $size, 0, 290, 35, $colour, $font, "Down: ".mksize($row["downloaded"]));

imagettftext($im, $size, 0, 290, 55, $colour, $font, "User Torrents: ".number_format($row["torrents"]));

/* End */
Unknown User
2008-05-03 22:20:26
(hi, have you an other solution to pass the rewrite mod, because it's don't work in my serveur.) i have resolve it. ok work good
Unknown User
2008-05-11 01:27:05


this is the result of mine....i'ts nice or what?? :)
Unknown User
2008-05-11 12:59:09
This is mine :

Unknown User
2008-05-12 10:08:42
nice :)
Unknown User
2008-05-13 03:42:16
well unused I don't see any points to use it , unless we able to port it to every each individual signature of our users , samewhere in the corner of them (signatures).
Unknown User
2008-05-16 10:58:25
i already have done this mod but my post in here dissapeared i dont know how.....
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 3
  • Members: 0
  • Guests online: 3
  • Comments: 3
  • Messages: 1,728