require("_admin/bnwglobal.php");
if ($id <> null ) 
	{
	$query = sprintf("select * from bnw_volumes where volumeid=%d", $id);
	$result = mysql_query($query)
		or die("3i There has been an error accessing the database. Please try again later. \n\n");
	if(mysql_error() <> "" or mysql_num_rows($result) == 0) $id = null;
	else
		{
		if(!mysql_data_seek ($result, 0)) $id = null;
		else
			{
			if(!($row=mysql_fetch_object($result))) $id = null;
			else
				{
				$bnw_meta_title = sprintf("IDEA %s - %s", $row->volume, $row->pub_date);
				$bnw_meta_description = "Volume table of contents";
				}
			}
		}
	}
else
	{
	$query = sprintf("select * from bnw_volumes order by volumeid desc");
	$result = mysql_query($query)
		or die("3i There has been an error accessing the database. Please try again later. \n\n");
	if(mysql_error() <> "" or mysql_num_rows($result) == 0) $sup = null;
	else
		{
		if(!mysql_data_seek ($result, 0)) $sup = null;
		else
			{
			$bnw_meta_title = "IDEA volumes";
			$bnw_meta_description = "Idea a journal of social issues";
			}
		}
	}
require("_includes/header.inc");
printf (" ");
printf("
");
printf("
| ");
if($id <> null)
	{
	printf(" %s -- %s\n", $row->volume, $row->pub_date); $query2 = sprintf("select * from bnw_articletypes"); $result2 = mysql_query($query2) or die("911 There has been an error accessing the database. Please try again later. \n\n"); for ($i=0; $i < mysql_num_rows($result2); $i++) { if(!mysql_data_seek ($result2, $i)) { printf ("Error seeking row %d", $i); continue; } if(!($row2=mysql_fetch_object($result2))) continue; $query = sprintf("select * from bnw_articles where articletype = %d and volumeid = %d order by pub_date desc", $row2->articletype, $id); $result = mysql_query($query) or die("91 There has been an error accessing the database. Please try again later. \n\n"); if(mysql_num_rows($result)>0) { printf (" ", $row2->articletype, $row2->masthead); for ($j=0; $j < mysql_num_rows($result); $j++) { if(!mysql_data_seek ($result, $j)) { printf ("Error seeking row %d", $j); continue; } if(!($row=mysql_fetch_object($result))) continue; printf(" %s\n", getarticleinfo($row->articleid, 1, 1, 1, 0)); printf(" ");
				printsuprefs(0, $row->articleid, 0);
				printf(" %s\n", $publish_date); $query = sprintf("select * from bnw_volumes order by volumeid desc"); $result = mysql_query($query) or die("912 There has been an error accessing the database. Please try again later. \n\n"); printf(" ");
	for ($i=0; $i < mysql_num_rows($result); $i++)
		{
		if(!mysql_data_seek ($result, $i))
			{
			printf ("Error seeking row %d", $i);
			continue;
			}
		if(!($row=mysql_fetch_object($result)))
			{
			printf("Error fetching object %d", $i);
			continue;
			}
		printf(" |