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

Re: Item mall V2

Postby Raavi on Tue Nov 30, 2010 2:54 pm

rave wrote:waa i double post it T_T sorry but promise i dont know how to code T_T

i didn't say anything about coding, ctrl+f search the table were it got token now, recplace it with the reborn table not that hard imo
Raavi
Rackie
Rackie
 
Posts: 243
Joined: Sun May 30, 2010 4:15 pm

Re: Item mall V2

Postby rave on Wed Dec 01, 2010 12:03 am

coding what should i change on the coding of item mall.php? then vcategory vitem and forsale.sqls

sorry i dont really know T_T

my reborn column is in character.sql and the zuly and donate are in accounts.sql its in different sqls T_T

are you saying that i will just add reborn = r on the category at each sql for item mall it will automatically read as reborn??? im very sorry im not good at coding php

thanks for helping me
rave
Clown
Clown
 
Posts: 459
Joined: Thu Dec 10, 2009 1:07 pm

Re: Item mall V2

Postby Rifke on Wed Dec 01, 2010 11:22 pm

It is more about the SQL queries than it is when coding the PHP.

Have you tried to read the code yet?

  1.  
  2. $item_mall->setlog(true); // enable/disable to create an information stream of who bought what
  3. $item_mall->setaccount_id(1); // set the users account ID
  4. $item_mall->setalevel(100); // set the users access level
  5.  


I'll try to help you change the code, but since I don't have the projects compiled on my computer I can not guarantee it will work.

As you can see you have the $item_mall->setaccount_id(1) < if put your character ID in there, we are pass most of the trouble already. the only thing that is left is to change the SQL queries.

If you found a way to get the current character (I do not suggest it by using a $_GET variable). We can change the SQL queries

Find the function decreaseMoney($type,$amount)
  1.  
  2. if ( $type == 'D' ) {
  3.             $sql = "SELECT donation FROM accounts WHERE id=%d;";
  4.         } else {
  5.             $sql = "SELECT zulystorage FROM accounts WHERE id=%d;";
  6.         }
  7.  

You can change the 'D' to 'R' for reborn poins. if that suits you of course... or leave it there to keep it simple.
Now we can change some SQL queries Whohooo!!!
  1.  
  2. if ( $type == 'D' ) {
  3.             $sql = "SELECT reborn_points FROM characters WHERE id=%d;";
  4.         } else {
  5.             $sql = "SELECT zuly FROM characters WHERE id=%d;";
  6.         }
  7.  


When we scroll down the code we find in the same function the following lines
  1.  
  2. if ( $type == 'D' ) {
  3.                     $sql = "UPDATE accounts SET donation=donation-%d WHERE id=%d AND online=1;";
  4.                 } else {
  5.                     $sql = "UPDATE accounts SET zulystorage=zulystorage-%d WHERE id=%d AND online=1;";
  6.                 }
  7.  

Here we have to change it to (maybe you know what to change already Go for it!)
  1.  
  2.                 if ( $type == 'D' ) {
  3.                     $sql = "UPDATE characters SET reborn_points=reborn_points-%d WHERE id=%d;";
  4.                 } else {
  5.                     $sql = "UPDATE characters SET zuly=zuly-%d WHERE id=%d;";
  6.                 }
  7.  

Notice that a player can now purchase items while still being in game.. This might a user to abuse the item mall...

Now the it will become tricky adding the item to a user's inventory, since the account id is not available anymore...
scroll down to the function addItemToCar

find the SQL querie
  1.  
  2. $sql = "INSERT INTO storage (owner,itemnum,itemtype,refine,slotnum,socketed,count) VALUES (%d,%d,%d,%d,%d,%d,%d);";
  3.  

to
  1.  
  2. $sql = "INSERT INTO items (owner,itemnum,itemtype,refine,slotnum,socketed,count) VALUES (%d,%d,%d,%d,%d,%d,%d);";
  3.  


Phew lucky storage and items use the same database layout (WIN ^^)

Now we continue, Phew hard word take a break, get something to eat or drink before we contune
****
* Some elevator music in the meanwhile *
***

Now we scroll down to the next function getFreeSlot
  1.  
  2. $sql = "SELECT slotnum FROM storage WHERE owner=%d;";
  3.  


