I fixed it by making some changes to /usr/share/zoneminder/skins/classic/includes/export_functions.php
changed function exportEventImagesMaster from line 666 to 690. It is a bit hacky, but it works for me. I bet it is pretty much the same for the flat skin, but I just use the classic. It would be a lot more efficient to just make one for-loop for the database calls, but I didn't want to mess around too much in there.
It would be nice if someone from the head office would look at it, and tell me if I broke something. It was my first dip into the code, and I mostly code in python.
changed this:
Code: Select all
<?php foreach($eids as $eid)
{
?>
<div><a href="javascript:switchevent('<?php echo $eventMonitorId[$eid].'/' . $eid; ?>/zmEventImages.html');"><?=$eid?></a></div>
<?php
}
?>
</div>
<?php
foreach ($monitors as $monitor)
{
echo "<div class='tab_content' id='tab$monitor'>";
echo "<h2>Monitor: " . $monitorNames[$monitor] . " </h2>";
foreach ($eids as $eid)
{
if ($eventMonitorId[$eid] == $monitor)
{
?>
<div><a href="javascript:switchevent('<?php echo $eventMonitorId[$eid].'/' . $eid; ?>/zmEventImages.html');"><?=$eid?></a></div>
<?php
}
}
echo'</div>';
}
into this:
Code: Select all
<?php foreach($eids as $eid)
{
# ----- start change by hesral -----
$sql = "select E.Id,E.MonitorId,M.Name As MonitorName,M.Width,M.Height,E.Name,E.Cause,E.Notes,E.StartTime,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived from Monitors as M inner join Events as E on (M.Id = E.MonitorId) where E.Id = '".dbEscape($eid)."'";
$event = dbFetchOne( $sql );
$eventPath = mygetEventPath( $event );
$event_path_array = explode('/', $eventPath);
unset($event_path_array[0]);
$eventPath = implode('/',$event_path_array);
?>
<div><a href="javascript:switchevent('<?php echo $eventPath; ?>/zmEventImages.html');"><?=$eid?></a></div>
<?php
# ----- stop change by hesral -----
}
?>
</div>
<?php
foreach ($monitors as $monitor)
{
echo "<div class='tab_content' id='tab$monitor'>";
echo "<h2>Monitor: " . $monitorNames[$monitor] . " </h2>";
foreach ($eids as $eid)
{
if ($eventMonitorId[$eid] == $monitor)
{
# ----- start change by hesral -----
$sql = "select E.Id,E.MonitorId,M.Name As MonitorName,M.Width,M.Height,E.Name,E.Cause,E.Notes,E.StartTime,E.Length,E.Frames,E.AlarmFrames,E.TotScore,E.AvgScore,E.MaxScore,E.Archived from Monitors as M inner join Events as E on (M.Id = E.MonitorId) where E.Id = '".dbEscape($eid)."'";
$event = dbFetchOne( $sql );
$eventPath = mygetEventPath( $event );
$event_path_array = explode('/', $eventPath);
unset($event_path_array[0]);
$eventPath = implode('/',$event_path_array);
?>
<div><a href="javascript:switchevent('<?php echo $eventPath; ?>/zmEventImages.html');"><?=$eid?></a></div>
<?php
# ----- stop change by hesral -----
}
}
echo'</div>';
}