// themenausgabe, beitragausgabe und memeberausgabe anfang
$wochentage = array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag");
$monate = array(1=>"Januar",2=>"Februar",3=>"März",4=>"April",5=>"Mai",6=>"Juni",7=>"Juli",8=>"August",9=>"September",10=>"Oktober",11=>"November",12=>"Dezember");
date_default_timezone_set("Europe/Berlin");
$tag = date("w");
$wochentag = $wochentage[$tag];
$kw = date("W");
$monat = date("n");
$diesenmonat = $monate[$monat];
//heutige
$daytimestamp_1 = mktime(0, 0, 0, gmdate("n"), gmdate("j"), gmdate("Y"));
$daytimestamp_2 = mktime(23, 59, 59, gmdate("n"), gmdate("j"), gmdate("Y"));
$query = $db->query("SELECT COUNT(*) AS newthreads FROM ".TABLE_PREFIX."threads WHERE dateline between '$daytimestamp_1' AND '$daytimestamp_2' AND visible='1' AND closed NOT LIKE 'moved|%'");
$newthreadstoday = my_number_format($db->fetch_field($query, "newthreads"));
$query = $db->query("SELECT COUNT(*) AS newposts FROM ".TABLE_PREFIX."posts WHERE dateline between '$daytimestamp_1' AND '$daytimestamp_2' AND visible='1'");
$newpoststoday = my_number_format($db->fetch_field($query, "newposts"));
$query = $db->query("SELECT COUNT(*) AS newmembers FROM ".TABLE_PREFIX."users WHERE regdate between '$daytimestamp_1' AND '$daytimestamp_2'");
$newmemberstoday = my_number_format($db->fetch_field($query, "newmembers"));
//diese woche
$weektimestamp_1 = mktime(0,0,0,date("m"),date("j")+1-date("w"),date("Y"));
$weektimestamp_2 = mktime(23,59,59,date("m"),date("j")-date("w")+7,date("Y"));
$query = $db->simple_select("threads", "*, COUNT(*) AS newthreads", "dateline between '$weektimestamp_1' AND '$weektimestamp_2' AND visible='1' AND closed NOT LIKE 'moved|%'");
$newthreadsweek = my_number_format($db->fetch_field($query, "newthreads"));
$query = $db->query("SELECT COUNT(*) AS newposts FROM ".TABLE_PREFIX."posts WHERE dateline between '$weektimestamp_1' AND '$weektimestamp_2' AND visible='1'");
$newpostsweek = my_number_format($db->fetch_field($query, "newposts"));
$query = $db->query("SELECT COUNT(*) AS newmembers FROM ".TABLE_PREFIX."users WHERE regdate between '$weektimestamp_1' AND '$weektimestamp_2'");
$newmembersweek = my_number_format($db->fetch_field($query, "newmembers"));
//diesen monat
$monthtimestamp_1 = mktime(0,0,0,date("m"),1,date("Y"));
$monthtimestamp_2 = mktime(23,59,59,date("m")+1,0,date("Y"));
$query = $db->simple_select("threads", "COUNT(*) AS newthreads", "dateline between '$monthtimestamp_1' AND '$monthtimestamp_2' AND visible='1' AND closed NOT LIKE 'moved|%'");
$newthreadsmonth = my_number_format($db->fetch_field($query, "newthreads"));
$query = $db->query("SELECT COUNT(*) AS newposts FROM ".TABLE_PREFIX."posts WHERE dateline between '$monthtimestamp_1' AND '$monthtimestamp_2' AND visible='1'");
$newpostsmonth = my_number_format($db->fetch_field($query, "newposts"));
$query = $db->query("SELECT COUNT(*) AS newmembers FROM ".TABLE_PREFIX."users WHERE regdate between '$monthtimestamp_1' AND '$monthtimestamp_2'");
$newmembersmonth = my_number_format($db->fetch_field($query, "newmembers"));
//alle
$query = $db->simple_select("threads", "COUNT(*) AS newthreads", "visible='1' AND closed NOT LIKE 'moved|%'");
$allthreads = my_number_format($db->fetch_field($query, "newthreads"));
$query = $db->query("SELECT COUNT(*) AS newposts FROM ".TABLE_PREFIX."posts WHERE visible='1'");
$allposts = my_number_format($db->fetch_field($query, "newposts"));
$query = $db->query("SELECT COUNT(*) AS newmembers FROM ".TABLE_PREFIX."users");
$allmembers = my_number_format($db->fetch_field($query, "newmembers"));
// themenausgabe, beitragausgabe und memeberausgabe ende