$row['username'], 'user_id' => $row['performed_by'], 'object' => $row['object'], 'object_id' => $row['object_id'], 'action' => $row['action'], 'date' => $date, 'hour' => $hour, 'ip_address' => $row['ip_address'], 'details' => $row['details'], ); } header('Content-type: application/csv'); header('Content-Disposition: attachment; filename='.date('YmdGis').'piwigo_activity_log.csv'); header("Content-Transfer-Encoding: UTF-8"); $f = fopen('php://output', 'w'); foreach ($output_lines as $line) { fputcsv($f, $line, ";"); } fclose($f); exit(); } // +-----------------------------------------------------------------------+ // | template initialization | // +-----------------------------------------------------------------------+ $template->set_filename('user_activity', 'user_activity.tpl'); $template->assign('ADMIN_PAGE_TITLE', l10n('User Activity logs')); // +-----------------------------------------------------------------------+ // | sending html code | // +-----------------------------------------------------------------------+ $template->assign(array( 'PWG_TOKEN' => get_pwg_token(), 'INHERIT' => $conf['inheritance_by_default'], 'CACHE_KEYS' => get_admin_client_cache_keys(array('users')), )); $template->assign_var_from_handle('ADMIN_CONTENT', 'user_activity'); ?>