Version: 1.00, by Vivi Ornitier
Developer Last Online: Mar 2008
Version: 2.2.x
Rating:
Released: 02-16-2002
Last Update: Never
Installs: 10
Is in Beta Stage
No support by the author.
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 https://vborg.vbsupport.ru/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!
scroll down for attachement
screenshots included in the zip
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
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.
Also, Vivi. When people purchase an item for over there current point total, it gives them a negative number, like -900. They can still get the item though.
afterlab: 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.
my conclusion is that you did something wrong when editing itemshop.php
watch for
if($points >=$value) {
that if statement checks checks your points. if your have more of equal to the points of the item you want to buy it will continue. if not, it will send you to the error page:
header ("Location: itemshop.php?action=error&why=points");
=====
tsk it was the old version again, here is he fully fixed version.
ouch. forgot template. :?: