Need help with the site/forum/pets? Ask questions and get help from other members here.
by Lady » Fri Jan 30, 2009 7:54 pm
I don't know if this has been explained/asked/whatever yet, but if it has please ignore/point me there.

How do you disable older adopts from being adopted? You can always type in the adoption code in the address bar and find older pets, but I'd like to "close" those old adopts. Is that possible?
-

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
-
by Nick » Fri Jan 30, 2009 8:33 pm
Hm, that's interesting, Lady! Actually, it doesn't support that right now. Fortunately, adding it is easy. In your XML file where you have something like:
- Code: Select all
<adoptable id="1">
Just edit it like:
- Code: Select all
<adoptable id="1" closed="1">
Then in adopt.php, after this line:
- Code: Select all
$adoptable=find_adoptable($_REQUEST['id']);
You can add:
- Code: Select all
if (isset($adoptable['closed'])) exit();
Now if people try to guess the older ID numbers, they just get an empty page and no adoption.
-

Nick
- Admin
-
- Posts: 6349
- Joined: Thu Jul 03, 2008 2:40 pm
- My pets
- My items
- My wishlist
- My gallery
- My scenes
- My dressups
- Trade with me
-
by Lady » Sat Jan 31, 2009 12:46 am
thenickdude wrote:Hm, that's interesting, Lady! Actually, it doesn't support that right now. Fortunately, adding it is easy. In your XML file where you have something like:
- Code: Select all
<adoptable id="1">
Just edit it like:
- Code: Select all
<adoptable id="1" closed="1">
Then in adopt.php, after this line:
- Code: Select all
$adoptable=find_adoptable($_REQUEST['id']);
You can add:
- Code: Select all
if (isset($adoptable->closed)) exit();
Now if people try to guess the older ID numbers, they just get an empty page and no adoption.
Awesomeness.

You should probably add another little bit on the coding about that, or just post a link to your post to point it out.
-

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
-
by Nick » Sat Jan 31, 2009 5:43 pm
What addresses are you trying to go to to view them? The correct addresses to view those pics were in the post I made. As is demonstrated in the tutorial, you need to include the ?id=1 or ?id=2 part to tell simple.php WHICH pet it is supposed to display. If you just go to simple.php on its own, it doesn't know which picture to show so it just shows nothing.
-

Nick
- Admin
-
- Posts: 6349
- Joined: Thu Jul 03, 2008 2:40 pm
- My pets
- My items
- My wishlist
- My gallery
- My scenes
- My dressups
- Trade with me
-
by SilverFlame » Sun Feb 01, 2009 3:56 am
- Code: Select all
<?php
//Tell the browser that we are sending it a PNG image to display
header("Content-Type: image/gif");
if ($_REQUEST['id']==1) {
//Echo the contents of the image file called "dogbaby.png" to send it to the browser
readfile("1gold.gif");
} else if ($_REQUEST['id']==2) {
//Echo the contents of the image file called "ratbaby.png" to send it to the browser
readfile("1silver.gif");
}
exit();
?>
That's the code. It shows both IDs.
-

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
Who is online
Users browsing this forum: No registered users and 1 guest