Vote 4 Coins Problem

  • Hallo liebe Breadfishe,
    Ich habe schon in ElitePvpers nachgefragt, aber die sind dort zu geizig zu helfen.


    Deswegen frage ich hier...


    Bei mir Funktioniert das Vote4 Coins nicht...


    Source Code ist.


    PHP
    <h2>Vote4Coins</h2></div><table><?PHPif(isset($_SESSION['user_admin']) && checkInt($_SESSION['user_admin']) && $_SESSION['user_admin']>=0) {	class Vote4Coins{			public static function GetVotes() {			global $serverSettings;			$topl_curl = curl_init();			curl_setopt($topl_curl, CURLOPT_URL,			'http://www.topliste.top-pserver.com/api?id=' . urlencode($serverSettings['voteid']) . 			'&request=' . urlencode('stats'));			curl_setopt($topl_curl, CURLOPT_HEADER, 0);			curl_setopt($topl_curl, CURLOPT_RETURNTRANSFER, 1);			curl_setopt($topl_curl, CURLOPT_HTTPHEADER, array('X_APIKEY: ' . $serverSettings['apikey']));			$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);				}				else{					return "error";				}			}			else{				return "error";			}			curl_close($topl_curl);					return $Data["unq_in_0_weekly"];		}		public static function GetIP(){			$ip = $_SERVER['REMOTE_ADDR'];			if (!empty($_SERVER['HTTP_CLIENT_IP'])) {				$ip = $_SERVER['HTTP_CLIENT_IP'];			} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {				$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];			}			return $ip;		}		public static function CanVote($accid){			global $serverSettings;			$SelVoteTime = mysql_query('SELECT id,accid,time as zeit FROM '.SQL_HP_DB.'.vote4coins WHERE accid='.mysql_real_escape_string($accid).' LIMIT 1');			$ip = $_SERVER['REMOTE_ADDR'];			$CheckIp = mysql_query('SELECT ip FROM '.SQL_HP_DB.'.vote4coins WHERE ip="'.$ip.'"');			if (mysql_num_rows($CheckIp)<1){				if (mysql_num_rows($SelVoteTime)<1){					return true;				}				else{					$GetVote = mysql_fetch_object($SelVoteTime);					$Differenz = (time()/3600)-($GetVote->zeit/3600);					if ($serverSettings['wartennachvote']>$Differenz){return false;}					else{return true;}				}			}			else{return false;}		}		public static function CheckTimeout($oldtime){			global $serverSettings;			$Differenz = (time()/60)-($oldtime/60);			if ($serverSettings['timeout']<=$Differenz){return false;}			else{return true;}		}		public static function InsertToLog($accid){			$ip = $_SERVER['REMOTE_ADDR'];			$SelVoteTime = mysql_query('SELECT id,accid,time as zeit FROM '.SQL_HP_DB.'.vote4coins WHERE accid='.mysql_real_escape_string($accid).' LIMIT 1');			if (mysql_num_rows($SelVoteTime)<1){				$Query = mysql_query("INSERT INTO ".SQL_HP_DB.".vote4coins (accid,time,ip) VALUES('".mysql_real_escape_string($accid)."','".time()."','".$ip."')");				return true;			}			else{				$Query = mysql_query("UPDATE ".SQL_HP_DB.".vote4coins SET time='".time()."', ip='".$ip."' WHERE accid=".mysql_real_escape_string($accid)." LIMIT 1");				return true;			}		}		public static function GiveCoins($accid){			global $serverSettings;			$coinsprovote = $serverSettings['coinsvote'];			$GiveCoins = mysql_query("UPDATE account.account SET coins=coins+".$coinsprovote." WHERE id=".mysql_real_escape_string($accid)." LIMIT 1");		}	}	if (!$Query)	if (Vote4Coins::CanVote($_SESSION['user_id'])){		if (isset($_POST["checkvote"])){			if ($GetNewVotes>$_SESSION["oldvote"]){				Vote4Coins::InsertToLog($_SESSION["user_id"]);				Vote4Coins::GiveCoins($_SESSION["user_id"]);				echo 'Du hast erfolgreich gevotet dir werden nun Coins gutgeschrieben.';				$GiveCoins = mysql_query("UPDATE account.account SET coins=coins+".$coinsprovote." WHERE id=".mysql_real_escape_string($accid)." LIMIT 1");			unset($_SESSION["oldtime"]);			unset($_SESSION["oldvote"]);		}		if (isset($_POST["voten"])){					$GetOldVotes = Vote4Coins::GetVotes();				if ($GetOldVotes){					$_SESSION["oldvote"] = $GetOldVotes;					$_SESSION["oldtime"] = time();					echo '<form method="POST"><table>';					echo '<tr><td>Wenn du gevotet hast dr&uuml;ck auf Pr&uuml;fen</td></tr>';					echo '<tr><td><input type="submit" name="checkvote" value="Pr&uuml;fen"/></td></tr>';					echo '</table></form>';				}				else{					echo 'Es ist ein Fehler aufgetreten beim Abfragen der Votes.12345';				}		}			elseif(!isset($_POST["checkvote"])){			echo '<script type="text/javascript">					function Votelink(url) {						fenster = window.open(url, "", "width=600, height=350, left = 0, top = 0");					}				</script>';			echo '<form method="POST"><table>';			echo '<tr><td>Dr&uuml;cke auf Voten und folge dann den Anweisungen.</td></tr>';			echo '<tr><td><input type="submit" name="voten" value="Vote" onClick="javascript:Votelink(\''.$serverSettings['votelink'].'\');"/></td></tr>';			echo '</table></form>';			}		}	else{		echo 'Du kannst nur alle '. $serverSettings["wartennachvote"].' Stunden voten.';	}}else{	echo'<p class="meldung">Sie m&uuml;ssen f&uuml;r diesen Bereich angemeldet sein.</p>';}?></table>


    Er gibt ein Error aus. Wird oben im Quelltext angezeigt.


    Ich hoffe mir kann jemand Helfen..


    Mit freundlichen Grüßen,
    SkillerZ


    //push anderer Code jetzt..


    Mehr transparents zu der Community!
    Aber bitte künftig: Transparenz und nicht Transparents

    Einmal editiert, zuletzt von Kevin_CaruZo ()