Uridium Posted May 11, 2008 Share Posted May 11, 2008 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 Item Type "; Add remove the "; before Adding next line > Delete Item Type "; 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.. Quote Link to comment Share on other sites More sharing options...
Uridium Posted May 11, 2008 Author Share Posted May 11, 2008 Re: Edit Item Type Code Solved Bump Quote Link to comment Share on other sites More sharing options...
~Destiny-Gaming~ Posted May 11, 2008 Share Posted May 11, 2008 Re: Edit Item Type Code Solved Nice Extra Feature Good One! Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted May 11, 2008 Share Posted May 11, 2008 Re: Edit Item Type Code Solved Nicely done :) Quote Link to comment Share on other sites More sharing options...
Uridium Posted May 12, 2008 Author Share Posted May 12, 2008 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. Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted May 12, 2008 Share Posted May 12, 2008 Re: Edit Item Type Code Solved You should do a edit item type now. Quote Link to comment Share on other sites More sharing options...
Uridium Posted May 12, 2008 Author Share Posted May 12, 2008 Re: Edit Item Type Code Solved Actually lol im already in the process of doing that one lol May also include an Add Picture to Item Type aswell now that ive got the Picture one solved from this post http://criminalexistence.com/ceforums/index.php?topic=18505.0 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.