vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   The Itemshop v5 (Original) (https://vborg.vbsupport.ru/showthread.php?t=38090)

Vivi Ornitier 04-29-2002 10:00 PM

The Itemshop v5 (Original)
 
Again, I'm posting this for a friend. He is the original itemshop creator. (see this thread):

Let's start with the beginning. You may wonder why this thread has the word original in its name. Well, there are too many itemshops out there. So here's a short version of the itemshop history:
  1. First of all, afterlab had the idea of an itemshop, which he also did, but it was pure text. People would have to talk to him to buy items, and he would have to manually substract the points.
  2. Then, as a member of ffr, i started talking about how easy and convenient it would be to have an automated itemshop. People just click on the link, and the item is added, points substracted. Later that day, i did the very first version of the itemshop. Nothing big, just a buy function. The items were stored in an array.
  3. I had released my itemshop on vb.org and afterlab was pretty unsatisfied that i hadn't given him any credit for the original idea. Actually i didn't even consider the itemshop a hack, it was more of a joke, something i had made for fun. I had no idea it would become so popular.
  4. 2 days later, version 4: This one had error pages, improved buy and sell function. I was planning a database powered itemshop, with admin cp interface.
  5. afterlab then pretty much copied my code 3 times, and released his first version "with item categories". It felt pretty unfair, while i was struggling to do something way more advanced, he was getting all the credit for something that was still 85% mine.
  6. then my computer broke, just as I was working on the admin cp of my database version. I was also planning to do the battle system hack.
  7. in the meantime, about one week later, afterlab released his itemshop 3 i think, database powered.
  8. couple of weeks later afterlab started all the battle system stuff.
  9. about 2 months after my computer crashed, it got finally fixed, and i began to work to complete my own itemshop.
  10. So well, here it is.
nice story, isn't it? ;)

here's a quick list of features:

Database driven
Full Template Set (everything that is outputted is generted through templates)
Infinite items categories and items
Items and category descriptions
Stock (idea by Crono)
Detailed items/categories/shops stats (number of sold items, profit)
All the item and category adding/editing/deleting and option editing is done through the cp.
Special icon column for different item display possibilities
!!!! Personal Shops !!! (members can create their own shops and sell items. You can specify how much it costs through the cp. while each category has it's own slot, all the personal shops work under one slot. That means, you can only have one item from all the personal shops)
An own donation system included

what it adds:

The itemshop adds 4 tables to the vbulletin database:
  • [items] - This is where all the items are stored
  • [items_cats] - This is where all the categories are stored
  • [items_options] - This is where the configuration data is stored
  • [items_user] - This is where all the user stuff and items he bought, are stored

26 templates to the main template set:
  • itemshop
  • itemshop_buypers
  • itemshop_delpers
  • itemshop_donate
  • itemshop_donate-error
  • itemshop_donate-more
  • itemshop_donate-self
  • itemshop_donate-thanks
  • itemshop_error-nosell
  • itemshop_error-noshop
  • itemshop_info
  • itemshop_its
  • itemshop_itsbits
  • itemshop_own
  • itemshop_pers
  • itemshop_persform
  • itemshop_personal
  • itemshop_pheader
  • itemshop_redir-del
  • itemshop_redir-edit
  • itemshop_redir-sell
  • itemshop_redir-thanks
  • itemshop_tablebottom
  • itemshop_tablemiddle
  • itemshop_tabletop
  • itemshop_view
Like i said, anything there is to edit can be edited through templates

File and Template Modifications:
there are 4 file modifications, but only one of them is neccessary.
and one template modification: postbit, wherever you want the donation link to be.
important!!!!: remember to change your points field and remove any old itemshop templates!!!

Installation method
First of all, be sure to back up your database!! This is a fairly large hack. Adds a lot of stuff to the database.

the installation is done through the install script install_itemshop.php. It will guide you through 5 easy steps.
the only manual edits you'll have to do are the ones above, file and template edits.

Included Files

readme.htm - general information
root/itemshop.php - main itemshop file
admin/itemadmin.php - itemshop admin interface
admin/install_itemshop.php - itemshop installation file
images/itemshop - itemshop image file. This is where you will have to upload all coresponding graphics.

Contact Information
mail: gheghe@rnc.ro
aim: MewtwoAlx

If you wish to colaborate with me in continuing this hack or to add item descriptions for further versions please contact me.
This hack can easily be used not only for rpg boards.. As an example: you add computer categories: cpu, hdd, monitor etc, replace points with $ and let people on your forum build themselves a computer!


I've already got a list of stuff i gotta update in the next version, but if there's any request feel free to ask.
The shop is 100% functional, but i want to improve stuff, make it more efficient.


[And please, before releasing any new mod/edit/version to this hack ask for permission] - If you agree to that condition you are allowed to freely use and distribute the zip below, as long asthe copyright and author information remains intact.
By not agreeing, you are not allowed to use this hack, nor will you get any support.

- Thank you! That was just to prevent my hours hard work on the itemshop to be stolen

Whoa, that was a lot of typing! I hope you like it! Attached file below.


screenshots attached:
https://vborg.vbsupport.ru/showthrea...268#post246268

https://vborg.vbsupport.ru/showthrea...277#post246277


*** update
all bugs reported by Kaelon are fixed.
i've also added some extra stuff:
ascending or descending order
postbit edit: well, for the postbit, i couldn't just put the imgs, cause all the items of the same type have the same image. so i put the image and a link to a separate item info page.
1 new template required for the item info page.
added remove feature in installation script. ( note: it will simply drop the tables and remove the templates).
75% faster!!! and less stress on your server
***

***
new update: bank hack integrated!!!
***

***

Dark Odin 04-30-2002 09:05 PM

Screenshots?

afterlab 04-30-2002 09:05 PM

LOL.. Well nonetheless, it's better then your last one.

Vivi Ornitier 04-30-2002 09:08 PM

no need for screenshots. pretty much looks like all the other itemshops. Just better. way better.

:knockedout: lol??? aww well, i'm getting better at coding.

Dark Odin 04-30-2002 09:11 PM

I wanna see how way better. :)

afterlab 04-30-2002 09:12 PM

Thanks for the itemshop history you added into the hack readme. I wish good luck to anyone who attempts to install this.

Vivi Ornitier 04-30-2002 09:25 PM

lol... reading that history thing, it is pretty funny. I sound like an 8 year old. :)

