Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Adoptables Sites Showcase (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=11)
-   -   Kritter Kingdom (http://www.mysidiaadoptables.com/forum/showthread.php?t=1339)

Missy Master 03-09-2010 08:21 PM

Kritter Kingdom
 
KRITTER KINGDOM

Come see the new and better than ever Kritter Kingdom, based loosely on ferret like creatures of different breeds :)

We've added to the breeding script, and now there are more varieties to be created than ever!

http://kritter-kingdom.com/deco_images/1305382196OK.png

http://kritter-kingdom.com/images/1305460886XK.png

http://kritter-kingdom.com/images/1305419700KD.png

Missy Master 03-11-2010 07:07 PM

RE: Kritter Kingdom
 
We've just added some neat stuff, and new art! ^^

Tequila 03-11-2010 08:02 PM

RE: Kritter Kingdom
 
Looks like a neat concept. Your theme isn't that easy on the eyes or easy to read at all though.

Magnie 03-11-2010 09:30 PM

RE: Kritter Kingdom
 
I suggest fixing the TOS so, for the people that actually read it can. It looks like on like '70' at the end you need to add a ';' ( Semi-colon ) Also, you can't see how much money you have... :/ Might try making it so you can. Or follow my simple guide below. :P

Guide to making money should on the Side Panel:

In 'inc/functions.php' go to line '217' or look around that line and find:

PHP Code:

if($isloggedin == "yes"){ 

Then after that put:

PHP Code:

$query "SELECT * FROM ".$prefix."users WHERE username = '".$loggedinname."'";

$result mysql_query($query);

$num mysql_numrows($result);

$i=0;

while (
$i 1) {



$money=@mysql_result($result,$i,"money");



$i++;



Change 'money' to whatever the currency name is then go to line '244' or around it should say:

PHP Code:

".$msgctr." 

and after it put:

PHP Code:

<b>".$loggedinname."'s Money:</b> ".$money." 

Then change 'money' to yo currency name. Then that should be all!

Arianna 03-12-2010 05:50 AM

RE: Kritter Kingdom
 
On VPL the topic was brought up that you're using copyrighted images.
You may be young, but that's a big no-no. I'd get rid of them as soon as possible. :/

Missy Master 03-12-2010 06:27 AM

RE: Kritter Kingdom
 
Quote:

Originally Posted by Arianna
On VPL the topic was brought up that you're using copyrighted images.
You may be young, but that's a big no-no. I'd get rid of them as soon as possible. :/


LOL I'm actually not young really at all, but pretty new to coding :D

we were going by on MyAdopts, on the Forum it says if you give credit, you can use them? There were several sites listed there that said they use Pokemon etc, but they gave credit at the bottom, and it was said to be okay? We assumed since it was okay there, then we could use them ( albeit with some fur patterns of our own )

We are just using Poser images now, that I personally paid for ....if it's a "big no no" as Arianna mentioned to use those images though, someone might want to warn them at MyAdopts -- there are several there with just the same disclaimer we were trying to use.



However if that has changed then we have others to use :)[hr]

thanks Magnie, that's what I needed for that !! I appreciate it! :D

Arianna 03-12-2010 11:29 AM

RE: Kritter Kingdom
 
Sorry for making that presumption. It's just usually the kids who come here with high hopes of a great petsite who choose to use images of the like.
Anyway, I noticed that it's becoming better. (: Keep going and it'll be awesome. :D

Missy Master 03-12-2010 04:57 PM

RE: Kritter Kingdom
 
Oh that's fine, I always knew my weakness for Eevee would get me into trouble one day :D :D

But thanks, we are working on this, myself and my other artist friend, and we're adding some neat 3 D images to it now <3

Seapyramid 03-12-2010 11:19 PM

RE: Kritter Kingdom
 
The background is a killer.. cant look at it. If it was a seamless tile it might be easier, but not much. Kill the background, it will chase people away.

Missy Master 03-13-2010 06:56 AM

RE: Kritter Kingdom
 
Quote:

Originally Posted by Seapyramid
The background is a killer.. cant look at it. If it was a seamless tile it might be easier, but not much. Kill the background, it will chase people away.

er........okay? I'll work on that as well today.. What about the rest of the work ...the Kritters and all? We've actually worked very hard on those.

My co conspirator on all this has written a really nice backstory which is at kaledonia.php there, if anyone wants to read it. And we have a Forum that has the beginnings of our RP, too. :) Please take a look at more than the background, hahah. Oh, I just changed that to something much more muted, but still animalish. It isn't hard on my eyes now, it's not that striking black and white.

