- + item_database (28 fields)
- - id (Primairy| intreger 11 | auto increment)
- - sub_id (index | intreger 11 | define item_subcategories)
- - item_id (index | intreger 11 | define item_itemlist)
- - socket ( / | intreger 1 | define if there's a socket)
- - refining ( / | intreger 1 | define if therer's a refining)
- - zullie ( / | intreger 11 | define amount of zullie)
- - paypal ( / | intreger 1 | define if paypal)
- - donation_points( / | intreger 11 | define amount of don. pts.)
- - itempic ( / | varchar 255 | define item picture
- - min_level ( / | intreger 11 | define a minum level)
- - str ( / | intreger 11 | define strength)
- - dex ( / | intreger 11 | define dexternity)
- - _int ( / | intreger 11 | define inteligence)
- - con ( / | intreger 11 | define concentration)
- - cha ( / | intreger 11 | define charm)
- - sen ( / | intreger 11 | define sensibility)
- - mspd ( / | varchar 11 | define movepent speed)
- - crit ( / | intreger 11 | define critical)
- - def ( / | intreger 11 | define defence)
- - dodge ( / | intreger 11 | define dodge- rate)
- - mdef ( / | intreger 11 | define magic defence)
- - atk ( / | intreger 11 | define atack power)
- - inv ( / | intreger 11 | define inventory)
- - attacc ( / | intreger 11 | define attack accuracy)
- - mpcon ( / | intreger 11 | define Mana Points consumption)
- - hp ( / | intreger 11 | define Hit points)
- - mp ( / | intreger 11 | define Mana points)
- + item_categories (3 fields)
- - id (primary| intreger 11 | auto increment)
- - category ( / | varchar 255 | define the category name)
- - info ( / | text | define some additinal information to he category)
- + item_subcategories (5 fields)
- - id (primary| intreger 11 | auto increment)
- - cid ( index | intreger 11 | define the category ID)
- - sub_category ( / | varchar 255 | define the sub catergy name)
- - info ( / | text | define some add. info. to the sub category)
- - items ( / | intreger 11 | define the amount of items in that sub_category)
- + item_itemlist (5 fields)
- - id (primary| intreger 11 | auto increment)
- - itemid ( index | intreger 11 | define the item id)
- - itemtype ( index | intreger 11 | define the item type)
- - itemname ( / | varchar 255 | define the item name)
- - iteminfo ( / | text | define Some onfo about the item )
I've seen many people requesting for an item mall. But none of them are quite happy when they get one.
The requirements are the same as in my previous tutorial.
I'm going to use the same system as I've used in my other tutoral, same as the map names and such.
What are we going to use?
- HTML
- PHP
- MySQL
- JavaScript
Our database model would look like this.
Alot of fields like you see.. ( index | type | info)
The indexes that are used are correct, and should be added in that way. If you use good indexes, it makes your queries to peform better.
More info about indexes can be found here.
Like I said I'm going to relay on my previous tutorial.
So I assume you have made a page in members & a template in templates, and setted up your index file right. (I'll get back to that)
If not (wich I assume anyway)
Create a file in you members called itemmall.php.
Create a file in templates called itemmall.tpl.
- This is done let us continue -
We make a itemmall template from scratch. If you see wich fields are needed, you can see how it would be build in your tables.
We've got a category & a subcategory.
First we need to display the Categories and if the users clicks one the Subcategories
What we need to do if some one comes to the categories-page.
- Say if there are categories | yes / no
- if yes show them
- if no show: There are no categories
- <!-- START BLOCK : MainIsCategory -->
- <dl>Categories
- <!-- START BLOCK : PrintCategories -->
- <dt><a href="index.php?{Seperator}={Page}&cid={cat_id}">{Category}</a>
- <dd>{CategoryInformation}</a></dd>
- </dt>
- <!-- END BLOCK : PrintCategories -->
- </dl>
- <!-- END BLOCK : MainIsCategory -->
- <!-- START BLOCK : MainIsNoCategory -->
- <p>Sorry but there are currently no <b>categories</b> to be viewed.</p>
- <!-- END BLOCK : MainIsNoCategory -->
Easy as that.
Now we make the itemall.php file ready.
- <?php
- /* Create connection to our database */
- $ident = @mysql_connect($DatabaseConfig['HOST'],$DatabaseConfig['USER'],$DatabaseConfig['PASS']);
- if ($ident == false)
- {
- die ('Database problem.');
- }
- if (!@mysql_select_db($DatabaseConfig['DB'],$ident))
- {
- die ('Wouldn't select database');
- }
- /* Connection created, no error's found */
- // Start the template Class.
- $mall = new TemplatePower('templates/itemmall.tpl');
- $mall->prepare();
- /* Now it's time to define if there are categories or not.
- easy to do with a Query (ofcource)
- */
- $CategoriesSQL = " SELECT id,category,info
- FROM item_categories
- ";
- $CategoriesQRY = @mysql_query($CategoriesSQL);
- /* Hide an error from public */
- if ( $CategoriesQRY === false ) // 3x = => bolean
- {
- /* There's an error; but the user doesn't need to know. So we just going to way we don't hae any categories. */
- $mall->newBlock('MainIsNoCategory');
- }
- elseif ( @mysql_num_rows($CategoriesQRY) == 0)
- {
- /* if the queryworks, but we still don't have any categories */
- $mall->newBlock('MainIsNoCategory');
- }
- else
- {
- /* Everthing is fine no error & records; PRINT! */
- $mall->newBlock('MainIsCategory');
- // No w'll output the result
- while ($CategoriesRES = @mysql_fetch_object($CategoriesQRY))
- {
- $Assign = array('Category' => $CategoriesRES->categories,
- 'CategoryInformation' => $CategoriesRES->info,
- 'cat_id' => $CategoriesRES->id);
- /* I putted them first in the array so it's easier to remove the extra slashes */
- $Assign = RetriveString($Assign); // We delete the extra slashes out of the result
- $mall->newBlock('PrintCategories');
- $mall->assign($Assign); // The result is the same.
- }
- }
- /* Print the itemmall content */
- $mall->printToScreen();
- ?>
Download functions:
If everythig is going right you'll see some nice categories (or none).
[size=x-small]Add some categories to the database by hand to see if it works.[/size]
Now we have our categories, now it's time to go to the sub category if a user clicks it.
Go back to your itemmall.tpl template and add some new code to it to make it display the subcategories
Example:
- <!--START BLOCK : MainSubCategory -->
- <a href="index.php?{Seperator={Page}">Categories</a> » Subcategory <br />
- <!-- START BLOCK : MainIsSubCategory -->
- <dl>SubCategories
- <!-- START BLOCK : PrintSubCategory -->
- <dt><a href="index.php?{Seperator}={Page}&cid={cat_id}&sid={sub_id}">{SubCategory}</a> ({Items})
- <dd>{SubCategoryInformation}</a></dd>
- </dt>
- <!-- END BLOCK : PrintSubCategory -->
- </dl>
- <!-- END BLOCK : MainIsSubCategory -->
- <!-- START BLOCK : MainIsNoSubCategory -->
- <p>Sorry but there are currently no <b>subcategories</b> to be viewed.</p>
- <!-- END BLOCK : MainIsNoSubCategory -->
- <!-- END BLOCK : MainSubCategory -->
It's about the same to the categories outputting. It's true. You can use the old one again. I don't care I do it on my way. (But don't complain if it doesn't turn out like you would it to be).
You also see that I've made a main block. It's used to make a good navigation pattern.
in you itemmall.php You need to make some elseif-blocks.
[quote] You you need to make elseif-blocks?[/quote]
It can work witout them. That's not the point. But it would display the subcategories & after it would show the categories.
(It's better to think infront it makes things easier.)
- <?php
- /* Create connection to our database */
- $ident = @mysql_connect($DatabaseConfig['HOST'],$DatabaseConfig['USER'],$DatabaseConfig['PASS']);
- if ($ident == false)
- {
- die ('Database problem.');
- }
- if (!@mysql_select_db($DatabaseConfig['DB'],$ident))
- {
- die ('Wouldn't select database');
- }
- /* Connection created, no error's found */
- // Start the template Class.
- $mall = new TemplatePower('templates/itemmall.tpl');
- $mall->prepare();
- if (isset($_GET['sid'])) // If the user clicked a sub cateogrie
- {
- /* Here comes the other content from outputting the items in the subcategory */
- }
- elseif ( isset($_GET['cid']) && preg_match("/^[0-9]+$/", $_GET['cid']) ) // if the user clicked a categorie
- {
- /* Here comes the other content from outputting the subcategories */
- $cid = $_GET['cid']; // The cid made it trough our preg_match :) So it's an intreger.
- /* Create our nagivation */
- $mall->newBlock('MainSubCategory');
- $mall->assign(array('Seperator', $Seperator,'Page' => $page )); // Done ^^
- /* Create the SQL & execute */
- $SubCatSQL = " SELECT id,sub_category,info,items
- FROM item_subcategories
- WHERE cid = '".$cid."' ";
- $SubCatQRY = @mysql_query($SubCatSQL);
- if ( $SubCatQRY === false )
- {
- /* Error in query > Print No subcategories */
- $mall->newBlock('MainIsNoSubCategory');
- }
- elseif ( @mysql_num_rows($SubCatQRY) == 0 )
- {
- /* No subcategories to show > Print No Subcategories */
- $mall->newBlock('MainIsNoSubCategory');
- }
- else
- {
- /* Success Print Subcategories */
- $mall->newBlock('MainIsSubCategory');
- while ( $SubCatRES = @mysql_fetch_object($SubCatQRY) )
- {
- $Assign = array('SubCategory' => $SubCatRES->categories,
- 'SubCategoryInformation' => $SubCatRES->info,
- 'sub_id' => $SubCatRES->id,
- 'cat_id' => $cid);
- /* I putted them first in the array so it's easier to remove the extra slashes */
- $Assign = RetriveString($Assign); // We delete the extra slashes out of the result
- $mall->newBlock('PrintSubCategory');
- $mall->assign($Assign); // The result is the same.
- $mall->assign(array('Seperator' => $Seperator, 'Page' => $page)); // To make the links work.
- }
- }
- }
- else
- {
- /* Here comes the other content from outputting the categories */
- // .... (it would make the Tutorial to long if I have to repeat it all over again)
- }
- /* Print the itemmall content */
- $mall->printToScreen();
- ?>
Phew we did that, all the Catogories popped up.
So for, so good.
Now it's time for the hardwork. Printing the items within the subcategory and link them toour main item database.
Let's do the items now. (It's up to you to create the extra's like: socket & refine.)
There has to be a link between items_database (itemid) and items_itemslist (id), to do this is to use a JOIN within your query. Or using 2 different queries.
Back to our template.
We'll add the following
- <!--START BLOCK : MainItems -->
- <a href="index.php?{Seperator={Page}">Categories</a> » <a href="index.php?{Seperator={Page}&cid={cat_id}">Subcategory</a> » Items
- <br />
- <!-- START BLOCK : MainIsItems -->
- <dl>Items
- <!-- START BLOCK : PrintMainItems -->
- <dt><a href="index.php?{Seperator={Page}&cid={cat_id}&sid={sub_id}&iid={item_id}">{Item}</a> ({Price})
- <dd>{ItemInformation}</dd>
- </dt>
- <!-- END BLOCK : PrintMainItems -->
- </dl>
- <!-- END BLOCK : MainIsItems -->
- <!-- START BLOCK : MainNoItems -->
- <p>Sorry but there are currently no <b>items</b> to be viewed.<p></p>
- <!-- END BLOCK : MainNoItems -->
- <!-- END BLOCK : MainItems -->
To our itemmall.php
- <?php
- if (isset($_GET['sid']) && preg_match("/^[0-9]+$/", $_GET['sid']) && isset($_GET['cid']) && preg_match("/^[0-9]+$/", $_GET['cid'])) // If the user clicked a sub cateogrie
- {
- /* Here comes the other content from outputting the items in the subcategory */
- $sid = $_GET['sid'];
- $cid = $_GET['cid'];
- $mall->newBlock('MainItems');
- /* The navigation */
- $mall->assign(array('Seperator' => $Seperator, 'Page' => $page,
- 'cat_id' => $cid);
- $ItemSQL = "SELECT
- item_database.id as item_id,
- item_database.zullie,
- item_database.paypal,
- item_database.donation_points,
- item_itemlist.itemname,
- item_itemlist.iteminfo
- FROM
- item_itemlist
- INNER JOIN
- item_database
- ON
- ( item_itemlist.id = item_database.item_id)
- WHERE
- item_database.sub_id = '".$sid."' ";
- /* It's a big query, but it selecs the name & info frmo item_itemlist e &
- prices and things from item_database */
- $ItemQRY = @mysql_query($ItemSQL);
- if ( $ItemQRY === false )
- {
- $mall->newBlock('MainNoItems');
- }
- elseif ( @mysql_num_rows($ItemQRY) == 0)
- {
- $mall->newBlock('MainNoItems');
- }
- else
- {
- $mall->newBlock('MainIsItems');
- while ($ItemRES = @mysql_fetch_object($ItemQRY))
- {
- /* Paypal: yes (1) No (0) */
- ( $ItemRES->paypal == 0 ) ? $EndStr = ' z' : $EndStr = ' pt';
- ( $ItemRES->paypal == 0 ) ? $Price = $ItemRES->zullie : $Price = $ItemRES->donation_points;
- /* We've defined donation & price */
- $Assign = array('Item' => $ItemRES->itemname,
- 'ItemInformaion' => $ItemRES->iteminfo,
- 'Price' => $Price.$EndStr,
- 'item_id' => $ItemRES->item_id);
- $Assign = RetriveString($Assign);
- /* You can add stats to it do; you only need to get them out of the database seperated */
- $mall->newBlock('PrintMainItems');
- $mall->assign($Assign); // Assing the array
- /* The navigation */
- $mall->assign(array('Seperator' => $Seperator, 'Page' => $page,
- 'cat_id' => $cid, 'sub_id' => $sid));
- }
- }
- }
- ?>
This is done also. If you click it only your url will change... Now we are going to up the new item id in a session.
Well add in top of our itemmall.php the session line.
Warning!
- Make sure you have in your index session_start(); This is placed just under the <?php line.
Just under this line we'll add the session storage.
- <?php
- /* Create connection to our database */
- $ident = @mysql_connect($DatabaseConfig['HOST'],$DatabaseConfig['USER'],$DatabaseConfig['PASS']);
- if ($ident == false)
- {
- die ('Database problem.');
- }
- if (!@mysql_select_db($DatabaseConfig['DB'],$ident))
- {
- die ('Wouldn't select database');
- }
- /* Connection created, no error's found */
- // Start the template Class.
- $mall = new TemplatePower('templates/itemmall.tpl');
- $mall->prepare();
- /* Store item in session */
- if ( isset($_GET['iid']) && preg_match("/^[0-9]+$/", $_GET['iid']) )
- {
- /* iid is a valid intreger */
- $item_id = $_GET['iid'];
- /* You can add refining & socketed and stuff later by your own. Now it is just the ID */
- $_SESSION['ItemMall'][] = $item_id; // [] stands for array format */
- }
- /* Here we will add like: You have xx items in your storage BUT we hide it when it's 0 */
- if (isset($_SESSION['ItemMall']) && @is_array($_SESSION['ItemMall']) && count($_SESSION['ItemMall']) > 0)
- {
- /*
- Item mall is set. It's an array & it's higher than zero.
- */
- $mall->newBlock('ItemsInMall'); /* We create thatblock later on */
- $mall->assign(array('Seperator' => $Seperator, 'Page' => $page,
- 'Type' => 'cart' , 'iItems' => count($_SESSION['ItemMall'])));
- }
- /* Here is your other item mall code */
Now we'll make the block named ItemsInMall goto your template itemmall.tpl
Add above any content (in top)
You can add more things if you like. That's up to you.
Everything is almost done. Now comes the hardpart. The purchace of the items.
In our itemmall.tpl we create a new block called MainShoppingCart & MainNoShoppingCart .
Example:
- <!-- START BLOCK : MainNoShoppingCart -->
- <p> You do not have any items in your shopping cart. </p>
- Click <a href="index.php{Seperator}={Page}" >here</a> to return to the categories. <br />
- <!-- END BLOCK : MainNoShoppingCart -->
- <!-- START BLOCK : MainShoppingCart -->
- <script language="JavaScript" type="text/javascript">
- function AreYouSure(item_id) {
- if(window.confirm("Are you sure you want to delete this item from your shopping cart?")) {
- window.location = "index.php?{Seperator}={Page}&type={Type}&del_id=" + item_id;
- }
- }
- </script>
- <a href="index.php{Seperator}={Page}" > Categories </a> » Shopping cart <br />
- <table width="100%" border="0" cellspacing="2" cellpadding="2">
- <!-- START BLOCK : ShoppingCart -->
- <tr>
- <td width="50%">{ItemName}<br /> » {ItemInformation} </td>
- <td valign="top" align="left">Price:<br />
- {Price} </td>
- <td align="center" width="10%">[ <a href="#" onClick="AreYouSure('{item_id}');">Remove</a>
- ]</td>
- </tr>
- <!-- END BLOCK : ShoppingCart -->
- <tr>
- <td height="30" align="right" valign="top">Zulie price:<br />
- Donation points:</td>
- <td height="30" colspan="2" align="left" valign="top">{TotalZuliePrice}
- z<br />
- {TotalDonationPts} pt<br /></td>
- </tr>
- <tr>
- <td height="30" colspan="3" align="right"><form name="form1" method="post" action="index.php?{Seperator}={Page}&type={Type}">
- <input name="PurchaseOrder" type="submit" id="PurchaseOrder" value="Purchase Order" {Disabled}>
- </form></td>
- </tr>
- </table>
- <!-- END BLOCK : MainShoppingCart -->
To our itemmall.php
Where we have the line that says we are in the items we make it into an elseif
- if (isset($_GET['type']) && $_GET['type'] == 'cart')
- {
- /* Here comes our item mall */
- if (isset($_GET['del_id']) && preg_match("/^[0-9]+$/", $_GET['del_id'])) // This will generate fase all the time. We use this later
- {
- /* Delete an item from your shopping cart */
- unset($_SESSION['ItemMall'][$_GET['del_id']]);
- }
- /* We count the items in the session if it's 0 we say you don't have any items in your cart */
- $ItemsInSession = count($_SESSION['ItemMall']);
- if ($ItemsInSession <= 0 || !@is_array($_SESSION['ItemMall']) )
- {
- /* No items in cart or the session isn't an array */
- $mall->newBlock('MainNoShoppingCart');
- $mall->assign(array('Seperator' => $Seperator, 'Page' => $Page));
- }
- else
- {
- /* Show the items */
- $mall->newBlock('MainShoppingCart');
- /* We could use a for loop. but if an item is deleted from your session the loop quits, even if there still are items. So that isn't good
- It took me a while to to figure out how I shoud do it. My conclusion felt on foreach()
- */
- $ItemMall = $_SESSION['ItemMall']; // Easier to use in the script
- /* In this example $Index would be the array Index & pointer would be the item id */
- foreach($ItemMall as $Index => $Pointer)
- {
- $x = $Index; /* No confusion posible now */
- $item_id = $Pointer; /* No confusion posible now */
- // Start the block
- $mall->newBlock('ShoppingCart');
- /* We select the item name from our database & also price (pts || zulie ) */
- $ShoppingSQL = "SELECT
- item_database.id as item_id,
- item_database.zullie,
- item_database.donation_points,
- item_database.paypal,
- item_itemlist.itemname,
- item_itemlist.iteminfo
- FROM
- item_database
- INNER JOIN
- item_itemlist
- ON
- (item_database.item_id = item_itemlist.id)
- WHERE
- item_database.id = '".$item_id."' ";
- $ShoppingQRY = @mysql_query($ShoppingSQL);
- if ($ShoppingQRY === false)
- {
- /* Querie returned false on that item. Unset that ID*/
- unset($_SESSION['ItemMall'][$x]);
- }
- elseif (mysql_num_rows($ShoppingQRY) == 0)
- {
- /* Someone editied the session!!!!!!!!!!!!!!!!!!!!!!
- Or the admn just deleted that item
- */
- $mall->assign(array('ItemInfo' => 'Invalid result', 'ItemInfo' => 'Invalid search result'));
- unset($_SESSION['ItemMall'][$x]);
- }
- else
- {
- /* No error's No 0 values */
- // Count zulie & donation pts...
- $ShoppingRES = @mysql_fetch_object($ShoppingQRY);
- $dpts = $dpts + $ShoppingRES->donation_points; // $new value = $old value + $DatabaseConfig_value
- $zulie = $zulie + $ShoppingRES->zullie;
- ( $ShoppingQRY->paypal == 0) ? $Price = $ShoppingRES->zullie.' z' : $Price = ShoppingRES->donation_points.' pts';
- $Assign('ItemName' => ShoppingRES->itemname, 'ItemInfo' => $ShoppingRES->iteminfo,
- 'Price' => $Price, 'item_id' => $ShoppingRES->item_id);
- $Assing = RetriveString($Assign);
- $mall->assign($Assign);
- // $mall->assign(array('Seperator' => $Seperator, 'Page' => $Page))
- }
- }
- /* Foreach has finished ; show the price */
- // I have no idea how your login works. But if you make one make sure it STORES the account ID somewhere . To make it absolute save use PASS & UserName to
- $AccountQRY = @mysql_query("SELECT donation,zulystorage,online
- FROM accounts
- WHERE id='".$AccountID."'
- /* && username='".$AccountUserName."' && password='".$AccountPassword."' */
- ";
- $AccountRES = @mysql_fetch_object($AccountQRY);
- if ($zulie > $AccountRES->zulystorage || $dpts > $AccountRES->donation || $AccountRES->online == 1)
- {
- /* Disable the submit */
- $mall->assgn('Disabled' => 'disabled="disabled"' );
- }
- else
- {
- // Do nothing or show how much he/she has left
- }
- }
- }
- elseif (isset($_GET['sid']) && preg_match("/^[0-9]+$/", $_GET['sid']) && isset($_GET['cid']) && preg_match("/^[0-9]+$/", $_GET['cid'])) // If the user clicked a sub cateogrie
- {
- /* here the item code */
- }
- elseif (...
Phew we are trough that one... Now our final stage is to to put those item in the storage.
Back to the itemmall.php . And again we need to place some code above thet code we've just wrote.
We start writing above the following code.
- if (isset($_GET['type']) && $_GET['type'] == 'cart')
What need to be happen
- Item must get into the storage
- Zulie or donation points need to be decreased
- ...
It's quite the same, we can use part of the code we've writen above and adjust it to make it work.
- if ($_SERVER['REQUEST_METHOD'] == "POST" && isset($_POST['PurchaseOrder']) && $_POST['PurchaseOrder'] == 'Purchase Order')
- {
- /* Purchase code */
- $StroagePointer = 159; // Last position in your storage tab down right corner
- foreach($ItemMall as $Index => $Pointer)
- {
- $x = $Index; /* No confusion posible now */
- $item_id = $Pointer; /* No confusion posible now */
- $ShoppingSQL = "SELECT
- item_database.zullie,
- item_database.donation_points,
- item_itemlist.itemid,
- item_itemlist.itemtype
- FROM
- item_database
- INNER JOIN
- item_itemlist
- ON
- (item_database.item_id = item_itemlist.id)
- WHERE
- item_database.id = '".$item_id."' ";
- $ShoppingQRY = @mysql_query($ShoppingSQL);
- if ($ShoppingQRY === false)
- {
- /* Querie returned false on that item. Unset that ID*/
- unset($_SESSION['ItemMall'][$x]);
- }
- elseif (mysql_num_rows($ShoppingQRY) == 0)
- {
- /* Unset that ID*/
- unset($_SESSION['ItemMall'][$x]);
- }
- else
- {
- $pts = 0; // Set don. pt to 0
- $zul = 0; // Set zul to 0
- $ShoppingRES = @mysql_fetch_object($ShoppingQRY);
- $pts = $ShoppingRES->donation_points;
- $zul = $ShoppingRES->zullie;
- /* decrease zullie or donation points; */
- $PriceSQL ="UPDATE
- account
- SET
- donation = donation - ".$pts.",
- zulystorage = zulystorage - ".$zul."
- WHERE
- id='".$AccountID."'
- /*&& usrname='".$AccountUserName."' && password='".$AccountPassword."' */
- ";
- $PriceQRY = @mysql_query($PriceSQL);
- if ($PriceQRY === false)
- {
- // Uhm something failed. Ah wel :)
- }
- else
- {
- // Everyting is fine.. Continue with the item.
- $StorageSQL = "INSERT INTO storage
- (owner,itemnum,itemtype,slotnum)
- VALUES
- ('".$AccountID."',
- '".$ShoppingRES->itemid."',
- '".$ShoppingRES->itemtype."',
- '".$StroagePointer."')
- ";
- $StorageQRY = @mysql_query($StorageSQL);
- if ($StorageQRY === false)
- {
- // Hehe to bad, but we won't unset the item ID, so he can try again. But to bad fro the donation points or zullie. He lost that :)
- }
- else
- {
- // Delete the item id from the session
- unset($_SESSION['ItemMall'][$x]);
- // Decrease Storagepointer with 1
- $StroagePointer--;
- }
- }
- }
- }
- }
How to create an Item Mall tutorial, written by Rifke
Thank you for your attention.
Kind regards
Rifke
This tutorial can be used to help you know more about PHP & MySQL & Templates. It's made for osRose, and other communities where I'm on. Any coppies in any posible way is not allowed. (This includes posting on other forums).