PHPGedview 2.12 MySql.
Some of my sources have more than one multimedia-item. When showing the details of a source-record in source.php, the filename of the first item is shown in the second item too. The second item is therefore not accessible.
Any suggestions?
Boudewijn.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
PHPGedview 2.12 MySql.
Some of my sources have more than one multimedia-item. When showing the details of a source-record in source.php, the filename of the first item is shown in the second item too. The second item is therefore not accessible.
Any suggestions?
Boudewijn.
I think that I see the problem.
Find lines 97-101 which currently look like this:
$cs = preg_match_all("/1 OBJE(.*)/", $source, $nmatch, PREG_SET_ORDER);
for($i=0; $i<$cs; $i++) {
$objerec = get_sub_record(1, $nmatch[$i][0], $source);
print_main_media($objerec, 1, $sid);
}
Replace those lines with these:
$pos1 = strpos($source, "1 OBJE");
while($pos1!==false) {
$pos2 = strpos($source, "\n1", $pos1+4);
if (!$pos2) $pos2 = strlen($source);
$objerec = substr($source, $pos1, $pos2-$pos1);
print_main_media($objerec, 1, $sid);
$pos1 = strpos($source, "1 OBJE", $pos2);
}
--John
John,
Works great! Thanks!
Boudewijn.