Make your own PHP adoptables system

Need help with the site/forum/pets? Ask questions and get help from other members here.

Re: Make your own PHP adoptables system

Postby Nick » Sat Dec 13, 2008 2:57 pm

Kiara wrote:
Code: Select all
<p><img src="http://kiarasdomain.net76.net\simple.php?a=<?php echo $_REQUEST['id'];?>&amp;v=<?php echo $v_id;?>"></p>


I think there might be something wrong with the location of the image...


You've used the wrong slash before "simple.php", you should be using this slash: /
User avatar
Nick
Admin
 
Posts: 6338
Joined: Thu Jul 03, 2008 2:40 pm
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: Make your own PHP adoptables system

Postby qhost » Sat Dec 13, 2008 9:05 pm

thenickdude wrote:
Kiara wrote:
Code: Select all
<p><img src="http://kiarasdomain.net76.net\simple.php?a=<?php echo $_REQUEST['id'];?>&amp;v=<?php echo $v_id;?>"></p>


I think there might be something wrong with the location of the image...


You've used the wrong slash before "simple.php", you should be using this slash: /


Oh, lol, now I get it :lol: Got a bit muddled 'cause I'm used to doing that with folders (like when you're displaying an image) Also...I had an idea for something else which I'm going to try out... ;)

EDIT: oh nevermind I got it working again :D
    -
    she/they | adult | australia | artist | writer
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

    My name is Boo & I am perpetually tired.
    I have real bad anxiety so I take a while to respond
    to msgs sometimes, sorry!
    -
User avatar
qhost
 
Posts: 4107
Joined: Wed Oct 01, 2008 6:36 pm
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: Make your own PHP adoptables system

Postby qhost » Wed Dec 17, 2008 10:22 pm

Sorry for the double post, but I thought it would be more noticeable this way :lol:


Okay, my site's fine and all, but there's one thing I need to know:

Using 000webhost, if I put the adoptables.xml file, simple.php and the pictures for my adoptables in a separate folder that isn't the public_html one, will the adoptable system still work? Because I've noticed that all people have to do is type in http://"mywebsitename"/adoptables.xml and it comes up with all the variations and picture names etc. (for people reading this I've deliberately changed adoptables.xml so it has names of pictures that don't exist) and then all they have to do is type in something like http://"mywebsite"/adoptrare.png and they can see the pet before it actually grows. So, as I said before, if the adoptables.xml and picture files aren't in public_html, will the system still work?

~Kiara
    -
    she/they | adult | australia | artist | writer
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

    My name is Boo & I am perpetually tired.
    I have real bad anxiety so I take a while to respond
    to msgs sometimes, sorry!
    -
User avatar
qhost
 
Posts: 4107
Joined: Wed Oct 01, 2008 6:36 pm
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: Make your own PHP adoptables system

Postby Nick » Wed Dec 17, 2008 10:45 pm

Yes, but you need to change the line that opens it (in adopttools.php) so that it has the right path. So if you wanted to store adoptables.xml in the folder above the current one you could put '../adoptables.xml' instead of 'adoptables.xml'. Or you could just rename it to something that people won't guess, like 'weiofmqwev.xml' and update the path to use that.
User avatar
Nick
Admin
 
Posts: 6338
Joined: Thu Jul 03, 2008 2:40 pm
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: Make your own PHP adoptables system

Postby qhost » Wed Dec 17, 2008 10:54 pm

thenickdude wrote:Yes, but you need to change the line that opens it (in adopttools.php) so that it has the right path. So if you wanted to store adoptables.xml in the folder above the current one you could put '../adoptables.xml' instead of 'adoptables.xml'. Or you could just rename it to something that people won't guess, like 'weiofmqwev.xml' and update the path to use that.


I'll try re-naming it for now I think :) Thanks!

(I don't think I'd name it weiofmqwev.xml though :lol: )
    -
    she/they | adult | australia | artist | writer
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬

    My name is Boo & I am perpetually tired.
    I have real bad anxiety so I take a while to respond
    to msgs sometimes, sorry!
    -
User avatar
qhost
 
