Example #1
0
        html_header();
        $uuids = $mendeley->get_related_uuids($uuid);
        if (count($uuids) == 0) {
            echo 'No documents found';
            link_home();
        } else {
            $paper = $mendeley->get_document($uuid);
            $db = new LitDb(DB_PATH);
            if (!$db->in_db($uuid)) {
                $db->to_db($paper);
            }
            link_home();
            echo '<h3>Related documents for ' . $uuid . '</h3>';
            foreach ($uuids as $uuid2) {
                $paper2 = $mendeley->get_document($uuid2);
                if (!$db->in_db($uuid2)) {
                    $db->to_db($paper2);
                }
                if (!$db->sim_in_db($uuid, $uuid2)) {
                    $db->sim_to_db($uuid, $uuid2);
                }
                echo '<P>';
                $paper2->format_html();
                echo '</P>';
            }
        }
        html_footer();
    }
} else {
    echo 'No UUID given.';
}