The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
mysql shop
Author Message
Pidrila
Apprentice
*

Posts: 36
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Apr 2013
Reputation: 0



Post: #1
mysql shop
I have an idea to make an shop in web page..
Ive seen this on other shard and i would like to get it for mee too Smile
i guess many people would like to get this, so who can help please Smile

I have a Vendor, one vendor for all players, they can set items to sell or buy items from this vendor, and all is throught mysql but only in game..

At first here is what my database looks like where all items is collected in there from vendor
[Image: rsz_1phpmyadmin.jpg]

now this is what my vendor dialog looks like in game
[Image: rsz_vendor.jpg]

and there is a scp dialog looks like when arraying the result

Code:
[DIALOG d_auction_item_list] //should be called with the bankbox of the auctioneer as default object
0,60
PAGE 0
NOMOVE
button 489 450 24 24 1 0 3 //my items
button 646 4 24 24 1 0 4 //search button
button 22 60 24 24 1 0 5 //platemail
button 22 80 24 24 1 0 6 //ringmail
button 22 100 24 24 1 0 7 //chainmail
button 22 120 24 24 1 0 8 //studded
button 30 140 24 24 1 0 9 //crystal sets
button 30 160 24 24 1 0 20 //crystal sets
button 15 180 24 24 1 0 10 //weapons
button 15 200 24 24 1 0 11 //bows
button 15 220 24 24 1 0 12 //mounts
button 349 450 24 24 1 0 13 // all items
button 419 450 24 24 1 0 14 //sell item
button 559 450 24 24 1 0 15 // cashout
button 15 240 24 24 1 0 16 //bottles
button 15 260 24 24 1 0 17 //imbues
button 13 415 24 24 1 0 18 //misc
button 15 40 24 24 1 0 19 //armors
resizepic 0 0 9300 800 480
resizepic 440 3 3000 200 22
resizepic 645 3 3000 60 22
resizepic 345 442 3000 65 35
resizepic 415 442 3000 65 35
resizepic 485 442 3000 65 35
resizepic 555 442 3000 65 35
resizepic 8 40 3000 253 400 //kreisa puse
resizepic 265 40 3000 528 400 //labaa puse
resizepic 8 26 3000 785 8 //augseja dala
dtext 8 5 6208 Uo Company Walmart
dtext 145 5 014D *
dtext 165 5 0112 - Sorting by latest Added item
dtext 650 40 014D Price (gp)
dtext 625 40 014D *
dtext 380 40 014D Name
dtext 654 3 6208 Search
dtext 300 40 014D Photo
dtext 350 448 014D All items
dtext 420 448 0112 Sell item
dtext 490 448 0225 My items
dtext 563 448 2015 Cashout
dtext 15 40 0112 Armors
dtext 25 60 6208 Platemail
dtext 25 80 6208 Ringmail
dtext 25 100 6208 Chainmail
dtext 25 120 6208 Studded/Leather
dtext 25 140 6208 Crystal
dtext 25 160 6208 Bone
dtext 15 180 0112 Weapons
dtext 15 200 0112 Bows
dtext 15 220 0112 Mounts
dtext 15 240 0112 Bottles
dtext 15 260 0112 Imbues
dtext 15 415 0112 Misc
LOCAL.VALUE=<src.tag0.cashpoints>
IF (<LOCAL.VALUE> = 0)
dtext 100 448 6208 0 Gp
ELSEIF (<LOCAL.VALUE> >= 1000) && (<LOCAL.VALUE> <= 9999)
LOCAL.NEWHALF=<dLOCAL.VALUE>>
dtext 100 448 6208 <dLOCAL.newhalf> Gp
ELSEIF (<LOCAL.VALUE> >= 10000) && (<LOCAL.VALUE> <= 99999)
LOCAL.NEWHALF=<STRSUB 0 2 <dLOCAL.VALUE>>
LOCAL.NEWHALF2=,<STRSUB 2 3 <dLOCAL.VALUE>>
dtext 100 448 6208 <dLOCAL.newhalf><LOCAL.newhalf2> Gp
ELSEIF (<LOCAL.VALUE> >= 100000) && (<LOCAL.VALUE> <= 999999)
LOCAL.NEWHALF=<STRSUB 0 3 <dLOCAL.VALUE>>
LOCAL.NEWHALF2=,<STRSUB 3 3 <dLOCAL.VALUE>>
dtext 100 448 6208 <dLOCAL.newhalf><LOCAL.newhalf2> Gp
ELSEIF (<LOCAL.VALUE> >= 1000000) && (<LOCAL.VALUE> <= 9999999)
LOCAL.NEWHALF=<STRSUB 0 1 <dLOCAL.VALUE>>
LOCAL.NEWHALF2=,<STRSUB 1 3 <dLOCAL.VALUE>>
LOCAL.NEWHALF3=,<STRSUB 4 3 <dLOCAL.VALUE>>
dtext 100 448 6208 <dLOCAL.newhalf><LOCAL.newhalf2><LOCAL.newhalf3> Gp
ELSEIF (<LOCAL.VALUE> >= 10000000) && (<LOCAL.VALUE> <= 99999999)
LOCAL.NEWHALF=<STRSUB 0 2 <dLOCAL.VALUE>>
LOCAL.NEWHALF2=,<STRSUB 2 3 <dLOCAL.VALUE>>
LOCAL.NEWHALF3=,<STRSUB 5 3 <dLOCAL.VALUE>>
dtext 100 448 6208 <dLOCAL.newhalf><LOCAL.newhalf2><LOCAL.newhalf3> Gp
ELSEIF (<LOCAL.VALUE> >= 100000000) && (<LOCAL.VALUE> <= 1000000000)
LOCAL.NEWHALF=<STRSUB 0 3 <dLOCAL.VALUE>>
LOCAL.NEWHALF2=,<STRSUB 3 3 <dLOCAL.VALUE>>
LOCAL.NEWHALF3=,<STRSUB 6 3 <dLOCAL.VALUE>>
dtext 100 448 6208 <dLOCAL.newhalf><LOCAL.newhalf2><LOCAL.newhalf3> Gp
endif
dtext 15 448 0112 Money earned:
dtextentry 443 3 255 25 0112

