![]() |
|
#1
|
||||
|
||||
|
So, on my site, I'd like to make it so that a user can only own one growing pet at a time. So, they adopt their first pet, then it must reach it's maximum level ('3' in most cases; 0, 1, 2, 3) before they can adopt another pet.
Would someone be able to code this for me? I can offer art, line art, shading of a line art, writing, or something as payment. Well, Thanks -Iris
__________________
My Mods Site (1.3.4, 2020 Mods) |
|
#2
|
||||
|
||||
|
I think you're looking for something like what I have. The user can only have 5 eggs at a time. But you have to add it to breeding.php, the pound (which with the new script I haven't tried yet) doadopt.php and I think that's it. It's something like this though
Code:
$stmt = $adopts->query("SELECT * FROM ".constant("PREFIX")."owned_adoptables WHERE owner='".$loggedinname."' AND currentlevel<='3' AND isfrozen='no'");
$data = $stmt->fetchAll();
$num = count($data);
if($num >= 5){
$canadopt = "no";
$article_title = "Too many eggs!"; $article_content = "You already have too many eggs to take care of! Come back once you have hatched an egg!";
}
else
|
|
#3
|
||||
|
||||
|
Thank you so much! However, on which line should that go for each?
Thanks, -Iris
__________________
My Mods Site (1.3.4, 2020 Mods) |
|
#4
|
||||
|
||||
|
This is the doadopt.php
Code:
<?php
include("functions/functions.php");
include("functions/functions_users.php");
include("functions/functions_adopts.php");
include("inc/lang.php");
//***************//
// START SCRIPT //
//***************//
$id = $_GET["id"];
$promocode = $_GET["promocode"];
$name = $_GET["name"];
$date = date("M j, Y");
// $date = "Oct 23, 2001";
if($isloggedin == "yes"){
$stmt = $adopts->query("SELECT * FROM ".constant("PREFIX")."owned_adoptables WHERE owner='".$loggedinname."' AND currentlevel<='3' AND isfrozen='no'");
$data = $stmt->fetchAll();
$num = count($data);
if($num >= 5){
$canadopt = "no";
$article_title = "Too many eggs!"; $article_content = "You already have too many eggs to take care of! Come back once you have hatched an egg!";
}
else
if($_SESSION["allow"] != 1){
$article_title = $err_idnoexist;
$article_content = $err_idnoexist_text;
}
|
|
#5
|
||||
|
||||
|
Huh, didn't seem to work properly. Now it keeps saying that the id was invalid, the id is 3, and it shows up in the url, but wasn't working. I reverted it to the original...hm...
__________________
My Mods Site (1.3.4, 2020 Mods) |
|
#6
|
||||
|
||||
|
Can you post the edited part?
|
![]() |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Looking for someone to code for me :) | Infernette | Staff Central | 33 | 02-03-2014 04:44 PM |
| PHP Code. | Aasixx | Questions and Supports | 2 | 09-17-2012 05:15 PM |
| Invite Code/Alpha Code | Shex | Questions and Supports | 0 | 03-07-2011 04:08 AM |
| I need a simple code | Cosma | Questions and Supports | 2 | 01-26-2010 04:55 AM |
| Need a code to vote | Cosma | Questions and Supports | 0 | 01-25-2010 04:24 PM |
What's New? |
What's Hot? |
What's Popular? |