I've fixed it in my plugin version a while back, I'll post the minor changes below.AlexK wrote:Thanks a lot for the wonderful plugin. I upgraded v1.1b to 1.2b to enable 'putput to file' but it is still not functioning. Whenever I do it, it outputs an empty file. Is 'output to file' bug still pending ?
Thanks!!!
Alex
in functions.php Change this function
Code: Select all
function export () {
global $haloe_config;
header("Content-type: text/plain");
header("Content-Disposition: attachment; filename=log_view-" . date("Y-m-d",time()) . ".log");
$haloe_messages = get_haloe_messages();
if (sizeof($haloe_messages) > 0) {
foreach ($haloe_messages as $haloe_message) {
print $haloe_message[$haloe_config["hostField"]] . "," . $haloe_message[$haloe_config["facilityField"]] . "," . $haloe_message[$haloe_config["priorityField"]] . "," . $haloe_message[$haloe_config["dateField"]] . "," . $haloe_message[$haloe_config["timeField"]] . "," . $haloe_message[$haloe_config["textField"]] . "\r\n";
}
}
}
Code: Select all
include('plugins/haloe/config.php');
db_connect_real($haloedb_hostname,$haloedb_username,$haloedb_password,$haloedb_default, $haloedb_type);
Code: Select all
function export () {
global $haloe_config;
header("Content-type: text/plain");
header("Content-Disposition: attachment; filename=log_view-" . date("Y-m-d",time()) . ".log");
include('plugins/haloe/config.php');
db_connect_real($haloedb_hostname,$haloedb_username,$haloedb_password,$haloedb_default, $haloedb_type);
$haloe_messages = get_haloe_messages();
if (sizeof($haloe_messages) > 0) {
foreach ($haloe_messages as $haloe_message) {
print $haloe_message[$haloe_config["hostField"]] . "," . $haloe_message[$haloe_config["facilityField"]] . "," . $haloe_message[$haloe_config["priorityField"]] . "," . $haloe_message[$haloe_config["dateField"]] . "," . $haloe_message[$haloe_config["timeField"]] . "," . $haloe_message[$haloe_config["textField"]] . "\r\n";
}
}
}
Code: Select all
include('./include/haloe-config.php');