Hab eine ein wenig andere Variante verwirklicht: Tippen bis vor die Achtelfinals:AceVentura hat geschrieben:
Wo kann ich denn den Weltmeistertipp zumindest bis nach dem 2 Spieltag verlängen lassen?
in der functions_wm.php
FINDE:
Code: Alles auswählen
function save_wm_tipp($user_id, $tipped_winner) {
global $db, $lang;
$first_game = get_first_game();
$first_game_time = $first_game[0]['game_time'];
$current_time = time();
if ( $current_time < $first_game_time ) {
//
// Delete old wm tipp
//
$sql = "DELETE FROM " . WM_TIPPS_TABLE . " WHERE tipp_user = $user_id AND tipp_game = 65";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not delete wm tip', '', __LINE__, __FILE__, $sql);
}
//
// Insert wm tipp
//
if ( $tipped_winner != 0 ) {
$sql = "INSERT INTO " . WM_TIPPS_TABLE . " (tipp_user,tipp_game,tipp_home) VALUES ($user_id,65,$tipped_winner)";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not insert wm tip', '', __LINE__, __FILE__, $sql);
}
}
}
}
Code: Alles auswählen
function save_wm_tipp($user_id, $tipped_winner) {
global $db, $lang;
$first_finalgame = get_first_finalgame();
$first_finalgame_time = $first_finalgame[0]['game_time'];
$current_time = time();
if ( $current_time < $first_finalgame_time ) {
//
// Delete old wm tipp
//
$sql = "DELETE FROM " . WM_TIPPS_TABLE . " WHERE tipp_user = $user_id AND tipp_game = 65";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not delete wm tip', '', __LINE__, __FILE__, $sql);
}
//
// Insert wm tipp
//
if ( $tipped_winner != 0 ) {
$sql = "INSERT INTO " . WM_TIPPS_TABLE . " (tipp_user,tipp_game,tipp_home) VALUES ($user_id,65,$tipped_winner)";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not insert wm tip', '', __LINE__, __FILE__, $sql);
}
}
}
}
function get_first_finalgame() {
global $db;
//
// Get games data
//
$sql = "SELECT *
FROM " . WM_FINALS_TABLE . "
ORDER BY game_time ASC LIMIT 1";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not get games data', '', __LINE__, __FILE__, $sql);
}
$resultsdata = array();
while ( $row = $db->sql_fetchrow($result) )
{
$resultsdata[] = $row;
}
$db->sql_freeresult($result);
return $resultsdata;
}