Item mall V2

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

Rate this script

0-2
8
28%
3-4
0
No votes
5-6
2
7%
7-8
3
10%
9-10
16
55%
 
Total votes : 29

Item mall V2

Postby Rifke on Wed Aug 19, 2009 5:39 pm

Item mall version 2
Response to: viewtopic.php?f=28&t=137
I’ve written this new version of the item mall because the previous one was just bad… To heavy and crappy coded. This one is better. I’ve removed pretty much of the HTML code, all tables are handled within a self-written table class. So that cleared up a lot or old code, it just needs to be tested. If anyone is willing to sacrifice their free time feel free.
Code should be easy readable.

Quick how-to:
table: mall_category
Make a list of all your categories etc
  • cid : Category ID – auto increment
  • ctitle: Category title
  • cdesc: Description of category
  • cparent: -1 to show on the main page, an different number referring to the cid from an other category, so you’ll get a sub category.
  • cminlevel: To get like VIP – Only items. Or GM only items for GMs that can’t make items or something. Or to create different levels like 101, 104 etc…
  • chidden: 0 to show, 1 to hide the category (like if you’re adding stuff so it won’t show up for other users. But you can also set the cminlevel to 300+ or so depending on what you like)
table: mall_items
Put the available items in here. Tables speak for them self. Field image is not used.. Could be added when necessary.
The other things speak for them self eg
  • item_id: 337
  • item_type: 11
  • item_name: Topaz [7]
  • item_desc: +35int
table: mall_forsale
This holds all the items you’re about to sell.
  • cid: Category id -> from mall_category
  • iid: item id -> from mall_items
  • price: INTEGER format, could also be negative to increase someone’s money?! Be warned! Lol
  • payment: Z for zully, D: for donationpoints
  • quantity: amount of that items, eg: 999 and for bullets would give you 999 bullets off course.
  • ref_able: is the item refineable if yes add a number between 1-9 for the grade to give
  • soc_able: does the item contain a socket?



