0) return mysql_fetch_assoc($result); else return false; } function any_beginning_with($initial,$type="") { $result=get_all_name_beginning_with($initial,$type); if (mysql_num_rows($result)>0) return(-1); else return(0); } function research_link($group) { if (trim($group)<>"") return "/research/groups/$group/"; } function get_all_name_beginning_with($initial,$type="") { switch (strtolower(trim($type))) { case "ac": $filter="and (category='Academic' or category='Retired academic' or category='Postdoc')"; break; case "vi": $filter="and category='Visitor'"; break; case "pg": $filter="and category='Postgraduate'"; break; case "it": $filter="and category='IT'"; break; case "se": $filter="and (category='Administrative' or category='Secretarial')"; break; case "ot": $filter="and not (category='Academic' or category='Retired academic' or category='Postdoc' or category='Visitor' or category='Postgraduate' or category='IT' or category='Secretarial' or category='Administrative')"; break; } mysql_select_db("people"); $result=mysql_query( "select p.id as localid, p.forenames, p.surname, p.title, p.position, p.category from people as p where p.active='-1' and p.surname like '$initial%' $filter order by sortname "); return $result; } function format_name($id,$forenames,$surname,$title="",$category="") { if ($category!=="") $cat="($category)"; else $cat=""; $name=make_name($forenames,$surname,$title) ."
$cat"; if ($id!=="") $name="$name"; return "$name\n"; } function none_if_null($val) { if (trim($val)=="" or $val=="0") return "None"; else return $val; } function make_email($email) { if ($email=="" or $email=="None") return $email; else return " "; } function make_url($url,$link) { if ($url=="" or $url=="None") return $url; else return "$link"; } function get_people_list($type) { $index="
"; for ($i=65;$i<=90;$i++) { $letter=chr($i); $result=get_all_name_beginning_with($letter,$type); if (mysql_num_rows($result)>0) { $index.="$letter "; $content.=" \n"; } else $index.="$letter "; $mod3=0; while ($row=mysql_fetch_array($result)) { extract($row); if ($mod3==0) $content.="\n\n"; // $content.=format_name($localid,$forenames,$surname,$title,$category); $content.=format_name($localid,$forenames,$surname,"",$position); if ($mod3==2) { $content.="\n"; $mod3=-1; } $mod3++; } while ($mod3>0) { $content.=format_name("","",""); if ($mod3==2) { $content.="\n"; $mod3=-1; } $mod3++; } if (mysql_num_rows($result)>0) $content.='
$letter
'."\n"; } $index.="
"; $content = trim($index) . $content; return $content; } mk_connection(); ?> <?php $dblink = mk_connection(); $booklist = $HTTP_GET_VARS['books']; $paperlist = $HTTP_GET_VARS['papers']; if (!isset($HTTP_GET_VARS['year']) || $HTTP_GET_VARS['year'] < 2004) { $HTTP_GET_VARS['year'] = date('Y'); // hack in case ?year is not set } if ($HTTP_GET_VARS['year'] > date('Y')) $HTTP_GET_VARS['year'] = date('Y'); // hack in case ?year is not set //echo "Preprints ", $HTTP_GET_VARS['year']; ?>
Preprints -
The postal address for the department and other contact information is found on the Contact information page. The following gives links to information about staff and postgraduates in the department, including email adresses and telephone numbers.

"; $content=""; echo "

Where there is no link to an electronic form of a preprint, please contact the author(s) directly.

"; $persontable.="
"; // Get the articles and print them mysql_select_db("research"); $query = "SELECT * from publications, preprints where preprints.paper_id = publications.id and publications.year = " . $HTTP_GET_VARS['year'] ; $result=mysql_query($query); if (mysql_num_rows($result) != 0) { echo $persontable; $paperstex = ""; while ($row=mysql_fetch_array($result)) { // author data not in correct format - so hacks applied below $row['author'] = str_replace (";", " and ", $row['author']); $row['author'] = str_replace (".,", ". and ", $row['author']); $row['author'] = str_replace ("&", " and ", $row['author']); if ($row['url'] != '') $url = "url = {" . $row['url'] . "},\n"; else $url = ''; $paperstex.= "@ARTICLE{".$HTTP_GET_VARS['year']. "/" . $row['id'] . ",\n" . "title = {" . $row['title'] . "},\n" . $url . "author = {" . $row['author'] . "},\n}\n\n " ; } // end while // $paperstex = str_replace (";", " and ", $paperstex); $randname = rand(); $bibfile = '/tmp/' . $randname . '.bib'; //echo $bibfile; $fh = fopen($bibfile, 'w') or die("can't open file"); fwrite($fh, $paperstex); fclose($fh); $command = "/usr/bin/bibtex2html -labelname -noheader -nofooter -nodoc -rawurl -nobibsource -o - $bibfile | sed 's/\[/' | sed 's/\">.*<\/a>\]/<\/b>/'"; // echo $command; passthru($command); unlink($bibfile); } echo $persontable; ?>