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)
-   -   darn it (http://www.mysidiaadoptables.com/forum/showthread.php?t=1945)

RoconzaArt 02-23-2011 02:20 AM

darn it
 
I keep trying to upgrade my site and it will not let me so I reinstalled the whole thing three times and keep getting this error.

http://www.roconza.sessions-st.net/adoptables/index.php

Hall of Famer 02-23-2011 02:24 AM

umm what version of Mysidia Adoptables are you trying to upgrade? Version 1.1.4?

RoconzaArt 02-23-2011 02:26 AM

yes, I just tried it again and no dice. Now I'm trying to reinstall it.

Hall of Famer 02-23-2011 02:32 AM

Looks like a complicated problem. I'd recommend you to talk to Enddayne and see whether she happened to change the site settings. If not, come back to this thread and I will see what I can do to help you.

RoconzaArt 02-23-2011 02:48 AM

Hmmm I just installed it on my backup 000webhost account and got the page but with errors.

http://kawaiipetshop.net78.net/kawaiipetshop/index.php

Hall of Famer 02-23-2011 02:55 AM

umm this is weird, looks like you fail to connect to mysql.

RoconzaArt 02-23-2011 03:01 AM

I just installed 1.1.3 and it works fine. It most be some thing in 1.4.

fadillzzz 02-23-2011 03:09 AM

Maybe there's something wrong in the functions.php...
Post it here, I'll take a look at it

Hall of Famer 02-23-2011 03:15 AM

umm interesting, I installed version v1.1.4 and it had no problem for me. Post your function.php and I'd like to see if a mistake is made when compiling a compressed file.

RoconzaArt 02-23-2011 03:28 AM

A few things just happened:

I installed it to the root and it had no errors

I tried making a adoptable and it will not show up.

Hall of Famer 02-23-2011 03:53 AM

Are you sure you installed it in the right way? I created an adoptable from acp and it worked perfectly fine.

fadillzzz 02-23-2011 03:57 AM

Quote:

Originally Posted by RoconzaArt (Post 14873)
A few things just happened:

I installed it to the root and it had no errors

I tried making a adoptable and it will not show up.

Did the adoptable get inserted into the database?
If yes, there's probably something wrong with adopt.php

RoconzaArt 02-23-2011 04:02 AM

No it's not.

fadillzzz 02-23-2011 04:08 AM

Then that means, something is wrong with your nadopt.php

RoconzaArt 02-23-2011 04:11 AM

Weird I didn't even mess with the nadopt.php. Let me test some thing.

RoconzaArt 02-23-2011 04:16 AM

PHP Code:

<?php

// **********************************************************************
// Mysidia Adoptables Script: nadopt.php
// Copyright 2011 Mysidia Adoptables staff team
// For help and support: http://www.mysidiaadoptables.com/forum/
//
// Redistribution prohibited without written permission
// **********************************************************************

// **********************************************************************
// This file allows the administrator to create a new adoptable...
// File ID: nadopt.php
// **********************************************************************


// Wake the sleeping giant

// **********************************************************************
// Basic Configuration Info
// **********************************************************************

include("inc/functions.php");
include(
"inc/config.php");

$themeurl grabanysetting("themeurl");


// **********************************************************************
// Define our ads by calling getads()
// **********************************************************************

$ads ""// No Ads, because we're in the Admin CP...

// **********************************************************************
// Grab any dynamic article content from the content table
// **********************************************************************

$pagecontent getsitecontent("index");
$article_title $pagecontent[title];
$article_content $pagecontent[content];
$article_content nl2br($article_content);

// **********************************************************************
// Grab any settings that we will need for the current page from the DB
// **********************************************************************

$browsertitle grabanysetting("browsertitle");
$sitename grabanysetting("sitename");
$slogan grabanysetting("slogan");

// **********************************************************************
// Check and see if the user is logged in to the site
// **********************************************************************

$loginstatus logincheck();
$isloggedin $loginstatus[loginstatus];
$loggedinname $loginstatus[username];

// **********************************************************************
// End Prepwork - Output the page to the user
// **********************************************************************

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

$name $_POST["name"];
$name preg_replace("/[^a-zA-Z0-9\\040.]/"""$name);
$name secure($name);

$description $_POST["description"];
$description secure($description);

$imageurl $_POST["imageurl"];
$imageurl secure($imageurl);

$existingimageurl $_POST["existingimageurl"];
$existingimageurl secure($existingimageurl);

$cba $_POST["cba"];
$cba preg_replace("/[^a-zA-Z0-9\\040.]/"""$cba);
$cba secure($cba);

$promocode $_POST["promocode"];
$promocode preg_replace("/[^a-zA-Z0-9\\040.]/"""$promocode);
$promocode secure($promocode);

$freqcond $_POST["freqcond"];
$freqcond secure($freqcond);

$number $_POST["number"];
$number secure($number);

$datecond $_POST["datecond"];
$datecond secure($datecond);

$date $_POST["date"];
$date secure($date);

$adoptscond $_POST["adoptscond"];
$adoptscond secure($adoptscond);

//////////////////////////////////////////////////////////////////////

$maxnumcond $_POST["maxnumcond"];
$maxnumcond secure($maxnumcond);

$morethannum $_POST["morethannum"];
$morethannum secure($morethannum);

$usergroupcond $_POST["usergroupcond"];
$usergroupcond secure($usergroupcond);

$usergroups $_POST["usergroups"];
$usergroups secure($usergroups);


//////////////////////////////////////////////////////////////////////

$alternates $_POST["alternates"];
$alternates secure($alternates);

$altoutlevel $_POST["altoutlevel"];
$altoutlevel secure($altoutlevel);

$altchance $_POST["altchance"];
$altchance secure($altchance);

$pricestatus $_POST["pricestatus"];
$pricestatus secure($pricestatus);

$pricevalue $_POST["pricevalue"];
$pricevalue secure($pricevalue);

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

$error ""

if(
$name == ""){
$error "You did not enter in a name for the adoptable.  Please go back and try again.";
}

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 we are using a promo code, we should have a promo code in the box...
if($cba == "promo" and $promocode == ""){
$error "You selected that this adoptable is available for adoption only with a promo code, but you did not enter in a promo code.  Please go back and either change this setting or type in a valid promo code.";
}

//If we are using conditions...

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.";
        }

}

