Kleines Problem mit Vote script!

02/13/2013 10:00 .CHiiLLOuT#1
Guten Tag epvp,

Ich habe ein kleines Problem mit diesem Vote script
[Only registered and activated users can see links. Click Here To Register...], dieser Script funktioniert, aber in der Account datenbank wird bei Lastvote das hier eingetragen:
Lastvote: 0000-00-00 00 00

Wenn jemand eine Lösung hat, bitte Melden :handsdown:
02/13/2013 12:45 theo1990#2
ich schaue mir mal das script an

Quote:
<div id="content"> <div class="postui2 text-title">
<h2>
Vote

</h2>
</div>
<div class="postui2 text-con">
<div class="con-wrap">
<?PHP
if(isset($_SESSION['user_admin']) && checkInt($_SESSION['user_admin']) && $_SESSION['user_admin']>=0) {
?>
<?php

class Vote
{

## Edit the info to your liking

var $config = array(
'db_host' => 'ip',
'db_user' => 'root',
'db_pass' => 'pw',
'db_database' => 'account',
## Wie viele Stunden müssen die Spieler warten bis sie wieder Voten können ?
'vote_int' => 12,
## Wie Viel Coins bekommt man fürs Voten ?
'vote_points' => 50
);


public function __construct()
{
$connect = mysql_connect($this->config['db_host'], $this->config['db_user'], $this->config['db_pass']);

if(!$connect)
die(mysql_error());

$db = mysql_select_db($this->config['db_database'], $connect);

if(!$db)
die(mysql_error());

}



public function do_vote()
{
$name = mysql_real_escape_string($_POST['name']);


$fetch = mysql_query("SELECT * FROM `account` WHERE `login` LIKE '".$_SESSION['user_name']."'" . "LIMIT 1") or die(mysql_error());
$get = mysql_fetch_array($fetch);



if((time() - $get['lastvote']) < (3600 * $this->config['vote_int']) && $get['lastvote'] != 0)
{
$hours_left = round((((($get['lastvote'] + (3600 * $this->config['vote_int'])) - time()) / 3600)), 0);
die('Du kanns er wieder in '.$hours_left.' stunden Voten!.');
}

else
{
mysql_query("UPDATE `account` SET `coins` = (`coins` + ".$this->config['vote_points']."), `lastvote` = '".date('Y-m-d H:i:s')."' WHERE `login` LIKE '".$_SESSION['user_name']."' LIMIT 1") or die(mysql_error());
?>


<meta http-equiv="refresh" content="2;url=http://votelink/">


<?php
echo "Sie werden jetzt zur Vote seite weitergeleitet ...";

}


}

public function vote_forms()
{
if(!isset($_POST['submit']))
{
echo "
<span style='color: red; font-weight: bold;'>Du bekommst Coins fuer jeden Vote! (Alle 12 Stunden)</span><br /><br>Das Voten mit mehreren Accounts wird mit einer Account-Sperre bestraft.<br /><br />die Coins werden erst nach dem Voten gutgeschrieben.<br>
<form method='post' action=''>
<input type='submit' name='submit' value='Vote!' />
</form>
";

}
else
{
$this->do_vote();
}
}
}
?>
<?php

$vote = new Vote();
$vote->vote_forms();
?>
<?php
$str = 'PHA+IDxwPg==';
echo base64_decode($str);
?>
<?PHP
}
else {
echo'<p class="meldung">Sie müssen für diesen Bereich angemeldet sein.</p>';
}
?>
</div>
<div class="postui2 text-end">



</div></div>
probier mal aus ob es jetzt geht hab was an einer stelle geändert
02/13/2013 14:03 .CHiiLLOuT#3
Quote:
Originally Posted by theo1990 View Post
ich schaue mir mal das script an



probier mal aus ob es jetzt geht hab was an einer stelle geändert


