';
echo '| ';
echo '', $tt, '';
echo ' | ';
echo '';
echo '';
echo '';
echo ' ';
}
// Album Reorder include =============================
// Following used for Album media sort ------------------
$reorder=safe_get('reorder', '1', '0');
if ($reorder==1) {
if ($kind==1) $rownum1=$numm;
if ($kind==2) $rownum2=$numm;
if ($kind==3) $rownum3=$numm;
if ($kind==4) $rownum4=$numm;
if ($kind==5) require WT_ROOT.WT_MODULES_DIR.'lightbox/functions/lb_horiz_sort.php';
}
// ==================================================
// Start pulling media items into thumbcontainer div ==============================
foreach ($rows as $rowm) {
if (isset($foundObjs[$rowm['m_media']])) {
if (isset($current_objes[$rowm['m_media']])) {
$current_objes[$rowm['m_media']]--;
}
continue;
}
// NOTE: Determine the size of the mediafile
$imgwidth = 300+40;
$imgheight = 300+150;
if (isFileExternal($rowm['m_file'])) {
if (in_array($rowm['m_ext'], $MEDIATYPE)) {
$imgwidth = 400+40;
$imgheight = 500+150;
} else {
$imgwidth = 800+40;
$imgheight = 400+150;
}
} else if (media_exists(check_media_depth($rowm['m_file'], 'NOTRUNC'))) {
$imgsize = findImageSize(check_media_depth($rowm['m_file'], 'NOTRUNC'));
$imgwidth = $imgsize[0]+40;
$imgheight = $imgsize[1]+150;
}
$rows=array();
//-- if there is a change to this media item then get the
//-- updated media item and show it
if (($newrec=find_updated_record($rowm['m_media'], $ged_id)) && $kind!=5 ) {
$row = array();
$row['m_media'] = $rowm['m_media'];
$row['m_file'] = get_gedcom_value("FILE", 1, $newrec);
$row['m_titl'] = get_gedcom_value("TITL", 1, $newrec);
if (empty($row['m_titl'])) $row['m_titl'] = get_gedcom_value("FILE:TITL", 1, $newrec);
$row['m_gedrec'] = $newrec;
$et = preg_match("/(\.\w+)$/", $row['m_file'], $ematch);
$ext = "";
if ($et>0) $ext = substr(trim($ematch[1]), 1);
$row['m_ext'] = $ext;
$row['mm_gid'] = $pid;
$row['mm_gedrec'] = $rowm['mm_gedrec'];
$row['m_gedfile'] = $rowm['m_gedfile'];
$rows['new'] = $row;
$rows['old'] = $rowm;
} else {
if (!isset($current_objes[$rowm['m_media']]) && ($rowm['mm_gid']==$pid)) {
$rows['old'] = $rowm;
} else {
$rows['normal'] = $rowm;
if (isset($current_objes[$rowm['m_media']])) {
$current_objes[$rowm['m_media']]--;
}
}
}
foreach ($rows as $rtype => $rowm) {
if ($kind!=5) {
$res = lightbox_print_media_row($rtype, $rowm, $pid);
}
$media_found = $media_found || $res;
$foundObjs[$rowm['m_media']]=true;
}
}
// =====================================================================================
//-- Objects are removed from the $current_objes list as they are printed.
//-- Any "Extra" objects left in the list are new objects recently added to the gedcom
//-- but not yet accepted into the database.
//-- We will print them too, and put any "Extra Items not in DB" into a new Row.
// Firstly, get count of Items in Database for this Individual
$indiobjs = "SELECT ";
$indiobjs .= "m_media, m_ext, m_file, m_titl, m_gedfile, m_gedrec, mm_gid, mm_gedrec FROM `##media`, `##media_mapping` where ";
$indiobjs .= "mm_gid=? ";
$indiobjs .= "AND mm_gedfile=? AND mm_media=m_media AND mm_gedfile=m_gedfile ";
$vars2=array($pid, WT_GED_ID);
$rows=WT_DB::prepare($indiobjs)->execute($vars2)->fetchAll(PDO::FETCH_ASSOC);
$foundObjs = array();
$numindiobjs = count($rows);
// Compare Items count in Database versus Item count in GEDCOM
if ($kind==5 && $ct!=$numindiobjs) {
// If any items are left in $current_objes list for this individual, put them into $kind 5 ("Not in DB") row
echo '';
echo '| ';
echo '', $tt, '';
echo ' | ';
echo '';
echo '';
echo '';
echo ' ';
foreach ($current_objes as $media_id=>$value) {
while ($value>0) {
$objSubrec = array_pop($obje_links[$media_id]);
$row = array();
$newrec = find_gedcom_record($media_id, $ged_id, true);
$row['m_media'] = $media_id;
$row['m_gedfile']=$ged_id;
$row['m_file'] = get_gedcom_value("FILE", 1, $newrec);
$row['m_titl'] = get_gedcom_value("TITL", 1, $newrec);
if (empty($row['m_titl'])) $row['m_titl'] = get_gedcom_value("FILE:TITL", 1, $newrec);
$row['m_gedrec'] = $newrec;
$et = preg_match("/(\.\w+)$/", $row['m_file'], $ematch);
$ext = "";
if ($et>0) $ext = substr(trim($ematch[1]), 1);
$row['m_ext'] = $ext;
$row['mm_gid'] = $pid;
$row['mm_gedrec'] = get_sub_record($objSubrec{0}, $objSubrec, $gedrec);
$res = lightbox_print_media_row('new', $row, $pid);
$media_found = $media_found || $res;
$value--;
}
}
}
// No "Extra" Media Items ============================
if ($kind==5 && $ct==$numindiobjs) {
// "Extra" Media Item in GEDCOM but NOT in DB ========
} else if ($kind==5 && $ct!=$numindiobjs) {
echo ' ';
echo ' ';
echo '';
echo ' ';
echo ' | ';
echo ' | ';
echo ' ';
echo ' ';
// Media Item in GEDCOM & in DB ======================
} else {
echo ' ';
echo ' ';
echo '';
echo ' ';
echo ' | ';
if ($kind==3 && $numm > 0) {
echo '';
echo WT_I18N::translate('"UK census images have been obtained from "The National Archives", the custodian of the original records, and appear here with their approval on the condition that no commercial use is made of them without permission.
Requests for commercial publication of these or other UK census images appearing on this website should be directed to: Image Library, The National Archives, Kew, Surrey, TW9 4DU, United Kingdom."
');
echo '';
}
echo ' | ';
echo '
';
echo '