Heres my code ( http://cs.swivelgames.com/templates/subSilver/sig_userbars/sig.php )
Code:
Mostly, I dont know were the image outputs... I cant figure out how to get _my_ sig
like sig.php?uid=2 or something.
Code:
<?php
define('IN_PHPBB',true);
//site-specific code removed
// set path below to phpBB files
$phpbb_root_path = "../../../";
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$uid = preg_replace('/[^\d]/','',$_GET['uid']);
$sql = "SELECT * FROM forum_users WHERE user_id = '" . $uid . "'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$ih = imagecreatefrompng("base.png");
$red = imagecolorallocate($ih, 128, 0, 0);
$green = imagecolorallocate($ih, 0, 128, 0);
$black = imagecolorallocate($ih, 0, 0, 0);
$white = imagecolorallocate($ih, 255, 255, 255);
$gray = imagecolorallocate($ih, 128, 128, 128);
$lightgray = imagecolorallocate($ih, 200, 200, 200);
$hostPath = $_SERVER['DOCUMENT_ROOT'];
$ttfArial = "/fonts/arial.ttf";
$ttfVisitor = "/fonts/visitor1.ttf";
if (isset($row['user_custom_title']) && $row['user_custom_title'] != NULL) { $title = $row['user_custom_title'];
} else if ($row['user_rank'] != 0 && $row['user_rank'] != NULL && isset($row['user_rank'])) {
$sql = "SELECT rank_title FROM forum_ranks WHERE rank_id = '" . $row['user_rank'] . "'";
$result = $db->sql_query($sql);
$row2 = $db->sql_fetchrow($result);
$title = $row2[0];
} else {
$sql = "SELECT * FROM forum_ranks WHERE rank_special <> '1'";
$result = $db->sql_query($sql);
while ($row2 = $db->sql_fetchrow($result))
{
if ($row2['rank_min'] < $row['user_posts']) { $title = $row2['rank_title']; }
}
}
$fitten = time()-900;
$sql = "SELECT * FROM forum_sessions WHERE session_user_id = '" . $row['user_id'] . "' AND session_time > '$fitten'";
$result = $db->sql_query($sql);
if ($db->sql_numrows($result) == 0)
{
$status = 'OFFLINE';
} else {
$status = 'ONLINE';
}
imagettftext ($ih, 10, 0, 2, 16, $black, $ttfArial, $row['username'] . " is " . $status);
imagettftext ($ih, 9, 0, 215, 21, $black, $ttfArial, "Rank: " . $title . "");
imagettftext ($ih, 9, 0, 215, 31, $black, $ttfArial, $row['user_posts'] . " posts written");
$width = 350;
$height = 38;
header("Content-type: image/png");
imagepng($ih);
imagedestroy($ih);
?>
Mostly, I dont know were the image outputs... I cant figure out how to get _my_ sig
like sig.php?uid=2 or something.