Item mall

This is guide mostly for website tools and code, for example CMS or registration scripts.
There can also be tools.

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

Item mall

Postby Rifke on Mon Sep 03, 2007 10:29 pm

I've written a new itemmall, ready to implent. It has no admin yet, though.

I'm making it easy
The rar file contains 6 files and 1 dir
  1. ItemMall.php
  2. prefix_itemmall_category.sql
  3. prefix_itemmall_subcategory.sql
  4. prefix_itemmall_items.sql
  5. prefix_cart.sql
  6. prefix_itemmall_full.sql
  7. _itemmall (dir)
NOTE; execute the SQL files in the same order as show above, starting with category.sql

I'm going to explain how to add it manualy.

You add your categories in the prefix_itemmall_category. Each id, will correspond with a sub id in the table prefix_itemmall_subcategory. Each id in the table prefix_itemmall_subcategory will corresponds with an sid id in the table prefix_itemmall_items.

I hope you still are following?

prefix_itemmall_category

  1.  
  2. id  |   name    |   info    |   locked
  3. -------------------------------------------------------
  4. 1   |  Test cat |   some test   |   0
  5. 2   |  More Test    |   More info   |   0
  6. ...
  7.  


prefix_itemmall_subcategory
  1.  
  2. id  |   cid |   name    | .... (and so on)
  3. -------------------------------------------------------
  4. 1   |   1   |  Cat 1.1  |   ....
  5. 2   |   1   |  Cat 1.2  |   ...
  6. 3   |   2   |  Cat 2.1  |   ...
  7. 4   |   1   |  Cat 1.3  |   ..
  8. 5   |   2   |  Cat 2.2  |   ...
  9. ...
  10.  

I hope this will make some things clear. so the field cid corresponds with an id in the first table.



the prefix_itemmall_items is a bit tougher.
  1.  
  2. id  |   sid |   fid |   price   |   type    |   ...
  3. ----------------------------------------------------------------------------------
  4. 1   |   1   | view below*   |  your price   |  1 or 0 **    |   ....
  5. 2   |   1   |   *   |  your price   |   **  |   ....
  6. 3   |   1   |   *   |  your price   |   **  |   ....
  7. 4   |   2   |   *   |  your price   |   **  |   ...
  8. ...
  9.  


sid coresponds with the previous table (prefix_itemmall_subcategory) . So the in the example above, it will create 3 images (sid = 1), in the subcategory Cat1.1, with category name: Test Cat

the field fid, correspons with an item id (not type, or num, but the 1 field). It's a unique intreger.

Price is in zulie or donation points. It's on of the two, it depends on what your type is set. 1 is donation, 0 is zulie.

For some other unexplaind fields
  • stats : like + 24% MP consumption or, +35 INT, etcetra.
  • refine: 1 is enable refine, 0 is disable refine
  • socket: 1 is enable socket, 0 is disable socket.



Configuration
if you open itemmall.php you'll see this:
  1.  
  2. $MySQLHost = 'localhost'; // Put here your Host,
  3. $MySQLUser = 'root'; // Put here your user;
  4. $MySQLPass = ''; // Put here your pass;
  5. $MySQLSlDB = ''; // Put here your Database;
  6. $MySQLPort = '3306';    // MySQL port
  7.  
  8. define('prefix', 'prefix_');
  9. $ShowErrors = true;     // true | false
  10. $ItemsOnRow = '10';     // Items on row. (Doesn't work [to much time])
  11. $ItemsOnPage = '10';    // Items on page. (Doesn't work [to much time])
  12. $ImageDir = '_itemmall/';   // don't forget the backslash...
  13.  
  14. $AccountID = '1';   // The main var $AccountID, has to be filed with the account id than your login script or what ever recieves. So make I made it realy easy...
  15.  

I don't think I have to explain much, you can redirect the $MySQL_vars, to the once's in your config. Leaving the originals unchanged.
example
  1.  
  2. // You have your database data in $Config['host'] things? You do it like this:
  3. $MySQLHost = $Config['host']; // Put here your Host,
  4. $MySQLUser = $Config['user']; // Put here your user;
  5.  


the rest is quite clear. But the last thing " $AccountID = '1'; "

$AccountID has to contain the account ID from wich user is currently logged in. So you'll have to make it's data change to wich user is using the item mall (not manulay ofcourse. But with your login script or what ever)

