-
Posts
110 -
Joined
-
Last visited
-
Days Won
3
Content Type
Profiles
Forums
Events
Everything posted by rednspirited
-
Ok ty sorry to be pushy
-
Is @Daveon vacation? I can not access the cpannel so i can use the hosting services.
-
is there a charge to transfer a domain?
-
this is an even better version than the first one thank you
-
love this attack system works great and its more to what i was looking for. and thanks for being prompt in responding to my questions 🙂
-
idea for a mod to be a staff note page for each player. this way you can know if there has been a warning given to a player or staff permission for more than one account on same ip. makes it easier to know whos actions to check for cash machining. who has cause a problem in the past etc.. have a small amount i can put for it who knows maybe others would like it too.
-
hmmm hadnt noticed that one 🙂 ty
-
also need a way to add npcs to the game Another good thing would be a comments section on players page
-
well i will be getting the premium this week and i love the free version have some old mods and was wondering if they need updating or not? lots are yours but some are not im just waiting to see what doesn't come with premium.
-
thanks i was told that got it done. i didnt think to check those files
-
got the free version to start and get the ball rolling on some things as far as word changes but i can not find where Boss & Underboss are to change them to what i need can anyone help me?
-
ok will get it next pay day thanks 🙂
-
when will the premium version be for sale?
-
[Promotion][Ends May 1st] Buy 1 get 1 of Equal Value
rednspirited replied to Sim's topic in Gangster Legends
nice i like your mods hope you keep at it 🙂 -
is there someone who could make a mod so you get levels and ranks. like level 1-10 be a say noob then level 11-20 be a beginner, or what ever rank suits your game.
-
this sounds great to me i like that idea and you got thanksgiving in the us in november.
-
help on inserting something in the header mc codes v2
rednspirited replied to rednspirited's topic in Modification Support
Ty -
my header is no the basic header and i can not figure out where to add this $propq=$db->query("SELECT * FROM `proposals` WHERE `proposal_to` = '$ir[userid]'"); if(mysqli_num_rows($propq)) { echo "<center><font size=15 color=green><a href='viewproposals.php'>You currently have some new/pending proposals, click here to view them.</a></font></center><br />"; } into my header <?php /** * MCCodes Version 2.0.5b * Copyright (C) 2005-2012 Dabomstew * All rights reserved. * * Redistribution of this code in any form is prohibited, except in * the specific cases set out in the MCCodes Customer License. * * This code license may be used to run one (1) game. * A game is defined as the set of users and other game database data, * so you are permitted to create alternative clients for your game. * * If you did not obtain this code from MCCodes.com, you are in all likelihood * using it illegally. Please contact MCCodes to discuss licensing options * in this case. * * File: header.php * Signature: 52c201ce2e8c549ae70d2936473022f0 * Date: Fri, 20 Apr 12 08:50:30 +0000 */ class headers { function startheaders() { global $ir, $set; echo <<<EOF <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" text color="blue" /> <link href="css/game.css" type="text/css" rel="stylesheet" /> <title>{$set['game_name']}</title> </head> <body> <center> <table width="970" border="0" cellpadding="0" cellspacing="0" class="table2"> <tr> <td class="lgrad"></td> <td class="center"> EOF; } function userdata($ir, $lv, $fm, $cm, $dosessh = 1) { global $db, $c, $userid, $set; $IP = $db->escape($_SERVER['REMOTE_ADDR']); $db->query( "UPDATE `users` SET `laston` = {$_SERVER['REQUEST_TIME']}, `lastip` = '$IP' WHERE `userid` = $userid"); if (!$ir['email']) { global $domain; die( "<body>Your account may be broken. Please mail help@{$domain} stating your username and player ID."); } if (!isset($_SESSION['attacking'])) { $_SESSION['attacking'] = 0; } if ($dosessh && ($_SESSION['attacking'] || $ir['attacking'])) { echo "You lost all your EXP for running from the fight."; $db->query( "UPDATE `users` SET `exp` = 0, `attacking` = 0 WHERE `userid` = $userid"); $_SESSION['attacking'] = 0; } $enperc = min((int) ($ir['energy'] / $ir['maxenergy'] * 100), 100); $wiperc = min((int) ($ir['will'] / $ir['maxwill'] * 100), 100); $experc = min((int) ($ir['exp'] / $ir['exp_needed'] * 100), 100); $brperc = min((int) ($ir['brave'] / $ir['maxbrave'] * 100), 100); $hpperc = min((int) ($ir['hp'] / $ir['maxhp'] * 100), 100); $enopp = 100 - $enperc; $wiopp = 100 - $wiperc; $exopp = 100 - $experc; $bropp = 100 - $brperc; $hpopp = 100 - $hpperc; $d = ""; $u = $ir['username']; if ($ir['donatordays']) { $u = "<span style='color: red;'>{$ir['username']}</span>"; $d = "<img src='donator.gif' alt='Donator: {$ir['donatordays']} Days Left' title='Donator: {$ir['donatordays']} Days Left' />"; } $gn = ""; global $staffpage; $bgcolor = '000000'; print <<<OUT <img src="title.jpg" alt="Mccodes Version 2" /><br /> <!-- Begin Main Content --> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="20%" bgcolor="#$bgcolor" valign="top"> <!-- Side Panel --> <b>Name:</b> $gn{$u} [{$ir['userid']}] $d<br /> <b>Money:</b> {$fm}<br /> <b>Level:</b> {$ir['level']}<br /> <b>Crystals:</b> {$ir['crystals']}<br /> [<a href='logout.php'>Emergency Logout</a>] <hr /> <b>Energy:</b> {$enperc}%<br /> <img src='greenbar.png' width='$enperc' height='10' /><img src='redbar.png' width='$enopp' height='10' /><br /> <b>Will:</b> {$wiperc}%<br /> <img src='bluebar.png' width='$wiperc' height='10' /><img src='redbar.png' width='$wiopp' height='10' /><br /> <b>Brave:</b> {$ir['brave']}/{$ir['maxbrave']}<br /> <img src='yellowbar.png' width='$brperc' height='10' /><img src='redbar.png' width='$bropp' height='10' /><br /> <b>EXP:</b> {$experc}%<br /> <img src='navybar.png' width='$experc' height='10' /><img src='redbar.png' width='$exopp' height='10' /><br /> <b>Health:</b> {$hpperc}%<br /> <img src='greenbar.png' width='$hpperc' height='10' /><img src='redbar.png' width='$hpopp' height='10' /><br /><hr /> <!-- Links --> OUT; if ($ir['fedjail'] > 0) { $q = $db->query( "SELECT * FROM `fedjail` WHERE `fed_userid` = $userid"); $r = $db->fetch_row($q); die( "<span style='font-weight: bold; color:red;'> You have been put in the {$set['game_name']} Federal Jail for {$r['fed_days']} day(s).<br /> Reason: {$r['fed_reason']} </span></body></html>"); } if (file_exists('ipbans/' . $IP)) { die( "<span style='font-weight: bold; color:red;'> Your IP has been banned from {$set['game_name']}, there is no way around this. </span></body></html>"); } } function menuarea() { define('jdsf45tji', true, true); include 'mainmenu.php'; global $ir, $c; $bgcolor = '000000'; print '</td><td width="2" class="linegrad" bgcolor="#' . $bgcolor . '"> </td><td width="80%" bgcolor="#' . $bgcolor . '" valign="top"><br /><center>'; if ($ir['hospital']) { echo "<b>NB:</b> You are currently in hospital for {$ir['hospital']} minutes.<br />"; } if ($ir['jail']) { echo "<b>NB:</b> You are currently in jail for {$ir['jail']} minutes.<br />"; } echo "<a href='donate.php'><b>Donate to {$set['game_name']} now for game benefits!</b></a><br />"; } function smenuarea() { define('jdsf45tji', true, true); include 'smenu.php'; global $ir, $c; $bgcolor = '000000'; print '</td><td width="2" class="linegrad" bgcolor="#' . $bgcolor . '"> </td><td width="80%" bgcolor="#' . $bgcolor . '" valign="top"><center>'; } function endpage() { global $db, $ir; $query_extra = ''; if (isset($_GET['mysqldebug']) && $ir['user_level'] == 2) { $query_extra = '<br />' . implode('<br />', $db->queries); } print <<<OUT </center> </td> </tr> </table></td> <td class="rgrad"></td> </tr> <tr> <td colspan="3"> <table cellpadding="0" cellspacing="0" border="0" width="100%"> <tr> <td class="dgradl"> </td> <td class="dgrad"> </td> <td class="dgradr"> </td> </tr> </table> </td> </tr> </table> {$db->num_queries} queries{$query_extra}</body> </html> OUT; } } can anyone help please and thank in advance
-
🙂 a quick witty reply 🤣
-
🤣 nice word play
-
it was coding got it fixed by adding in a small bit of logic 🙂 the php version was what i checked first
-
Will try when I'm off work funny thing is it added items then just stopped doing it
-
function new_item_submit() { global $db, $ir, $c, $h; if ($ir['user_level'] != 2) { echo 'You cannot access this area.<br /> > <a href="staff.php">Go Back</a>'; die($h->endpage()); } staff_csrf_stdverify('staff_newitem', 'staff_items.php?action=newitem'); $itmname = (isset($_POST['itmname']) && preg_match( "/^[a-z0-9_]+([\\s]{1}[a-z0-9_]|[a-z0-9_])+$/i", $_POST['itmname'])) ? $db->escape(strip_tags(stripslashes($_POST['itmname']))) : ''; $itmdesc = (isset($_POST['itmdesc'])) ? $db->escape(strip_tags(stripslashes($_POST['itmdesc']))) : ''; $weapon = (isset($_POST['weapon']) && is_numeric($_POST['weapon'])) ? abs(intval($_POST['weapon'])) : 0; $armor = (isset($_POST['armor']) && is_numeric($_POST['armor'])) ? abs(intval($_POST['armor'])) : 0; $_POST['itmtype'] = (isset($_POST['itmtype']) && is_numeric($_POST['itmtype'])) ? abs(intval($_POST['itmtype'])) : ''; $_POST['itmbuyprice'] = (isset($_POST['itmbuyprice']) && is_numeric($_POST['itmbuyprice'])) ? abs(intval($_POST['itmbuyprice'])) : ''; $_POST['itmsellprice'] = (isset($_POST['itmsellprice']) && is_numeric($_POST['itmsellprice'])) ? abs(intval($_POST['itmsellprice'])) : ''; if (empty($itmname) || empty($itmdesc) || empty($_POST['itmtype']) || empty($_POST['itmbuyprice']) || empty($_POST['itmsellprice'])) $itmbuy = ($_POST['itmbuyable'] == 'on') ? 1 : 0; $effects = array(); for ($i = 1; $i <= 3; $i++) { $efxkey = "effect{$i}"; $_POST[$efxkey . 'stat'] = (isset($_POST[$efxkey . 'stat']) && in_array($_POST[$efxkey . 'stat'], array('energy', 'will', 'brave', 'hp', 'strength', 'agility', 'guard', 'labour', 'IQ', 'hospital', 'jail', 'money', 'crystals', 'cdays', 'bankmoney', 'cybermoney', 'crimexp'))) ? $_POST[$efxkey . 'stat'] : 'energy'; $_POST[$efxkey . 'dir'] = (isset($_POST[$efxkey . 'dir']) && in_array($_POST[$efxkey . 'dir'], array('pos', 'neg'))) ? $_POST[$efxkey . 'dir'] : 'pos'; $_POST[$efxkey . 'type'] = (isset($_POST[$efxkey . 'type']) && in_array($_POST[$efxkey . 'type'], array('figure', 'percent'))) ? $_POST[$efxkey . 'type'] : 'figure'; $_POST[$efxkey . 'amount'] = (isset($_POST[$efxkey . 'amount']) && is_numeric($_POST[$efxkey . 'amount'])) ? abs(intval($_POST[$efxkey . 'amount'])) : 0; $_POST[$efxkey . 'on'] = (isset($_POST[$efxkey . 'on']) && in_array($_POST[$efxkey . 'on'], array('1', '0'))) ? $_POST[$efxkey . 'on'] : 0; $effects[$i] = $db->escape( serialize( array("stat" => $_POST[$efxkey . 'stat'], "dir" => $_POST[$efxkey . 'dir'], "inc_type" => $_POST[$efxkey . 'type'], "inc_amount" => abs( (int) $_POST[$efxkey . 'amount'])))); } $m = $db->query( "INSERT INTO `items` VALUES(NULL, {$_POST['itmtype']}, '$itmname', '$itmdesc', {$_POST['itmbuyprice']}, {$_POST['itmsellprice']}, $itmbuy, '{$_POST['effect1on']}', '{$effects[1]}', '{$_POST['effect2on']}', '{$effects[2]}', '{$_POST['effect3on']}', '{$effects[3]}', $weapon, $armor)"); stafflog_add("Created item {$_POST['itmname']}"); echo 'The ' . $_POST['itmname'] . ' Item was added to the game.<br /> > <a href="staff_items.php?action=newitem">Go Home</a>'; die($h->endpage()); } function edit_item_begin() { global $db, $ir, $c, $h, $userid; if ($ir['user_level'] != 2) { echo 'You cannot access this area.<br />> <a href="staff.php">Go Back</a>'; die($h->endpage()); } $csrf = request_csrf_html('staff_edititem1'); echo " <h3>Editing Item</h3> You can edit any aspect of this item.<br /> <form action='staff_items.php?action=edititemform' method='post'> Item: " . item_dropdown(NULL, 'item') . " <br /> {$csrf} <input type='submit' value='Edit Item' /> </form> "; } function edit_item_form() { global $db, $ir, $c, $h; if ($ir['user_level'] != 2) { echo 'You cannot access this area.<br /> > <a href="staff.php">Go Back</a>'; die($h->endpage()); } staff_csrf_stdverify('staff_edititem1', 'staff_items.php?action=edititem'); $_POST['item'] = (isset($_POST['item']) && is_numeric($_POST['item'])) ? abs(intval($_POST['item'])) : ''; if (empty($_POST['item'])) { echo 'Invalid Item.<br /> > <a href="staff_items.php?action=killitem">Go Back</a>'; die($h->endpage()); } $d = $db->query( "SELECT * FROM `items` WHERE `itmid` = {$_POST['item']}"); if ($db->num_rows($d) == 0) { $db->free_result($d); echo 'Item doesn\'t seem to exist.<br /> > <a href="staff_items.php?action=edititem">Go Back</a>'; die($h->endpage()); } $itemi = $db->fetch_row($d); $db->free_result($d); $csrf = request_csrf_html('staff_edititem2'); $itmname = addslashes($itemi['itmname']); $itmdesc = addslashes($itemi['itmdesc']); echo " <h3>Editing Item</h3> <form action='staff_items.php?action=edititemsub' method='post'> <input type='hidden' name='itmid' value='{$_POST['item']}' /> Item Name: <input type='text' name='itmname' value='{$itmname}' /> <br /> Item Desc.: <input type='text' name='itmdesc' value='{$itmdesc}' /> <br /> Item Type: " . itemtype_dropdown(NULL, 'itmtype', $itemi['itmtype']) . " <br /> Item Buyable: <input type='checkbox' name='itmbuyable' " . (($itemi['itmbuyable']) ? "checked='checked'" : '') . " /> <br /> Item Price: <input type='text' name='itmbuyprice' value='{$itemi['itmbuyprice']}' /> <br /> Item Sell Value: <input type='text' name='itmsellprice' value='{$itemi['itmsellprice']}' /> <hr /> <b>Usage Form</b> <hr /> "; $stats = array("energy" => "Energy", "will" => "Will", "brave" => "Brave", "hp" => "Health", "strength" => "Strength", "agility" => "Agility", "guard" => "Guard", "labour" => "Labour", "IQ" => "IQ", "hospital" => "Hospital Time", "jail" => "Jail Time", "money" => "Money", "crystals" => "Crystals", "cdays" => "Education Days Left", "bankmoney" => "Bank money", "cybermoney" => "Cyber money", "crimexp" => "Crime XP"); for ($i = 1; $i <= 3; $i++) { if (!empty($itemi["effect" . $i])) { $efx = unserialize($itemi["effect" . $i]); } else { $efx = array("inc_amount" => 0); } $switch1 = ($itemi['effect' . $i . '_on'] > 0) ? " checked='checked'" : ""; $switch2 = ($itemi['effect' . $i . '_on'] > 0) ? "" : " checked='checked'"; echo " <b><u>Effect {$i}</u></b> <br /> On? <input type='radio' name='effect{$i}on' value='1'$switch1 /> Yes <input type='radio' name='effect{$i}on' value='0'$switch2 /> No <br /> Stat: <select name='effect{$i}stat' type='dropdown'> "; foreach ($stats as $k => $v) { echo ($k == $efx['stat']) ? '<option value="' . $k . '" selected="selected">' . $v . '</option>' : '<option value="' . $k . '">' . $v . '</option>'; } $str = ($efx['dir'] == "neg") ? '<option value="pos">Increase</option> <option value="neg" selected="selected">Decrease</option>' : '<option value="pos" selected="selected">Increase</option> <option value="neg">Decrease</option>'; $str2 = ($efx['inc_type'] == "percent") ? '<option value="figure">Value</option> <option value="percent" selected="selected">Percent</option>' : '<option value="figure" selected="selected">Value</option> <option value="percent">Percent</option>'; echo " </select> Direction: <select name='effect{$i}dir' type='dropdown'> {$str} </select> <br /> Amount: <input type='text' name='effect{$i}amount' value='{$efx['inc_amount']}' /> <select name='effect{$i}type' type='dropdown'>{$str2}</select> <hr /> "; } echo " <b>Combat Usage</b> <br /> Weapon Power: <input type='text' name='weapon' value='{$itemi['weapon']}' /> <br /> Armor Defense: <input type='text' name='armor' value='{$itemi['armor']}' /> <hr /> {$csrf} <input type='submit' value='Edit Item' /> </form> "; } function edit_item_sub() { global $db, $ir, $c, $h, $userid; if ($ir['user_level'] != 2) { echo 'You cannot access this area.<br />> <a href="staff.php">Go Back</a>'; die($h->endpage()); } staff_csrf_stdverify('staff_edititem2', 'staff_items.php?action=edititem'); $itmname = (isset($_POST['itmname']) && preg_match( "/^[a-z0-9_]+([\\s]{1}[a-z0-9_]|[a-z0-9_])+$/i", $_POST['itmname'])) ? $db->escape(strip_tags(stripslashes($_POST['itmname']))) : ''; $itmdesc = (isset($_POST['itmdesc'])) ? $db->escape(strip_tags(stripslashes($_POST['itmdesc']))) : ''; $weapon = (isset($_POST['weapon']) && is_numeric($_POST['weapon'])) ? abs(intval($_POST['weapon'])) : 0; $armor = (isset($_POST['armor']) && is_numeric($_POST['armor'])) ? abs(intval($_POST['armor'])) : 0; $_POST['itmtype'] = (isset($_POST['itmtype']) && is_numeric($_POST['itmtype'])) ? abs(intval($_POST['itmtype'])) : ''; $_POST['itmbuyprice'] = (isset($_POST['itmbuyprice']) && is_numeric($_POST['itmbuyprice'])) ? abs(intval($_POST['itmbuyprice'])) : ''; $_POST['itmsellprice'] = (isset($_POST['itmsellprice']) && is_numeric($_POST['itmsellprice'])) ? abs(intval($_POST['itmsellprice'])) : ''; $_POST['itmid'] = (isset($_POST['itmid']) && is_numeric($_POST['itmid'])) ? abs(intval($_POST['itmid'])) : ''; if (empty($itmname) || empty($itmdesc) || empty($_POST['itmtype']) || empty($_POST['itmbuyprice']) || empty($_POST['itmsellprice']) || empty($_POST['itmid'])) $q = $db->query( 'SELECT COUNT(`itmid`) FROM `items` WHERE `itmid` = ' . $_POST['itmid']); if ($db->fetch_single($q) == 0) { $db->free_result($q); echo 'Invalid item.<br /> > <a href="staff_items.php?action=edititem">Go Back</a>'; die($h->endpage()); } $db->free_result($q); $itmbuy = ($_POST['itmbuyable'] == 'on') ? 1 : 0; $effects = array(); for ($i = 1; $i <= 3; $i++) { $efxkey = "effect{$i}"; $_POST[$efxkey . 'stat'] = (isset($_POST[$efxkey . 'stat']) && in_array($_POST[$efxkey . 'stat'], array('energy', 'will', 'brave', 'hp', 'strength', 'agility', 'guard', 'labour', 'IQ', 'hospital', 'jail', 'money', 'crystals', 'cdays', 'bankmoney', 'cybermoney', 'crimexp'))) ? $_POST[$efxkey . 'stat'] : 'energy'; $_POST[$efxkey . 'dir'] = (isset($_POST[$efxkey . 'dir']) && in_array($_POST[$efxkey . 'dir'], array('pos', 'neg'))) ? $_POST[$efxkey . 'dir'] : 'pos'; $_POST[$efxkey . 'type'] = (isset($_POST[$efxkey . 'type']) && in_array($_POST[$efxkey . 'type'], array('figure', 'percent'))) ? $_POST[$efxkey . 'type'] : 'figure'; $_POST[$efxkey . 'amount'] = (isset($_POST[$efxkey . 'amount']) && is_numeric($_POST[$efxkey . 'amount'])) ? abs(intval($_POST[$efxkey . 'amount'])) : 0; $_POST[$efxkey . 'on'] = (isset($_POST[$efxkey . 'on']) && in_array($_POST[$efxkey . 'on'], array('1', '0'))) ? $_POST[$efxkey . 'on'] : 0; $effects[$i] = $db->escape( serialize( array("stat" => $_POST[$efxkey . 'stat'], "dir" => $_POST[$efxkey . 'dir'], "inc_type" => $_POST[$efxkey . 'type'], "inc_amount" => abs( (int) $_POST[$efxkey . 'amount'])))); } $db->query( 'UPDATE `items` SET `itmtype` = ' . $_POST['itmtype'] . ',`itmname` = "' . $itmname . '",`itmdesc` = "' . $itmdesc . '",`itmbuyprice` = ' . $_POST['itmbuyprice'] . ',`itmsellprice` = ' . $_POST['itmsellprice'] . ',`itmbuyable` = ' . $itmbuy . ',`effect1_on` = "' . $_POST['effect1on'] . '",`effect1` = "' . $effects[1] . '",`effect2_on` = "' . $_POST['effect2on'] . '",`effect2` = "' . $effects[2] . '",`effect3_on` = "' . $_POST['effect3on'] . '",`effect3` = "' . $effects[3] . '",`weapon` = ' . $weapon . ',`armor` = ' . $armor . ' WHERE `itmid` = ' . $_POST['itmid']); stafflog_add("Edited item {$_POST['itmname']}"); echo 'The ' . $_POST['itmname'] . ' Item was edited successfully.<br /> > <a href="staff.php">Go Home</a>'; die($h->endpage()); } think thats all you need
-
thanks 🙂 will see what happens <?php /** * MCCodes Version 2.0.5b * Copyright (C) 2005-2012 Dabomstew * All rights reserved. * * Redistribution of this code in any form is prohibited, except in * the specific cases set out in the MCCodes Customer License. * * This code license may be used to run one (1) game. * A game is defined as the set of users and other game database data, * so you are permitted to create alternative clients for your game. * * If you did not obtain this code from MCCodes.com, you are in all likelihood * using it illegally. Please contact MCCodes to discuss licensing options * in this case. * * File: class/class_db_mysql.php * Signature: c43fdec3c66d23162f869ddcf5af599d * Date: Fri, 20 Apr 12 08:50:30 +0000 */ if (!defined('MONO_ON')) { exit; } if (!function_exists('error_critical')) { // Umm... die('<h1>Error</h1>' . 'Error handler not present'); } if (!extension_loaded('mysql')) { // dl doesn't work anymore, crash error_critical('Database connection failed', 'MySQL extension not present but required', 'N/A', debug_backtrace(false)); } class database { var $host; var $user; var $pass; var $database; var $persistent = 0; var $last_query; var $result; var $connection_id; var $num_queries = 0; var $start_time; function configure($host, $user, $pass, $database, $persistent = 0) { $this->host = $host; $this->user = $user; $this->pass = $pass; $this->database = $database; $this->persistent = $persistent; return 1; //Success. } function connect() { if (!$this->host) { $this->host = "localhost"; } if (!$this->user) { $this->user = "root"; } if ($this->persistent) { $conn = mysql_pconnect($this->host, $this->user, $this->pass); } else { $conn = mysql_connect($this->host, $this->user, $this->pass, true); } if ($conn === false) { error_critical('Database connection failed', mysql_errno() . ': ' . mysql_error(), 'Attempted to connect to database on ' . $this->host, debug_backtrace(false)); } // @overridecharset mysql $this->connection_id = $conn; if (!mysql_select_db($this->database, $this->connection_id)) { error_critical('Database connection failed', mysql_errno($conn) . ': ' . mysql_error($conn), 'Attempted to select database: ' . $this->database, debug_backtrace(false)); } return $this->connection_id; } function disconnect() { if ($this->connection_id) { mysql_close($this->connection_id); $this->connection_id = 0; return 1; } else { return 0; } } function change_db($database) { if (!mysql_select_db($database, $this->connection_id)) { error_critical('Database change failed', mysql_errno($this->connection_id) . ': ' . mysql_error($this->connection_id), 'Attempted to select database: ' . $database, debug_backtrace(false)); } $this->database = $database; } function query($query) { $this->last_query = $query; $this->num_queries++; $this->result = mysql_query($this->last_query, $this->connection_id); if ($this->result === false) { error_critical('Query failed', mysql_errno($this->connection_id) . ': ' . mysql_error($this->connection_id), 'Attempted to execute query: ' . nl2br($this->last_query), debug_backtrace(false)); } return $this->result; } function fetch_row($result = 0) { if (!$result) { $result = $this->result; } return mysql_fetch_assoc($result); } function num_rows($result = 0) { if (!$result) { $result = $this->result; } return mysql_num_rows($result); } function insert_id() { return mysql_insert_id($this->connection_id); } function fetch_single($result = 0) { if (!$result) { $result = $this->result; } return mysql_result($result, 0, 0); } function easy_insert($table, $data) { $query = "INSERT INTO `$table` ("; $i = 0; foreach ($data as $k => $v) { $i++; if ($i > 1) { $query .= ", "; } $query .= $k; } $query .= ") VALUES("; $i = 0; foreach ($data as $k => $v) { $i++; if ($i > 1) { $query .= ", "; } $query .= "'" . $this->escape($v) . "'"; } $query .= ")"; return $this->query($query); } function escape($text) { return mysql_real_escape_string($text, $this->connection_id); } function affected_rows() { return mysql_affected_rows($this->connection_id); } function free_result($result) { return mysql_free_result($result); } } i cant seem to find a thing wrong with the code here is the file it is referring to
-
keep getting this error when i add items aslo getting this when i try editing i cant see the error can any one help me?