////PAGE SYSTEM
//DB.QUERY "SELECT * FROM <tag.auction_table> ORDER BY `id` DESC LIMIT 99999999";
DB.QUERY "SELECT COUNT(*) as category_allitems FROM <tag.auction_table> ORDER BY `id` DESC LIMIT 99999999";
src.ctag.totalpages=<eval (((<db.row.0.category_allitems>-1) / 8) + 1)>
dtext 715 3 0481 Items: <eval (<db.row.0.category_allitems>)>
dtext 623 448 0481 Page: [<eval <src.ctag.actualpage>>/<eval <src.ctag.totalpages>>]
if <eval (<db.row.0.category_allitems> < 1)>
        dtext 380 100 0112 There is no items in the Walmart
        endif

//Mysql query that fetches the rows from <src.ctag.dialogindex> to <src.ctag.dialogindex>+8
DB.QUERY "SELECT * FROM <tag.auction_table> ORDER BY `vip` DESC, `id` DESC LIMIT <eval (<src.ctag.dialogindex>)>,<eval (<src.ctag.dialogindex>+8)>";
FOR index 0 7
    LOCAL.VALUE=<db.row.<eval (<local.index>)>.currentbid>
    if <db.row.<eval (<local.index>)>.uid>
        local.y=(((<local.index>)*45)+65)
        local.x=(((<local.index>)*45)+55)
        local.xs=(((<local.index>)*45)+97)
        local.ys=(((<local.index>)*45)+68)
        local.ys2=(((<local.index>)*45)+58)
        local.buy=(((<local.index>)*45)+66)
        local.name=(((<local.index>)*45)+80)
        if <eval (<db.row.<eval (<local.index>)>.vip> > 0)>
        dtext 380 <local.y> 014d <uid.<db.row.<eval (<local.index>)>.uid>.name> -VIP-
        else
        dtext 380 <local.y> 0 <uid.<db.row.<eval (<local.index>)>.uid>.name>
        endif
        resizepic 640 <local.ys2> 3000 100 42 //Lai naudu redz
        button 759 <local.ys> 5224 5003 1 0 <eval (<db.row.<eval (<local.index>)>.id>+10)>
        IF (<LOCAL.VALUE> >= 1) && (<LOCAL.VALUE> <= 9999)
        LOCAL.NEWHALF=<dLOCAL.VALUE>>
        dtext 650 <local.y> 0 <dLOCAL.newhalf>
        ELSEIF (<LOCAL.VALUE> >= 10000) && (<LOCAL.VALUE> <= 99999)
                   LOCAL.NEWHALF=<STRSUB 0 2 <dLOCAL.VALUE>>
                LOCAL.NEWHALF2=,<STRSUB 2 3 <dLOCAL.VALUE>>
        dtext 650 <local.y> 0 <dLOCAL.newhalf><LOCAL.newhalf2>
        ELSEIF (<LOCAL.VALUE> >= 100000) && (<LOCAL.VALUE> <= 999999)
                   LOCAL.NEWHALF=<STRSUB 0 3 <dLOCAL.VALUE>>
                LOCAL.NEWHALF2=,<STRSUB 3 3 <dLOCAL.VALUE>>
        dtext 650 <local.y> 0 <dLOCAL.newhalf><LOCAL.newhalf2>
        ELSEIF (<LOCAL.VALUE> >= 1000000) && (<LOCAL.VALUE> <= 9999999)
                   LOCAL.NEWHALF=<STRSUB 0 1 <dLOCAL.VALUE>>
                LOCAL.NEWHALF2=,<STRSUB 1 3 <dLOCAL.VALUE>>
                LOCAL.NEWHALF3=,<STRSUB 4 3 <dLOCAL.VALUE>>
        dtext 650 <local.y> 0 <dLOCAL.newhalf><LOCAL.newhalf2><LOCAL.newhalf3>
        ELSEIF (<LOCAL.VALUE> >= 10000000) && (<LOCAL.VALUE> <= 99999999)
                   LOCAL.NEWHALF=<STRSUB 0 2 <dLOCAL.VALUE>>
                LOCAL.NEWHALF2=,<STRSUB 2 3 <dLOCAL.VALUE>>
                LOCAL.NEWHALF3=,<STRSUB 5 3 <dLOCAL.VALUE>>
        dtext 650 <local.y> 0 <dLOCAL.newhalf><LOCAL.newhalf2><LOCAL.newhalf3>
        ELSEIF (<LOCAL.VALUE> >= 100000000) && (<LOCAL.VALUE> <= 1000000000)
                   LOCAL.NEWHALF=<STRSUB 0 3 <dLOCAL.VALUE>>
                LOCAL.NEWHALF2=,<STRSUB 3 3 <dLOCAL.VALUE>>
                LOCAL.NEWHALF3=,<STRSUB 6 3 <dLOCAL.VALUE>>
        dtext 650 <local.y> 0 <dLOCAL.newhalf><LOCAL.newhalf2><LOCAL.newhalf3>
        endif
        tilepichue 300 <local.x> <eval <uid.<db.row.<eval (<local.index>)>.uid>.id>> <eval <uid.<db.row.<eval (<local.index>)>.uid>.color>>
        resizepic 275 <local.xs> 9300 507 5 <db.row.<eval (<local.index>)>.uid>
        resizepic 750 <local.buy> 9300 37 20 <db.row.<eval (<local.index>)>.uid>
        dtext 758 <local.buy> 0112 Buy
        dtext 650 <local.name> 0481 By <uid.<db.row.<eval (<local.index>)>.seller>.name>
        if (<uid.<db.row.<eval (<local.index>)>.uid>.istalisman>)
        elif (<uid.<db.row.<eval (<local.index>)>.uid>.isarmor>)
        dtext 381 <local.name> 0481 Dur: <uid.<db.row.<eval (<local.index>)>.uid>.MORE1L>/<uid.<db.row.<eval (<local.index>)>.uid>.MORE1H>
        ELif (<uid.<db.row.<eval (<local.index>)>.uid>.isjeweli>)
        dtext 500 <local.name> 0481 Plus +<uid.<db.row.<eval (<local.index>)>.uid>.MOREX>
        dtext 381 <local.name> 0481 Charges: <uid.<db.row.<eval (<local.index>)>.uid>.MOREM>
        ELif (<uid.<db.row.<eval (<local.index>)>.uid>.isjewelires>)
        dtext 381 <local.name> 0481 Charges: <uid.<db.row.<eval (<local.index>)>.uid>.MOREM>
        ELIF (<uid.<db.row.<eval (<local.index>)>.uid>.type>==t_jewelry)
        dtext 381 <local.name> 0481 Charges: <eval <uid.<db.row.<eval (<local.index>)>.uid>.tag.charge>>
        ELIF (<uid.<db.row.<eval (<local.index>)>.uid>.type>==t_charm)
        dtext 381 <local.name> 0481 Charges: <eval <uid.<db.row.<eval (<local.index>)>.uid>.morex>>
        ELIF (<uid.<db.row.<eval (<local.index>)>.uid>.baseid>==i_treature_map)
        dtext 381 <local.name> 0481 Level: <eval <uid.<db.row.<eval (<local.index>)>.uid>.tag.tlevel>>
        ELIF <uid.<db.row.<eval (<local.index>)>.uid>.isweapon>
        dtext 500 <local.name> 0481 Dmg: <uid.<db.row.<eval (<local.index>)>.uid>.DAM>
        dtext 381 <local.name> 0481 Dur: <uid.<db.row.<eval (<local.index>)>.uid>.MORE1L>/<uid.<db.row.<eval (<local.index>)>.uid>.MORE1H>
        ELIF <uid.<db.row.<eval (<local.index>)>.uid>.amount> > 1
        dtext 381 <local.name> 0481 Amount: <uid.<db.row.<eval (<local.index>)>.uid>.amount>
        ENDIF
    endif
