Connect($CONFIG['sql_host'], $CONFIG['sql_user'], $CONFIG['sql_pass'], $CONFIG['sql_database']); // Get the number of members and the last reset $result = $db->Execute("SELECT last_newday, num_members FROM ".$CONFIG['sql_prefix']."_etc"); list($last_newday, $TMPL['nummem']) = $db->FetchArray($result); // Is it a new day/week/month? $time = time(); if ($CONFIG['daymonth'] == 1) { $current_day = date("m", time() + (3600 * $CONFIG['timeoffset'])); } elseif ($CONFIG['daymonth'] == 2) { $current_day = date("W", time() + (3600 * $CONFIG['timeoffset'])); } else { $current_day = date("d", time() + (3600 * $CONFIG['timeoffset'])); } if ($last_newday != $current_day) { require_once $CONFIG['path'].'/sources/new_day.php'; } if ($CONFIG['daymonth'] == 1) { $LNG['g_today'] = $LNG['g_thismonth']; $LNG['g_yesterday'] = $LNG['g_lastmonth']; $LNG['g_2days'] = $LNG['g_2months']; $LNG['g_3days'] = $LNG['g_3months']; } elseif ($CONFIG['daymonth'] == 2) { $LNG['g_today'] = $LNG['g_thisweek']; $LNG['g_yesterday'] = $LNG['g_lastweek']; $LNG['g_2days'] = $LNG['g_2weeks']; $LNG['g_3days'] = $LNG['g_3weeks']; } // gzip if ($CONFIG['gzip']) { ob_start("ob_gzhandler"); } // Options of what to do $action = array( 'display' => 1, 'edit' => 1, 'email' => 1, 'graph' => 1, 'join' => 1, 'lostcode' => 1, 'lostpw' => 1, 'rate' => 1, 'search' => 1, 'stats' => 1 ); // Require the appropriate script if (!isset($action[$FORM['a']])) { $FORM['a'] = 'display'; } require_once $CONFIG['path'].'/sources/'.$FORM['a'].'.php'; build_skin_stuff(); $db->Close; // Print the content echo do_template("wrapper"); if ($DEBUG) { echo "