Location: PHPKode > projects > MyPHPBib > bib_display_reference.php
<?php

include ('phpbib/phpbib.inc.php');

// Parameter in URL is accessed using GET
$ref_id 	= $_GET['id'];
$ref_format = $_GET['format'];
$ref_output = '';
if (isset ($_GET['output']))
{
	$ref_output = $_GET['output'];
}

// Defaults
if ($ref_format == '')
	$ref_format = 'html';

$r = new Reference();
$xpresult = $r->GetFormattedReference ($ref_id, $ref_format);

	switch ($ref_format)
	{
		case 'html':
//	require_once ('login/user.inc.php');
//		include ('header.inc.php');
//echo "<body>\n";
//include ('top.inc.php');
//echo "<div id=\"content\">\n";
			echo $xpresult;
//echo "</div>\n";
//include ('footer.inc.php');
//echo "</body>\n</html>\n";
			break;

		case 'report':
			require_once ('login/user.inc.php');
			include ('header.inc.php');
			echo "<body>\n";
			include ('top.inc.php');
			echo "<div id=\"content\">\n";
			echo $xpresult;
			include ('footer_floater.inc.php');
			echo "</div>\n";
			echo "</body>\n";
			echo "</html>\n";

			break;
			
		case 'refer':
			// Endnote/Refer format
			if ($ref_output == 'file')
			{
				header("Content-type: " . $config['mime_endnote']);
				header("Content-Disposition: attachment; filename=citmg-endnote");
				echo $xpresult;
			}
			else
			{
				echo "<pre>" . $xpresult . "</pre>";
			}
			break;
		case 'ris':
			// Reference Manager (RIS) format
			if ($ref_output == 'file')
			{
				header("Content-type: " . $config['mime_RIS']);
				header("Content-Disposition: attachment; filename=citmg-ris");
				echo $xpresult;
			}
			else
			{
				echo "<pre>" . $xpresult . "</pre>";
			}
			break;
		case 'bibtex':
			// BibTex
			if ($ref_output == 'file')
			{
				header("Content-type: " . $config['mime_bibtex']);
				header("Content-Disposition: attachment; filename=citmg-bibtex");
				echo $xpresult;
			}
			else
			{
				echo "<pre>" . $xpresult . "</pre>";
			}
			break;
		case 'prism':
			// PRISM
			if ($ref_output == 'file')
			{
				header("Content-type: application/xml");
//				header("Content-Disposition: attachment; filename=citmg-bibtex");
				echo $xpresult;
			}
			else
			{
				echo $xpresult;
			}
			break;
		default:
			echo "<pre>" . $xpresult . "</pre>";
			break;
	}


?>

Return current item: MyPHPBib