Jump to content
MakeWebGames

Edit Item Type Code Solved


Uridium

Recommended Posts

Ok so ive been banging my brains for days trying to solve this thing and finally I managed it :)

Firstly open up smenu.php

Just After this line

 

Add remove the "; before Adding next line

 

Then Open Your staff_items.php

Look for

 

case 'newitemtype': newitemtype(); break;

Then Add This Line Underneath it.

 

case 'remitemtype' : rem_item_type(); break;

Then just before

 

$h->endpage();

Add this Coding

 

function rem_item_type()

{

global $db,$ir,$c,$h,$userid;

if($ir['user_level'] > 2)

{

die("403");

}

if($_POST['remname'])

{

$d=$db->query("SELECT * FROM itemtypes WHERE itmtypename='{$_POST['remname']}'");

while($a=mysql_fetch_array($d))

{

$db->query("DELETE FROM itemtypes WHERE itmtypeid='{$a['itmtypeid']}'");

print "Item Type {$_POST['remname']} Was Sucessfully Removed.";

}

stafflog_add("Removed item type {$_POST['remname']}");

print "<h3>Remove Item Type</h3><hr />

<form action='staff_items.php?action=remitemtype' method='post'>

Name: <input type='text' name='remname' />

<input type='submit' value='Remove Item Type' /></form>

";

}

else

{

print "<h3>Remove Item Type</h3><hr />

<form action='staff_items.php?action=remitemtype' method='post'>

Name: <input type='text' name='remname' />

<input type='submit' value='Remove Item Type' /></form>

";

so that the Bottom final part looks like

 

}

}

$h->endpage();

?>

You can Now Delete Item Types from the game without going into phpmyadmin..

Link to comment
Share on other sites

Re: Edit Item Type Code Solved

Id like some feed back on this as its my First attempt at solving anything on the MCC. If anyone received error messages whilst applynig the above code and so on. I tested it on Firefox and IE and it worked fine for me.

Link to comment
Share on other sites

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...