Menu

Invalid media-filenames in Soucedetails

Help
2003-07-24
2003-08-14
  • Boudewijn Sjouke

    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.

     
    • John Finlay

      John Finlay - 2003-07-29

      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

       
    • Boudewijn Sjouke

      John,

      Works great! Thanks!

      Boudewijn.

       

Log in to post a comment.