Jump to content
MakeWebGames

Help With Player User Card


mxyi

Recommended Posts

Hey guys,

i found this mod that allows users to have theire own user card but the code doesent work i get the error Fatal error: Cannot redeclare class database in /home/bloodles/public_html/class/class_db_mysql.php on line 16 so can anyone help me fix it because it will be cool to have a player card for users :D dont worry about where it says image.png because i actauly have a backround image called that :P so all i need is someone to fix the code! please any help will do, im using mc codes v2

<?php
//Coded By Eternal
//www.deadlyghetto.net
//Leave this please

require "globals.php";
include "config.php";
global $_CONFIG;
define("MONO_ON", 1);
require "class/class_db_mysql.php";
$db=new database;
$db->configure($_CONFIG['hostname'],
$_CONFIG['username'],
$_CONFIG['password'],
$_CONFIG['database'],
$_CONFIG['persistent']);
$db->connect();
$c=$db->connection_id;
if(isset($_GET['id']) AND ctype_digit($_GET['id'])) {
$id = mysql_escape(trim($_GET['id']));
}
else {echo" Invalid Action";}
if($id) {


   $query = sprintf("select level, username,money from users where userid = %u",$id);
   $result = mysql_query($query);

   $data = mysql_fetch_array($result);
$info ="                  My Info \n {$data['username']}   Level: {$data['level']}  Cash: \$".number_format($data['money'])."\n http://www.domain.com/register.php?r=".$id."";

// Create a 300x100 image
$im = imagecreatetruecolor(200, 100);
$image = imagecreatefrompng('image.png'); // Get a background for jpg it is imagecreatefromjpg()
imagealphablending($image, true); // setting alpha blending on         ~~~ remove if not using png
imagesavealpha($image, true); // save alphablending setting (important)  ~~~ remove if not using png
$black = imagecolorallocate($image, 0x00, 0x00, 0x00); 

// Path to our ttf font file
//$font_file = './arial.ttf'; // Any type of TTF font can take place as it is defining it to an image.


imagefttext($image, 13, 0, 20, 60, $black, $font_file, $info);
//            I     S   R  L   T     C        F          TX
/*************************\
I= Background image
S= Font Size
R= Right Border
L= Left Border
T= Top Border
C Font Color* Colour
F File to load eg.. arial.ttf
TX Text Info
*/
// Output image to the browser
header('Content-Type: image/png');

imagepng($image);
imagedestroy($image);
}
else{echo"
die";}
?>

hope you guys can help! THANKS :D

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...