<% #----------------------------------------------------------------- # GDL # Connecting People's Knowledge # Copyright (c) 1998-2001 by KMRG ITB, kmrg@kmrg.lib.itb.ac.id # Version 3.1, April 2001, by: Ismail Fahmi, ismail@itb.ac.id # Free for IndonesiaDLN Members #----------------------------------------------------------------- # ---------------- init ---------------- include "./inc/types.inc"; $goinit = mysql_query("SELECT DC_IDENTIFIER_HIERARCHY, DC_CONTRIBUTOR_MODIFIEDBY, REVIEW, ACCESS_RIGHT FROM metadata WHERE DC_IDENTIFIER = '$id'"); if ($goinit){ $rinit = mysql_fetch_array($goinit); $reader_allowed = FALSE; $DC_CONTRIBUTOR_MODIFIEDBY = $rinit[DC_CONTRIBUTOR_MODIFIEDBY]; if ($rinit[ACCESS_RIGHT] == "Intranet"){ if (($DC_CONTRIBUTOR_MODIFIEDBY == $sess_email)|| ($sess_group == "1")) { $reader_allowed = TRUE; } else { if ($gochk = mysql_query("SELECT GID FROM metadata_group WHERE DC_IDENTIFIER = '$id'")) { while ($rchk = mysql_fetch_array($gochk)){ if ($sess_addgroup[$rchk[GID]] == "1"){ $reader_allowed = TRUE; } } } } } else { $reader_allowed = TRUE; } if ($reader_allowed) { // allowed to read if (empty($sess_last_clicked_top)){ $sess_last_clicked_top = $rinit[DC_IDENTIFIER_HIERARCHY]; } session_register("sess_article_master"); $sess_article_master = $rinit[DC_IDENTIFIER_HIERARCHY]; $cat_target = $sess_last_clicked_top; include "./inc/create_path.inc"; $REVIEW = $rinit[REVIEW]; } else { // not allowed to read $title = "Intranet Only"; $content = "./pages/not_authorized.inc"; include "./template/template_noad.html"; exit; } } %> <%=$id%> - GDL <%=$DC_PUBLISHER_ID%> <% include "./inc/menu_head.inc";%> <% # ------------- display metadata ------------------------------ if ($goart = mysql_query("SELECT * from metadata where DC_IDENTIFIER = '$id'")){ $row = mysql_fetch_array($goart); # get the publisher data $pub_id = strtoupper($row[DC_PUBLISHER_ID]); $gopub = mysql_query("SELECT * FROM publisher where DC_PUBLISHER_ID = '$pub_id'"); if ($gopub){ if (mysql_num_rows($gopub)>0){ $rowpub = mysql_fetch_array($gopub); $PUB_TYPE = $rowpub[DC_PUBLISHER_TYPE]; $PUB_CONNECTION = $rowpub[DC_PUBLISHER_CONNECTION]; if ($pub_id == $DC_PUBLISHER_ID) { $pub_url = "http://$DC_PUBLISHER_HOSTNAME"; } elseif ($PUB_CONNECTION == "DEDICATED"){ $pub_url = "http://".$rowpub[DC_PUBLISHER_HOSTNAME]; } else { $pub_url = "http://$GDL_SERVER"; } $publisher = " $pub_id/".trim($rowpub[DC_PUBLISHER])."
".$rowpub[DC_PUBLISHER_ORGNAME]."
Knowledge Officer: ".$rowpub[DC_PUBLISHER_CKO]."
"; if ($rowpub[DC_PUBLISHER_CONNECTION] == "DEDICATED"){ $publisher .= "Home: $pub_url"; } else { $stype = ucfirst(strtolower($rowpub[DC_PUBLISHER_TYPE])); $home = "http://$GDL_SERVER/go.php?top=/*$stype/$pub_id/"; $publisher .= "Home: $home"; } } else { $publisher = "Unable to get information for publisher $pub_id.
Please contact $DC_PUBLISHER_ADMIN to update publishers database."; } } else { echo "Publisher: ".mysql_error(); } # ------------- display header and banner --------------------- include "./inc/border_top.inc"; #include "./inc/ad.inc"; include "./inc/display_path_article.inc"; %>
 
<% echo "

".stripslashes($row[DC_TITLE])."

"; if (strlen($row[DC_TITLE_ALTERNATIVE])>5){ echo "

(".stripslashes($row[DC_TITLE_ALTERNATIVE]).")

"; } echo "

".stripslashes($row[DC_CREATOR])."
".stripslashes($row[DC_CREATOR_ORGNAME])."

"; echo ""; $date = $row[DC_DATE]; echo ""; if (!empty($row[DC_SUBJECT])) echo ""; if (!empty($row[DC_SUBJECT_CLASSIFICATION])) echo ""; if (!empty($row[DC_SUBJECT_DDC])) echo ""; if (!empty($row[DC_TITLE_SERIES])) echo ""; echo ""; echo "
Date:$date
Keywords:".stripslashes($row[DC_SUBJECT_KEYWORDS])."
Subject:".stripslashes($row[DC_SUBJECT])."
Classification:".stripslashes($row[DC_SUBJECT_CLASSIFICATION])."
DDC:".stripslashes($row[DC_SUBJECT_DDC])."
Series:".stripslashes($row[DC_TITLE_SERIES])."
View XML:$id
"; echo "

".$types[$row[DC_TYPE]].""; if (empty($pub_url)&&($pub_id != $DC_PUBLISHER_ID)){ echo "

WARNING: UNKNOWN PUBLISHER ADDRESS ($pub_id) !!
Please update your PUBLISHER database.