To make it load in as a module
It has to be included in an other page (or to make it standalone it requires a random parameters to make the url checking posible eg: itemmall_v2.php?p=itemmall_or_what_ever

In the itemmall_v2 You'll find:
// Configuring some data
$item_mall->setlog(true); // enable/disable to create an information stream of who bought what
$item_mall->setaccount_id(1); // set the users account ID
$item_mall->setalevel(100); // set the users access level

You'll have to retrieve the account id, and the access level to get the stuff to work fine.




Download: DOWNLOAD NOW!
Password: myrose


Dynasty CMS plugin
Add this file to your administrator's dir, and than you can add a new link to in your administrator's panel.
  1. <a href="?op=add_dpts">Add Donation Points</a>

:ugeek: Warning: Don't forget to change the SQL queries if you use an the other donation field.

add_dpts.zip
Dynasty CMS plugin
(952 Bytes) Downloaded 1476 times
Attachments
itemmall_v2.txt
Item mall with login module
(16.38 KiB) Downloaded 1623 times
Last edited by Rifke on Mon Sep 14, 2009 12:35 pm, edited 5 times in total.
Rifke
Pero pero
Pero pero
 
Posts: 719
Joined: Thu Aug 09, 2007 3:01 pm
Location: Belgium

Re: Item mall V2

Postby thriel on Wed Aug 19, 2009 6:34 pm

does this version also support both donation points and zullie ?
We Have it all at RoseZA... Image
Image
User avatar
thriel
Rackie
Rackie
 
Posts: 194
Joined: Fri Jun 05, 2009 7:36 am
Location: South Africa

Re: Item mall V2

Postby Rifke on Wed Aug 19, 2009 8:53 pm

Yes

If you have read through all the details
...
table: mall_forsale
This holds all the items you’re about to sell.

* cid: Category id -> from mall_category
* iid: item id -> from mall_items
* price: INTEGER format, could also be negative to increase someone’s money?! Be warned! Lol
* payment: Z for zully, D: for donationpoints
* quantity: amount of that items, eg: 999 and for bullets would give you 999 bullets off course.
* ref_able: is the item refineable if yes add a number between 1-9 for the grade to give
* soc_able: does the item contain a socket?
Rifke
Pero pero
Pero pero
 
Posts: 719
Joined: Thu Aug 09, 2007 3:01 pm
Location: Belgium

Re: Item mall V2

Postby Mike567 on Thu Aug 20, 2009 7:01 am

i go on http://localhost/itemmall_v2.php
then its work fine i click the Muse Staff, then the url is http://localhost&i_cid=9&i_par=1 now,

it not working on me... and not requird login page
User avatar
Mike567
Antares
Antares
 
Posts: 392
Joined: Wed Mar 19, 2008 4:27 am
Location: Philippines

Re: Item mall V2

Postby Mike567 on Thu Aug 20, 2009 11:37 am

its kinda little weird,

i'm using dynastycms rev 1. but i really don't understand this,
User avatar
Mike567
Antares
Antares
 
Posts: 392
Joined: Wed Mar 19, 2008 4:27 am
Location: Philippines

Re: Item mall V2

Postby Rifke on Thu Aug 20, 2009 2:40 pm

...
To make it load in as a module
It has to be included in an other page (or to make it standalone it requires a random parameters to make the url checking posible eg: itemmall_v2.php?p=itemmall_or_what_ever



Mike567 wrote:i go on http://localhost/itemmall_v2.php
then its work fine i click the Muse Staff, then the url is http://localhost&i_cid=9&i_par=1 now,

it not working on me... and not requird login page


So you'll have to go to
http://localhost/itemmall_v2.php?p=random


The login is not my concern, you'll have to add/create it your own...



If you use dynasty CMS you'll just add a new link in user panel. to index.php?p=itemmall_v2, and then add the itemmall_v2.php under modules (I think) and it should work.
Rifke
Pero pero
Pero pero
 
Posts: 719
Joined: Thu Aug 09, 2007 3:01 pm
Location: Belgium

Re: Item mall V2

Postby Mike567 on Thu Aug 20, 2009 4:34 pm

ok, thnx

but when i go when i go on user panel then click the item mall which direct me into t
his http://localhost/index.php?op=itemmall_v2 URL. then the result is only Main and which direct to
this http://localhost/index.php?op=itemmall_v2 URL.

and i see on the itemmal_v2 there's a code include('class.table.inc.php');
but i don't have class.table.inc.php

sorry bcz i only noob at php
User avatar
Mike567
Antares
Antares
 
Posts: 392
Joined: Wed Mar 19, 2008 4:27 am
Location: Philippines

Re: Item mall V2

Postby Rifke on Thu Aug 20, 2009 9:42 pm

In the .ZIP file you're able to download from the URL in the first post, there are three files included

  • itemmall_v2.php
  • class.table.inc.php
  • sql_with_some_pre_made_categories.sql


Now you only have moved itemmall_v2.php to your modules dir... Add the class.table.inc.php there to and it should work...
It makes sence if you click on Main than you redirect to your MAIN page... in this case the itemmall page.
Rifke
Pero pero
Pero pero
 
Posts: 719
Joined: Thu Aug 09, 2007 3:01 pm
Location: Belgium

Re: Item mall V2

Postby Mike567 on Fri Aug 21, 2009 1:09 pm

thx, i saw it now
User avatar
Mike567
Antares
Antares
 
Posts: 392
Joined: Wed Mar 19, 2008 4:27 am
Location: Philippines

Re: Item mall V2

Postby Mike567 on Fri Aug 21, 2009 1:17 pm

btw, how to add points?

donation points or nb_donation points?

edit:and can you give a script that i can add the donation points in admin panel.
bcz i try but nothing happend. i only edit the change the character name

  1. <?php if(!session_is_registered(Admin)) {
  2. die('Access Denied');
  3. }
  4. ?>
  5. <form id="form1" name="form1" method="post" action="?op=name_change">
  6. <table width="275" border="0" align="center">
  7.   <tr>
  8.     <td width="98">Account Name: </td>
  9.     <td width="167"><label>
  10.       <input type="text" name="textfield1">
  11.     </label></td>
  12.   </tr>
  13.   <tr>
  14.     <td width="98"> Donation PT: </td>
  15.     <td width="167"><label>
  16.       <input type="text" name="textfield2">
  17.     </label></td>
  18.   </tr>
  19.   <tr>
  20.     <td>Are you sure? </td>
  21.     <td><label>
  22.       <input name="sure" type="checkbox" id="sure" value="checkbox">
  23.     </label></td>
  24.   </tr>
  25. </table>
  26.  
  27. <p align="center">
  28.   <input name="submit" type="submit" id="submit" />
  29.   <br />
  30.   <br />
  31. <?php
  32. if(isset($_POST['sure'])) {
  33. mysql_query("UPDATE accounts SET donation = '".$_POST['textfield2']."' WHERE username = '".$_POST['textfield1']."'");
  34. echo 'Add DPT Succesfully!.';
  35. } else {
  36. echo 'If you want to add the donation points, then click the box!';
  37. }
  38. ?></p>
  39.  
  40. </form>
  41.  
User avatar
Mike567
Antares
Antares
 
Posts: 392
Joined: Wed Mar 19, 2008 4:27 am
Location: Philippines

Next

Return to PHP / Web Guides, Scripts and tools.

Who is online

Users browsing this forum: No registered users and 9 guests

cron