but no need to be sarcastic about installing it. Belive me, it does work.

screenshots part1

snyx 04-30-2002 09:33 PM

sorry, but I just don't understand this hack?! its a itemshop where you buy stuff? okay... well whats the point? how do you tell if a user has bought something? how to you make currency to buy these items? sorry but im just a little behind :D

Vivi Ornitier 04-30-2002 09:40 PM

Quote:

Originally posted by snyx
sorry, but I just don't understand this hack?! its a itemshop where you buy stuff? okay... well whats the point? how do you tell if a user has bought something? how to you make currency to buy these items? sorry but im just a little behind :D
well, the items are displayed in the postbit template (which i forgot to do, btw. i'll have it done tomorrow. it's too late now). You make money by posting. The amount of money that is added is also specified in the cp.
It's pretty fun. All the rpg boads want thiskind of stuff.
And not only rpg boards. take my example above. make a couple of categories > computer components. then change the points to dolars. member will be able to buy their own computer, piece by piece.


Quote:

Originally posted by xiphoid
You do sound like a 8 year old in that little story, but I understand why you wrote it. Thank you for explaining, and I am considering this one for installation.

I am doubting on a few things though:

First you say: This is easy 5 steps, ..
Then I read: only files & templates have to be done manually.
err?

First I read: No need for screenshots, nothing has changed.
Then I read: but it looks better, way better!
err? Isn't it worth a screenshot or 2 in action then? Or a site where we can browse through as a guest (or test account)?

You talk about a battle thingy, is it included in this release? And if not, can we expect it soon? And what are possible other features you are currently working on?

Has this been tested on several boards, and which versions if I may ask?

- not trying to sound harsh here, just have questions! -

well, the installer adds the tables and templates. but you have to do the file edits.

the looks haven't changed very much, just the script itself.
it has been tested on 3 boards, and it should work on all vb versions.


screenshots part2

Floris 04-30-2002 09:42 PM

You do sound like a 8 year old in that little story, but I understand why you wrote it. Thank you for explaining, and I am considering this one for installation.

I am doubting on a few things though:

First you say: This is easy 5 steps, ..
Then I read: only files & templates have to be done manually.
err?

First I read: No need for screenshots, nothing has changed.
Then I read: but it looks better, way better!
err? Isn't it worth a screenshot or 2 in action then? Or a site where we can browse through as a guest (or test account)?

You talk about a battle thingy, is it included in this release? And if not, can we expect it soon? And what are possible other features you are currently working on?

Has this been tested on several boards, and which versions if I may ask?

- not trying to sound harsh here, just have questions! -

JulianD 04-30-2002 09:56 PM

It seems very impressive! I'm gonna try to install it later... Thanks!

Webmasta XT 04-30-2002 10:00 PM

This is amazing.. Way Better than all the other ItemShops.. :)

Floris 04-30-2002 10:05 PM

