Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #11  
Old 09-28-2012, 04:23 PM
GuardiansWish GuardiansWish is offline
Member
 
Join Date: Jun 2012
Posts: 95
Gender: Female
Credits: 8,869
GuardiansWish is on a distinguished road
Default

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

http://fc04.deviantart.net/fs71/f/20...sh-d5g9n5x.png
Reply With Quote
  #12  
Old 09-28-2012, 04:24 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 394,868
Hall of Famer is on a distinguished road
Default

umm what is the problem? The images wont show?
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #13  
Old 09-28-2012, 04:24 PM
GuardiansWish GuardiansWish is offline
Member
 
Join Date: Jun 2012
Posts: 95
Gender: Female
Credits: 8,869
GuardiansWish is on a distinguished road
Default

None of them will, nor will they with you go to level them up
Reply With Quote
  #14  
Old 09-28-2012, 05:04 PM
GuardiansWish GuardiansWish is offline
Member
 
Join Date: Jun 2012
Posts: 95
Gender: Female
Credits: 8,869
GuardiansWish is on a distinguished road
Default

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
Reply With Quote
  #15  
Old 09-28-2012, 05:13 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 394,868
Hall of Famer is on a distinguished road
Default

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


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #16  
Old 09-28-2012, 05:16 PM
GuardiansWish GuardiansWish is offline
Member
 
Join Date: Jun 2012
Posts: 95
Gender: Female
Credits: 8,869
GuardiansWish is on a distinguished road
Default

But what's the error about?
Reply With Quote
  #17  
Old 09-28-2012, 05:20 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 394,868
Hall of Famer is on a distinguished road
Default

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?
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #18  
Old 09-28-2012, 05:22 PM
GuardiansWish GuardiansWish is offline
Member
 
Join Date: Jun 2012
Posts: 95
Gender: Female
Credits: 8,869
GuardiansWish is on a distinguished road
Default

I think it is from both of them but I have no clue what the line requires.
Reply With Quote
  #19  
Old 09-28-2012, 05:34 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 394,868
Hall of Famer is on a distinguished road
Default

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.
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #20  
Old 09-28-2012, 08:05 PM
GuardiansWish GuardiansWish is offline
Member
 
Join Date: Jun 2012
Posts: 95
Gender: Female
Credits: 8,869
GuardiansWish is on a distinguished road
Default

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);

?>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Make free pet not show in adopt page? Abronsyth Questions and Supports 4 10-07-2014 03:29 PM
Need a pixel artist to help make adoptables! SilverDragonTears Staff Central 12 07-07-2012 11:18 AM
How to not show clicked adoptables Lonin Questions and Supports 9 06-08-2012 01:29 PM
View Active Promocodes Plugin HIddenPanda Mys v1.1.x Mods 11 01-25-2011 05:10 PM
show adoptables Blackmagic Questions and Supports 0 11-02-2009 02:36 AM


All times are GMT -5. The time now is 01:01 PM.

Currently Active Users: 962 (0 members and 962 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636