Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   I can't make my adoptables show up/active! (http://www.mysidiaadoptables.com/forum/showthread.php?t=3795)

MintChip 08-10-2012 03:08 PM

I can't make my adoptables show up/active!
 
I'm new to mysidiaadopts, and my friend[Guardianswish] is my coder. She helps with the system. Well she's busy/gone and I can't figure out how to make the adoptables active. I can take them off, freeze/delete them. But I can't make them visible. Help? And coupled with that.. Our adoptables are all mixed up. They say the wrong names for the pictures they display, but when "fed" or "clicked" on the first time they turn into what the file was named? What's up with that?
http://www.chibifurs.com/adopt.php
See what I mean here?

I need to know if there's a way to fix both problems and as soon as possible. c:

Hall of Famer 08-12-2012 08:21 PM

umm it seems to me that your adoptables are showing up just fine, did your coder somehow fix this problem already?

MintChip 08-16-2012 01:40 PM

Quote:

Originally Posted by Hall of Famer (Post 24458)
umm it seems to me that your adoptables are showing up just fine, did your coder somehow fix this problem already?

The names are mixmatched. Here's a screenshot the with explaination.
Click

--
And as stated in the top, I can't make the adoptables show up.
The ones that are up the Coder put up. But there was a problem with a few and they disappeared. In the image above the "Brown Egg" actually is a Saber when you adopt it, and the egg won't show up period. The Dogs that were suppose to be up never showed up to adopt. They are in the system, and should be showing up, but I see nothing that needs clicked or anything to make them visible to everyone. I'm thinking somethings been done to make them not show up even after you have all the levels and everything set up, and the coder apparently knows how to make the adoptables visible but hasn't explained to me how to, or won't.

Aasixx 08-16-2012 05:23 PM

Try deleting and then re-adding the pets?

Hall of Famer 08-17-2012 03:31 AM

To me it seems that you are confused with the concept of adoptables types and levels. If you do not mind, show me a screenshot of your table prefix.adoptables in phpmyadmin. This way I can explain it more clearly to you.

GuardiansWish 09-28-2012 02:15 PM

Hi there. I'm their coder, back form being away and I can't figure it out either. Here's the screenshot you asked for.

http://fc03.deviantart.net/fs70/f/20...sh-d5g97nm.png

Hall of Famer 09-28-2012 03:56 PM

Well check your adopt_ids from the two tables of your database: prefix_adoptables, prefix_adoptables_conditions. Do they match each other? If not, your adoptables will not show up from adoption center. A common cause of this is reordering ids after deleting a record from phpmyadmin.

GuardiansWish 09-28-2012 04:01 PM

Should they match exactly, because this is the prefix_adoptables_conditions and it has a lot more in rows than prefix_adoptables

http://fc07.deviantart.net/fs70/f/20...sh-d5g9kij.png

Hall of Famer 09-28-2012 04:06 PM

Yes they are supposed to match with each other. I am guessing you deleted some records from table prefix_adoptables in phpmyadmin but not from the other table?

Anyway the easiest fix is to figure out which row from table prefix_adoptables_conditions should match with which row from table prefix_adoptables. In your database the ids are messed up, but the adoptables type should serve as a good indicator of how to match a row from one table to another.

GuardiansWish 09-28-2012 04:11 PM

If I did, it was accidental.

I'll get them to match and let you know how it goes.

GuardiansWish 09-28-2012 04:23 PM

OKay, did all that. But now here's what's happened.

http://fc04.deviantart.net/fs71/f/20...sh-d5g9n5x.png

Hall of Famer 09-28-2012 04:24 PM

umm what is the problem? The images wont show?

GuardiansWish 09-28-2012 04:24 PM

None of them will, nor will they with you go to level them up

GuardiansWish 09-28-2012 05:04 PM

I just tried to make a test pet to see if it would just effect older images and this is what I got:


Fatal error: Uncaught exception 'Exception' with message 'Database error 1054 - Unknown column 'class' in 'field list'' in /home/chibifur/public_html/classes/class_database.php:161 Stack trace: #0 /home/chibifur/public_html/classes/class_database.php(54): Database->_query('adoptables', Array, 'insert') #1 /home/chibifur/public_html/admincp/adoptpost.php(92): Database->insert('adoptables', Array) #2 {main} thrown in /home/chibifur/public_html/classes/class_database.php on line 161

