null ) { $query = sprintf("select * from bnw_articles where articleid=%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("%s -%s", $row->title, getauthname($row->authorid)); $bnw_meta_description = $row->blurb; $bnw_meta_keywords = $row->keywords; $type = $row->articletype; } } } } if ($sup <> null ) { $query = sprintf("select * from bnw_supplements where articleid=%d", $sup); $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 { if(!($row=mysql_fetch_object($result))) $sup = null; else { $bnw_meta_title = sprintf("%s -%s", $row->title, getauthname($row->authorid)); $bnw_meta_description = $row->blurb; $bnw_meta_keywords = $row->keywords; $type = $row->articletype; } } } } if($id == null and $sup == null) { if($type <> null) { $query = sprintf("select * from bnw_articletypes where articletype=%d", $type); $result = mysql_query($query) or die("3t There has been an error accessing the database. Please try again later. \n\n"); if(mysql_error() <> "" or mysql_num_rows($result) == 0) $type = null; else { if(!mysql_data_seek ($result, 0)) $type = null; else { if(!($row=mysql_fetch_object($result))) $type = null; else { $bnw_meta_title = sprintf("$row->title"); $bnw_meta_description = sprintf("$row->description"); $bnw_meta_keywords = sprintf("$row->keywords"); } } } } } if($type == null) $type = 1; $bnw_meta_title = str_replace('\n', ' ', strip_tags($bnw_meta_title)); $bnw_meta_description = str_replace('\r\n', ' ', strip_tags($bnw_meta_description)); $bnw_meta_keywords = str_replace('\n', ' ', strip_tags($bnw_meta_keywords)); require("_includes/header.inc"); $query2 = sprintf("select * from bnw_articletypes where articletype=%d", $type); $result2 = mysql_query($query2) or die("3t There has been an error accessing the database. Please try again later. \n\n"); if(mysql_error() <> "" or mysql_num_rows($result2) == 0) $type = null; else { if(!mysql_data_seek ($result2, 0)) $type = null; else { if(!($row2=mysql_fetch_object($result2))) $type = null; } } printf ("", $type, $row2->masthead); ?>
  null or $sup <> null) { $publish_date = formatdate($row->pub_date, 0); printf("

%s -- %s \n", $publish_date, getvolumelink($row->volumeid)); if($sup<>0) printsuprefs(1, $row->articleref, $sup); else printsuprefs(1, $id, 0); ?> %s
\n", $row->title ); if($row->subtitle > "") printf("%s
", $row->subtitle); if($row->authline <> null) printf("

%s

", $row->authline ); else printf("%s\n", getauthlink($row->authorid) ); $pgm = "workshop"; if($row->subnote > "") printf("

%s", $row->subnote); if( $row->abstract > "") printf("

Abstract
%s

\n", $row->abstract); if( $row->filename == "") { printf("

%s\n", $row->article ); } else { $file = sprintf( "articles/%s", $row->filename); if (!$file_handle = fopen($file,"r")) { echo "Cannot open file."; } if (!$file_contents = fread($file_handle, filesize($file))) { echo "Cannot retrieve file contents."; } else { echo "$file_contents"; } fclose($file_handle); } if( $row->copyright > "") printf("

Copyright © %s

\n", $row->copyright); if($sup<>0) printsuprefs(1, $row->articleref, $sup); else printsuprefs(1, $id, 0); // if( $row->threadid > 0) // printf("


View and post comments about this article...

\n", $row->threadid); } else { $publish_date = formatdate(0, 0); printf("

%s

\n", $publish_date); $query = sprintf("select articleid, authorid, title, blurb, pub_date, new_until, volumeid, articletype from bnw_articles where articletype = %d order by volumeid desc, pub_date desc", $type); $result = mysql_query($query) or die("91 There has been an error accessing the database. Please try again later. \n\n"); 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))) continue; printf("

%s\n", getarticleinfo($row->articleid, 1, 1, 1, 1)); printf("

"); printsuprefs(0, $row->articleid, 0); printf("

\n"); } } ?>