I just installed apache, mysql, php on my localhost, and then installed vbulletin 2.2.5 clean from the .zip file, then i run your installation script and did the manual file changes.
I couldn't do the template changes,
because all the templates were removed and I had MANY [change original] links, with empty content, and not title in front of it.
The site doesn't work anymore now.

NTLDR 04-30-2002 10:17 PM

Looks very good, I may try intstalling this one :D Is this the same as the one used on your board?

Vivi Ornitier 04-30-2002 10:18 PM

Quote:

Originally posted by xiphoid
I just installed apache, mysql, php on my localhost, and then installed vbulletin 2.2.5 clean from the .zip file, then i run your installation script and did the manual file changes.
I couldn't do the template changes,
because all the templates were removed and I had MANY [change original] links, with empty content, and not title in front of it.
The site doesn't work anymore now.


hmmm..... i just tried a clean 225 install and it worked fine.
I got the template installation function from bane's installer. so if vbstats and any other similar hack works, so should this.
i have tested it over and over and install script worked fine for me.

AnkisethGallant 04-30-2002 10:37 PM

This is boss, but what can I use this for if I'm not getting a battle system? I REALLY want this, but I can't find a use. Any suggestions? My site is music oriented.

Neo 04-30-2002 10:46 PM

Good Job Vivi :)

Nice of you to put this images in aswell for people.

Ruth 05-01-2002 12:35 AM

nice work Vivi,

may i suggest to you, to combine this with secure downloads script , so users can download files using their points, and upload files and get points.

cheers, :)

AnkisethGallant 05-01-2002 01:10 AM

HELP! It's not working. A few things:
What is the thing about the field for for the money?
When I clicked donate, it had an error.
Some help here? What is the code to put the money on the post bit? How do I change the name of the points?

EDIT: Also, I'm guessing I have to add the link to the main page for it?

hypedave 05-01-2002 01:13 AM

Quote:

Originally posted by Ruth
nice work Vivi,

may i suggest to you, to combine this with secure downloads script , so users can download files using their points, and upload files and get points.

cheers, :)


very good suggestion

DFX 05-01-2002 01:20 AM

Are there any battle hacks that work with this, and recognize the weapons and armor and go by their actual attack and defensive properties?

AnkisethGallant 05-01-2002 01:21 AM

------------------------------
Warning: Variable passed to each() is not an array or object in /home/virtual/site8/fst/var/www/html/boards/admin/itemadmin.php on line 147

Items updated!
-------------------------

-------------------------
Database error in vBulletin 2.2.5:

Invalid SQL: SELECT item1,points1,description1,icon1 FROM items_user WHERE userid=1
mysql error: Unknown column 'item1' in 'field list'

mysql error number: 1054

Date: Tuesday 30th of April 2002 09:24:31 PM
Script: http://www.punkmusicrocks.com/boards...hp?action=main
Referer: http://www.punkmusicrocks.com/boards/index.php?
---------------------------------

What about those two things?

It also won't let me edit items.

Velocd 05-01-2002 01:34 AM

