A modification

Forum
Last Post
Threads / Messages

jcga1992

Member
Member
Joined
Oct 23, 2011
Messages
6
Points
0
Mysidian Dollar
0
First, sorry for my bad english....

In this moment when i vote one adoptable i get money.

The modification that i want do is, when someone vote my adoptable I get the money.

I only know a little PHP if someone can show me how do it...

Thank you so much.
 
So instead of members receiving money when they level up an adopt you want the person who's adopt is clicked to get the money? Or both?
 
Umm this should be quite simple php programming. What I'd do is to edit the levelup.php file and find the line where money is added to users. If I recall, the user is specified to be $loggedinname, which corresponds to the one who click on adoptables. All that needs to b done is to change this variable to the actual owner of the pet getting clicks. Lemme know if this is helpful or not, if you really ain't comfortable with php I can show you a sample Php code on how to make such modification.
 
So instead of members receiving money when they level up an adopt you want the person who's adopt is clicked to get the money? Or both?

Only the person who's adopt is clicked

Umm this should be quite simple php programming. What I'd do is to edit the levelup.php file and find the line where money is added to users. If I recall, the user is specified to be $loggedinname, which corresponds to the one who click on adoptables. All that needs to b done is to change this variable to the actual owner of the pet getting clicks. Lemme know if this is helpful or not, if you really ain't comfortable with php I can show you a sample Php code on how to make such modification.

I think you say here?

Code:
if($owned_adoptable['isfrozen'] == "no"){ 
	$reward = clickreward(grabanysetting('rewardmoney'), $GLOBALS['username'], $GLOBALS['money']);
	$newamount = $GLOBALS['money'] + $reward;
	runquery("UPDATE {$GLOBALS['prefix']}users SET `money` = '{$newamount}' WHERE `username` = '{$loggedinname}'");
	$article_content = $article_content . "<div align='center'><br />You have earned {$reward} ".grabanysetting('cost')." for leveling up this adoptable. <br />You now have {$newamount} ".grabanysetting('cost')."</div>";

What i should put in $loggedinname. Thank you a lot.
 
Last edited:
Well I would do the following changes:

PHP:
if($owned_adoptable['isfrozen'] == "no"){
        $result = runquery("SELECT * FROM {$prefix}users WHERE username='{$owned_adoptable['owner']}'");
        $user = mysql_fetch_array($result);
        $reward = clickreward(grabanysetting('rewardmoney'), $owned_adoptable['owner'], $user['money']);     
        $newamount = $user['money'] + $reward;    
        runquery("UPDATE {$GLOBALS['prefix']}users SET `money` = '{$newamount}' WHERE `username` = '{$owned_adoptable['owner']}'");
As you can see, the program looks a bit confusing 'cause the adoptable owner's money data cannot be easily retrieved from database. The mysql SELECT query has to be executed and mysql_fetch_array needs to be manipulated. Also the $article_content line is removed for a good reason. Try this on your site and lemme know if it works.
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,121
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Top