Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Off Topic Discussions > Adoptables Sites Showcase

Notices

Reply
 
Thread Tools Display Modes
  #31  
Old 03-15-2010, 11:35 AM
Magnie's Avatar
Magnie Magnie is offline
Pythonic
 
Join Date: Dec 2009
Location: Polaris, the Planet
Posts: 34
Gender: Male
Credits: 5,013
Magnie
Send a message via ICQ to Magnie
Default 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
Reply With Quote
  #32  
Old 03-15-2010, 11:40 AM
Missy Master's Avatar
Missy Master Missy Master is offline
Pet-Sim.Online
 
Join Date: Jan 2010
Posts: 475
Gender: Unknown/Other
Credits: 55,049
Missy Master is an unknown quantity at this point
Default 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 ----
Reply With Quote
  #33  
Old 03-15-2010, 12:19 PM
Magnie's Avatar
Magnie Magnie is offline
Pythonic
 
Join Date: Dec 2009
Location: Polaris, the Planet
Posts: 34
Gender: Male
Credits: 5,013
Magnie
Send a message via ICQ to Magnie
Default 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.
Reply With Quote
  #34  
Old 03-15-2010, 12:30 PM
Missy Master's Avatar
Missy Master Missy Master is offline
Pet-Sim.Online
 
Join Date: Jan 2010
Posts: 475
Gender: Unknown/Other
Credits: 55,049
Missy Master is an unknown quantity at this point
Default 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??
Reply With Quote
  #35  
Old 03-15-2010, 03:22 PM
Magnie's Avatar
Magnie Magnie is offline
Pythonic
 
Join Date: Dec 2009
Location: Polaris, the Planet
Posts: 34
Gender: Male
Credits: 5,013
Magnie
Send a message via ICQ to Magnie
Default 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.
Reply With Quote
  #36  
Old 03-15-2010, 03:54 PM
Missy Master's Avatar
Missy Master Missy Master is offline
Pet-Sim.Online
 
Join Date: Jan 2010
Posts: 475
Gender: Unknown/Other
Credits: 55,049
Missy Master is an unknown quantity at this point
Default 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

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







?>
Reply With Quote
  #37  
Old 03-15-2010, 07:56 PM
Magnie's Avatar
Magnie Magnie is offline
Pythonic
 
Join Date: Dec 2009
Location: Polaris, the Planet
Posts: 34
Gender: Male
Credits: 5,013
Magnie
Send a message via ICQ to Magnie
Default 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....
Reply With Quote
  #38  
Old 03-15-2010, 08:14 PM
Missy Master's Avatar
Missy Master Missy Master is offline
Pet-Sim.Online
 
Join Date: Jan 2010
Posts: 475
Gender: Unknown/Other
Credits: 55,049
Missy Master is an unknown quantity at this point
Default 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
Reply With Quote
  #39  
Old 03-15-2010, 10:47 PM
Missy Master's Avatar
Missy Master Missy Master is offline
Pet-Sim.Online
 
Join Date: Jan 2010
Posts: 475
Gender: Unknown/Other
Credits: 55,049
Missy Master is an unknown quantity at this point
Default 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!
Reply With Quote
  #40  
Old 03-16-2010, 02:48 PM
Magnie's Avatar
Magnie Magnie is offline
Pythonic
 
Join Date: Dec 2009
Location: Polaris, the Planet
Posts: 34
Gender: Male
Credits: 5,013
Magnie
Send a message via ICQ to Magnie
Default RE: Kritter Kingdom

Lol, you're welcome. *me just likes to help, don't ask why* xD
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 12:17 PM.

Currently Active Users: 964 (0 members and 964 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636