ENDFOR

And there is the mysql code that inserts info in database
Code:
DB.EXECUTE "INSERT INTO <topobj.tag.auction_table>(uid, amount, category, name, currentbid, step, minimum_price, saletime, seller) VALUES('<link.uid>','<link.amount>','<eval <tag.category>>','<link.name>','<eval (<argtxt[1]>)>','0','0','99999999999','<src.uid>');"
DB.query "SELECT saletime FROM <topobj.tag.auction_table> WHERE uid='<link.uid>'"

How i can transfer all this, to set this vendor dialog appears on website??

1. i need all pictures get from server and host them to website, okey i can do that.. but i need each color to be hosted of each armor,weapon ect? or just 1 and then i can change color like ingame <hue> ??

If somebody knows about this then please give me advice Smile Cheers.
(This post was last modified: 01-27-2014 11:56 PM by Pidrila.)
01-27-2014 09:09 PM
Find all posts by this user Like Post Quote this message in a reply
admin phoenix
Master
**

Posts: 354
Likes Given: 1
Likes Received: 23 in 13 posts
Joined: Mar 2012
Reputation: 3



Post: #2
RE: mysql shop
make own columns for color, gumppic ids and so on Smile
01-29-2014 01:06 AM
Find all posts by this user Like Post Quote this message in a reply
Pidrila
Apprentice
*