Going to go fix the money thing and the TOS now!

Missy Master 03-13-2010 08:31 AM

RE: Kritter Kingdom
 
the money add on is working, yay!! thanks again for that Magnie, that was a huge help!! Now everyone can see how much they are making <3

We really have some active members already, I feel good to see that! As time goes on we will move from "just" clicks to much more of course, just taking it slowly and weathering all those little bumps in the road.

Thanks again to everyone here for their mods, couldn't have done it without you!

Magnie 03-13-2010 10:02 AM

RE: Kritter Kingdom
 
Lol, no problem. :D The new background is much better! ;)

Missy Master 03-13-2010 12:04 PM

RE: Kritter Kingdom
 
Oh great, I'm really glad!! Hope you enjoy your time there, we are officially opening Monday ----

the last really big thing I need to do is make a way for members to send money to each other, so we can do the sales! Once we have that, we will be all set, pretty much! :D

Any idea how to implement that? I have spent hours trying to figure that out, and I know it's really easy, and I am just not seeing it --- If anyone can help me do this, I'd be very grateful, I really have tried to figure it out, and I am just not getting it.

Magnie 03-13-2010 07:02 PM

RE: Kritter Kingdom
 
Nothing is easy until you can do it easily. ;)

This is actually something hard. I'm not even sure it's possible on the myadopts site that has all the features ( It might be part of the trading... I'm not sure ). Give me some time and I'll figure one out. :)

Missy Master 03-13-2010 08:13 PM

RE: Kritter Kingdom
 
Magnie you're the best!

Thank you so much, I am still looking at this too, trying to figure out how to take from the one source, the money of the logged in user, and then send to the person you are buying the adoptable from --- I won't give up, and I really appreciate that help! ^__^

Magnie 03-13-2010 08:48 PM

RE: Kritter Kingdom
 
This was completely made up from my mind, so yeah it may not be perfect.

From what I know, this will require two files. Let's name one "givemoney.php" and "givemoney2.php"

givemoney.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");



$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

// **********************************************************************


if($isloggedin == 'yes'){
$article_content "<FORM METHOD='POST' ACTION='givemoney.php2'>

Give to User:<input name='user' type='text' id='user'><br>
Amount to Give:<input name='gm' type='text' id='gm'>
<INPUT TYPE='submit' VALUE='Give Money'>
</FORM>"
;
}
else{
$article_content "[Display Some Nice Message to the Guest]";
}

// **********************************************************************

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

// **********************************************************************







?>

givemoney2.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");



$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

// **********************************************************************

if($isloggedin == 'yes') {
$user $_GET["user"];

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

$user secure($user);

$gm $_GET["gm"];

$gm secure($gm);

$query "SELECT * FROM ".$prefix."users WHERE username = '$loggedinname'";

$result = @mysql_query($query);



//Loop out code

$i=0;

while (
$i 1) {



$cash=@mysql_result($result,$i,"cash");



$i++;

}

$query "SELECT * FROM ".$prefix."users WHERE username = '$user'";

$result = @mysql_query($query);



//Loop out code

$i=0;

while (
$i 1) {



$cash2=@mysql_result($result,$i,"cash");



$i++;

}

$cashs $cash $gm;
$cashs2 $cash2 $cash;
if(
$gm !> $cash){
$query "UPDATE ".$prefix."users SET cash='".$cashs."' WHERE username='".$loggedinname."'";

mysql_query($query);
$query "UPDATE ".$prefix."users SET cash='".$cashs2."' WHERE username='".$user."'";

mysql_query($query);
$article_content "[Put a nice message of it's success]";
}
else{
article_content "[Put a nice message of it's failure]";
}
}




// **********************************************************************

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

// **********************************************************************







?>

I would suggest testing this with a test account and your account before you start doing it with other people. Also, if your cash name is different from "cash" then change every single "cash" in both files.

Edit: Needed to fix two IF Statements.

Seapyramid 03-13-2010 10:23 PM

RE: Kritter Kingdom
 