Hall of Famer 09-28-2012 05:13 PM

Well it seems to me that you need to fix id mismatch for the table prefix_levels too.

GuardiansWish 09-28-2012 05:16 PM

But what's the error about?

Hall of Famer 09-28-2012 05:20 PM

The error says that the field 'class' is nonexistent in your database table prefix_adoptables. Take a look at it from phpadmymin and see if this is indeed the case?

GuardiansWish 09-28-2012 05:22 PM

I think it is from both of them but I have no clue what the line requires.

Hall of Famer 09-28-2012 05:34 PM

umm post your adoptpost.php file from admincp folder. Id like to see what goes wrong for you. Its weird though, your earlier screenshots showed clearly that the column 'class' exists in your table prefix_adoptables.

GuardiansWish 09-28-2012 08:05 PM

Yea, I realized that and went back and re-did it, still getting the same error.

Code:

<?php

define("SUBDIR", "AdminCP");
include("../functions/functions.php");
include("../functions/functions_users.php");
include("../functions/functions_adopts.php");
include("../inc/lang.php");

//***************//
//  START SCRIPT //
//***************//

if($isloggedin == "yes"){

        $group = getgroup();
        $cancp = cancp($group);
        $canedit = cando($group, "canmanageadopts");

        if($cancp == "yes" and $canedit == "yes"){

                // We are logged in and can access this page, so let's get the post info...
                // We sanitize at the same time we take in...

                $page = $_POST["page"];

                if($page == "createanadopt"){
                // We are logged in and can access this page, so let's get the post info...
                    $name = $_POST["name"];
                    $class = $_POST["class"];
                    $description = $_POST["description"];
                    $cost = $_POST["cost"];
                    $imageurl = $_POST["imageurl"];
                    $existingimageurl = $_POST["existingimageurl"];
                    $cba = $_POST["cba"];
                    $freqcond = $_POST["freqcond"];
                    $number = $_POST["number"];
                    $datecond = $_POST["datecond"];
                    $date = $_POST["date"];
                    $adoptscond = $_POST["adoptscond"];
                    //////////////////////////////////////////////////////////////////////
                    $maxnumcond = $_POST["maxnumcond"];
                    $morethannum = $_POST["morethannum"];
                    $usergroupcond = $_POST["usergroupcond"];
                    $usergroups = $_POST["usergroups"];
                    //////////////////////////////////////////////////////////////////////
                    $alternates = $_POST["alternates"];
                    $altoutlevel = $_POST["altoutlevel"];
                    $altchance = $_POST["altchance"];

                    // Now we run some checks to make sure that we have a go.

                    if($name == "") $error = "You did not enter in a name for the adoptable. Please go back and try again.";
                    if($imageurl == "" and $existingimageurl == "none") $error = "You did not select an image for this adoptable. Please go back and make sure an image is selected for this adopt.";
                    if($imageurl != "" and $existingimageurl != "none") $error = "You selected two images for the adoptable's egg image. Please go back and make sure that either the image textbox is blank or the image dropdown box is set to No Exising Image.";
                    if($cba != "always" and $cba != "promo" and $cba != "conditions") $error = "You did not choose a valid scenario when this adoptable can be adopted. Please go back and either select the Always option, the Promo option or the Conditions option.";
                    if($cba == "conditions"){
                            if($freqcond == "enabled" and !is_numeric($number)) $error = "A condition is enabled but is blank or has an incorrect value. Please go back and double check your conditions and that they contain valid input.";
                            if($datecond == "enabled" and $date == "") $error = "A condition is enabled but is blank or has an incorrect value. Please go back and double check your conditions and that they contain valid input.";
                            if($adoptscond == "enabled"){
                                  if($moreless == "" or !is_numeric($morelessnum) or $levelgrle == "" or !is_numeric($grlelevel)) $error = "A condition is enabled but is blank or has an incorrect value. Please go back and double check your conditions and that they contain valid input.";
                            }

                            if($maxnumcond == "enabled" and !is_numeric($morethannum)) $error = "A condition is enabled but is blank or has an incorrect value. Please go back and double check your conditions and that they contain valid input.";
                            if($usergroupcond == "enabled" and !is_numeric($usergroups)) $error = "A condition is enabled but is blank or has an incorrect value. Please go back and double check your conditions and that they contain valid input.";
                    }

                    if($alternates == "enabled") {
                                if(!is_numeric($altoutlevel) or !is_numeric($altchance)) $error = "There has been an error with the adoptable's alternate settings you selected. Please go back and make sure the alternate values are filled in correctly.";
                    }

                    //Check and see if an adoptable with this name already exists...

                    $obj = $adopts->select("adoptables", array(), "type = '{$name}'")->fetchObject();
                    if(is_object($obj)) $error = "An adoptable with this name already exists in your database. Please go back and rename the adoptable to something different.";

                    //If we have an error, show it.  Otherwise continue...

                    if($error != ""){
                            $article_title = "An Error Has Occurred!";
                            $article_content = $error;
                    }
                    else{
                            //There has been no error, continue with the addition of the adoptable to the system...

                            //First determine which image URL to use...

                            if($imageurl != "" and $existingimageurl == "none") $eggimage = $imageurl;
                            else $eggimage = $existingimageurl;

                            // insert into table adoptables
                                $adopts->insert("adoptables", array("id" => NULL, "type" => $name, "class" => $class, "description" => $description, "eggimage" => $eggimage, "whenisavail" => $cba,
                                                                    "alternates" => $alternates, "altoutlevel" => $altoutlevel, "altchance" => $altchance, "cost" => $cost));
                               
                // insert into table adoptables_conditions       
                                $adopts->insert("adoptables_conditions", array("id" => NULL, "type" => $name, "whenisavail" => $cba, "freqcond" => $freqcond, "number" => $number, "datecond" => $datecond,
                                                                              "date" => $date, "adoptscond" => $adoptscond, "moreless" => $maxnumcond, "morelessnum" => $morethannum, "levelgrle" => $usergroupcond, "grlelevel" => $usergroups));
                               
                            // insert our level thing
                            $adopts->insert("levels", array("lvid" => NULL, "adoptiename" => $name, "thisislevel" => 0, "requiredclicks" => 0,
                                                                "primaryimage" => $eggimage, "alternateimage" => NULL, "rewarduser" => NULL, "promocode" => NULL));
                                                       
                            $article_title = "Adoptable Added Successfully";
                            $article_content = "Your adoptable, {$name}, has been added to the database successfully. You can now <a href='adopt.php?do=addlevel'>Add a Level</a> to this adoptable. You can also <a href='index.php'>go back to the Admin CP index page</a>.";
                    }
            }               
                elseif($page == "editanadopt"){

                        // Edit an adoptable...

                        $select = $_POST["select"];
                        $delete = $_POST["delete"];
                        $deltype = $_POST["deltype"];
                        $resetconds = $_POST["resetconds"];
                        $resetdate = $_POST["resetdate"];
                        $date = $_POST["date"];
                        $type = $_POST["type"];

                        if($delete == "yes"){

                                // We are either deleting or freezing the adoptable...

                                if($deltype == "freeze"){

                                        // We are simply freezing the adoptable, prohibiting new adoptions...
                                        // Let's use the conditions setting to make an impossible condition so it can never be adopted...
                                        $code = rand(1,300000);
                                       
                                        $adopts->update("adoptables", array("whenisavail" => promo), "type='{$type}'");
                                        $adopts->update("adoptables_conditions", array("whenisavail" => promo), "type='{$type}'");

                                        $article_title = "Adoptable Frozen Successfully";
                                        $article_content = "This adoptable will no longer appear available for new adoptions.
                                                                                To reverse this you can manage this adoptable again and choose to remove all restrictions on its adoption.
                                                                                <a href='adopt.php'>Click Here</a> to manage your adoptables.";

                                }
                                elseif($deltype == "soft"){

                                        // We are doing a soft delete...
                                        // First we need to level up any users currently using this adoptable as an egg...                                       
                                        // Now we do a mass upgrade of all users with this adoptable type and eggs of this adoptable type...

                                        $adopts->update("owned_adoptables", array("currentlevel" => 1), "type='{$type}' AND currentlevel='0'");
                                        // Now we delete the egg image...

                                        $adopts->delete("adoptables", "type='{$type}'");
                    $adopts->delete("adoptables_conditions", "type='{$type}'");

                                        $article_title = "Adoptable Deleted Successfully";
                                        $article_content = "A soft delete was performed successfully. <a href='adopts.php'>Click Here</a> to manage your adoptables.";

                                }
                                elseif($deltype == "hard"){

                                        // Hard delete, there's no going back...

                                        // First we delete any owned adoptables of this type from the system...

                                        $adopts->delete("owned_adoptables", "type='{$type}'");

                                        // Now delete any levels for this type of adoptable...

                                        $adopts->delete("levels", "adoptiename='{$type}'");
                                        // Now we can delete the egg image...

                                        $adopts->delete("adoptables", "type='{$type}'");
                    $adopts->delete("adoptables_conditions", "type='{$type}'");

                                        $article_title = "Adoptable Deleted Successfully";
                                        $article_content = "The adoptable was deleted successfully and was purged from the system. All traces have been removed.
                                        <a href='adopt.php'>Click Here</a> to manage adoptables.";

                                }
                                else{

                                        // We should NEVER get here under normal operations (unless the user is an idiot)...                                       
                                        $article_title = "Delete Error";
                                        $article_content = "We could not delete your adoptable from the system. Perhaps you did not specify a deletion type? 
                                                                                If that's the case, please go back and specify a deletion type.";
                                }
                        }
                        else{

                                // We are not deleting or freezing the adoptable, so do the rest of the actions...

                                if($select != "" and $select != "nochange"){
                                        // We are updating the adoptable's image in the database...
                                        $adopts->update("adoptables", array("eggimage" => $select), "type='{$type}'");
                                }

                                if($resetconds == "yes"){

                                        // Let's remove all of the restrictions from this adoptable
                                        // This is easy, just set when is available to always :)

                                        $adopts->update("adoptables", array("whenisavail" => 'always'), "type='{$type}'");
                    $adopts->update("adoptables_conditions", array("whenisavail" => 'always'), "type='{$type}'");
                                }

                                if($resetdate == "yes" and $date != ""){

                                        // We are resetting only the adoption based date restriction...
                                        $adopts->update("adoptables_conditions", array("date" => $date), "type='{$type}'");
                                }

                                // All Done!

                                $article_title = "Adoptable Updated";
                                $article_content = "Your changes have been saved. <a href='adopt.php'>Click Here</a> to manage your adoptables.";
                        }

                }
                elseif($page == "addanadopt"){
               
                    // We are giving an adoptable to user
                    $owned_adoptable['type'] = $_POST["type"];
            $owned_adoptable['name'] = $_POST["name"];
            $owned_adoptable['owner'] = $_POST["owner"];
            $owned_adoptable['clicks'] = $_POST["clicks"];
            $owned_adoptable['level'] = $_POST["level"];
            $owned_adoptable['usealternates'] = $_POST["usealternates"];
            $owned_adoptable['gender'] = $_POST["gender"];

            foreach($owned_adoptable as $key=>$val){
                if($val == ""){
                    $error = "You did not enter in {$key} for the adoptable.  Please go back and try again.";
                    $flag = "yes";
                }
            }                                               

            switch ($flag){
                case "yes":
                //If we have an error, show it.  Otherwise continue...
                $article_title = "An Error Has Occurred!";
                $article_content = $error;
                break;
 
                default:
                //There has been no error, continue with the addition of the adoptable to the system...
                $code = codegen(10,0);
                $adopts->insert("owned_adoptables", array("aid" => NULL, "type" => $owned_adoptable['type'], "name" => $owned_adoptable['name'], "owner" => $owned_adoptable['owner'], "currentlevel" => $owned_adoptable['level'], "totalclicks" => $owned_adoptable['clicks'], "code" => $code,
                                                                      "imageurl" => NULL, "usealternates" => $owned_adoptable['usealternates'], "tradestatus" => 'fortrade', "isfrozen" => 'no', "gender" => $owned_adoptable['gender'], "lastbred" => 0));
                               
                $article_title = "Adoptable Added Successfully";
                $article_content = "A new adoptable, {$owned_adoptable['name']}, has been added for user {$owned_adoptable['owner']} successfully.
                                  </br><a href='users.php'>Click Here</a> to return to the user manager.";
 
            }
                }
                elseif($page == "manageanadopt"){
                    // We are now editing this adoptable's info

            $aid = $_POST["aid"];
            $owned_adoptable['type'] = $_POST["type"];
            $owned_adoptable['name'] = $_POST["name"];
            $owned_adoptable['owner'] = $_POST["owner"];
            $owned_adoptable['clicks'] = $_POST["totalclicks"];
            $owned_adoptable['level'] = $_POST["currentlevel"];
            $owned_adoptable['gender'] = $_POST["gender"];

            // Now we run some checks to make sure that we have a go.

            foreach($owned_adoptable as $key=>$val){
                if($val == ""){
                    $error = "You did not enter in {$key} for the adoptable.  Please go back and try again.";
                    $flag = "yes";
                }
            }                       

            switch ($flag){
                case "yes":
                //If we have an error, show it.  Otherwise continue...
                $article_title = "An Error Has Occurred!";
                $article_content = $error;
                break;
 
                default:
                //There has been no error, continue with the editing of the adoptable to the system...
                $adopts->update("owned_adoptables", array("type" => $owned_adoptable['type'], "name" => $owned_adoptable['name'], "owner" => $owned_adoptable['owner'], "totalclicks" => $owned_adoptable['clicks'], "currentlevel" => $owned_adoptable['level'], "gender" => $owned_adoptable['gender']), "aid='{$aid}'");
                $article_title = "Adoptable Edited Successfully";
                $article_content = "The data of adoptable {$owned_adoptable['name']} has been edited for user {$owned_adoptable['owner']} successfully.
                                </br><a href='users.php'>Click Here</a> to return to the user manager. ";
            }
                }
                elseif($page == "delimg")
                {

                        // Delete an image...

                        $iid = $_POST["iid"];

                        if(is_numeric($iid)){

                                // Check that the image with the ID actually exists on the server...

                                $stmt = $adopts->select("filesmap", array(), "id='{$iid}'");
                                if($row = $stmt->fetchObject()){

                                        // Check that the image file exists on the server, it is writable, and the IDs match...

                                        if($row->id == $iid and is_writable($row->serverpath)){

                                                // We can only delete files that are writable by the server...

                                                // Actually delete the file...

                                                unlink($row->serverpath);

                                                // Delete the file from the filesmap...

                                                $adopts->delete("filesmap", "id='{$iid}'");
                                                $article_title = "File Deleted Successfully";
                                                $article_content = "The file was deleted successfully. <a href='adopt.php?do=manageimg'>Click Here</a> to delete another file.";

                                        }
                                        else{

                                                // We cannot delete the file...

                                                $article_title = "File Deletion Failed";
                                                $article_content = "We cannot delete your file. Either the file does not exist on the server, or it does not exist in the database, or it exists but it is not writable so the server will not permit deletion.
                                                Please use a FTP program to manually delete the file.";
                                        }
                                }
                                else{                               
                                        $article_title = "Image Not Found";
                                        $article_content = "An image with the specified ID was not found. Please go back and try again. If issues persist, try deleting the image with your FTP program.";                                       
                                }
                        }
                        else{               
                                $article_title = "Invalid or Incorrect Image ID";
                                $article_content = "The image id is either blank or is not numeric. Please go back and select a valid image from the images list.";
                        }
                }
                else{
                        $article_title = "Error";
                        $article_content = "Error. The specified action is invalid or does not exist!";
                }
        }
        else{
                $article_title = "Access Denied";
                $article_content = "Access Denied";
        }
}
else{
        $article_title = "Access Denied";
        $article_content = "Access Denied";
}

//***************//
//  OUTPUT PAGE  //
//***************//

echo showpage($article_title, $article_content, $date);

?>


Hall of Famer 09-30-2012 12:33 AM

Well it does not seem to me that there is anything wrong with the script, and in fact this is not really a glitch to begin with as the other users besides dev staff do not have such problem. Are you sure your database table prefix_adoptables contains a field called 'class'?

GuardiansWish 09-30-2012 06:59 AM

Yes, I am 100% sure.

Hall of Famer 09-30-2012 09:16 PM

umm this is weird, again I dont understand why you are getting an error saying the column 'class' does not exist. Please gimme more time investigating into the cause of the issue, it has never happened before.

GuardiansWish 10-01-2012 07:07 AM

Alright, I'll try to hold the fort down on this end.

GuardiansWish 10-04-2012 11:57 AM

My hand has been forced....I'll be re-installing the scripts with a new database today

Hall of Famer 10-04-2012 09:45 PM

I see, thats too bad. I am sorry to hear that, you are really experiencing a problem I've no idea how to resolve. A missing field 'class', but the screenshots you showed me clearly said the column exists in your database table and I see no error in your script file either.


All times are GMT -5. The time now is 11:59 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.