if(
$pricestatus == "enabled"){

        if(!
is_numeric($pricevalue) or !is_numeric($pricevalue)){
        
$error "There has been an error with the adoptable's pricing settings you selected.  Please go back and make sure the price of your adoptable filled in correctly.";
        }
        if(
$pricevalue 0){
        
$error "Your adoptable's price cannot be a negative number, please go back and change this value again.";
        }

}

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

$query "SELECT * FROM ".$prefix."adoptables WHERE type = '$name'";
$result mysql_query($query);
$num mysql_numrows($result);

if(
$num 0){
$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...

$eggimage "";

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

mysql_query("INSERT INTO ".$prefix."adoptables VALUES ('', '$name', '$description','$eggimage','$cba','$promocode', '$freqcond', '$number','$datecond','$date','$adoptscond','$maxnumcond','$morethannum','$usergroupcond','$usergroups','$alternates','$altoutlevel','$altchance','$pricestatus','$pricevalue')");

$article_title "Adoptable Added Successfully";
$article_content "Your adoptable, ".$name.", has been added to the database successfully.  You can now <a href='admin.php?set=adopts&do=addlevel'>Add a Level</a> to this adoptable.  You can also <a href='admin.php'>go back to the Admin CP index page</a>.";

}


//This bracket ends the check of whether or not this user can access the adopts portion of the ACP


}



else{

$article_title "Access Denied";
$article_content "Access Denied";

}

// **********************************************************************
// Begin Template Definition
// **********************************************************************

//Define our current theme
$file $themeurl;

// Do the template changes and echo the ready template
$template file_get_contents($file);

$template replace(':ARTICLETITLE:',$article_title,$template);
$template replace(':ARTICLECONTENT:',$article_content,$template);
$template replace(':ARTICLEDATE:',$article_date,$template);

$template replace(':BROWSERTITLE:',$browsertitle,$template);
$template replace(':SITENAME:',$sitename,$template);

//Define our links

if($cancp == "yes"){

//Admins see a custom set of links here...

$links getadmlinks();

}
else{

$links getlinks();

}

$template replace(':LINKSBAR:',$links,$template);

//Get the content for the side bar...

$sidebar getsidebar();
$template replace(':SIDEFEED:',$sidebar,$template);

//Get the ad content...
$template replace(':ADS:',$ads,$template);

//Get the slogan info
$template replace(':SLOGAN:',$slogan,$template);


echo 
$template;

// **********************************************************************
// End Template Definition
// **********************************************************************



?>


Hall of Famer 02-23-2011 04:25 AM

umm I dont get it, it seems that your nadopt.php is completely fine to me. Can you take a screenshot of your sql table prefix_adoptables? Thanks.

RoconzaArt 02-23-2011 04:33 AM

It's not adopting that the problem it's making the pet to adopt.

http://i1134.photobucket.com/albums/...n/6edef2b2.png
http://i1134.photobucket.com/albums/...n/847fdc71.png

fadillzzz 02-23-2011 04:44 AM

The prefix_adoptables is missing 2 fields pricestatus & pricevalue

The insert query in nadopt.php:
Code:

INSERT INTO ".$prefix."adoptables VALUES ('', '$name', '$description','$eggimage','$cba','$promocode', '$freqcond', '$number','$datecond','$date','$adoptscond','$maxnumcond','$morethannum','$usergroupcond','$usergroups','$alternates','$altoutlevel','$altchance','$pricestatus','$pricevalue')
Either remove those 2 variables from the insert query or add 2 fields to the table.

RoconzaArt 02-23-2011 04:50 AM

What is the type and collation on them? Are they default or not?

Sorry for causing troble

Hall of Famer 02-23-2011 04:50 AM

Well yeah, Fadillzzz is right, your sql table is missing two columns. I have no idea why this happens, you were not using a fresh install of Mys v1.1.4, were you? I am pretty sure the new configwrite.php file does automatically create two new columns in table prefix_owned_adoptables.

fadillzzz 02-23-2011 04:52 AM

This is the CREATE table query from the installation script
PHP Code:

$query "CREATE TABLE ".$prefix."adoptables (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, type varchar(40), description varchar(300), eggimage varchar(120), whenisavail varchar(50), promocode varchar(50), freqcond varchar(50), number INT, datecond varchar(50), date varchar(20), adoptscond varchar(20), moreless varchar(20), morelessnum INT, levelgrle varchar(25), grlelevel INT, alternates varchar(10), altoutlevel INT, altchance INT, pricestatus varchar(10), pricevalue INT)"

The pricestatus field's type is varchar with length of 10
the pricevalue field's type is int

fadillzzz 02-23-2011 04:57 AM

For pricestatus use latin1_general_ci
For pricevalue leave it blank

I think they're both NULL by default

EDIT: Sorry for double post

RoconzaArt 02-23-2011 05:03 AM

Ya that worked.

I did do a fresh install I dunno why it didn't work,


All times are GMT -5. The time now is 05:49 AM.

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