Código PHP:
<?php
/**
*
* @author Original Author Username [email protected] - http://mywebsite.tld
* @author Another Author Username [email protected] - http://domain.tld
*
* @package {PACKAGENAME}
* @version $Id$
* @copyright (c) 2007 Your Group Name
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* @ignore
*/
define('IN_PHPBB', true);
// Specify the path to you phpBB3 installation directory.
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
// The common.php file is required.
include($phpbb_root_path . 'common.' . $phpEx);
// since we are grabbing the user avatar, the function is inside the functions_display.php file since RC7
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
header("Content-type: image/gif");
$id_get = $_GET['id'];
settype($id_get, 'integer');
$id_get = mysql_real_escape_string($id_get);
$get_Data = mysql_query("SELECT * FROM phpbb_ficha_ninja WHERE user_id='$id_get'");
if($fields = mysql_fetch_array($get_Data)){
//Our variables containing the text to be displayed.
$var1 = $fields['name'];
$var2 = $fields['clan'];
$var3 = $fields['rank'];
$var4 = $fields['level'];
$var5 = $fields['fue'];
$var6 = $fields['agu'];
$var7 = $fields['cck'];
$var8 = $fields['pv'];
$var9 = $fields['pc'];
$var10 = $fields['in_t'];
$var11 = $fields['res'];
$var12 = $fields['nin'];
$var13 = $fields['gen'];
$var14 = $fields['tai'];
$var15 = $fields['villa'];
//Our font size
$font = 3;
//The image the text will be on
$image = "images/fichaninja/ficha.gif";
$ficha = ImageCreateFromgif("$image");
//Text color
$text_color = imagecolorallocate ($ficha, 0, 0,0);//black text
imagestring ($ficha, $font, 125, 37, $var1, $text_color);
imagestring ($ficha, $font, 125, 86, $var2, $text_color);
imagestring ($ficha, $font, 260, 86, $var3, $text_color);
imagestring ($ficha, $font, 370, 86, $var4, $text_color);
imagestring ($ficha, $font, 22, 137, $var5, $text_color);
imagestring ($ficha, $font, 100, 137, $var6, $text_color);
imagestring ($ficha, $font, 177, 137, $var7, $text_color);
imagestring ($ficha, $font, 253, 137, $var8, $text_color);
imagestring ($ficha, $font, 330, 137, $var9, $text_color);
imagestring ($ficha, $font, 30, 174, $var10, $text_color);
imagestring ($ficha, $font, 108, 174, $var11, $text_color);
imagestring ($ficha, $font, 183, 174, $var12, $text_color);
imagestring ($ficha, $font, 255, 174, $var13, $text_color);
imagestring ($ficha, $font, 330, 174, $var14, $text_color);
//GET AVATAR
$vatar = mysql_query("SELECT user_avatar,username,user_avatar_type,user_avatar_width,user_avatar_height FROM phpbb_users WHERE user_id='$id_get'");
if ($avatcons = mysql_fetch_array($vatar)){
global $user, $config, $phpbb_root_path, $phpEx;
if (empty($avatar) || !$avatar_type || (!$config['allow_avatar'] && !$ignore_config))
{
return '';
}
$avatar_img = '';
switch ($avatar_type)
{
case AVATAR_UPLOAD:
if (!$config['allow_avatar_upload'] && !$ignore_config)
{
return '';
}
$avatar_img = $phpbb_root_path . "download/file.$phpEx?avatar=";
break;
case AVATAR_GALLERY:
if (!$config['allow_avatar_local'] && !$ignore_config)
{
return '';
}
$avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
break;
case AVATAR_REMOTE:
if (!$config['allow_avatar_remote'] && !$ignore_config)
{
return '';
}
break;
}
$avatar_img .= $avatar;
$avatar_img = str_replace(' ', '%20', $avatar_img);
$newwidth = 90;
$newheight = 90;
$tipo = explode('.',$avatar_img);
if ($tipo[1] == 'gif'){
$source = imagecreatefromgif($avatar_img);
}
if ($tipo[1] == 'jpg'){
$source = imagecreatefromjpg($avatar_img);
}
if ($tipo[1] == 'png'){
$source = imagecreatefrompng($avatar_img);
}
#imagecopyresized($ficha, $source, 17, 18, 0, 0, $newwidth, $newheight, $avatcons['user_avatar_width'], $avatcons['user_avatar_height']);
}
// Get new sizes
$villa = imagecreatefromgif("images/fichaninja/$var15.gif");
// Resize
#imagecopy($ficha, $villa, 330, 83, 0, 0, 28, 20);
imagegif($ficha);
}
?>