Log in

View Full Version : help with levelup.php please


Sensacionsk8
02-26-2011, 05:47 PM
Hi, I need someone to help me change the levelup.php.
I need is the money earned by an adoptable to click, what won the owner of adoptable. maybe I can help of Hall of Famer or someone else please.
excuse for English, but I'm using google translator

DragonTamerChris
02-26-2011, 05:55 PM
Not to be rude but couldn't you have just bumped your old thread instead of making a new thread? People will try to help you as fast as you can, they just might have not found your thread yet. Making new topics just spams the forum.

I'm sorry I can't help you, I would if I could.

(Sorry to the mods if mini-modding is not allowed on the forums, I'm just simply stating a member oponion to this person.)

fadillzzz
02-26-2011, 11:36 PM
I can only understand your first sentence. :ooo:
But I'm guessing that you want to make that only the owner of the adoptables will get money by clicking it... (is that correct?)
Also, if you're using google translate, try to use a proper sentence to get better result.

Sensacionsk8
02-27-2011, 09:32 AM
I can only understand your first sentence. :ooo:
But I'm guessing that you want to make that only the owner of the adoptables will get money by clicking it... (is that correct?)
Also, if you're using google translate, try to use a proper sentence to get better result.

is correct.
sorry for this other issue, but I thought that in the previous post is not understood.

fadillzzz
02-27-2011, 09:52 AM
Well first, we have to make the script check if the clicker is the owner before giving out the money and if it's not, don't give any.

open your levelup.php

find this code around line 231 - 236

// Start Rewards

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


//Get currency on level up
Add below

if($owner == $loggedinname)
{
After that, find this

$article_content = $article_content . "<div align='center'><br />You have earned ". $amount ." Dollars for leveling up this Adoptable. <br />You now have " . $newbalance . " Dollars.</div>";
below that, add the closing curly bracket

}


hope this solves your problem :)

Sensacionsk8
02-27-2011, 12:11 PM
thanks, but Not exactly, what I want is this:

$newclicks = $totalclicks + 1; // Add 1 click to the current click total of this adoptable...
$newdollars = $dollar + 10; //make it work
// Actually insert our click information into the database...
$query = "UPDATE ".$prefix."owned_adoptables SET totalclicks='".$newclicks."' WHERE aid='".$id."'";
mysql_query($query);

$query = "UPDATE ".$prefix."users SET dollar='".$newdollars."' WHERE uid='".$uid."'";
mysql_query($query);

I need this:
http://i51.tinypic.com/2ry645j.jpg

fadillzzz
02-27-2011, 12:41 PM
Oh so what you mean was, everytime an adoptables receives a click, the owner of the adoptables get the money?
That's easy, just change this query from line 238

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

$query = "SELECT * FROM `".$prefix."users` WHERE `username`='$owner'";
and on line 253, find this query

mysql_query("UPDATE `".$prefix."users` SET `dollar`='" . $newbalance . "' WHERE `username`='$loggedinname'");
and change it into this

mysql_query("UPDATE `".$prefix."users` SET `dollar`='" . $newbalance . "' WHERE `username`='$owner'");

I think that should do the trick..

Sensacionsk8
02-27-2011, 01:44 PM
thanks for your help, you are the best