Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Mys v1.1.x Mods (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=20)
-   -   Adoptable shop new version! [UPDATED!] (http://www.mysidiaadoptables.com/forum/showthread.php?t=1360)

mapleblade 03-22-2010 03:42 PM

Adoptable shop new version! [UPDATED!]
 
1 Attachment(s)
Hey!

here were some bugs, i fixed em, and now the shop will be the normal adopt.php :D


the fixed version can be seen at: http://miromotel.0fees.net/adoptables/adopt.php

Im to lazy to explain all code so ill just put the files in a zip and show the SQL


NOTE: YOUR CURRENCY MUST BE NAMED "coins" OR IT WONT WORK!

SQL including users:
PHP Code:



CREATE TABLE 
IF NOT EXISTS `adopts_adoptables` (
  `
idint(11NOT NULL AUTO_INCREMENT,
  `
typevarchar(40) DEFAULT NULL,
  `
descriptionvarchar(300) DEFAULT NULL,
  `
eggimagevarchar(120) DEFAULT NULL,
  `
whenisavailvarchar(50) DEFAULT NULL,
  `
promocodevarchar(50) DEFAULT NULL,
  `
freqcondvarchar(50) DEFAULT NULL,
  `
numberint(11) DEFAULT NULL,
  `
datecondvarchar(50) DEFAULT NULL,
  `
datevarchar(20) DEFAULT NULL,
  `
adoptscondvarchar(20) DEFAULT NULL,
  `
morelessvarchar(20) DEFAULT NULL,
  `
morelessnumint(11) DEFAULT NULL,
  `
levelgrlevarchar(25) DEFAULT NULL,
  `
grlelevelint(11) DEFAULT NULL,
  `
alternatesvarchar(10) DEFAULT NULL,
  `
altoutlevelint(11) DEFAULT NULL,
  `
altchanceint(11) DEFAULT NULL,
  `
priceint(11NOT NULL DEFAULT '0',
  
PRIMARY KEY (`id`)
ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=;


CREATE TABLE IF NOT EXISTS `adopts_users` (
  `
uidint(11NOT NULL AUTO_INCREMENT,
  `
usernamevarchar(20) DEFAULT NULL,
  `
passwordvarchar(100) DEFAULT NULL,
  `
emailvarchar(60) DEFAULT NULL,
  `
usergroupint(11) DEFAULT NULL,
  `
newmessagenotifyvarchar(10) DEFAULT NULL,
  `
membersincevarchar(20) DEFAULT NULL,
  `
isbannedint(11) DEFAULT NULL,
  `
websitevarchar(80) DEFAULT NULL,
  `
profilepicvarchar(80) DEFAULT NULL,
  `
aimvarchar(80) DEFAULT NULL,
  `
yahoovarchar(80) DEFAULT NULL,
  `
msnvarchar(80) DEFAULT NULL,
  `
coinsint(11NOT NULL DEFAULT '0',
  
PRIMARY KEY (`uid`),
  
UNIQUE KEY `username` (`username`)
ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=

Okay now the files:

ATTACHED FILES IN ZIP:
adopt.php
doadopt.php
admin.php
nadopt.php
levelup.php (gives at levelup random between 100 and 200 coins)


Hope u guys like it :D

(for admin.php, only changed function is new (new adopt) for ppl who have other stuff in it)

redheadturkey 03-22-2010 06:52 PM

RE: Adoptable shop new version!
 
wow you're the best!! thanks so much for this, gonna try it all out! ^__________^

Arianna 03-23-2010 12:48 AM

RE: Adoptable shop new version!
 
While I appreciate your effort, I don't see why there's a third mod for this. Mine works just fine without a separate page. :P Either way, good job. ^^

mapleblade 03-23-2010 02:10 AM

RE: Adoptable shop new version!
 
well, i can just make it the normal adopts page, and make free adopts price 0, i thought ppl maybe wanted it seperate, and isnt this the first one thats released in forums, for the new version?

mapleblade 03-23-2010 07:34 AM

RE: Adoptable shop new version!
 
IF YOU GUYS WANT A ADOPT.PHP, BUT THEN TRANSFORMED TO SHOP, ILL MAKE IT WHEN 10PPL WANT IT, LOL

SieghartZeke 03-23-2010 08:18 AM

RE: Adoptable shop new version!
 
Err...I cant show the Demo!! O_O"

mapleblade 03-23-2010 08:33 AM

RE: Adoptable shop new version! (updating)
 
bequz the shop.php is gone now, irs adopt.php now

SieghartZeke 03-23-2010 08:33 AM

RE: Adoptable shop new version! (updating)
 
Oh...Now i have seen the demo...fantastic...=_="

mapleblade 03-23-2010 08:37 AM

RE: Adoptable shop new version! (updating)
 
whats wrong? lol..., im now on pc, so ill post the new files within an hour.

SieghartZeke 03-23-2010 08:37 AM

RE: Adoptable shop new version! (updating)
 
Oh Okay...Thank you VwV

mapleblade 03-23-2010 09:00 AM

RE: Adoptable shop new version! [UPDATED!]
 
UPDATED!

Arianna 03-23-2010 12:21 PM

RE: Adoptable shop new version!
 
Quote:

Originally Posted by mapleblade
well, i can just make it the normal adopts page, and make free adopts price 0, i thought ppl maybe wanted it seperate, and isnt this the first one thats released in forums, for the new version?

Oh; mine's a donator mod. Oh well. xD

mapleblade 03-23-2010 12:24 PM

RE: Adoptable shop new version! [UPDATED!]
 
lol, now its for everyone bcuz i made one lol....

but it IS nice huh? xD

redheadturkey 03-23-2010 01:03 PM

RE: Adoptable shop new version! [UPDATED!]
 
Something I really need is a good working item shop, but I might be able to get this to work for that somehow ---

but yes, it's really very nice, and thank you for sharing it! :D :D

mapleblade 03-23-2010 01:37 PM

RE: Adoptable shop new version! [UPDATED!]
 
u can maybe make an new table shop_items or such, and change the php of the shop to the items.

Arianna 03-23-2010 03:47 PM

RE: Adoptable shop new version! [UPDATED!]
 
I coded an inventory script; I thought I offered it to you, redheadturkey/Annatar. :)

redheadturkey 03-23-2010 05:30 PM

RE: Adoptable shop new version! [UPDATED!]
 
I never got it hun .. <3 I think you were going to send it? ... or maybe I didn't get that message or something, I'd LOVE to have it though! You can send it here or Annatar either one <3 thanks!!

Arianna 03-24-2010 01:04 AM

RE: Adoptable shop new version! [UPDATED!]
 
I've been super-busy lately and I hardly have enough time to work on my own stuff; should be in your PMs this weekend. I hope.

redheadturkey 03-24-2010 01:57 AM

RE: Adoptable shop new version! [UPDATED!]
 
thanks Arianna, I really appreciate it! Just whenever you can send it is great... no worries! <3

SieghartZeke 03-24-2010 08:06 AM

RE: Adoptable shop new version! [UPDATED!]
 
Ehm...But is strange...when i go to lvl up...I have the total money ugual to the money received! HELP!"

mapleblade 03-24-2010 08:17 AM

RE: Adoptable shop new version! [UPDATED!]
 
ugal?[hr]
i made an account on your site, it looks fine...

SieghartZeke 03-25-2010 12:24 PM

RE: Adoptable shop new version! [UPDATED!]
 
Uhm...Not in The Site Link!!

http://gca.netai.net[hr]
Here What I show:
You have gained 190 Coins! Your total coins are now : 190
IS THE SAME THE TOTAL MONEY!!! WHY!??!?![hr]
And...Why I dont show the new pets with the Price in adopt.php????

mapleblade 03-25-2010 02:44 PM

RE: Adoptable shop new version! [UPDATED!]
 
Quote:

Originally Posted by SieghartZeke
Uhm...Not in The Site Link!!

http://gca.netai.net[hr]
Here What I show:
You have gained 190 Coins! Your total coins are now : 190
IS THE SAME THE TOTAL MONEY!!! WHY!??!?![hr]
And...Why I dont show the new pets with the Price in adopt.php????

Uhm you have added the price table in adoptables table in your MYSQL?
And, is your currency named coins?

also look at your users table if theres a table coins.

If you still have that, i dont know whats wrong, because with my fresh install it works just fine.[hr]
Your registration is also wrong, at register .php add an extra ,'' at the mysql instert, thats the coins table.

SieghartZeke 03-25-2010 05:16 PM

RE: Adoptable shop new version! [UPDATED!]
 
Uhhhh can repair for me the problem???
Im a fail with coding...=_=""

Code:

<?php

// **********************************************************************
// Rusnak PHP Adoptables Script
// Copyright 2009 Brandon Rusnak
// For help and support: http://www.rusnakweb.com/forum/
//
// Redistribution prohibited without written permission
// **********************************************************************

// Wake the sleeping giant

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

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

$themeurl = grabanysetting("themeurl");

// **********************************************************************
// Define our top links by calling getlinks()
// **********************************************************************

$links = getlinks();

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

$ads = getads("register");

// **********************************************************************
// 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"){

$article_title = "You already have an account";
$article_content = "You already have an account, thus there is no need for you to register a new one.";

}
else{

//Grab the post data from the form

$username = $_POST["username"];
$pass1 = $_POST["pass1"];
$pass2 = $_POST["pass2"];
$email = $_POST["email"];
$tos = $_POST["tos"];
$hidden = $_POST["hidden"];

//Protect the database
$username = preg_replace("/[^a-zA-Z0-9\040.]/", "", $username);
$username = secure($username);
$pass1 = secure($pass1);
$pass2 = secure($pass2);
$email = preg_replace("/[^a-zA-Z0-9@._-]/", "", $email);
$email = secure($email);
$tos = preg_replace("/[^a-zA-Z0-9s]/", "", $tos);
$hidden = preg_replace("/[^a-zA-Z0-9s]/", "", $hidden);

        if($hidden != "goregister"){

        //The form was not submitted, so we are showing the signup page...

        $article_title = $regnew;
        $article_content = $regnewexplain."<br><form name='form1' method='post' action='register.php'>
          <p>Username: <input name='username' type='text' id='username' maxlength='20'></p>
          <p>Your username may be up to 20 characters long and may only contain letters, numbers and spaces. </p>
          <p>Password: <input name='pass1' type='password' id='pass1' maxlength='20'></p>
          <p>Your password may be up to 20 characters long and may contain letters, numbers, spaces and special characters. The use of a special character, such as * or ! is recommended for increased security. </p>
          <p>Confirm Password: <input name='pass2' type='password' id='pass2' maxlength='20'></p>
          <p>Email Address: <input name='email' type='text' id='email'></p>
          <p><input name='tos' type='checkbox' id='tos' value='yes'> I agree to the <a href='tos.php' target='_blank'>Terms of Service</a>.
          <input name='hidden' type='hidden' id='hidden' value='goregister'></p>
          <p><input type='submit' name='Submit' value='Register'>
          </p></form>";


        }
        else{

        //We are attempting to register the user...

        //First MD5 hash the passwords:

        $pass1 = md5($pass1);
        $pass2 = md5($pass2);

        //Next check that the username does not already exist...

        $flag = 0;
        $query = "SELECT * FROM ".$prefix."users WHERE username = '$username'";
        $result = @mysql_query($query);
        $num = @mysql_numrows($result);

        if($num > 0){
        $flag = 1;
        }

        //Now we verify that the email address is a valid email address...
        $emailisvalid = "no";


        if(eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$", $email)) {
       
        $emailisvalid = "yes";
       
        }
       
        //First check that something required was not left blank...

        if($username == "" or $pass1 == "" or $pass2 == "" or $email == ""){
        $article_title = "Error";
        $article_content = $regblank;
        }
        else if($pass1 != $pass2){
       
        //Passwords do not match

        $article_title = "Your passwords do not match";
        $article_content = $passnomatch;

        }
        else if($tos != "yes"){

        //User did not agree to TOS
        $article_title = "Terms of Service Error";
        $article_content = $notos;

        }
        else if($flag > 0){

        //Username already exists
        $article_title = "Your username already exists";
        $article_content = $userexists;       

        }
        else if($emailisvalid != "yes"){

        //Email address is not valid or is a fake

        $article_title = "Email address is not valid";
        $article_content = $emailinvalid;

        }
        else{

        //All checks are done, actually create the user's account on the database

        $date = date('Y-m-d');

            mysql_query("INSERT INTO ".$prefix."users VALUES ('', '$username', '$pass1','$email','3','1', '$date', '0','','','','','','0')");

        //Now that we have created the user, let's log them in...

        $status = dologin($username, $pass1);

        if($status != "success"){
       
        $article_title = "Something is Wrong!";
        $article_content = "Something is very, very wrong.  Please contact Elesis about this error.";

        }
        else{

        //We are registered and logged in...

        $article_title = $titleregsuccess;
        $article_content = $regsuccess."".$username."".$regsuccess2;

        //Reflect our changes in the sidebar...
        $sidebar = "<b><u>Welcome ".$username."</u></b>:<br><a href='account.php'>Go to My Account</a><br><a href='adopt.php'>Adopt Some Pets</a>";

        }


        }
       


        }

}

// **********************************************************************
// 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
$template = replace(':LINKSBAR:',$links,$template);

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

if($sidebar == ""){

$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
// **********************************************************************



?>

[hr]
Ehy...Im registrated in your site..and i see when i dont have money i can always buy a pet!! Is a Bug?

mapleblade 03-26-2010 02:20 AM

RE: Adoptable shop new version! [UPDATED!]
 
No, if your register, you gain 1000coins[hr]
Here ya go:
PHP Code:

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

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

$themeurl grabanysetting("themeurl");

// **********************************************************************
// Define our top links by calling getlinks()
// **********************************************************************

$links getlinks();

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

$ads getads("register");

// **********************************************************************
// 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"){

$article_title "You already have an account";
$article_content "You already have an account, thus there is no need for you to register a new one.";

}
else{

//Grab the post data from the form

$username $_POST["username"];
$pass1 $_POST["pass1"];
$pass2 $_POST["pass2"];
$email $_POST["email"];
$tos $_POST["tos"];
$hidden $_POST["hidden"];

//Protect the database
$username preg_replace("/[^a-zA-Z0-9\040.]/"""$username);
$username secure($username);
$pass1 secure($pass1);
$pass2 secure($pass2);
$email preg_replace("/[^a-zA-Z0-9@._-]/"""$email);
$email secure($email);
$tos preg_replace("/[^a-zA-Z0-9s]/"""$tos);
$hidden preg_replace("/[^a-zA-Z0-9s]/"""$hidden);

    if(
$hidden != "goregister"){

    
//The form was not submitted, so we are showing the signup page...

    
$article_title $regnew;
    
$article_content $regnewexplain."<br><form name='form1' method='post' action='register.php'>
      <p>Username: <input name='username' type='text' id='username' maxlength='20'></p>
      <p>Your username may be up to 20 characters long and may only contain letters, numbers and spaces. </p>
      <p>Password: <input name='pass1' type='password' id='pass1' maxlength='20'></p>
      <p>Your password may be up to 20 characters long and may contain letters, numbers, spaces and special characters. The use of a special character, such as * or ! is recommended for increased security. </p>
      <p>Confirm Password: <input name='pass2' type='password' id='pass2' maxlength='20'></p>
      <p>Email Address: <input name='email' type='text' id='email'></p>
      <p><input name='tos' type='checkbox' id='tos' value='yes'> I agree to the <a href='tos.php' target='_blank'>Terms of Service</a>. 
      <input name='hidden' type='hidden' id='hidden' value='goregister'></p>
      <p><input type='submit' name='Submit' value='Register'>
      </p></form>"
;


    }
    else{

    
//We are attempting to register the user...

    //First MD5 hash the passwords:

    
$pass1 md5($pass1);
    
$pass2 md5($pass2);

    
//Next check that the username does not already exist...

    
$flag 0;
    
$query "SELECT * FROM ".$prefix."users WHERE username = '$username'";
    
$result = @mysql_query($query);
    
$num = @mysql_numrows($result);

    if(
$num 0){
    
$flag 1;
    }

    
//Now we verify that the email address is a valid email address...
    
$emailisvalid "no";


    if(
eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$"$email)) {
    
    
$emailisvalid "yes";
    
    }
    
    
//First check that something required was not left blank...

    
if($username == "" or $pass1 == "" or $pass2 == "" or $email == ""){
    
$article_title "Error";
    
$article_content $regblank;
    }
    else if(
$pass1 != $pass2){
    
    
//Passwords do not match

    
$article_title "Your passwords do not match";
    
$article_content $passnomatch;

    }
    else if(
$tos != "yes"){

    
//User did not agree to TOS
    
$article_title "Terms of Service Error";
    
$article_content $notos;

    }
    else if(
$flag 0){

    
//Username already exists
    
$article_title "Your username already exists";
    
$article_content $userexists;    

    }
    else if(
$emailisvalid != "yes"){

    
//Email address is not valid or is a fake

    
$article_title "Email address is not valid";
    
$article_content $emailinvalid;

    }
    else{

    
//All checks are done, actually create the user's account on the database

    
$date date('Y-m-d');

        
mysql_query("INSERT INTO ".$prefix."users VALUES ('', '$username', '$pass1','$email','3','1', '$date', '0','','','','','','0','')"); 

    
//Now that we have created the user, let's log them in...

    
$status dologin($username$pass1);

    if(
$status != "success"){
    
    
$article_title "Something is Wrong!";
    
$article_content "Something is very, very wrong.  Please contact Elesis about this error.";

    }
    else{

    
//We are registered and logged in...

    
$article_title $titleregsuccess;
    
$article_content $regsuccess."".$username."".$regsuccess2;

    
//Reflect our changes in the sidebar... 
    
$sidebar "<b><u>Welcome ".$username."</u></b>:<br><a href='account.php'>Go to My Account</a><br><a href='adopt.php'>Adopt Some Pets</a>";

    }


    }
    


    }

}

// **********************************************************************
// 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
$template replace(':LINKSBAR:',$links,$template);

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

if($sidebar == ""){

$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
// **********************************************************************



?> 

[hr]
At my mysql, i set the dealfault 1000 so in the begining you have 1000coins.[hr]
Oh, there was someting wrong in doadopt.php[hr]
This fixes the unlimited adoptions problem :D
Doadopt.php
PHP Code:

<?php

// **********************************************************************
// Rusnak PHP Adoptables Script
// Copyright 2009 Brandon Rusnak
// For help and support: http://www.rusnakweb.com/forum/
//
// Redistribution prohibited without written permission
// **********************************************************************

// Wake the sleeping giant

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

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

$themeurl grabanysetting("themeurl");

// **********************************************************************
// Define our top links by calling getlinks()
// **********************************************************************

$links getlinks();

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

$ads getads("any");

// **********************************************************************
// 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
// This file actually processes the adoption of a pet...
// **********************************************************************

$id $_GET["id"];
$id preg_replace("/[^a-zA-Z0-9s]/"""$id);
$id secure($id);

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

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

if(
$isloggedin == "yes"){


// 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 WHERE id='$id'";
$result mysql_query($query);
$num mysql_numrows($result);

$query2 "SELECT * FROM ".$prefix."users WHERE username='$loginstatus[username]'";
$result2 mysql_query($query2);
$num2 mysql_numrows($result2);

//Loop out code
$i=0;
while (
$i 1) {

$aid=@mysql_result($result,$i,"id"); //The adoptable's ID
$type=@mysql_result($result,$i,"type");
$description=@mysql_result($result,$i,"description");
$eggimage=@mysql_result($result,$i,"eggimage");
$price=@mysql_result($result,$i,"price");
$coins=@mysql_result($result2,$i,"coins");
$i++;
}


if(
$id == $aid){

// The ID submitted matches an existing adoptable type

$canadopt canadopt($aid"adopting"$promocode);

// If we can adopt this creature, do the adoption
// Otherwise we show an error...

if($canadopt == "yes"){


// **********************************************************************
// BEGIN the actual adoption process
// **********************************************************************

// First we see if we have a custom name.
// If not, we use the default name

if($name == ""){
$name $type;
}

// Now we determine if we are using alternate images or not

$alts getaltstatus($id00);

// Now we actually process the adoption and add it to the database...
// We need a unique code for the adoptable so we can show it to the user when we're done here...

$code rand(120000);

$newcoins $coins $price;
if(
".$coins." ".$price."){
$query2 "UPDATE ".$prefix."users SET coins='".$newcoins."' WHERE username='".$loginstatus[username]."'";
    
mysql_query($query2);

mysql_query("INSERT INTO ".$prefix."owned_adoptables VALUES ('', '$type', '$name','$loggedinname','0','0', '$code', '','$alts','notfortrade','no')");



// Adoption complete, show the user a confirmation screen...
// We need to show the adoptable info from the database...


$query "SELECT * FROM ".$prefix."owned_adoptables WHERE code='$code' and owner='$loggedinname'";
$result mysql_query($query);
$num mysql_numrows($result);

//Loop out code
$i=0;
while (
$i 1) {
 
$id=@mysql_result($result,$i,"aid"); 


$i++;
}



$article_title $name." adopted successfully";
$article_content "<img src='".$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! ";
}else{
$article_title "Error";
$article_content "You dont have enough coins for this adoptable.";
}


// **********************************************************************
// END the actual adoption process
// **********************************************************************


}

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 



// **********************************************************************
// 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
$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
// **********************************************************************



?>

[hr]
ill update the .zip

SieghartZeke 03-26-2010 11:37 AM

RE: Adoptable shop new version! [UPDATED!]
 
Uhm....Now dont work the register.php!!!!
When i try to make a an account, it say that:
Warning: preg_replace() [function.preg-replace]: No ending delimiter '/' found in /home/a2394530/public_html/register.php on line 82

Then, in the page i show this:
Error

You did not fill in all the required fields. Please go back and make sure you filled in all of the form fields.

BUT I FILL ALL!!!!!! HELP!!! =_=£

mapleblade 03-26-2010 12:00 PM

RE: Adoptable shop new version! [UPDATED!]
 
uhm...
wierd.......... 0.o, my thing should work, unless if you have more tables

SieghartZeke 03-26-2010 12:52 PM

RE: Adoptable shop new version! [UPDATED!]
 
Uhm...how i can show to you my Sql Table???[hr]
Wait....can e usefull if i copy and paste my Sql table here??

mapleblade 03-26-2010 01:07 PM

RE: Adoptable shop new version! [UPDATED!]
 
uhm just count your rows okay?

SieghartZeke 03-26-2010 02:37 PM

RE: Adoptable shop new version! [UPDATED!]
 
Ehm...From what Table i need to count?? User Table or Adopt table?

mapleblade 03-26-2010 02:56 PM

RE: Adoptable shop new version! [UPDATED!]
 
user table, because that is what the register makes ;)

SieghartZeke 03-26-2010 03:07 PM

RE: Adoptable shop new version! [UPDATED!]
 
Uhm Okay...

Here what i have:
uid
username
password
email
usergroup
newmessagenotify
membersince
isbanned
website
aim
yahoo
msn
coin

mapleblade 03-26-2010 03:16 PM

RE: Adoptable shop new version! [UPDATED!]
 
it shouldbe coins not coin lol

SieghartZeke 03-26-2010 03:18 PM

RE: Adoptable shop new version! [UPDATED!]
 
OH...LE GASP...How i can rename?

mapleblade 03-26-2010 03:18 PM

RE: Adoptable shop new version! [UPDATED!]
 
Uhm.. http://gca.netai.net/register.php works just fine?

SieghartZeke 03-26-2010 03:19 PM

RE: Adoptable shop new version! [UPDATED!]
 
Woops Renamed XD

mapleblade 03-26-2010 03:19 PM

RE: Adoptable shop new version! [UPDATED!]
 
u click o nthe pencil after it

(at the base of the table, so not the entries)[hr]
thats why it showed 170 coins allthe time, because the table didnt existed :D

SieghartZeke 03-26-2010 03:24 PM

RE: Adoptable shop new version! [UPDATED!]
 
Uhm...Dont work...The Register.php dont work...=_="

mapleblade 03-27-2010 03:49 AM

RE: Adoptable shop new version! [UPDATED!]
 
uhm put an new register.php and add ,'0' at the sql insert table, that MUST work[hr]
btw, sor the let users create adopts mod, there was an file missing, its now included in that topic....

SieghartZeke 03-27-2010 04:07 AM

RE: Adoptable shop new version! [UPDATED!]
 
Omg...How? Im a fail with Coding...
Code:

mysql_query("INSERT INTO ".$prefix."users VALUES ('', '$username', '$pass1','$email','3','1', '$date', '0','','','','','')");


All times are GMT -5. The time now is 04:03 AM.

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