Posts: 36
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Apr 2013
Reputation: 0



Post: #3
RE: mysql shop
(01-29-2014 01:06 AM)admin phoenix Wrote:  make own columns for color, gumppic ids and so on Smile

yes, but how do i appear these gumppic on html page??
01-29-2014 01:20 AM
Find all posts by this user Like Post Quote this message in a reply
Feeh
Sphere Developer
*****

Posts: 156
Likes Given: 6
Likes Received: 40 in 29 posts
Joined: Sep 2012
Reputation: 4



Post: #4
RE: mysql shop
Since sphere does not allow the user to deal with images, you have these options:

1-Export every item+hue image creating a incredible large image database on your website, then export the item id and hue to the SQL table then loading these values on PHP/ASP/whatever

2-Create a custom application, to be started from scripts with SYSCMD, that export the requested item image as base64 string, then storing it to the SQL table and loading the string as image from the web part

3-Export the item id/hue to the SQL and create a PHP/ASP/whatever that is capable of reading the mul files on your web folder, generating the image and caching it

Feeh/Epila - Nightly releases / SphereWiki / Github Issues / Sphere's GitHub
(This post was last modified: 01-29-2014 04:16 AM by Feeh.)
01-29-2014 04:14 AM
Find all posts by this user Like Post Quote this message in a reply
admin phoenix
Master
**

