Jump to content

Acridic

Members
  • Posts

    3
  • Joined

  • Last visited

Acridic's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Okay that's good to know I didn't know if it would help any to post both. And I will poke that area and see if I can get it to work PFMaBiSmAd.
  2. I was given the code & the whole script for free, it does run I think it was ment for PHP4? But for what ever reason I can't get the PHP 5 script to run. Heres the original doadopt file before I was given the egg lock code (not sure if that will help or not ^-^). <?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"]; if($isloggedin == "yes"){ if($_SESSION["allow"] != 1){ $article_title = $err_idnoexist; $article_content = $err_idnoexist_text; } elseif($_SESSION["allow"] == 1){ // I guess the first thing to do is see if we have a valid adoptable ID submitted... if($id == "" or !is_numeric($id)){ $article_title = $err_idnoexist; $article_content = $err_idnoexist_text; } else{ // The adoptable ID appears to be valid, so we need to double check that it is valid by pulling up the adoptable in the DB $query = "SELECT * FROM {$prefix}adoptables, {$prefix}adoptables_conditions WHERE {$prefix}adoptables.id='{$id}' AND {$prefix}adoptables_conditions.id = {$prefix}adoptables.id"; $stmt = $adopts->query($query); $row = $stmt->fetchObject(); if($id == $row->id){ // The ID submitted matches an existing adoptable type $canadopt = canadopt($row->id, "adopting", $promocode, $row); // If we can adopt this creature, do the adoption if($canadopt == "yes") { if (changecash(-$row->cost, $GLOBALS['loggedinname'], $GLOBALS['money'])==true) { // BEGIN the actual adoption process // First we see if we have a custom name; if not, we use the default name if($name == "") $name = $row->type; // Now we determine if we are using alternate images or not $alts = getaltstatus($id, 0, 0); // We need a unique code for the adoptable so we can show it to the user when we're done here... $code = codegen(10, 0); $genders = array('f', 'm'); $rand = rand(0,1); $query = "INSERT INTO {$prefix}owned_adoptables (aid, type, name, owner, currentlevel, totalclicks, code, imageurl, usealternates, tradestatus, isfrozen, gender, lastbred) VALUES ('', '{$row->type}', '{$name}','{$loggedinname}','0','0', '{$code}', '','{$alts}','fortrade','no', '{$genders[$rand]}','0')"; $adopts->query($query); if(!empty($promocode)){ // The promo code has been used, needs to update it before information is leaked out! $newpromocode = codegen(15,0); $query = "UPDATE {$prefix}adoptables_conditions SET promocode='{$newpromocode}' WHERE type='{$row->type}'"; $adopts->query($query); } // Adoption complete, show the user a confirmation screen... $stmt = $adopts->query("SELECT * FROM {$prefix}owned_adoptables WHERE code='{$code}' and owner='{$loggedinname}'"); $owned_adoptable = $stmt->fetchObject(); $id = $owned_adoptable->aid; $article_title = $name." adopted successfully"; $article_content = "<img src='{$row->eggimage}'><br>{$congrats1} {$name}. You can now manage {$name} on the <a href='myadopts.php'>My Adopts</a> page.<br><br><b><a href='myadopts.php?act=manage&id={$id}'>Click Here to Manage {$name}</a><br> <a href='myadopts.php?act=bbcode&id={$id}'>Click Here to get BBCodes / HTML Codes for {$name}</a></b><br><br> Be sure and <a href='levelup.php?id={$id}'>feed</a> {$name} with clicks so that they grow!"; unset($_SESSION["allow"]); // END the actual adoption process } else { $article_title = "Not enough money."; $article_content = "You don't have enough {$GLOBALS['settings']['cost']} to buy this adoptable. Earn some money and then try again."; } } else { $article_title = $accden; $article_content = $adoptnoper; } } // End the if for if $id == $aid else { // Adoptable does not exist, show an error. $article_title = $err_idnoexist; $article_content = $err_idnoexist_text; } // End the else for if $id == $aid } // End the valid ID input else test statement (bulk of code goes above here) } } // End the log in check IF else { // Guests cannot adopt pets, so why bother... $article_title = $guesttitleerror; $article_content = $guesterror; } // End the log in check ELSE //***************// // OUTPUT PAGE // //***************// echo showpage($article_title, $article_content, $date); ?> Edit: I have to go run to the bank and deal with some stuff, when I get back I will look up what you said PFMaBiSmAd
  3. Acridic

    Hello!

    Hello! I found this site via google while trying to search up my mountain of php/script problems xD Thought I should post an introduction, I am still a baby when it comes to PHP, Java, MSQL and all those things but I am rather decent at CSS and HTML from coding little profiles for online games. I recently became the leader of a new adoption site and have no idea what I am doing! So I hope to find lots of answers and over all information to help me learn and point me in the right direction
  4. Okay so I am still a baby at PHP, I got the PHP 5 book for dummies but I haven't finished it all yet. Maybe I messed up something in mysql database or maybe it is just the php but the short story is this is my first time running a website. Anyways here is the script: <?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"]; if($isloggedin == "yes"){ $stmt = $adopts->query ($query = "SELECT * FROM {$prefix}adoptables, {$prefix}"."owned_adoptables WHERE owner='".$loggedinname."' AND currentlevel<'6' AND isfrozen='no'"); $data = $stmt->fetchAll(); $num = count($data); if($num >= 7){ $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; // The adoptable ID appears to be valid, so we need to double check that it is valid by pulling up the adoptable in the DB $query = "SELECT * FROM {$prefix}adoptables, {$prefix}adoptables_conditions WHERE {$prefix}adoptables.id='{$id}' AND {$prefix}adoptables_conditions.id = {$prefix}adoptables.id"; $stmt = $adopts->query($query); $row = $stmt->fetchObject(); if($id == $row->id){ // The ID submitted matches an existing adoptable type $canadopt = canadopt($row->id, "adopting", $promocode, $row); // If we can adopt this creature, do the adoption if($canadopt == "yes") { if (changecash(-$row->cost, $GLOBALS['loggedinname'], $GLOBALS['money'])==true) { // BEGIN the actual adoption process // First we see if we have a custom name; if not, we use the default name if($name == "") $name = $row->type; // Now we determine if we are using alternate images or not $alts = getaltstatus($id, 0, 0); // We need a unique code for the adoptable so we can show it to the user when we're done here... $code = codegen(10, 0); $genders = array('f', 'm'); $rand = rand(0,1); $query = "INSERT INTO {$prefix}owned_adoptables (aid, type, name, owner, currentlevel, totalclicks, code, imageurl, usealternates, tradestatus, isfrozen, gender, lastbred) VALUES ('', '{$row->type}', '{$name}','{$loggedinname}','0','0', '{$code}', '','{$alts}','fortrade','no', '{$genders[$rand]}','0')"; $adopts->query($query); if(!empty($promocode)){ // The promo code has been used, needs to update it before information is leaked out! $newpromocode = codegen(15,0); $query = "UPDATE {$prefix}adoptables_conditions SET promocode='{$newpromocode}' WHERE type='{$row->type}'"; $adopts->query($query); } // Adoption complete, show the user a confirmation screen... $stmt = $adopts->query("SELECT * FROM {$prefix}owned_adoptables WHERE code='{$code}' and owner='{$loggedinname}'"); $owned_adoptable = $stmt->fetchObject(); $id = $owned_adoptable->aid; $article_title = $name." adopted successfully"; $article_content = "<img src='{$row->eggimage}'><br>{$congrats1} {$name}. You can now manage {$name} on the <a href='myadopts.php'>My Adopts</a> page.<br><br><b><a href='myadopts.php?act=manage&id={$id}'>Click Here to Manage {$name}</a><br> <a href='myadopts.php?act=bbcode&id={$id}'>Click Here to get BBCodes / HTML Codes for {$name}</a></b><br><br> Be sure and <a href='levelup.php?id={$id}'>feed</a> {$name} with clicks so that they grow!"; unset($_SESSION["allow"]); // END the actual adoption process } else { $article_title = "Not enough money."; $article_content = "You don't have enough {$GLOBALS['settings']['cost']} to buy this adoptable. Earn some money and then try again."; } } else { $article_title = $accden; $article_content = $adoptnoper; } } // End the if for if $id == $aid else { // Adoptable does not exist, show an error. $article_title = $err_idnoexist; $article_content = $err_idnoexist_text; } // End the else for if $id == $aid } // End the valid ID input else test statement (bulk of code goes above here) } } // End the log in check IF else { // Guests cannot adopt pets, so why bother... $article_title = $guesttitleerror; $article_content = $guesterror; } // End the log in check ELSE //***************// // OUTPUT PAGE // //***************// echo showpage($article_title, $article_content, $date); ?> Ive tried everything from staring at it to poking it around but it doesn't change anything. I want to make it so people can pick out up to 7 eggs before they have to wait for them to reach a certain level and then they can pick up more eggs. I thought changing if($num >= 7) To 7 would work, but it still limits them to only 2 eggs. I really don't know what else to do.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.