We change this to
  1.  
  2. $sql = "SELECT slotnum FROM items WHERE owner=%d;";
  3.  


A little bit further in the same function we find the following for loop for ( $x = 159; $x >= 1; $x--) {

I am not sure about the number 159 ... Since you're using the inventory, the numbers are different.... so you'll have to find it yourself, or a friendly person can help me out here


And that should be about it :)


Good luck
Rifke
Pero pero
Pero pero
 
Posts: 719
Joined: Thu Aug 09, 2007 3:01 pm
Location: Belgium

Re: Item mall V2

Postby rave on Thu Dec 02, 2010 2:39 pm

honestly sir Rifke i dont understand your reply at all is there something like i will download and ready to use reborn points on character.sql same like vps and dps on accounts.sql? like on the 1st page T_T
rave
Clown
Clown
 
Posts: 459
Joined: Thu Dec 10, 2009 1:07 pm

Re: Item mall V2

Postby Rifke on Thu Dec 02, 2010 2:45 pm

It is a walk-through on how to change the code yourself
Rifke
Pero pero
Pero pero
 
Posts: 719
Joined: Thu Aug 09, 2007 3:01 pm
Location: Belgium

Re: Item mall V2

Postby rave on Fri Dec 03, 2010 2:14 am

ok sir let me try it 1st ^^

just to clear this walk through let me use my reborn points at characters.sql as POINTS to redeem items on my VOTE MALL SHOP right?

or i will create another vote mall and named it REBORN SHOP??

cause i wanted to have like the VOTEMALL the vmall vcat and vitem and others something like that ^^
rave
Clown
Clown
 
Posts: 459
Joined: Thu Dec 10, 2009 1:07 pm

Re: Item mall V2

Postby rave on Fri Nov 25, 2011 12:23 am

Mike567 wrote:when i go http://localhost/itemmal_v2.php then i click the category its say
http://localhost/&i_cid=2&i_par=1

EDIT:nvm its need http://localhost/index1.php?op=itemmall_v2
btw, rifke can you give me the auto logout when you closed the page?

EDIT:ohhh its auto logout, btw thnx for this great and friendly item mall :D


i got this problem anyone care to help me?
for mike567 how did you fixed it please help i dont know how to put this ?op=itemmall_v2 T_T
thanks in advance
rave
Clown
Clown
 
Posts: 459
Joined: Thu Dec 10, 2009 1:07 pm

Re: Item mall V2

Postby rave on Fri Nov 25, 2011 12:49 pm

rave wrote:
Mike567 wrote:when i go http://localhost/itemmal_v2.php then i click the category its say
http://localhost/&i_cid=2&i_par=1

EDIT:nvm its need http://localhost/index1.php?op=itemmall_v2
btw, rifke can you give me the auto logout when you closed the page?

EDIT:ohhh its auto logout, btw thnx for this great and friendly item mall :D


i got this problem anyone care to help me?
for mike567 how did you fixed it please help i dont know how to put this ?op=itemmall_v2 T_T
thanks in advance


Anyone please
rave
Clown
Clown
 
Posts: 459
Joined: Thu Dec 10, 2009 1:07 pm

Re: Item mall V2

Postby rave on Sun Nov 27, 2011 3:39 pm

rave wrote:
rave wrote:
Mike567 wrote:when i go http://localhost/itemmal_v2.php then i click the category its say
http://localhost/&i_cid=2&i_par=1

EDIT:nvm its need http://localhost/index1.php?op=itemmall_v2
btw, rifke can you give me the auto logout when you closed the page?

EDIT:ohhh its auto logout, btw thnx for this great and friendly item mall :D


i got this problem anyone care to help me?
for mike567 how did you fixed it please help i dont know how to put this ?op=itemmall_v2 T_T
thanks in advance


Anyone please


fix thanks for the help OSROSE
rave
Clown
Clown
 
Posts: 459
Joined: Thu Dec 10, 2009 1:07 pm

Re: Item mall V2

Postby PurpleYouko on Mon Nov 28, 2011 1:07 am

problem is that nobody here knows a damn thing about the item mall that Rifke set up way back. :?
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

PreviousNext

Return to PHP / Web Guides, Scripts and tools.

Who is online

Users browsing this forum: No registered users and 6 guests