It is not easy & it is a trade system. The trade system I created took me about 5 weeks to complete

Missy Master 03-14-2010 03:23 AM

RE: Kritter Kingdom
 
ah fantastic Magnie, I'll try it out today!! This is my birthday and this is a wonderful present, thank you so much!!! **happy dance**

Missy Master 03-14-2010 04:41 PM

RE: Kritter Kingdom
 
Just had to change givemoney.php2 to givemoney2.php in the givemoney.php code and it was good to go for the form -- -

changed "cash" to "money" for the second file-- but it isn't taking from the logged in user, and giving to the intended user.

Hmm ... not sure what is the matter .... ?

So close! :D

Now it is giving me an error, right about:

$cashs = $cash - $gm;
$cashs2 = $cash2 + $cash;
if($gm !> $cash){
$query = "UPDATE ".$prefix."users SET cash='".$cashs."' WHERE username='".$loggedinname."'";

mysql_query($query);
$query = "UPDATE ".$prefix."users SET cash='".$cashs2."' WHERE username='".$user."'";

Seapyramid 03-15-2010 12:18 AM

RE: Kritter Kingdom
 
Background is still not seamless & with the size of squares you are using it will hurt you time later. The colors are much better however. I did a search & while many came up this was the top one http://www.tickie.net/Backgrounds/index.html try looking there for a seamless you like.

Your pets... This kinda confuses me because most pets are transparent & yours have a full scene. Not bad, new approaches is always good & if it works for you that's great! The images are appealing & nice to look at. However, their size is larger then many forums allow. You might want to consider the size as it greatly limits where they can be posted.

Can't help you with your trade system. Mine took me weeks & that was at 12-18 hours a day. I can't just give it away.

Sea

Missy Master 03-15-2010 03:31 AM

RE: Kritter Kingdom
 
Thanks for the good words, I appreciate that! Yes I actually got the idea for the backgrounds from Mweor, and I'dlike to eventually be able to just change those around. I've been trying very hard to focus on the site and try to get this coding worked out--but my 17 year old Pom had a stroke the night before yesterday, we just found out that's why he was ill. He might recover, but he's pretty ill still, and the timing with my birthday yesterday was not the best.

I will be messing with the image size today, getting them small for the top ten really helped--- I really want to have them large on the profile only. But I have the gist of how now, at least.

I'll take a look at those backgrounds for the site too today, as well as the theme for the SMF forum I am using --- I had set an opening date of March 31st, got enthused and set it to today, only to have my poor dog take ill, and really have to put the attention where the priority is.

Oh I totally understand about the trading system! Magnie has kindly worked out something, we are so close, and hopefully it will be workable! I intend to give full credit there of course, I'm really very grateful for all the mods, and all the extra help! I've made art in Poser for years and years, and the beauty of it is, you can buy models and work with them -- and they are yours to use on your site, which is neat!

I really want to implement an auction system too -- so all in good time :D

Magnie 03-15-2010 10:27 AM

RE: Kritter Kingdom
 
What's the exact error? I'm not getting an error when I try it. But you are right it isn't giving the money... ( What's the 'cash' column in the user's table again? But anyways, change all the 'money' to the one in the Database.)

Change givemoney2.php:

PHP Code:

$cashs $cash $gm;
$cashs2 $cash2 $cash;
if(
$gm !> $cash){
$query "UPDATE ".$prefix."users SET money='".$cashs."' WHERE username='".$loggedinname."'";

mysql_query($query);
$query "UPDATE ".$prefix."users SET money='".$cashs2."' WHERE username='".$user."'";

mysql_query($query);
$article_content "[Put a nice message of it's success]";


To:

PHP Code:

$cashs $cash $gm;
$cashs2 $cash2 $gm;
if(
$gm !> $cash){
$query 'UPDATE `'.$dbname.'`.`'.$prefix.'users` SET `money` = \''.$cashs.'\' WHERE `'.$prefix.'users`.`username` = '.$loggedinname.';';
mysql_query($query);

$query 'UPDATE `'.$dbname.'`.`'.$prefix.'users` SET `money` = \''.$cashs2.'\' WHERE `'.$prefix.'users`.`username` = '.$user.';';
mysql_query($query);

$article_content "[Put a nice message of it's success]";


Try that...

Missy Master 03-15-2010 10:38 AM

RE: Kritter Kingdom
 
For my users table the money is just called money, so that should be right!

got that error:

Parse error: syntax error, unexpected '!' in /home/content/a/n/n/annakk/html/givemoney2.php on line 123

maybe its this part?

if($gm !> $cash){

((thanks again for the help here, gonna really give you massive credit for this!! ))

Magnie 03-15-2010 10:43 AM

RE: Kritter Kingdom
 
You could try changing it to:

if($gm <= $cash){

But when I opened my file up and looked at line 123 the code is:

if($isloggedin == 'yes') {

But you might as well try it.

Missy Master 03-15-2010 11:04 AM

RE: Kritter Kingdom
 
hmmmm that didn't help....or maybe it did, lol, now I get:


Parse error: syntax error, unexpected $end in /home/content/a/n/n/annakk/html/givemoney2.php on line 180

here's my entire givemoney2.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("account");

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


$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') {
$user = $_GET["user"];

$user = preg_replace("/[^a-zA-Z0-9\\040.]/", "", $user);

$user = secure($user);

$gm = $_GET["gm"];

$gm = secure($gm);

$query = "SELECT * FROM ".$prefix."users WHERE username = '$loggedinname'";

$result = @mysql_query($query);



//Loop out code

$i=0;

while ($i < 1) {



$money=@mysql_result($result,$i,"money");



$i++;

}

$query = "SELECT * FROM ".$prefix."users WHERE username = '$user'";

$result = @mysql_query($query);



//Loop out code

$i=0;

while ($i < 1) {



$money2=@mysql_result($result,$i,"money");



$i++;

}

$cashs = $cash - $gm;
$cashs2 = $cash2 + $gm;
if($gm !> $cash){
$query = 'UPDATE `'.$dbname.'`.`'.$prefix.'users` SET `money` = \''.$cashs.'\' WHERE `'.$prefix.'users`.`username` = '.$loggedinname.';';
mysql_query($query);

$query = 'UPDATE `'.$dbname.'`.`'.$prefix.'users` SET `money` = \''.$cashs2.'\' WHERE `'.$prefix.'users`.`username` = '.$user.';';
mysql_query($query);

$article_content = "[Put a nice message of it's success]";
}







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



?>


Magnie 03-15-2010 11:18 AM

RE: Kritter Kingdom
 
Change:

$article_content = "[Put a nice message of it's success]";

To:

$article_content = "[Put a nice message of it's success]";
}

There should be two '}' next to each other instead of one.

Missy Master 03-15-2010 11:23 AM

RE: Kritter Kingdom
 
I did that, still getting:

Parse error: syntax error, unexpected '!' in /home/content/a/n/n/annakk/html/givemoney2.php on line 123

Magnie 03-15-2010 11:31 AM

RE: Kritter Kingdom
 
Change:

PHP Code:

if($isloggedin == 'yes') {
$user $_GET["user"];

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

$user secure($user);

$gm $_GET["gm"];

$gm secure($gm);

$query "SELECT * FROM ".$prefix."users WHERE username = '$loggedinname'";

$result = @mysql_query($query);



//Loop out code

$i=0;

while (
$i 1) {



$money=@mysql_result($result,$i,"money");



$i++;

}

$query "SELECT * FROM ".$prefix."users WHERE username = '$user'";

$result = @mysql_query($query);



//Loop out code

$i=0;

while (
$i 1) {



$money2=@mysql_result($result,$i,"money");



$i++;

}

$cashs $cash $gm;
$cashs2 $cash2 $gm;
if(
$gm !> $cash){
$query 'UPDATE `'.$dbname.'`.`'.$prefix.'users` SET `money` = \''.$cashs.'\' WHERE `'.$prefix.'users`.`username` = '.$loggedinname.';';
mysql_query($query);

$query 'UPDATE `'.$dbname.'`.`'.$prefix.'users` SET `money` = \''.$cashs2.'\' WHERE `'.$prefix.'users`.`username` = '.$user.';';
mysql_query($query);

$article_content "[Put a nice message of it's success]";


To:

PHP Code:

if($isloggedin == 'yes') {
$user $_GET["user"];

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

$user secure($user);

$gm $_GET["gm"];

$gm secure($gm);

$query "SELECT * FROM ".$prefix."users WHERE username = '$loggedinname'";

$result = @mysql_query($query);



//Loop out code

$i=0;

while (
$i 1) {



$money=@mysql_result($result,$i,"money");



$i++;

}

$query "SELECT * FROM ".$prefix."users WHERE username = '$user'";

$result = @mysql_query($query);



//Loop out code

$i=0;

while (
$i 1) {



$money2=@mysql_result($result,$i,"money");



$i++;

}

$cashs $cash $gm;
$cashs2 $cash2 $gm;
if(
$gm <= $cash){
$query 'UPDATE `'.$dbname.'`.`'.$prefix.'users` SET `money` = \''.$cashs.'\' WHERE `'.$prefix.'users`.`username` = '.$loggedinname.';';
mysql_query($query);

$query 'UPDATE `'.$dbname.'`.`'.$prefix.'users` SET `money` = \''.$cashs2.'\' WHERE `'.$prefix.'users`.`username` = '.$user.';';
mysql_query($query);

$article_content "[Put a nice message of it's success]";
}



Arianna 03-15-2010 11:31 AM

RE: Kritter Kingdom
 
Check the line over 123. ;3 That might help. xD Sometimes things like that are annoying. :P

Missy Master 03-15-2010 11:34 AM

RE: Kritter Kingdom
 
okay I take it back, had to refresh several times, now no error!

Still isnt taking the money out though ... oh Ill try that, thanks!! I'm not sure what to edit there -- well no more syntax error, and it IS showing the "give a nice message" thing!

Just no transfer of the money ...

Magnie 03-15-2010 11:35 AM

RE: Kritter Kingdom
 
Yeah, it said 123 :P Since I can't open up the file myself and edit it, then I can't speed up the process on fixing it. xD

Missy Master 03-15-2010 11:40 AM

RE: Kritter Kingdom
 
no more syntax prob, it's coming up fine! I am trying to help think too what would be causing the failure to take from the one, and then give to the new one ----

Magnie 03-15-2010 12:19 PM

RE: Kritter Kingdom
 
Maybe change the some of the code back to:

$query = "UPDATE ".$prefix."users SET money='".$cashs."' WHERE username='".$loggedinname."'";

and

$query = "UPDATE ".$prefix."users SET money='".$cashs2."' WHERE username='".$user."'";

:/ I'm not really sure.

Missy Master 03-15-2010 12:30 PM

RE: Kritter Kingdom
 
I'll try that, and thank you so much for working on this for me, I really appreciate it very much! :D :D

I am sure it's really close, likely just one thing is messing it up :)

I'll keep you posted, and yeah, from what I can tell, it really ought to be working, so I'll go over it with a fine tooth comb hehehe -- just baffled why it isn't working, possibly the form isn't inputting what we need it to?[hr]
Okay update, lol. Using that code above:

Code:

$query = "UPDATE ".$prefix."users SET money='".$cashs."' WHERE username='".$loggedinname."'";

mysql_query($query);

$query = "UPDATE ".$prefix."users SET money='".$cashs2."' WHERE username='".$user."'";


It took all the money out of the sending user ( loggedinname ) and put it to 0---and did not add any to the receiver -- but at least it's doing something !

This is possibly a clue??

Magnie 03-15-2010 03:22 PM

RE: Kritter Kingdom
 
On a project I'm working on, it does that to me all the time! ( X.X ) Could you post the entire file please? ( givemoney2.php ) Thanks.

Missy Master 03-15-2010 03:54 PM

RE: Kritter Kingdom
 
sure!

givemoney2.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("account");

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


$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') {
$user = $_GET["user"];

$user = preg_replace("/[^a-zA-Z0-9\\040.]/", "", $user);

$user = secure($user);

$gm = $_GET["gm"];

$gm = secure($gm);

$query = "SELECT * FROM ".$prefix."users WHERE username = '$loggedinname'";

$result = @mysql_query($query);



//Loop out code

$i=0;

while ($i < 1) {



$money=@mysql_result($result,$i,"money");



$i++;

}

$query = "SELECT * FROM ".$prefix."users WHERE username = '$user'";

$result = @mysql_query($query);



//Loop out code

$i=0;

while ($i < 1) {



$money2=@mysql_result($result,$i,"money");



$i++;

}

$cashs = $cash - $gm;
$cashs2 = $cash2 + $gm;
if($gm <= $cash){




$query = "UPDATE ".$prefix."users SET money='".$cashs."' WHERE username='".$loggedinname."'";


$query = "UPDATE ".$prefix."users SET money='".$cashs2."' WHERE username='".$user."'";



mysql_query($query);


$article_content = "[Not active yet!]";
}

}






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



?>


And then givemoney.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");



$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

// **********************************************************************


if($isloggedin == 'yes'){
$article_content = "<FORM METHOD='POST' ACTION='givemoney2.php'>

Give to User:<input name='user' type='text' id='user'><br>
Amount to Give:<input name='gm' type='text' id='gm'>
<INPUT TYPE='submit' VALUE='Give Money'>
</FORM>";
}
else{
$article_content = "[Display Some Nice Message to the Guest]";
}

// **********************************************************************

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

// **********************************************************************







?>


Magnie 03-15-2010 07:56 PM

RE: Kritter Kingdom
 
How could I have made that happen?

Here's a "fixed" version of givemoney2.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("account");

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


$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') {
$user $_POST["user"];

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

$user secure($user);

$gm $_POST["gm"];

$gm secure($gm);

$query "SELECT * FROM ".$prefix."users WHERE username = '$loggedinname'";

$result = @mysql_query($query);



//Loop out code

$i=0;

while (
$i 1) {



$money=@mysql_result($result,$i,"money");



$i++;

}

$query "SELECT * FROM ".$prefix."users WHERE username = '$user'";

$result = @mysql_query($query);



//Loop out code

$i=0;

while (
$i 1) {



$money2=@mysql_result($result,$i,"money");



$i++;

}

$cashs $cash $gm;
$cashs2 $cash2 $gm;
if(
$gm <= $cash){




$query "UPDATE ".$prefix."users SET money='".$cashs."' WHERE username='".$loggedinname."'";


$query "UPDATE ".$prefix."users SET money='".$cashs2."' WHERE username='".$user."'";



mysql_query($query);


$article_content "[Not active yet!]";
}

}






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



?>

It was suppose to be "POST" not "GET" xD GET is for getting things from the URL, and POST gets the variables that have the input....

Missy Master 03-15-2010 08:14 PM

RE: Kritter Kingdom
 
oh cool!! Let me go try that, thanks again so much, I'll let you know what happens!! <3[hr]
it WORKS!! Here is the code that finally worked:


givemoney2.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("account");

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


$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') {
$user = $_POST["user"];

$user = preg_replace("/[^a-zA-Z0-9\\040.]/", "", $user);

$user = secure($user);

$gm = $_POST["gm"];

$gm = secure($gm);

$query = "SELECT * FROM ".$prefix."users WHERE username = '$loggedinname'";

$result = @mysql_query($query);



//Loop out code

$i=0;

while ($i < 1) {



$cash=@mysql_result($result,$i,"money");



$i++;

}

$query = "SELECT * FROM ".$prefix."users WHERE username = '$user'";

$result = @mysql_query($query);



//Loop out code

$i=0;

while ($i < 1) {



$cash2=@mysql_result($result,$i,"money");



$i++;

}

$cashs = $cash - $gm;
$cashs2 = $cash2 + $gm;
if($gm <= $cash){




$query = "UPDATE ".$prefix."users SET money='".$cashs."' WHERE username='".$loggedinname."'";

mysql_query($query);

$query = "UPDATE ".$prefix."users SET money='".$cashs2."' WHERE username='".$user."'";

mysql_query($query);


$article_content = "[Not active yet!]";
}

}






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



?>

Not sure how it happened, but at some point the variable for $cash and $cash2 was changed to read $money, and $money2 up above all that, where it was first declared--- so --- we have a working mod here now!!

Thank you SO much Magnie, and you are getting a massive credit on the site for this!! :D :D

Missy Master 03-15-2010 10:47 PM

RE: Kritter Kingdom
 
on a side note, this is the last chance to get the soon to be extinct Alacorn there on KK --- go to the Promo page on your sidebar, enter ALACORN, and you may take as many as you wish, before midnight tonight!!

We are dropping them after that, they are a one time very special creature!

Magnie 03-16-2010 02:48 PM

RE: Kritter Kingdom
 
Lol, you're welcome. *me just likes to help, don't ask why* xD


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

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