Posts: 4107
Joined: Wed Oct 01, 2008 6:36 pm
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: Make your own PHP adoptables system

Postby Lady » Tue Dec 30, 2008 5:32 am

I'm having trouble with the files in the zip.

I had problems every time I edited it on my own, so I scraped all of it and started from the zip files to see what I kept messing up on. Unfortunately, the problem keeps coming up anyway.

It says there are errors in both the adopttools.php (line 49) and the simple.php (line 18). Here are those lines respectively.
foreach ($adoptable->variation as $variation) {
foreach ($variation->age as $age) {

What's wrong? (I'm testing this on 000webspace, but I don't think the PHP version is an issue..)
ImageImageImageImage
User avatar
Lady
 
Posts: 4424
Joined: Tue Jun 24, 2008 5:44 am
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: Make your own PHP adoptables system

Postby SilverFlame » Tue Dec 30, 2008 12:26 pm

Ah, thanks a ton Nick :D
I've been looking for a complex tut on this for a while, on Google.

I know some PHP, so I was wondering f there were any tuts on how to use it for an adoption system, but here it is xD

Thanks again ^^
Clicky clicky?
I need profile views to win a contest. The prize is a rare on DragCave.
Thanks to clickers! <3

ImageImageImageImage
User avatar
SilverFlame
 
Posts: 13
Joined: Sun Dec 28, 2008 11:27 am
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: Make your own PHP adoptables system

Postby Rolly-chan » Tue Dec 30, 2008 12:34 pm

First of all: THANK you for this tutorial! I've tried to learn PHP to make my own code but it seems I was thinking much too complicated XD

I have a question though: If I upload my pets into another folder that is not in the folder where the php-sites are, what do I have to change so that the images of the pets show up on the page where the code for them is displayed?

Because the images are not displayed if I put them into another folder...
User avatar
Rolly-chan
 
Posts: 2790
Joined: Tue Nov 18, 2008 8:09 am
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: Make your own PHP adoptables system

Postby Mausoleum » Tue Dec 30, 2008 12:55 pm

Rolly-chan wrote:First of all: THANK you for this tutorial! I've tried to learn PHP to make my own code but it seems I was thinking much too complicated XD

I have a question though: If I upload my pets into another folder that is not in the folder where the php-sites are, what do I have to change so that the images of the pets show up on the page where the code for them is displayed?

Because the images are not displayed if I put them into another folder...


That's because when you just put the name of the image (like meep.png) then that tells your server that the picture is in the same folder as the file you're putting the name in. If you put it in another folder, you must change your linked file name accordingly. So, if you had two folders at the root, one with the images (called images) and one with the pet php files (called pets) then to link a pet from the images you'd put images/meep.png
Image
Kii Project + Lox Recolours + House of Snarkiness + Lackless Deviantart + Art competition = My Stuff.
If you'll excuse me, I'm going to lock myself in the pantry and drown my sorrows in bottled water and granola bars.
"I am an artist, not a printer" Remember that and heck yes, I said it first :U

User avatar
Mausoleum
 
Posts: 3907
Joined: Wed Oct 08, 2008 4:29 am
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Re: Make your own PHP adoptables system

Postby Rolly-chan » Tue Dec 30, 2008 1:00 pm

rosepose wrote:That's because when you just put the name of the image (like meep.png) then that tells your server that the picture is in the same folder as the file you're putting the name in. If you put it in another folder, you must change your linked file name accordingly. So, if you had two folders at the root, one with the images (called images) and one with the pet php files (called pets) then to link a pet from the images you'd put images/meep.png


Ah, I've found the problem. Thanks ^^ I forgot to change the path for the adults and that's why they wouldn't display =)
Thank you :D

Edit: Okay, it doesn't work. I just tried. And I only changed the path in the adoptables.xml file.
User avatar
Rolly-chan
 
Posts: 2790
Joined: Tue Nov 18, 2008 8:09 am
My pets
My items
My wishlist
My gallery
My scenes
My dressups
Trade with me

Who is online

Users browsing this forum: No registered users and 3 guests