Prevent display of hidden metadata fields in slideshow

From CONTENTdm Users Wiki

Jump to: navigation, search

On 2007-08-01 Colin Eliott of Athabasca University pointed out that hidden metadata fields were displayed by the metadata viewer of the slideshow viewer (inside favorite).

The associated web template is fav_meta_viewer.php. I have no idea why fav_meta_viewer.php doesn't just call meta_scr.php, but I attribute it to the general inconsistency and disarray of the CONTENTdm code base. In any case meta_scr.php is quite complex, so i'm not going to call it either.

Instead apply the following patch.

Index: fav_meta_viewer.php
===================================================================
--- fav_meta_viewer.php (revision 2552)
+++ fav_meta_viewer.php (working copy)
@@ -68,7 +68,7 @@
 } else {
        for($i = 0; $i < count($conf); $i++){
        $tag = strtoupper($conf[$i]["nick"]);
-               if(isset($structure[$index[$tag][0]]["value"])){
+               if($conf[$i]["hide"] != "1" && isset($structure[$index[$tag][0]]["value"])){
                $fieldbuf = $structure[$index[$tag][0]]["value"];
                print("<tr><td class=\"tdtext\" width=\"150\"><span class=\"maintext\"><b>{$conf[$i]["name"]}</b></span></td><td class=\"tdtext\"><span class=\"maintext\">$fieldbuf</span></td></tr>\n");
                }

This just checks that the field is not hidden before displaying it.