nabend,
ist es irgendwie moeglich die Topliste alle 7 Tage bzw jeden Sonntag automatisch zu reseten?
LG
Hier kann eine Notiz zum Merk-Eintrag hinzugefügt werden (optional)
Geschlossen |
site_statistic()
$wtag = 0; // Wochen Tag. Sonntag = 0, Samstag = 6 $d = date('j'); $m = date('n'); $y = date('Y'); $sql = "SELECT wtag FROM prefix_stats WHERE d = " . $d . " AND m = " . $m . " AND yar = " . $y . " AND wtag = " . $wtag . " LIMIT 1"; $query = @db_query($sql); if ( @db_num_rows($query) === 1 ) { $sql = "UPDATE prefix_topliste SET `klickin` = 0, `klickout` = 0"; @db_query($sql); }
MySQL Error: 1054 : Unknown column 'd' in 'where clause' in Query: SELECT wtag FROM ic1_stats WHERE d = 14 AND m = 8 AND yar = 2011 AND wtag = 0 LIMIT 1 Debug backtrace: @ mysql.php:32 -- debug_bt() @ mysql.php:50 -- db_check_error(...) @ index.php:29 -- db_query(...)
$wtag = 0; // Wochen Tag. Sonntag = 0, Samstag = 6 $stag = 0; // Stunde. $mtag = 0; // Minute. $timestamp = time(); $min = date("i",$timestamp); $tag = date("d",$timestamp); if ( $min == $mtag AND $tag == $wtag ) { $d = date('j'); $m = date('n'); $y = date('Y'); $sql = "SELECT wtag FROM prefix_stats WHERE day = " . $d . " AND stunde = " . $stag . " AND mon = " . $m . " AND yar = " . $y . " AND wtag = " . $wtag . " LIMIT 1"; $query = @db_query($sql); if ( @db_num_rows($query) === 1 ) { $sql = "UPDATE prefix_topliste SET `klickin` = 0"; @db_query($sql); } }
$wtag = 0; // Wochen Tag. Sonntag = 0, Samstag = 6; if ( date('w') === $wtag ) { $d = date('d'); $m = date('m'); $y = date('Y'); $sql = "SELECT count FROM prefix_counter WHERE date LIKE '" . $y . "-" . $m . "-" . $d . "' LIMIT 1"; $query = @db_query($sql); if ( @db_num_rows($query) === 0 || db_result($query,0,0) == '1' ) { $sql = "UPDATE prefix_topliste SET `klickin` = 0"; @db_query($sql); } }
Geschlossen | ||
Zurück zu Module und Modifikationen |