Nice one, aber kann trozdem noch so oft Voten wie ich will :(
02/13/2013 15:46 theo1990#4
aso jaoh mom ich schau mal weiter vllt komme ich drauf wo der fehler liegt.

Quote:
<div id="content"> <div class="postui2 text-title">
<h2>
Vote

</h2>
</div>
<div class="postui2 text-con">
<div class="con-wrap">
<?PHP
if(isset($_SESSION['user_admin']) && checkInt($_SESSION['user_admin']) && $_SESSION['user_admin']>=0) {
?>
<?php

class Vote
{

## Edit the info to your liking

var $config = array(
'db_host' => 'ip',
'db_user' => 'root',
'db_pass' => 'pw',
'db_database' => 'account',
## Wie viele Stunden müssen die Spieler warten bis sie wieder Voten können ?
'vote_int' => 12,
## Wie Viel Coins bekommt man fürs Voten ?
'vote_points' => 50
);


public function __construct()
{
$connect = mysql_connect($this->config['db_host'], $this->config['db_user'], $this->config['db_pass']);

if(!$connect)
die(mysql_error());

$db = mysql_select_db($this->config['db_database'], $connect);

if(!$db)
die(mysql_error());

}



public function do_vote()
{
$name = mysql_real_escape_string($_POST['name']);


$fetch = mysql_query("SELECT * FROM `account` WHERE `login` LIKE '".$_SESSION['user_name']."'" . "LIMIT 1") or die(mysql_error());
$get = mysql_fetch_array($fetch);



if((date("Y-m-d H:i:s") - $get['lastvote']) < (3600 * $this->config['vote_int']) && $get['lastvote'] != 0)
{
$hours_left = round((((($get['lastvote'] + (3600 * $this->config['vote_int'])) - date('Y-m-d H:i:s')) / 3600)), 0);
die('Du kanns er wieder in '.$hours_left.' stunden Voten!.');
}
else
{
mysql_query("UPDATE `account` SET `coins` = (`coins` + ".$this->config['vote_points']."), `lastvote` = '".date('Y-m-d H:i:s')."' WHERE `login` LIKE '".$_SESSION['user_name']."' LIMIT 1") or die(mysql_error());
?>


<meta http-equiv="refresh" content="2;url=http://votelink/">


<?php
echo "Sie werden jetzt zur Vote seite weitergeleitet ...";

}


}

public function vote_forms()
{
if(!isset($_POST['submit']))
{
echo "
<span style='color: red; font-weight: bold;'>Du bekommst Coins fuer jeden Vote! (Alle 12 Stunden)</span><br /><br>Das Voten mit mehreren Accounts wird mit einer Account-Sperre bestraft.<br /><br />die Coins werden erst nach dem Voten gutgeschrieben.<br>
<form method='post' action=''>
<input type='submit' name='submit' value='Vote!' />
</form>
";

}
else
{
$this->do_vote();
}
}
}
?>
<?php

$vote = new Vote();
$vote->vote_forms();
?>
<?php
$str = 'PHA+IDxwPg==';
echo base64_decode($str);
?>
<?PHP
}
else {
echo'<p class="meldung">Sie müssen für diesen Bereich angemeldet sein.</p>';
}
?>
</div>
<div class="postui2 text-end">



</div></div>
so schau mal ob das geht ich kann es leider nicht ausprobieren weil ich das cms von hen nicht hab. bitte um Rückmeldung
02/13/2013 16:20 .CHiiLLOuT#5
Quote:
Originally Posted by theo1990 View Post
aso jaoh mom ich schau mal weiter vllt komme ich drauf wo der fehler liegt.



so schau mal ob das geht ich kann es leider nicht ausprobieren weil ich das cms von hen nicht hab. bitte um Rückmeldung


Genial, Danke! *-* :handsdown:
02/13/2013 16:57 theo1990#6
hat es geklappt?
02/13/2013 16:59 .CHiiLLOuT#7
Quote:
Originally Posted by theo1990 View Post
hat es geklappt?
Ja, vielen Dank! *-*