mxyi Posted July 11, 2010 Share Posted July 11, 2010 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 Quote Link to comment Share on other sites More sharing options...
Danny696 Posted July 11, 2010 Share Posted July 11, 2010 remove require "globals.php"; Quote Link to comment Share on other sites More sharing options...
mxyi Posted July 11, 2010 Author Share Posted July 11, 2010 Will try it now, i assume it will work because dan is very helpfull and smart :D Quote Link to comment Share on other sites More sharing options...
Dayo Posted July 11, 2010 Share Posted July 11, 2010 i think this was a paid mod, may be wrong :S Quote Link to comment Share on other sites More sharing options...
mxyi Posted July 11, 2010 Author Share Posted July 11, 2010 Nope it was free and dan, i got fatal error call to undefined function mysql_escape() on line 19 :( Quote Link to comment Share on other sites More sharing options...
Dayo Posted July 11, 2010 Share Posted July 11, 2010 try $db->escape() mor mysql_real_escape_string() (not sure if $db->escape ir right ot not tho i dont realy use the $db class) Quote Link to comment Share on other sites More sharing options...
Danny696 Posted July 12, 2010 Share Posted July 12, 2010 mysql_escape isnt a real function, either replace with $db->escape or mysql_real_escape_string :) Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted July 13, 2010 Share Posted July 13, 2010 The function in question is not default mccode function mysql_escape($str){return str_replace("'","''",$str);} Quote Link to comment Share on other sites More sharing options...
mxyi Posted July 13, 2010 Author Share Posted July 13, 2010 lol i got it working thanks all the mysql_escape thing was the only thing wrong :D thanks dudes.. Quote Link to comment Share on other sites More sharing options...
r14170 Posted July 25, 2010 Share Posted July 25, 2010 Can u tell me what i need to replace.. coz im a totally noob as you discovered before.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.