Vote4Coins Script funktioniert nicht.

07/19/2011 13:21 ♥ .Meroc' ♥#1
Moin,


Mein Vote4Coins Script funktioniert nicht ganz :-(
PHP Code:
<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'        =>    'xx.xx.xx.xxx',
        
'db_user'        =>    'root',
        
'db_pass'        =>    'xxxxxxxxxxxxxxxx',
        
'db_database'    =>    'account',
        
## Wie viele Stunden müssen die Spieler warten bis sie wieder Voten können ?
        
'vote_int'       =>    24,
        
## Wie Viel Coins bekommt man fürs Voten ?
        
'vote_points'    =>    25
    
);
    
    
    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 erst wieder in '.$hours_left.' stunden Voten!.');
            }
            
            else
            {
                
mysql_query("UPDATE `account` SET `coins` = (`coins` + ".$this->config['vote_points']."), `lastvote` = '".time()."' WHERE `login` LIKE '".$_SESSION['user_name']."' LIMIT 1") or die(mysql_error());
?>


<meta http-equiv="refresh" content="2;url=http://www.topliste.****************/In/3820-hiroshi2-com.htm">


<?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>

Habe es in meinem UserCP eingebunden usw. Wenn ich nun auf "Vote!" klicke, kommt
PHP Code:
Vote4Coins
Unknown column 
'lastvote' in 'field list' 
Da ich mich leider mit Php nicht auskenne usw, bräuchte ich eure hilfe :x

Viele Grüße

Black
07/19/2011 13:27 iYoshix3#2
die Spalte lastvote ist in der account.account Tabelle nicht enthalten.

Mfg
07/19/2011 13:32 ♥ .Meroc' ♥#3
Danke.
Etwas peinliche frage, aber wie mache ich in Navicat ne neue Spalte in der account tabelle? xD


Habs hinbekommen das man weitergeleitet wird, allerdings bekomme ich keine coins beim voten :/