I've made that part extreamly easy, so I won't expect any dificulties (I hope) have fun.
itemmall_new.rar
(132.51 KiB) Downloaded 1198 times


All code provided is under the GNU General Public License
Last edited by Rifke on Mon Dec 03, 2007 9:36 pm, edited 1 time in total.
Rifke
Pero pero
Pero pero
 
Posts: 719
Joined: Thu Aug 09, 2007 3:01 pm
Location: Belgium

Re: Item mall

Postby john0114 on Tue Sep 04, 2007 7:22 pm

any issues with users refreshing their browsers to duplicate items?
john0114
Smoulie
Smoulie
 
Posts: 69
Joined: Tue Aug 21, 2007 8:40 am

Re: Item mall

Postby Rifke on Tue Sep 04, 2007 10:04 pm

Nope, the items will be deleted out of the user's database shopping cart.
Rifke
Pero pero
Pero pero
 
Posts: 719
Joined: Thu Aug 09, 2007 3:01 pm
Location: Belgium

Re: Item mall

Postby Dinosaur on Wed Sep 05, 2007 10:44 pm

hmm, i dont get what you mean by the put in your login script which part of it or can you just help me out if you dont mind?
thanks if you do
dinosaur
Dinosaur
Jelly Bean
Jelly Bean
 
Posts: 15
Joined: Wed Sep 05, 2007 10:38 pm

Re: Item mall

Postby Rifke on Thu Sep 06, 2007 7:08 pm

You have to retieve the account id if the user that is currenty logged on.

With a loginscript like

  1.  
  2. $Sql = " SELECT id FROM accounts WHERE username='".$username."' AND password='".$password."' ";
  3. $Qry = @mysql_query($Sql) or die('Sorry, but there was a little database problem, and I was not able to log you on.');
  4.  
  5. $Arr = mysql_fetch_assoc($Qry);
  6.  
  7. $AccountID = $Arr['id'];
  8.  

You can put the $Arr['id']; in a $_SESSION.. or cookie or w/e.
Rifke
Pero pero
Pero pero
 
Posts: 719
Joined: Thu Aug 09, 2007 3:01 pm
Location: Belgium

Re: Item mall

Postby Flik on Wed Oct 03, 2007 11:12 pm

can you post a screenshoot?
User avatar
Flik
Smoulie
Smoulie
 
Posts: 49
Joined: Mon Sep 10, 2007 5:05 pm

Re: Item mall

Postby tchild on Sun Oct 28, 2007 1:10 am

I'm confused with the fid.. where do I find it? (I'm trying to do skill books and other items not in the itemmall_full.sql) What's the backslash? When I click on the categories, it just brings me to http://localhost/?cid=1 which shows my homepage...

Is there a script or something on how to make my item mall a pop-up when I click on 'Item Mall' link? I want to make a pop-up since the Item Mall list goes all the way to the corner and away from the center.
tchild
Jelly Bean
Jelly Bean
 
Posts: 20
Joined: Sun Oct 28, 2007 1:03 am

Re: Item mall

Postby Rifke on Sun Oct 28, 2007 7:16 pm

fid: Full Item ID this interger referes to the unique ID in full_itemmall
Rifke
Pero pero
Pero pero
 
Posts: 719
Joined: Thu Aug 09, 2007 3:01 pm
Location: Belgium

Re: Item mall

Postby tchild on Sun Oct 28, 2007 9:11 pm

Rifke wrote:fid: Full Item ID this interger referes to the unique ID in full_itemmall


So If the items not in the full_itemmall, I need to make my own or edit it?
How does the images work? Like how am I suppose to put images? Right now the images are 'X's Can you give me an example of the Image directory for the Item Mall? I'm confused at:

$ImageDir = '_itemmall/'; // don't forget the backslash...
tchild
Jelly Bean
Jelly Bean
 
Posts: 20
Joined: Sun Oct 28, 2007 1:03 am

Re: Item mall

Postby Rifke on Mon Oct 29, 2007 1:01 am

In the table: itemmall_full you're got a table imgname. That name referes to a picture in the $ImageDir.

Images have to be jpg or gif.
Rifke
Pero pero
Pero pero
 
Posts: 719
Joined: Thu Aug 09, 2007 3:01 pm
Location: Belgium

Next

Return to PHP / Web Guides, Scripts and tools.

Who is online

Users browsing this forum: No registered users and 2 guests

cron