So hier mal die Vereinfachte und fixxed version der backed.php, ist auch gleich auf 1 umgeschrieben
PHP Code:
<?php
/**
* Vote 4 Coins Script for toplist.****************
*
* Coded by .CHuckNorris
*
* @copyright .CHuckNorris 2013 All rights reserved
*/
$ID='SITE_ID'; // Enter side id here
$API_KEY='API_KEY'; // Enter api key here
$REQUEST='votes';
$VoteCoins='2000'; // Enter coins to get here
$sqlServ = mysql_connect("localhost", "root", "");
$topl_curl=curl_init();
curl_setopt($topl_curl, CURLOPT_URL,
'http://www.topliste.****************/api?id=' . urlencode($ID) . '&request=' . urlencode($REQUEST) . '&vuid=9999');
curl_setopt($topl_curl, CURLOPT_HEADER, 0);
curl_setopt($topl_curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($topl_curl, CURLOPT_HTTPHEADER, array('X_APIKEY: ' . $API_KEY));
$topl_data=curl_exec($topl_curl);
$topl_info=curl_getinfo($topl_curl);
if (!curl_errno($topl_curl))
{
if ($topl_info['http_code'] == 200)
{
$Data=json_decode($topl_data, true);
foreach($Data as $vuid)
{
$PlayerNewCoins_SQL = "UPDATE account.account
SET coins = coins + ".$VoteCoins."
WHERE id = '".$vuid."'";
mysql_query($PlayerNewCoins_SQL, $sqlServ);
}
}
}
else
{
echo 'Curl error: ' . curl_error($topl_curl);
}
curl_close($topl_curl);
?>
Was habe ich gemacht?
Ich habe das selecten weggenommen und lasse die coins direkt von Mysql Addieren => 1 mysql abfrage gespart, dann habe ich es von vote_coins auf coins geändert und habe
es auch gleich richtig gesetzt das sie $VoteCoins addiert werden und nicht die $VoteBonusCoins die garnicht exestieren.
ps. Ist nicht getestet, solte etwas nicht stimme bitte mitteilen dann ändere ich es :)