Final Fantasy Republic Forums  
 Home | Forums | Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
     
    
        
     
 
Final Fantasy Republic Forums  
Username:

Password:
CAPTCHA:
  
        
Closed Thread
 
LinkBack Thread Tools Display Modes
  rake
 
 
rake's Avatar
Sorceror|Supreme
 
Posts: 1,269
 
Reg: Jan 15 2002
 
ID: 4
 
RP: 0
 
None
None
None
None
     
 
Default  tata!! Itemshop!
02.17.02, 06:37:01
  Post #1 (permalink)
 
     

Hehe. I put this little thing together. It's nothing fancy, but it does it's job.
It works together with the points hack. Your items and the cost (in points) are kept in an array inside itemshop.php. You'll have to edit the file each time you want to add a new item.I might add database support for items later and a cp interface, but right now, it's good.
First, you'll need to add another profile field.
Title: Item or whatever you want to call it
Description: up to you
Max Input: 100
Field Length: 25
Display Order: current fields +1
Required: no
Hidden: no
Editable: no

it's basically just like the points. Remember the field number and change it in the file. Default is(if you haven't added any other fields before):
points: 5
item: 6

in itemshop.php you may want to change the $loop variable. Associated images should be put in the images/itemshop/ direcotry, and have the same name you gave the item in the array.
if you don't want associated images, you must take them out in the file and in the itemshop template.
upload the file itemshop.php

make a template called itemshop, and put in the contents of the itemshop.txt file

in the postbit template:
under: <a href="moderator.php?s=$session[sessionhash]&action=points&userid=$userinfo[userid]" target=_blank>Points:</a> $post[field5]<br> (or whatever you have for your points)
put: <a href="itemshop.php">Item:</a> $post[field6]<br>

if you wish any new user to have "No Item" instead of nothing in the postbit template, run this query:
ALTER TABLE `forums`.`userfield` CHANGE `field6` `field6` CHAR(250) DEFAULT 'No Item' NOT NULL
change forums to the name of the database, and field6 to the number of your item field.
please note that it won't modify any existing users. Just users that register after you run the query.

That's about all. I'll edit this if i forgot anything.
Enjoy!
Attached Files
File Type: zip itemshop.zip (68.6 KB, 77 views)
______________________________________



Last edited by rake : 02.17.02 at 08:21:54.
Send a message via ICQ to rake Send a message via AIM to rake   rake is offline
View rakes Profile! Find more posts by rake! Visit rakes Homepage!  
  rake
 
 
rake's Avatar
Sorceror|Supreme
 
Posts: 1,269
 
Reg: Jan 15 2002
 
ID: 4
 
RP: 0
 
None
None
None
None
     
 
Default  02.17.02, 08:20:10
  Post #2 (permalink)
 
     

Update: Added error pages if you don't have enough points and if you already have the item. Added thank you page.
The items will only be linked if you can afford them.
Send a message via ICQ to rake Send a message via AIM to rake   rake is offline
View rakes Profile! Find more posts by rake! Visit rakes Homepage!  
  afterlab
 
 
afterlab's Avatar
Founder of FFR
 
Posts: 3,376
 
Reg: Jul 17 2001
 
ID: 1
 
RP: 150
 
Final Fantasy XI
Jamestown Story
50 First Dates
Alternative Press
XBox 360
     
 
Default  02.17.02, 08:21:56
  Post #3 (permalink)
 
     

Wow, you've impressed me greatly, Mewtwo. I'll look into this and test it soon.

EDIT: Can you get multiple items?
______________________________________



From the founder of Final Fantasy Republic
Gamertag Nation

  afterlab is offline
View afterlabs Profile! Find more posts by afterlab! Visit afterlabs Homepage!  
  rake
 
 
rake's Avatar
Sorceror|Supreme
 
Posts: 1,269
 
Reg: Jan 15 2002
 
ID: 4
 
RP: 0
 
None
None
None
None
     
 
Grin  02.17.02, 08:24:31
  Post #4 (permalink)
 
     

thanks. I already tested it on my localhost. (i'm running apache+php+mysql locally)

it doesn't support multiple items yet. But i might do that soon.
Send a message via ICQ to rake Send a message via AIM to rake   rake is offline
View rakes Profile! Find more posts by rake! Visit rakes Homepage!  
  
 
Posts: n/a
 
ID:
 
RP:
     
 
Default  02.17.02, 08:30:17
  Post #5 (permalink)
 
     

*What the...I just got logged out*

Anyway...Sounds quite great. I commend you on your PHP skills, of which I have none.

This should be a neat addition, since now we don't need to bug afterlob.


Last edited by afterlab : 02.17.02 at 08:32:48.
 
 
  
 
Posts: n/a
 
ID:
 
RP:
     
 
Default  02.17.02, 09:38:42
  Post #6 (permalink)
 
     

Umm...uh oh. Might want to get that Itemshop fixed. Take a gander at my RP, rofl!

If $RPVar < 0 then Displaysteherrorsubroutine!

 
 
  Buzz Beer
 
 
Buzz Beer's Avatar
.Iron Chef.
 
Posts: 95
 
Reg: Jan 20 2002
 
ID: 47
 
RP: 0
 
None
None
None
None
     
 
Default  02.17.02, 09:40:59
  Post #7 (permalink)
 
     

My RP 0wnz j00!!!

  Buzz Beer is offline
View Buzz Beers Profile! Find more posts by Buzz Beer!  
  afterlab
 
 
afterlab's Avatar
Founder of FFR
 
Posts: 3,376
 
Reg: Jul 17 2001
 
ID: 1
 
RP: 150
 
Final Fantasy XI
Jamestown Story
50 First Dates
Alternative Press
XBox 360
     
 
Default  02.17.02, 09:41:47
  Post #8 (permalink)
 
     

Aha, I see. I'll go talk with Vivi (the creator of the script).
  afterlab is offline
View afterlabs Profile! Find more posts by afterlab! Visit afterlabs Homepage!  
  aerosol
 
 
aerosol's Avatar
Registered Member
 
Posts: 5,529
 
Reg: Aug 25 2001
 
ID: 9
 
RP: 0
     
 
Default  02.17.02, 09:44:58
  Post #9 (permalink)
 
     

Goodness me oh my.
______________________________________

A E R O S O L
I AM BLACK, JEWISH, AND COMPLETELY WORTHLESS, I PROMISE
  aerosol is offline
View aerosols Profile! Find more posts by aerosol! Visit aerosols Homepage!  
  rake
 
 
rake's Avatar
Sorceror|Supreme
 
Posts: 1,269
 
Reg: Jan 15 2002
 
ID: 4
 
RP: 0
 
None
None
None
None
     
 
Default  02.17.02, 11:00:17
  Post #10 (permalink)
 
     

actually you should talk to crono too. He posted it for me on vbulletin. And if you don't belive me, talk to both of them.

and there shouldn't be any negative number. there's an if statement that compares your points to the the item you want to buy. If you don't have enough points you get am error message. (you actually shouldn't even see that at all, because there's no link if the item costs more than you have.

here's what i get on my test forums if i try to buy blood sword, which costs more than i have, and isn't linked:

my conclusion is that you did something wrong when editing itemshop.php

Last edited by rake : 02.17.02 at 11:09:59.
Send a message via ICQ to rake Send a message via AIM to rake   rake is offline
View rakes Profile! Find more posts by rake! Visit rakes Homepage!  
  afterlab
 
 
afterlab's Avatar
Founder of FFR
 
Posts: 3,376
 
Reg: Jul 17 2001
 
ID: 1