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)

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 02:51 PM.

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