Posts: 354
Likes Given: 1
Likes Received: 23 in 13 posts
Joined: Mar 2012
Reputation: 3



Post: #5
RE: mysql shop
01-29-2014 10:09 PM
Find all posts by this user Like Post Quote this message in a reply
Pidrila
Apprentice
*

Posts: 36
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Apr 2013
Reputation: 0



Post: #6
RE: mysql shop
how i can send sysmessage to play that says which item he buys.. cant get it.. doesnt work..

Code:
[PLEVEL 1]
f_status_add_fire_lord


[function f_status_add_fire_lord]
db.connect
if ( <DB.connected> )
DB.QUERY "SELECT * FROM ibf_members WHERE status_fire_lord='1'"
    if (<DB.ROW.NUMROWS> > 0)
        for R 0 <eval <DB.ROW.NUMROWS>-1>
        if (<DB.ROW.<eval <LOCAL.R>>.status_fire_lord> = 1)
        serv.newitem=i_fames
        DB.EXECUTE "UPDATE ibf_members SET status_fire_lord='0' WHERE name='<DB.ROW.<eval <LOCAL.R>>.name>'"
        new.cont=<uid.<DB.ROW.<eval <LOCAL.R>>.uid>.findlayer.21.uid>
        serv.<DB.ROW.<eval <LOCAL.R>>.uid>.sysmessage eee // this dont work..
        serv.log Succesfull!!
        endif
        end
    endif
endif
(This post was last modified: 02-05-2014 10:43 PM by Pidrila.)
02-05-2014 09:26 PM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #7
RE: mysql shop
ref1=<db.row.<dlocal.r>.uid>
ref1.sysmessage eee
02-05-2014 11:15 PM
Find all posts by this user Like Post Quote this message in a reply
Pidrila
Apprentice
*

Posts: 36
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Apr 2013
Reputation: 0



Post: #8
RE: mysql shop
i did this other way, But thanks Wink

Code:
try uid.<db.row.<eval <LOCAL.R>>.uid>.sysmessage @55 You just bought Fire Lord from Chaos Web Shop!
02-06-2014 12:03 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #9
RE: mysql shop
You are wellcome, however, if you are using 0.56x you don't need the TRY in this, and you can change <eval <local.r>> with <dlocal.r> (<dwhatever> just evals what you specify).
02-06-2014 12:31 AM
Find all posts by this user Like Post Quote this message in a reply
Pidrila
Apprentice
*

Posts: 36
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Apr 2013
Reputation: 0



Post: #10
RE: mysql shop
(02-06-2014 12:31 AM)XuN Wrote:  You are wellcome, however, if you are using 0.56x you don't need the TRY in this, and you can change <eval <local.r>> with <dlocal.r> (<dwhatever> just evals what you specify).

hmm, weird, i tryed to use without try before and it debuged me a error that cant resolve.. and im using 0.56b Wink
02-06-2014 05:05 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)