View Full Version : Adoptable shop new version! [UPDATED!]
mapleblade
03-22-2010, 03:42 PM
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:
CREATE TABLE IF NOT EXISTS `adopts_adoptables` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` varchar(40) DEFAULT NULL,
`description` varchar(300) DEFAULT NULL,
`eggimage` varchar(120) DEFAULT NULL,
`whenisavail` varchar(50) DEFAULT NULL,
`promocode` varchar(50) DEFAULT NULL,
`freqcond` varchar(50) DEFAULT NULL,
`number` int(11) DEFAULT NULL,
`datecond` varchar(50) DEFAULT NULL,
`date` varchar(20) DEFAULT NULL,
`adoptscond` varchar(20) DEFAULT NULL,
`moreless` varchar(20) DEFAULT NULL,
`morelessnum` int(11) DEFAULT NULL,
`levelgrle` varchar(25) DEFAULT NULL,
`grlelevel` int(11) DEFAULT NULL,
`alternates` varchar(10) DEFAULT NULL,
`altoutlevel` int(11) DEFAULT NULL,
`altchance` int(11) DEFAULT NULL,
`price` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
CREATE TABLE IF NOT EXISTS `adopts_users` (
`uid` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(20) DEFAULT NULL,
`password` varchar(100) DEFAULT NULL,
`email` varchar(60) DEFAULT NULL,
`usergroup` int(11) DEFAULT NULL,
`newmessagenotify` varchar(10) DEFAULT NULL,
`membersince` varchar(20) DEFAULT NULL,
`isbanned` int(11) DEFAULT NULL,
`website` varchar(80) DEFAULT NULL,
`profilepic` varchar(80) DEFAULT NULL,
`aim` varchar(80) DEFAULT NULL,
`yahoo` varchar(80) DEFAULT NULL,
`msn` varchar(80) DEFAULT NULL,
`coins` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`uid`),
UNIQUE KEY `username` (`username`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
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
wow you're the best!! thanks so much for this, gonna try it all out! ^__________^
Arianna
03-23-2010, 12:48 AM
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
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
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
Err...I cant show the Demo!! O_O"
mapleblade
03-23-2010, 08:33 AM
bequz the shop.php is gone now, irs adopt.php now
SieghartZeke
03-23-2010, 08:33 AM
Oh...Now i have seen the demo...fantastic...=_="
mapleblade
03-23-2010, 08:37 AM
whats wrong? lol..., im now on pc, so ill post the new files within an hour.
SieghartZeke
03-23-2010, 08:37 AM
Oh Okay...Thank you VwV
mapleblade
03-23-2010, 09:00 AM
UPDATED!
Arianna
03-23-2010, 12:21 PM
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
lol, now its for everyone bcuz i made one lol....
but it IS nice huh? xD
redheadturkey
03-23-2010, 01:03 PM
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
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
I coded an inventory script; I thought I offered it to you, redheadturkey/Annatar. :)
redheadturkey
03-23-2010, 05:30 PM
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
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
thanks Arianna, I really appreciate it! Just whenever you can send it is great... no worries! <3
SieghartZeke
03-24-2010, 08:06 AM
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
ugal?[hr]
i made an account on your site, it looks fine...
SieghartZeke
03-25-2010, 12:24 PM
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
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
Uhhhh can repair for me the problem???
Im a fail with coding...=_=""
<?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,$templ ate);
$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
No, if your register, you gain 1000coins[hr]
Here ya go:
// ************************************************** ********************
// 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,$templ ate);
$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
// ************************************************** ********************
// 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($id, 0, 0);
// 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(1, 20000);
$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,$templ ate);
$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
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
uhm...
wierd.......... 0.o, my thing should work, unless if you have more tables
SieghartZeke
03-26-2010, 12:52 PM
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
uhm just count your rows okay?
SieghartZeke
03-26-2010, 02:37 PM
Ehm...From what Table i need to count?? User Table or Adopt table?
mapleblade
03-26-2010, 02:56 PM
user table, because that is what the register makes ;)
SieghartZeke
03-26-2010, 03:07 PM
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
it shouldbe coins not coin lol
SieghartZeke
03-26-2010, 03:18 PM
OH...LE GASP...How i can rename?
mapleblade
03-26-2010, 03:18 PM
Uhm.. http://gca.netai.net/register.php works just fine?
SieghartZeke
03-26-2010, 03:19 PM
Woops Renamed XD
mapleblade
03-26-2010, 03:19 PM
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
Uhm...Dont work...The Register.php dont work...=_="
mapleblade
03-27-2010, 03:49 AM
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
Omg...How? Im a fail with Coding...
mysql_query("INSERT INTO ".$prefix."users VALUES ('', '$username', '$pass1','$email','3','1', '$date', '0','','','','','')");
mapleblade
03-27-2010, 06:20 AM
is this from your new register.php?
if so youst add ,'' so ti would be:
mysql_query("INSERT INTO ".$prefix."users VALUES ('', '$username', '$pass1','$email','3','1', '$date', '0','','','','','','')");
SieghartZeke
03-27-2010, 07:47 AM
Yay!!!!! Now Work!!!
Ehm a other question, for show the total monay on the Sidebar??Like this:
Manage Character
"Your Money 450"[hr]
Ahh...and how change the money when you register?
"Like: You regesiter in the site and receive 1500 Coins"
mapleblade
03-27-2010, 07:56 AM
where you did put ,'' change that to ,'1500' then, it puts 1500 coins ni then.[hr]
Oh and ill make an code dto msee your coins
SieghartZeke
03-27-2010, 08:06 AM
Uhm...I Dont want touch the register code...or i make a disaster!!!
mapleblade
03-27-2010, 08:15 AM
Okay
Find: $sidebar = "<b><u>".$loggedinname."'s Links:</u></b><br><br>
And put this ABOVE that
$query222 = "SELECT * FROM ".$prefix."users WHERE username = '$loggedinname'";
$result222 = @mysql_query($query222);
$num222 = @mysql_numrows($result222);
//Loop out code
$i=0;
while ($i < 1) {
$coins=@mysql_result($result222,$i,"coins");
$i++;
}
Then at last you add the line that really shows it.
Somewhere you want it in the text of your sidebar put this:
You currenty have $coins Coins.<br>
[hr]
lol, ill make it again for you
mysql_query("INSERT INTO ".$prefix."users VALUES ('', '$username', '$pass1','$email','3','1', '$date', '0','','','','','','1500')");
SieghartZeke
03-27-2010, 08:22 AM
Awwww...I have a other error!!!
Parse error: syntax error, unexpected T_STRING in /home/a2394530/public_html/inc/functions.php on line 239[hr]
Oh and this error came only when i put the "You currenty have $coins Coins.<br> "
What the problem??? =_=""[hr]
And sorry if i bother you---But how i can put an image of the coin when you level up a pet?
mapleblade
03-27-2010, 08:44 AM
oh change $coins to ".$coins."
if that shows errror
'.$coins.'[hr]
BTW for the image, just find Price: in the adopt.php and put <img src="img link"> before it.
SieghartZeke
03-27-2010, 11:34 AM
Ok...All work....the only last problem is...when i go to create i pet, it doesnt create this!!
mapleblade
03-27-2010, 11:48 AM
it only creates in your own shop heh?
so usershop.php?user=yourname
SieghartZeke
03-27-2010, 12:14 PM
Ops... Wrong places....i Was talking of the "Adoptable Shop"[hr]
Oh Wait...
When i go to the admin.php, i make all thing for create adoptable, and when say that i have succesfull created pet, and i click "Add a new level" Say that the adoptable id doesn't exist!""
mapleblade
03-28-2010, 05:30 AM
u have added the 'price' at the end of the adoptables table?
gensuperman
03-28-2010, 01:50 PM
Well, this code wouldn't work for me,
I added the SQL info as per first post within my SQL Query on my site, and that added fine, and then I uploaded/overwrote the files needed as per your zipped file in the first post of this thread.
After testing, I found that any new adoptable that I create will not show up on the adopt page, it still will only show the old adoptable.
Also, existing adoptable dont show a price, although has the word price under their image.
Not sure what I'm doing wrong, but, I can't create any new adoptable now and if I try and buy one, then it says I dont have enough coins.
SieghartZeke
03-29-2010, 05:24 AM
I Have the same problem....°_°[hr]
u have added the 'price' at the end of the adoptables table?
Ehm no....what code i need to create??[hr]
Omg....Im a Idiot...Added the table and now...WORK!!!!!!!!! XD
mapleblade
03-29-2010, 11:14 AM
maybe saame for above, you added price table at adoptables or shop adoptables table AT THE END?
gensuperman
03-31-2010, 12:45 AM
maybe saame for above, you added price table at adoptables or shop adoptables table AT THE END?
Its kinda difficult to understand you... are you saying to add the SQL information to the SQL Query? I have already done that and this still doesn't work. I have even updated the price and coins within that SQL Query(s) and it still didn't matter.
The issue I am having isn't about price or coins. After I upload the adoptable shop files to my server, I then try and create an adoptable within the admin area, and I add a PRICE within that adoptables creation. However, after I create it, the adoptable never shows up in the list of options for choosing to adopt. It is almost as if, the adoptable was never created to begin with.
This is a very odd bug... which I believe points back to the SQL Query's that you are having people add to their server SQL database... there must be something that is getting Null(ed) that shouldn't.
Basically, I'm going to have to re-install this script each and every time to a new SQL database until I can figure out which setting is causing this.
As for adding price to the end of something... I must be overlooking what you are suggesting, as I can't find it... Frankly, I believe that I have followed the steps precisely as you have written them.
Can anyone please assist me with this and let me know what steps they took to get this working?
mapleblade
03-31-2010, 07:38 AM
uhm.... you sure you have uplaoded the right files?, and if so? do you have any other tables in your adoptables table that may cause an problem, like gender?
redheadturkey
03-31-2010, 01:46 PM
Are you looking for the new adoptable in the right place -- it will not show up in the usual places, but only in the usershop itself ---- it wont show up in the regular shop, or the normal place to get a pet to adopt.
I am using it on my site, you can take a look there if you wish :)
Click on Customs in the top menu once you reg .......
Tequila
08-15-2011, 07:50 AM
Locking this do to a necro post. :3
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.