Aí vai da "pecinha"... que está à frente do monitor e do teclado.

Abraço.

Código: Selecionar todos
$csv_output = trim($config['sitename']) . ',' . $user->lang['EMAIL'];
$csv_output .= "\n";
//$csv_output .= $user->lang['USER_ID'] . ',' . $user->lang['USERNAME'] . ',' . $user->lang['EMAIL_ADDRESS'] . ',' . $user->lang['SORT_JOINED'] . ',' . $user->lang['LAST_VISIT'];
$csv_output .= $user->lang['USER_ID'] . ';' . $user->lang['USERNAME'] . ';' . $user->lang['EMAIL_ADDRESS'] . ';' . $user->lang['SORT_JOINED'] . ';' . $user->lang['LAST_VISIT'];
$csv_output .= "\n";
//Pull Users from the database
$sql = 'SELECT FROM_UNIXTIME(user_regdate) AS regdate, user_id, username, user_email, FROM_UNIXTIME(user_lastvisit) AS lastvisit
FROM ' . USERS_TABLE . '
WHERE user_type <> ' . USER_IGNORE . '
ORDER BY user_id';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
{
//$csv_output .= $row['user_id'] . ',' . $row['username'] . ',' . $row['user_email'] . ',' . $row['regdate'] . ',' . $row['lastvisit'];
$csv_output .= $row['user_id'] . ';' . $row['username'] . ';' . $row['user_email'] . ';' . $row['regdate'] . ';' . $row['lastvisit'];
$csv_output .="\n";
}
Código: Selecionar todos
header("Content-type: application/vnd.ms-excel");
header("Content-disposition: attachment; filename=" . str_replace(" ", "_", $config['sitename']) . '_' . $user->lang['EMAIL'] . 's_' . date("Y-m-d").".csv");
Código: Selecionar todos
header("Content-Encoding: UTF-8");
header("Content-type: text/csv; charset=UTF-8");
header("Content-disposition: attachment; filename=" . str_replace(" ", "_", $config['sitename']) . '_' . $user->lang['EMAIL'] . 's_' . date("Y-m-d").".csv");
echo "\xEF\xBB\xBF"; // UTF-8 BOM