"; } #--- files contents....----------------------------------------------------- if ($goc = mysql_query("SELECT * from relation where DC_IDENTIFIER = '$id' and DC_RELATION_HASACCESS = 'Public' ORDER BY DC_RELATION_NO")) { echo " contains ".mysql_num_rows($goc)." files (for public).

"; while ($rowc = mysql_fetch_array($goc)){ $c++; $exists = FALSE; $url = "$pub_url".$rowc[DC_RELATION_HASURI]; # --- if image is JPG or PNG if (ereg("download",$rowc[DC_RELATION_HASURI])){ $arimg = explode("?f=",$rowc[DC_RELATION_HASURI]); $filesrc = $root_dir.$arimg[1]; } else { $arimg[1] = $rowc[DC_RELATION_HASURI]; } if (file_exists($filesrc)){ if (eregi("(.jpg|.png)",$filesrc)){ $imgsize = getimagesize($filesrc); $imgremark = $imgsize[3]; echo ""; } $exists = TRUE; } elseif ($pub_id != $DC_PUBLISHER_ID) { $filesrc2 = "$root_dir/$pub_id$arimg[1]"; if (file_exists($filesrc2)){ $exists = TRUE; } } # -------- show the files link if ($exists){ if (!eregi("$pub_id",$arimg[1])){ $file_path = "/$pub_id$arimg[1]"; } else { $file_path = $arimg[1]; } $url2 = "http://$DC_PUBLISHER_HOSTNAME/download.php?f=$file_path"; echo "$c. $url2
    (".$rowc[DC_RELATION_HASFILENAME].", ". $rowc[DC_RELATION_HASSIZE]." bytes) $imgremark"; } else { echo "$c. $url
    (".$rowc[DC_RELATION_HASFILENAME].", ". $rowc[DC_RELATION_HASSIZE]." bytes) $imgremark"; } echo "
"; if ($c == $row[DC_RELATION_COUNT]){ break; } } } else { echo mysql_error(); } # ---------- related categories --- echo "

Categories:"; if ($gocat = mysql_query("SELECT DC_IDENTIFIER_HIERARCHY from toc WHERE DC_IDENTIFIER = '$id' order by DC_IDENTIFIER_HIERARCHY")) { while($rowcat = mysql_fetch_array($gocat)){ echo "

  • ". ereg_replace("/","/ ",$rowcat[DC_IDENTIFIER_HIERARCHY]).""; if ($rowcat[DC_IDENTIFIER_HIERARCHY] == $row[DC_IDENTIFIER_HIERARCHY]){ echo " (master)"; } } } # --------- creator ---------- $str_creator = $row[DC_CREATOR]."
    ".$row[DC_CREATOR_ORGNAME]; if (!empty($row[DC_CREATOR_EMAIL])){ $str_creator .= "
    Email: ".$row[DC_CREATOR_EMAIL]."
    "; } if (!empty($row[DC_CREATOR_BDAY])){ $str_creator .= "Birth date: ".$row[DC_CREATOR_BDAY]."
    "; } if (!empty($row[DC_CREATOR_STREET])){ $str_creator .= $row[DC_CREATOR_STREET]; } if (!empty($row[DC_CREATOR_LOCALITY])){ $str_creator .= " ".$row[DC_CREATOR_LOCALITY]; } if (!empty($row[DC_CREATOR_REGION])){ $str_creator .= " ".$row[DC_CREATOR_REGION]; } if (!empty($row[DC_CREATOR_COUNTRY])){ $str_creator .= " ".$row[DC_CREATOR_COUNTRY]; } if (!empty($row[DC_CREATOR_PCODE])){ $str_creator .= " ".$row[DC_CREATOR_PCODE]; } echo "

    Creator: $str_creator

    "; # --------- publisher -------- echo "

    Publisher: $publisher

    "; echo "

    Language: ".$row[DC_LANGUAGE]; echo "

    Description:

    ".ereg_replace("\n","

    ",stripslashes($row[DC_DESCRIPTION]))."

    "; if (!empty($row[DC_DESCRIPTION_ALTERNATIVE])){ echo "

    Description (English):

    ".ereg_replace("\n","

    ",stripslashes($row[DC_DESCRIPTION_ALTERNATIVE]))."

    "; } %>
  • <% $goc = mysql_query("SELECT * FROM contributor WHERE DC_IDENTIFIER='$id'"); if ($goc){ while ($rowc = mysql_fetch_array($goc)){ $str_contributor .= $rowc[DC_CONTRIBUTOR_ROLE].": ".$rowc[DC_CONTRIBUTOR]."
    "; } } else { echo mysql_error(); } if (strlen($row[DC_CONTRIBUTOR])>0){ $str_contributor .= nl2br(stripslashes($row[DC_CONTRIBUTOR])); } if (!empty($str_contributor)){ %> <% } %> <% if (!empty($row[DC_SOURCE])){%> <%}%> <% if (!empty($row[DC_RELATION])){%> <%}%> <% if (!empty($row[DC_COVERAGE])){%> <%}%>
    Contributor: <%=$str_contributor%>
    Last Modified: <%=$row[DC_DATE_MODIFIED]%>, by <%=$row[DC_CONTRIBUTOR_MODIFIEDBY]%>
    Sources: <% if (eregi("http://",$row[DC_SOURCE])){ echo "".$row[DC_SOURCE].""; } else { echo stripslashes($row[DC_SOURCE]); } %>
    Relation: <%=stripslashes($row[DC_RELATION])%>
    Coverage: <%=stripslashes($row[DC_COVERAGE])%>
    Copyright: <%=stripslashes($row[DC_RIGHTS])%>
       
    <% } else { echo mysql_error(); } %>

    <% include "./inc/border_bottom.inc"; include "./inc/menu_body_end.inc"; %>