View Full Version : Adoptables hack
antialiasis
06-01-2006, 10:00 PM
This hack adds a little adoption center to your forum where your users can adopt lovely little adoptables which will be 'upgraded' as the user gains the posts needed for the next stage. (Thus, an adoptable can be originally adopted as an egg, ten posts later the egg has cracks in it, twenty posts after that it hatches into a baby [insert something cute and loveable here], still fifty posts after that it has grown a little, and 100 posts later it's an adult - or something in that direction.)
2 template edits
4 files to upload
1 product to install
Features
Admin features
- Specify which usergroups can view adoptables, which can adopt, which can create adoptables and which can edit/delete others' adoptables
- Specify a maximum number of adopted adoptables per user for each user group
- Specify whether users can adopt adoptables that they created themselves
- Specify whether to use a "general description" for each adoptable, a description for each stage for an adoptable, or both
Adoptable creation features
- Create adoptables with up to five "stages", each with its own image, minimum posts to adopt it, user-specified posts needed to get from the previous stage to this one, and a custom description (if stage descriptions are enabled)
- View list of all your created adoptables
- Edit the adoptables that you have already created if you slipped up
- Only the first stage can be seen by a potential owner - surprise them with what their adoptable grows into
Adoptable management features
- Easily view a list of all adoptables (adopted and available)
- Edit or delete any adoptable easily from the list
Adopter features
- View a list of all available adoptables, only a button-click away from being yours, or of your own adoptables
- Disown an adoptable if you change your mind
- Release adoptables that are at their final stage to the wild so you can adopt new ones without leaving them for somebody else to pick up
- Show your own adoptables off in your profile
Installation
1. Download the zip file attached to this post and unzip it.
2. Upload all the files from the upload folder to the appropriate folder in your forum directory.
3. Import product-adoptables.xml through the Admin CP.
4. Two template edits:
In template MEMBERINFO
FIND
$footer
ABOVE it add
$useradoptables
-------------------
In template navbar
WHERE YOU WANT THE ADOPTION CENTER LINK, add
<if condition="$permissions['adoptpermissions'] & $vbulletin->bf_ugp_adoptpermissions['canview']"><td class="vbmenu_control"><a href="adopt.php$session[sessionurl_q]">$vbphrase[adoption_center]</a></td></if>
5. Modify the adoptable permissions for all your usergroups and the adoptable options under vBulletin options as you want them.
6. You're done! Go notify your users. And if you like it, click "I have installed this hack".
Uninstallation
1. Undo the two template edits above.
2. Uninstall the Adoptables product.
3. Remove adopt.php, includes/functions_adopt.php, includes/xml/bitfield_adoptables.xml and includes/cron/updateadoptables.php from your server directory.
Support
Just ask in this thread and I'll do the best I can to help.
Version history
1.2: Added feature to allow or disallow normal users to view full adoptable list. To upgrade: Download the new zip file, reinstall the product with Allow Overwrite definitely set to ON, and reupload adopt.php.
1.1: Fixed missing templates and custom Who's Online status bug. To upgrade: Download the zip file again and reinstall the product, making sure that Allow Overwrite is set to ON. Nothing else has been changed.
1.0: Initial release.
FLMom
06-02-2006, 12:55 AM
sounds cute and something I might be interested in..do you have any screenshots?
The Chief
06-02-2006, 12:57 AM
we need screenies :)
antialiasis
06-02-2006, 01:12 AM
Oh, yeah, the screenies. I tend to forget them for some reason.
I'm making some now. Should be there in a couple of minutes.
EDIT: Screenshots added.
The Chief
06-02-2006, 01:32 AM
Oh, yeah, the screenies. I tend to forget them for some reason.
I'm making some now. Should be there in a couple of minutes.
EDIT: Screenshots added.
Looks interesting, I might give it a shot tommorow ;D
FLMom
06-02-2006, 01:37 AM
I am also going to try it out tomorrow when I have more time. Good job and thank you :banana:
Protoman
06-02-2006, 02:23 AM
is this almost like a pets sorta thing? but based on posting?
and at some point can you make them die so they have to adopt a new one?
Interesting modification. Nice job I see a lot of promise with this one.
dirtycrow
06-02-2006, 02:35 AM
what do they look like once they hatch?
FLMom
06-02-2006, 03:17 AM
I tried installing it but had trouble, so I will try again in the morning ;)
Also, can you recommend a place to put the Adoption Link, I tried placing it in several different spots within my navbar template and none worked. Thanks!
Oddjob
06-02-2006, 03:44 AM
<font color="Lime">Installed</font> fine.....looking forward to playing w/ this.
So this is similar to Petz I guess.....Nice work though.Must have been hard :)
antialiasis
06-02-2006, 09:09 AM
is this almost like a pets sorta thing? but based on posting?
Well, they don't actually do anything except sit in your profile and look cute (or grotesque, if either somebody was fooling around when they made it or you have that sort of taste) and then occasionally turn into an older version of themselves - they don't need care, get hungry, battle each other or anything. (That is in fact the reason I didn't want to refer to it as a pets hack, since it could make users expect something more than it is.)
and at some point can you make them die so they have to adopt a new one?
At the moment at least, there is no such feature, but I think most people would end up getting bored of having an adoptable staying completely static in their profiles after growing to its final stage. They're bound to end up releasing it and adopting something new sooner or later...
what do they look like once they hatch?
They look like whatever the adoptable's creator has specified - when you make one, you have to enter an image URL for each stage. There are no adoptables that actually come with it, so you'll just need those with creation permissions to go wild.
I tried installing it but had trouble, so I will try again in the morning
Also, can you recommend a place to put the Adoption Link, I tried placing it in several different spots within my navbar template and none worked. Thanks!
What trouble are you having exactly? I have a bit of a history of managing to mess something up with either the installation instructions or the product XML, so the problem might be on my end. (I did install it on a test forum using the files I attached and following the steps I put in the post and it seemed to work fine, but just in case.)
Well, in the navbar template, you can find this:
<if condition="$show['member']">
<td class="vbmenu_control"><a href="usercp.php$session[sessionurl_q]">$vbphrase[user_cp]</a></td>
</if>
That's the link to the User CP. If you want the adoption center link right after that, just put the code right below that bit. However, what should be already below the user CP link is this:
<td class="vbmenu_control"><a href="faq.php$session[sessionurl_q]">$vbphrase[faq]</a></td>
And that's obviously the FAQ link, so if you want the adoption center link after that, then put it below there. You should be able to figure out the other locations from that...
So this is similar to Petz I guess.....Nice work though.Must have been hard
Heh, thanks. It wasn't as hard as I thought it would be, actually - everything turned out to be surprisingly straightforward even for me as a fairly inexperienced coder. But it was a lot of code just to type. I think I was working on this thing pretty much for two or three days straight with eating/sleeping breaks but not much else... I really have too much time on my hands.
projectego
06-02-2006, 09:25 AM
Looks awesome, thanks! :)
bada_bing
06-02-2006, 05:55 PM
Just an idea.. If there were seveal pets or live things to choose from for example
a baby to adult male/female
a tatpole to from
a fish egg to fish
and so on
PabloAM
06-02-2006, 08:23 PM
Please, I need a "gif?s" of creatures :)
the $useradoptables code isn't working. Please assist.
Krahl
06-02-2006, 08:40 PM
Cute.
How difficult would it be to change the "growth" to be dependant on something other than post count? For example, Reputation or cash or something entirely new?
I'll have other questions, but that's the primary one for the moment.
Thanks for creating it.
Krahl
theodonnells
06-02-2006, 11:42 PM
the $useradoptables code isn't working. Please assist.
Same here have run the cron and still nothing showing..
Attached are 5 small images for members to test with!!!An egg that turns into a smiley!!
48792
Also getting this error in who's online
Parse error: parse error, unexpected T_STRING in public_html/forum/includes/functions_online.php(765) : eval()'d code on line 234
Error goes away if adoptable product disabled....
antialiasis
06-03-2006, 12:36 AM
bada_bing, as I said, no adoptables actually come with the hack - you or some of your users will have to make them yourselves. The hack allows you to make tadpoles > frogs or whatever you want, as long as you supply the images.
Both the $useradoptables and Who's Online glitch should be fixed now - to upgrade, just download the zip file again and reinstall the product with Allow Overwrite set to On.
Changing the number the growth is dependent on should be very easy - you'd just need to change a few phrases and find all the instances of $vbulletin->userinfo['posts'] in the templates, adopt.php, includes/cron/updateadoptables.php and the Get Member's Adoptables plugin. Then just replace them with something like $vbulletin->userinfo['reputation'] for reputation, etc.
Request for a adoption hack 1.2 :
1. "view all adoptables" section so that users who can not edit adoptables can see all adoptables and who is owning them.
2. In postbit, if users has an adoptable, an icon will be shown and we can click on it to see adoption info and description.
I can only request because I don't know how to code. Looking forward for your kind approval.
antialiasis
06-03-2006, 02:13 PM
Both of those should be fairly easy to add - I think I'd make them options in the Admin CP.
Shelly
06-03-2006, 05:41 PM
im new at this, just helping someone out, and this is the first product that i had any issues with. when i tried to upgrade your code i keep getting a table already created error:
Database error in vBulletin 3.5.4:
Invalid SQL:
CREATE TABLE adopt (
adoptableid INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(20) NOT NULL,
img1url VARCHAR(255) NOT NULL,
img2url VARCHAR(255) NOT NULL,
img3url VARCHAR(255) NOT NULL,
img4url VARCHAR(255) NOT NULL,
img5url VARCHAR(255) NOT NULL,
generaldesc TEXT,
desc1 TEXT,
desc2 TEXT,
desc3 TEXT,
desc4 TEXT,
desc5 TEXT,
minposts MEDIUMINT UNSIGNED DEFAULT 0,
stage2posts SMALLINT UNSIGNED,
stage3posts SMALLINT UNSIGNED,
stage4posts SMALLINT UNSIGNED,
stage5posts SMALLINT UNSIGNED,
creatorid INT UNSIGNED NOT NULL,
ownerid INT UNSIGNED NOT NULL DEFAULT 0,
currentstage TINYINT UNSIGNED NOT NULL DEFAULT 1,
startposts INT UNSIGNED,
gender ENUM('Male','Female')
);
MySQL Error : Table 'adopt' already exists
Error Number : 1050
Date : Saturday, June 3rd 2006 @ 06:35:56 PM
i had alow overwrite set to yes
any ideas?
antialiasis
06-03-2006, 06:09 PM
Oh, right, looks like I forgot to include IF NOT EXISTS. Try the product in the new zip file.
Shelly
06-03-2006, 07:03 PM
thanks for the quick reply, that fixed it, now there is a new problem:
Database error in vBulletin 3.5.4:
Invalid SQL:
ALTER TABLE usergroup ADD adoptpermissions INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL, ADD maxadopted INT( 10 ) DEFAULT '5' NOT NULL;
MySQL Error : Duplicate column name 'adoptpermissions'
Error Number : 1060
Date : Saturday, June 3rd 2006 @ 08:02:23 PM
antialiasis
06-04-2006, 12:46 AM
Try again now...
Both of those should be fairly easy to add - I think I'd make them options in the Admin CP.
Waited for 3 days. Are you thinking or making? :confused:
antialiasis
06-04-2006, 01:02 PM
Have a bit of patience... You're not paying me for this, after all, so I can work in my time.
Shelly
06-04-2006, 07:55 PM
that cleared my problem, thanks
antialiasis
06-07-2006, 11:10 PM
Uninstalled.
Well, that's too bad, since I just added one of your features... =/
The other one turned out to be bit too much of a hassle code-wise for a not-particularly-useful feature, so I thought it wasn't really worth it in the long run. After all, if you want to see somebody's adoptables, you can just view their profile.
dashaka2
06-13-2006, 05:46 PM
I like the idea of this. I have a collectible card site. I was wondering If I can hatch an image of a card. If I can that would be perfect.
Can the Admin setup a page that the users can pick from?
Can users trade them?
Also are there any websites that I can see a working demo on this and what pages it effects?
Looking forward to the repsonses :)
AMFMaree
06-15-2006, 12:35 AM
I like this idea but I would like to have some creatures with it.. I wouldnt know the first thing about creating them.
AMFMaree
06-15-2006, 10:27 AM
I second the motion to have a link or the egg within the postbit ...
Once again.. are you going to supply the gifs for us to have a selection to add.. it would be nice if you could..pretty please
EasyTarget
06-15-2006, 08:48 PM
cool hack.
how about an option to make your adoptable turn into a fighting creature and pit peoples adoptables against eachother? The adoptables which are more mature can get new features or something :p
You could challenge someone's adoptable if they have set their status to be available for fights.
maybe an adoptable cemetery if there's like a life expectancy for each adoptable.
or what about adoptables that require care? maybe combine this with vbplaza/vbux so that users can user their points to buy stuff for their adoptable. (food, water, collar, etc) And you can use the vbplaza setting to display gifts, but display stuff that the adoptables have instead.
maybe a runaway center for adoptables that have left their owners do to lack of care.
Pamela
06-16-2006, 04:30 PM
This is such a cute idea!!! Can you...or anyone...supply some pet images though. I don't have a clue how to make them myself! :confused:
Reeve of shinra
06-16-2006, 06:09 PM
These kind of hacks are always very popular... I am sure some people are going to worship you for releasing this. =)
antialiasis
06-19-2006, 01:18 AM
I like the idea of this. I have a collectible card site. I was wondering If I can hatch an image of a card. If I can that would be perfect.
Can the Admin setup a page that the users can pick from?
Can users trade them?
Also are there any websites that I can see a working demo on this and what pages it effects?
Looking forward to the repsonses :)
You can make any image you want hatch from the egg.
I'm not sure what you mean by the second question - there is already a page listing all available adoptables which users can access.
They can not be traded directly at the moment, but such a feature could probably be implemented in later versions.
This doesn't affect any existing pages except the user profile page - the rest of the adoption center is contained in a new file that you upload when you install the hack. The other template edit is just to add the adoption center link to the navbar.
As for a working demo, well, on my site guests can't see adoptables and my test forum is not accessible from any other IPs than mine, so I guess somebody else would have to show you one. =/ At least you have the screenshots.
I like this idea but I would like to have some creatures with it.. I wouldnt know the first thing about creating them.
This is such a cute idea!!! Can you...or anyone...supply some pet images though. I don't have a clue how to make them myself!
Well, the thing is that I'm no better at it than you are. I let my users create adoptables for each other, and then just watch on the sidelines. :p So sorry, I'm afraid I can't supply you with pet images.
cool hack.
how about an option to make your adoptable turn into a fighting creature and pit peoples adoptables against eachother? The adoptables which are more mature can get new features or something
You could challenge someone's adoptable if they have set their status to be available for fights.
maybe an adoptable cemetery if there's like a life expectancy for each adoptable.
or what about adoptables that require care? maybe combine this with vbplaza/vbux so that users can user their points to buy stuff for their adoptable. (food, water, collar, etc) And you can use the vbplaza setting to display gifts, but display stuff that the adoptables have instead.
maybe a runaway center for adoptables that have left their owners do to lack of care.
I think you're looking for something more like P3tz. That's a full-fledged virtual pet thing that's compatible with currency systems where the pets can fight each other and need care. This is meant just to be a simple little thing if you're not looking for all those features and just want your users to be able to adopt something and then leave it alone.
Renae
06-19-2006, 03:43 PM
I also second having the adopted animal on the postbit, instead of the profile. I'm sure this would not be hard to do though. I'm sure it's just moving things around. Or even in both.
I understand you cannot make the adoptables, I dont' think I can either. I've been asking members to step up and make them. But maybe we can set up some sort of sharing here, so that if one forurm has a bunch and they want to share, the other people can use their animals too. Just an idea.
antialiasis
06-20-2006, 06:04 PM
The problem with putting adoptables in the postbit is mostly all the queries it adds to every thread view.
zeroality
08-01-2006, 05:27 AM
Dude you have no idea how awesome this is for a Pokemon-based message board since Pokemon themselves do hatch from eggs and 'evolve' in stages.
In fact, the egg sprite in those screenshots looks like it was ripped off of the Gameboy Advance games?
Looks great. I'll install tomorrow most likely.
antialiasis
08-14-2006, 10:03 PM
Heh, indeed it was. Pok?mon fan with Pok?mon forum here. :)
zeroality
08-23-2006, 02:38 AM
That explains it. :) Well, I finally got around to actually doing this but now I have a problem.
I created an adoptable but the 'next stage' stuff isn't working.
I am 99% sure that I put in all the stuff properly and it works just fine, creates the adoptable. They just don't go on to the next stage when the user gets the appropriate number of posts. There are no errors either.
Any ideas? :\
antialiasis
08-23-2006, 04:57 PM
That's most likely just because the adoptables are updated via a scheduled task. It should run every hour exactly (as in one o'clock, two o'clock, three o'clock, etc). Wait until that time has passed and then see if it hasn't been updated.
(You can, of course, run the scheduled task immediately through the Admin CP if you'd rather not wait to test it - not that said adoptable shouldn't already have been updated now, if the member had enough posts at the time you posted here.)
zeroality
08-23-2006, 05:25 PM
I removed all the stages so no, it didn't update because there's nothing to update.
I'll check that out, thanks.
givemeplain
09-21-2006, 05:27 AM
nice hack. by any chance could you make it that more than one user can adopt the same thing? by making an adoptable unique to every person, there would have to be hundreds to accomdate any medium sized - larger forum.
Doc31
09-26-2006, 10:17 AM
I second the motion to have a link or the egg within the postbit ...
Once again.. are you going to supply the gifs for us to have a selection to add.. it would be nice if you could..pretty please
I third forth and fith this motion. needs to have a link to adoptable in postbit or people dont know you even have one unless they check your profile. and who bothers with that.
haytham
10-13-2006, 12:38 PM
Maybe it is a mistake on my side but I doubt it. I have installed this hack and all hell broke lose on my forum. I can't modify permissions for groups. I get this error:Database error in vBulletin 3.6.1:
Invalid SQL:
UPDATE usergroup SET
### UPDATE QUERY GENERATED BY fetch_query_sql() ###
`title` = 'Registered Users',
`description` = '',
`usertitle` = '',
`opentag` = '',
`closetag` = '',
`passwordexpires` = '0',
`passwordhistory` = '0',
`adoptpermissions` = '15',
`maxadopted` = '5',
`arcadepermissions` = '7',
`forumpermissions` = '1044991',
`genericpermissions` = '304723919',
`attachlimit` = '0',
`pmquota` = '50',
`pmpermissions` = '3',
`pmsendmax` = '0',
`calendarpermissions` = '17',
`wolpermissions` = '1',
`adminpermissions` = '0',
`genericoptions` = '63',
`profilepicmaxwidth` = '100',
`profilepicmaxheight` = '100',
`profilepicmaxsize` = '65535',
`avatarmaxwidth` = '80',
`avatarmaxheight` = '80',
`avatarmaxsize` = '20000',
`signaturepermissions` = '172031',
`sigpicmaxwidth` = '500',
`sigpicmaxheight` = '100',
`sigpicmaxsize` = '20000',
`sigmaxrawchars` = '800',
`sigmaxchars` = '400',
`sigmaxlines` = '0',
`sigmaxsizebbcode` = '7',
`sigmaximages` = '2'
WHERE usergroupid=2;
MySQL Error : Unknown column 'adoptpermissions' in 'field list'
Error Number : 1054
Date : Friday, October 13th 2006 @ 06:34:18 AM
Script : http://www.XXXX.com/XXX/admincp/usergroup.php?do=update
Referrer : http://www.XXXX.com/XXX/admincp/usergroup.php?do=edit&usergroupid=2
IP Address : XXX.229.XXX.84
Username : haytham
Classname : vb_database
=====================================
I tried to uninstall the hack but got this message:
-------------
Database error in vBulletin 3.6.1:
Invalid SQL:
DROP TABLE adopt;
MySQL Error : Unknown table 'adopt'
Error Number : 1051
Date : Friday, October 13th 2006 @ 06:37:06 AM
Script : http://www.XXXX.com/XXX/admincp/plugin.php?do=productkill
Referrer : http://www.XXXX.com/XXX/admincp/plugin.php?do=productdelete&productid=adoptables&s=
IP Address : XXX.229.XXX.84
Username : haytham
Classname : vb_database
-==================================
so what can I do now to uninstall this hack?
antialiasis
10-22-2006, 06:29 PM
Hmm, it looks like something went wrong during the installation itself. Couldn't be sure exactly what it is, but from the looks of it, the hack isn't really installed at your forum so you don't exactly need to uninstall it...
Okay, the code seems to be a little buggy. I'm going to reupload the product and you can try it again.
Ophelia
11-16-2006, 02:41 PM
I would like for the egg to show up in the area where their name is when they post (I can never remember what that is called). Right under their avatar. Is there a way to do this?
FCS-Webmaster
02-05-2008, 01:55 AM
Doesn`2 work with vB 3.6.8 PL2 sad...
Greek76
10-13-2008, 03:33 PM
I guess this mod is dead? No hope of life for 3.7?
rob01
11-14-2008, 01:10 AM
did he forgot to add the pets images o.O?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.