Damnit, just when I thought it was gone and I would be few out of those who still had the original. But now this is released...:(

J/k. But I did work so hard to integrate the previous one, adding buy buttons and other things. But hey, you added a stock feature, thats pretty sweet. I may have to wait till the weekend to install this one.

[high]* Velocd hits install button[/high]

AnkisethGallant 05-01-2002 02:07 AM

Why isn't anyone helping?!?!?

Velocd 05-01-2002 03:09 AM

/me shrugs
/me points at Vivi

AnkisethGallant 05-01-2002 03:19 AM

It's ALL fixed now.

Is there a way to control the stock of a specific item?
Also, personal shops can create their own items, shouldn't they sell what's in the inventory, and what they've already bought?
And, Is it possible to allow a user to carry a bigger number of a category than just one item?

BigJohnson 05-01-2002 03:35 AM

very nice hack and are u still working on the battle hack and will you incorporate it with this hack so you can use weapons etc...

Kaelon 05-01-2002 03:38 AM

Very nice hack, Vivi. I set up a private test forum - a fresh, clean install of 2.2.5, and mostly everything looks like it is functioning properly on the admin backend. I run into the first error at the "Donate" function. It looks like your hack doesn't escape apostrophe's appropriately. There are also some other bugs that I have itemized below for your reference.

1. No Apostrophe Escape

Quote:

Database error in vBulletin 2.2.5:

Invalid SQL: UPDATE items SET stock='5' WHERE name='Cat's Claws'
mysql error: You have an error in your SQL syntax near 's Claws'' at line 1

mysql error number: 1064

-- snip --

Referer:
I fixed the above problem by simply removing any problem items that used apostrophes ('). We also get the same errors when you try to add any Item whose name OR description have either an apostrophe or a quote (").

2. Donate Error

Your donate URL, as you specified it in postbits, is incorrect. The correct URL, whether or not you use JavaScript, should be as follows:

Code:

<a href="itemshop.php?action=donate&user=$post[userid]">Donate</a>
Previously, you didn't have the $post[userid] variable, and instead just referenced [userid]. Changing this fixed it for me.

3. Sold Item Graphic Remains

When you sell an item, the graphic for the previous (sold) item remains even though you have no item listed in the appropriate slot. When you purchase a new item, fortunately, the new item graphic icon replaces the old item graphic. This can be fixed if you clear out the value for your categorical icon in use.

I'll continue testing and let you know if I run into anything else.

Juan

Kaelon 05-01-2002 04:53 AM

Basically, aside from that above, this hack is working very nicely. I must hand it to you, Vivi - a job very well done. I think I can figure out the postbit code to show items purchased by the player by simply looking at the other templates, but I look forward to seeing how you do it.

Juan/Kaelon

Edit: Actually, nope, the other templates didn't have any postbit examples I could stick in, so I'll wait for you to include your postbit. =)

Vivi Ornitier 05-01-2002 06:36 AM

thank you for pointing that out Kaelon. I'll fix it all.
I'll also do the postbit today.

I'm sorry for not making it clear, but the shinra points hack is required. After installing the shop, you need to go to your admin cp, and under the itemshop section, Edit options. Make sure the correct point field is specified there. That's where you control stock: minimum stock, maximum stock and stock reset time.

itemshop are identified by the userid of their owner, so having multiple personal shops is impossible.

Erwin 05-01-2002 07:02 AM

Your previous itemshop was quite simple and functional - I'm going to stick with it. :) Good job on this one, but I like the fact that I can use the stock custom userfields with the previous version - easy for me to build other hacks upon it. Keep up with the great hacks!

Kaelon 05-01-2002 08:11 AM

Great! Thanks, Vivi!

Just let me know once you've got the postbit included, fixes added and where I can nab it.

Again, excellent hack. I particularly love the flexibility to add categories (in effect, shops). Congratulations.

Kaelon

FFMania 05-01-2002 09:23 AM

I have problem here......

When I follow the instruction in editing both newreply.php and newthread.php.....the result is not really good.

Instead of what I have set (2 Points Per Reply and 5 points per new thread) it turns out to be 7 points per reply and 10 points per new thread.....I never modify anything....the itemshop script did it by itself? 0_o

And it also...stop the post counts from working.....for me at least...what should I do now?

And oh, I have the points hack, points addon, donate points and star hacks installed btw....so plz help me out...I am confused now ;) thx in advance :)

ceo_tfw 05-01-2002 12:13 PM

great hack, I have installed it and I had a few errors but with a little editing with my php3 files now it is up and running great,

I must say that it drives your members to post more,, yeehaaa

Vivi Ornitier 05-01-2002 12:17 PM

thanks Kaelon! :)

file updated.


FF Mania: you set the value in the admin cp.
the default value in the admin cp is 5.

you edited the file and added 2 and 5:
2+5=7
5+5=10

use the admin cp. ;)

AnkisethGallant 05-01-2002 07:23 PM

So, if we get the points hack (which one?), we'll be able to change stock.

What about personal shops? Is there any way to control it, where users can only resell items they bought?

Also, is it possible to change it where you can buy more than one item in a category?

Vivi Ornitier 05-01-2002 07:30 PM

Quote:

Originally posted by AnkisethGallant
So, if we get the points hack (which one?), we'll be able to change stock.

What about personal shops? Is there any way to control it, where users can only resell items they bought?

Also, is it possible to change it where you can buy more than one item in a category?

the itemshop basically works without the shinra points system.
It only needs a custom user field for the points.

stock is controllable through the admin cp.

in the personal shops, people create their own items. they can't resell items. and right now, it's impossible to buy more items in one category


bank screenshot attached

AnkisethGallant 05-01-2002 07:33 PM

Alright. If I knew how to hack, I'd work on that, adding the ability to resell.

How do I control stock in the CP, I don't see it anywhere.

Vivi Ornitier 05-01-2002 07:42 PM

Edit Options part :rambo:

ender 05-01-2002 07:45 PM

What's the bank screenshot? Is that something coming in a future version?

Also, in functions.php you use $bbuserinfo[userid], that will only check the user browsing the forum and consequently it will display all he owns on every post no matter what the user.

The correct function would be: $post[userid]


All times are GMT. The time now is 04:52 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01787 seconds
  • Memory Usage 1,851KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete