I have a problem with my gtop100 voting. And I am not sure where it is going wrong at the moment.
What I have:
The url the player clicks is defined like this:
Code:
<a href="http://www.gtop100.com/topsites/Flyff/sitedetails/mysitehere?vote=1&pingUsername=<?= $_SESSION['user'] ?>" title="Flyff Private Server" target="_blank"><img src="http://www.gtop100.com/images/votebutton.jpg" border="0" alt="Vote Now"></a>
On gtop100 I have defined this as my pingback url:

This leads to my votepingback url. Which has the following code:
Code:
<?php
require_once($_SERVER['DOCUMENT_ROOT'].'/Source/Includes/Config.php');
$voterIP = isset($_POST["VoterIP"]) ? $_POST['VoterIP'] : ''; // voter ip address
$success = isset($_POST["Successful"]) ? abs($_POST["Successful"]) : 1; // 1 for error, 0 for successful
$reason = isset($_POST['Reason']) ? $_POST["Reason"] : '';
$pingUsername = isset($_POST["pingUsername"]) ? $_POST["pingUsername"] : '';
$postback = isset($_GET['custom']) ? $_GET['custom'] : '';
// GTop 100
if (!empty($_POST['pingUsername']))
{
$controller = new Donate();
$object = $controller->SetVoteCoins($pingUsername);
}
else
{
Alert("Not from Gtop100");
}
?>
Code:
public function SetVoteCoins($pingUsername)
{
global $cfg;
$vote = self::Select(array('vcoins', 'lastvote'), 'Website', 'WebAccount', array('username' => $pingUsername));
$last = $vote['Result'][1]['lastvote'];
$coins = (int)$vote['Result'][1]['vcoins'];
$nextvote = time()+1*20*60*60;
$newcoins = $coins + 10;
self::Update(array('vcoins' => $newcoins), array('username' => $pingUsername), 'Website', 'WebAccount');
self::Update(array('lastvote' => $nextvote), array('username' => $pingUsername), 'Website', 'WebAccount');
//if($last == NULL || $last <= time()){
// $nextvote = time()+1*20*60*60;
// $newcoins = $coins + 10;
// self::Update(array('vcoins' => $newcoins), array('username' => $_SESSION['user']), 'Website', 'WebAccount');
// self::Update(array('lastvote' => $nextvote), array('username' => $_SESSION['user']), 'Website', 'WebAccount');
// return 'Vote success. Please refresh your panel to see your vote coins.';
//}else {
// return 'Can not vote now. New vote at: ' . date('d.m.Y h:i:s a');
//}
}
However when I vote I do not get anything, I can see on my Gtop100 dashboard I have 4x IN but 0x OUT. So its not going out? I don't know exactly what this means or where the error is within the page.
I know that browsing to the url triggers the PHP code.
Any ideas?






