Hallo habe ein Problemm wenn ich voten will steht bei mir immer andauert
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /var/customers/webs/w259453453/hp/pages/vote4us.php on line 32
versuche ganze zeit zu fixxen aber irgenwie krieg ich es nicht hin könnt ihr mir bitte
helfen der vote script ist hier
hier vote4us
und hier Backend.php
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /var/customers/webs/w259453453/hp/pages/vote4us.php on line 32
versuche ganze zeit zu fixxen aber irgenwie krieg ich es nicht hin könnt ihr mir bitte
helfen der vote script ist hier
hier vote4us
PHP Code:
<?php
/**
* Vote 4 Coins Script for topliste.*****************
*
* Coded by 'ChuckNorris
*
* Changelog:
* 25.07.2014 Add time limit (stop flooding with vote links in skype)
*
* @copyright 'ChuckNorris 2014 All rights reserved
*/
$DELAY = 60 * 60 * 24;// Time Limit / f.e. 60 Sekunden * 60 Minuten * 24 Stunden = 24 Stunden (in Sekunden)
$hpDB = 'homepage';
?>
<div style="margin-top: 70px;" class="box">
<div class="top"></div>
<div class="middle">
<h3>Vote4Us</h3>
<div class="big-line"></div>
<?
date_default_timezone_set('Europe/Berlin');
$VoteLink = "http://www.topliste.*****************/in/2012-test-de.html"; // Edit VoteLink
$VotePage = $VoteLink . "?vuid=" . $_SESSION['user_id'];
$VoteBonusCoins = 2000;
$CheckVoteLog_SQL = "SELECT UNIX_TIMESTAMP(`lastVote`) as lastVote FROM `" . $hpDB . "`.`v4c` WHERE `aid`='" . $vuid . "'";
$result = mysql_query($CheckVoteLog_SQL, $sqlHp);
if(!empty($_SESSION["user_id"]) && mysql_num_rows($result) > 0 && mysql_result($result, 0, "lastVote") < time() - $DELAY) {
?>
<p class="meldung">
Du hast bereits gevotet. Du kannst das nächste mal um <? echo date("G:i:s", mysql_result($result, 0, "lastVote") + $DELAY)?> voten.
</p>
<?
} else if(!empty($_SESSION["user_id"])) {
?>
<p class="meldung">
Pro Vote erhältst du <?php echo $VoteBonusCoins;?> Vote-Coins!
Missbrauch oder Bugusing wird mit<br>
einem Bann von allen Account's bestraft!<br />
<b>Nachdem du gevotet hast kann es bis zu 2 Minuten dauern bis du deine Coins erhälst!</b>
</p>
<br>
<p>Um voten zu können, klicke auf dem folgenden Link:
<a href="<?php echo $VotePage; ?>"><font color="red">Vote!</font></a></p>
<? } else { ?>
<p><font color="red">ACHTUNG:</font> Du bekommst nur Vote-Coins, wenn du auch eingeloggt bist!<br>
<a href="<?php echo $VoteLink;?>"><img style="border: 0px;" src="http://www.topliste.*****************/buttons/vote_8_0.png"/></a></p>
<?php } ?>
</div>
<div class="bottom"></div>
</div>
PHP Code:
<?php
/**
* Vote 4 Coins Script for topliste.*****************
*
* Coded by 'ChuckNorris
*
* Changelog:
* 25.07.2014 Add time limit (stop flooding with vote links in skype)
*
* @copyright 'ChuckNorris 2014 All rights reserved
*/
//******************** CONFIGURATION AREA ********************//
$DELAY = 60 * 60 * 24;// Time Limit / f.e. 60 Sekunden * 60 Minuten * 24 Stunden = 24 Stunden (in Sekunden)
$ID='2012'; // Enter side id here
$API_KEY='490a83c23424c1a9684b'; // Enter api key here
$VoteCoins='2000'; // Enter coins to get here
$sqlServ = mysql_connect("000000000", "root", "0000000");
$hpDB = 'homepage';
//****************** END CONFIGURATION AREA *******************//
//***************** DO NOT CHANGE CODE HERE *******************//
$REQUEST='votes';
$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)
{
$CheckVoteLog_SQL = "SELECT UNIX_TIMESTAMP(`lastVote`) as lastVote FROM `" . $hpDB . "`.`v4c` WHERE `aid`='" . $vuid . "'";
$result = mysql_query($CheckVoteLog_SQL, $sqlServ);
echo mysql_error();
$lastVoteTime = 0;
if(mysql_num_rows($result) == 0) {
$AddVoteLog_SQL = "INSERT INTO `" . $hpDB . "`.`v4c`(`aid`, `lastVote`) VALUES('" . $vuid . "', NOW())";
mysql_query($AddVoteLog_SQL);
} else {
$UpdateVoteLog_SQL = "UPDATE `" . $hpDB . "`.`v4c` SET `lastVote`=NOW() WHERE `aid`='" . $vuid . "'";
mysql_query($UpdateVoteLog_SQL);
$lastVoteTime = mysql_result($result, 0, "lastVote");
}
if($lastVoteTime < time() - $DELAY) {
$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);
?>