2010-04-06, 09:14 AM
hi all... i was modified the userbar plugin. i make that like id card like this..
look.. i cant understand about PHP codes enough.. i dont know to show avatar on that card..
see this codes:
its some codes for that card...
yesterday, i take the
my question is... how to insert the avatar image on that card.. i hope anyone help me ...
look.. i cant understand about PHP codes enough.. i dont know to show avatar on that card..
see this codes:
define("IN_MYBB", 1);
define("KILL_GLOBALS", 1);
define("NO_ONLINE", 1);
require "./inc/init.php";
global $db;
$query = $db->simple_select('users', 'username,usergroup,postnum,uid,money,myrpg_life,myrpg_attack,myrpg_defense,myrpg_level,reputation', 'uid=\''.intval($mybb->input['uid']).'\'');
$user = $db->fetch_array($query);
$gid = intval($user['usergroup']);
$query2 = $db->simple_select('usergroups', 'title', 'gid=\''.$gid.'\'');
$usergroup = $db->fetch_array($query2);
if($mybb->settings['set_userbar'] == "1")
{
$image = $mybb->settings['choose_image_userbar'];
Header ("Content-type: image/png");
$img_create = imageCreateFromPNG("./images/userbar/".$image.".png");
$color = ImageColorAllocate ($img_create, 000, 000, 000);
$colorheader = ImageColorAllocate ($img_create, 255, 255, 255);
ImageString ($img_create, 3, 8, 70, ($user['username']), $color);
ImageString ($img_create, 2, 20, 83, ($usergroup['title']), $color);
ImageString ($img_create, 2, 20, 170, "ID Num: ". ($user['uid']), $color);
ImageString ($img_create, 2, 20, 182, "Posts: ". ($user['postnum']), $color);
ImageString ($img_create, 2, 20, 194, "Rep: ". ($user['reputation']), $color);
ImageString ($img_create, 2, 8, 210, "HP: ". ($user['myrpg_life'])."/100", $color);
ImageString ($img_create, 2, 8, 222, "ATK: ". ($user['myrpg_attack'])."/500", $color);
ImageString ($img_create, 2, 95, 210, "DEF: ". ($user['myrpg_defense'])."/500", $color);
ImageString ($img_create, 2, 95, 222, "Lvl: ". ($user['myrpg_level']), $color);
ImageString ($img_create, 2, 20, 240, "Duit: Rp". ($user['money']), $color);
ImagePng ($img_create);
ImageDestroy ($img_create);
}
else {
echo "";
}
?>
its some codes for that card...
yesterday, i take the
ImageString ($img_create, 3, 8, 70, ($user['avatar]), $color);
under the ($user['username']), $color);
... but .its just shown the url of image, not show image..my question is... how to insert the avatar image on that card.. i hope anyone help me ...