, Machinatio, Inc., on 1-8-2001. This file (viewpubs.php) displays the publications of a given type based upon entries in the lcs_categories tables, drawing from the publications table. The code was updated by Tony Scelfo on 1-11-2002 */ require("pubutil.php"); dbconnect(); // global variables $debug = false; $sort = sanitize_xss($_GET['sort']); $cat = sanitize_xss($_GET['cat']); $count = sanitize_xss($_GET['count']); $currentpage = sanitize_xss($_GET['currentpage']); if(!isset($sort) || $sort =='') { $sort = "docnum"; } // check to see if any kind of sorting operation is requested // sorting has been requested by a given variable if ($sort == "title") { $query = sprintf("SELECT * FROM publications WHERE publication_type = '%s' ORDER BY publication_title", mysql_real_escape_string($cat)); //$query = "SELECT * FROM publications WHERE publication_type = \"$cat\" ORDER BY publication_title"; $result = mysql_query($query) or die ("database selection failed"); if(!$result) { die('Invalid query: ' . mysql_error()); } } if ($sort == "docnum") { $query = sprintf("SELECT * FROM publications WHERE publication_type = '%s' ORDER BY substring_index(lcs_doc_number,'-', -1)+1 desc", mysql_real_escape_string($cat)); //$query = "SELECT * FROM publications WHERE publication_type = \"$cat\" ORDER BY substring_index(lcs_doc_number,'-', -1)+1 desc"; $result = mysql_query($query) or die ("database selection failed"); if(!$result) { die('Invalid query: ' . mysql_error()); } } if ($sort == "author") { $query = sprintf("SELECT * FROM publications WHERE publication_type = '%s' ORDER BY author_lastname, author_firstname", mysql_real_escape_string($cat)); // $query = "SELECT * FROM publications WHERE publication_type = \"$cat\" ORDER BY author_lastname, author_firstname"; $result = mysql_query($query) or die ("database selection failed"); if(!$result) { die('Invalid query: ' . mysql_error()); } } if ($sort == "group") { $query = sprintf("SELECT * FROM publications WHERE publication_type ='%s' ORDER BY lcs_group", mysql_real_escape_string($cat)); // $query = "SELECT * FROM publications WHERE publication_type = \"$cat\" ORDER BY lcs_group"; $result = mysql_query($query) or die ("database selection failed"); } if ($sort == "date") { $query = sprintf("SELECT * FROM publications WHERE publication_type = '%s' ORDER BY publication_year, publication_month, publication_day", mysql_real_escape_string($cat)); // $query = "SELECT * FROM publications WHERE publication_type = \"$cat\" ORDER BY publication_year, publication_month, publication_day"; $result = mysql_query($query) or die ("database selection failed"); die("ran query: " . $query); if(!$result) { die('Invalid query: ' . mysql_error()); } } if ($sort == "url") { //$query = "SELECT * FROM publications WHERE publication_type = \"$cat\" ORDER BY url_additional"; $query = "SELECT * FROM publications"; $result = mysql_query($query) or die ("database selection failed"); if(!$result) { die('Invalid query: ' . mysql_error()); } } $catresult = mysql_query(sprintf("SELECT * FROM lcs_categories WHERE pub_category='%s'", mysql_real_escape_string($cat))); if(!$catresult) { die('Invalid query: ' . mysql_error()); } $catarray = mysql_fetch_array($catresult); $cat_description = $catarray["cat_description"]; ?> LCS Publications: <? echo $cat_description ?>
  This page is a (temporary and unofficial) indexable mirror of the MIT LCS publications page http://www.lcs.mit.edu/publications/viewpubs.php?cat=tr&sort=docnum&count=2000. The LCS TR/TM publications database fell off google some months ago, due to an unfortunate robots.txt. LCS is entangled in a lab merger at the moment, so it's unclear when this will be fixed. This page will go away once it is. -- mncharity@vendian.org 2003-Sep-29

"); if(mysql_num_rows($result) > $count) { echo("
    "); if(mysql_num_rows($result) > $count) { echo("


LCS

Click on the title of the document for more information. Click the column headers to sort by different fields.

"); echo("Page ".$currentpage." of ".ceil(mysql_num_rows($result) / $count)); echo(" | First Page"); if($currentpage > 1) { echo(" | Previous Page"); } else { echo(" | Previous Page"); } if($currentpage < ceil(mysql_num_rows($result) / $count)) { echo(" | Next Page"); } else { echo(" | Next Page"); } echo(" | Last Page"); echo(""); if($count==10) { echo("Show 10 | 25 | 50 | 100 per page"); } if($count==25) { echo("Show 10 | 25 | 50 | 100 per page"); } if($count==50) { echo("Show 10 | 25 | 50 | 100 per page"); } if($count==100) { echo("Show 10 | 25 | 50 | 100 per page"); } echo("
"); } //If the current page is not the first page, move the array foward so that the next item //in the array will be the one that is to be displayed first if($currentpage > 1) { for($i = 0; $i < (($currentpage - 1) * $count); $i++) { mysql_fetch_array($result); } } ?>
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; if ($debug) { // echo database information for debug reasons echo "
  • Publication Id: $publication_id"; echo "
    LCS Document Number: $lcs_doc_number"; echo "
    LCS Group: $lcs_group_name"; echo "
    Publication Title: $publication_title"; echo "
    Publication Author: $author_lastname, $author_firstname"; echo "
    Publication Date: " . $publication_month . "-" . $publication_day . "-" . $publication_year; echo "
    Additional URL:$url_additional"; echo "
    Publication Abstract: $publication_abstract"; } } ?>
  • Publication Title LCS Document Number Publication Author LCS Group Publication Date
    $publication_title$lcs_doc_number"; if ($author_lastname == "") { echo "No Author Available"; } else { echo "$author_lastname, $author_firstname"; } echo "$lcs_group_name".$publication_month."-".$publication_day."-".$publication_year."
    "); echo("Page ".$currentpage." of ".ceil(mysql_num_rows($result) / $count)); echo(" | First Page"); if($currentpage > 1) { echo(" | Previous Page"); } else { echo(" | Previous Page"); } if($currentpage < ceil(mysql_num_rows($result) / $count)) { echo(" | Next Page"); } else { echo(" | Next Page"); } echo(" | Last Page"); echo(""); if($count==10) { echo("Show 10 | 25 | 50 | 100 per page"); } if($count==25) { echo("Show 10 | 25 | 50 | 100 per page"); } if($count==50) { echo("Show 10 | 25 | 50 | 100 per page"); } if($count==100) { echo("Show 10 | 25 | 50 | 100 per page"); } echo("
    "); } ?>