// Defines the $lg variable
require("/p/hci/public/htdocs/publications/getLanguage.php");

if ($lg=="fr")
{
// Translate "fr" and these lines into another language if needed.
$txtIn="en";
$txtNoResult="Aucun résultat n'a été trouvé.";
$txtCloseName="Noms avec une orthographe proche ";
$txtDisplayAll="Afficher toute la liste";
}
else
{
// Default language is english
$txtIn="in";
$txtNoResult="No publications were found.";
$txtCloseName="Possible name misspellings";
$txtDisplayAll="Display the complete list";
}

if (!isset($author)) $author = $_GET["author"];
if (!isset($display)) $display = $_GET["display"];
if (!isset($full)) $full = $_GET["full"];
if (!isset($idAuthor)) $idAuthor = str_replace(array("[[:alpha]]", "/"), "", $_GET["idAuthor"]);
if (!empty($idAuthor) && (!is_numeric($idAuthor)))
unset($idAuthor);
if (!isset($nbPerPage)) $nbPerPage = $_GET["nbPerPage"];
if (!isset($pg)) $pg = $_GET["pg"];
if (!isset($title)) $title = $_GET["title"];
if (!isset($year)) $year = $_GET["year"];

if (empty($pg)) $pg = 1;
if (empty($nbPerPage)) $nbPerPage = 20;

$option["author"] = $author;
$option["display"] = $display;
$option["full"] = $full;
$option["idAuthor"] = $idAuthor;
$option["nbPerPage"] = $nbPerPage;
$option["pg"] = $pg;
$option["title"] = $title;
$option["year"] = $year;

require("/p/hci/public/htdocs/publications/utils.php");
sqlConnect();

// Search for author name from idAuthor
if (!empty($idAuthor))
{
$resultIdAuthor = sqlQuery("SELECT first, last FROM authors WHERE id=$idAuthor");
$rowIdAuthor=mysql_fetch_array($resultIdAuthor);
$author=$rowIdAuthor["last"];
}

$labName="HCI";
if (empty($author))
$titleName=$labName;
else
if ($lg=="fr")
$titleName="de $author chez $labName";
else
$titleName="$author's";

if ($lg=="fr")
if ($display=="gallery")
$title="Galerie d'images $titleName";
else
$title="Publications $titleName";
else
if ($display=="gallery")
$title="$titleName image gallery";
else
{
$title="$titleName publications";
if (!empty($author)) $title.=" with $labName";
}

if (!empty($year) && ($year != -1))
$title .= " $txtIn $year";

$css="/publications/listpubli.css";
//include("header.php");
//echo "

$title

\n\n”;
//unset($title); // interfers with form parameters

$title=$_GET["title"];

require(“/p/hci/public/htdocs/publications/publiUtils.php”);

$result = bibQueryResults($option);
$nbPublis=mysql_num_rows($result);

// Search engine
//require(“/p/hci/public/htdocs/publications/search.php”);

function pageIndex()
{
global $nbPublis;
global $nbPerPage;
global $pg;
global $txtDisplayAll;

$res = “

\n”;
else
$res .= ”

\n$href”.”-1′>$txtDisplayAll ($nbPublis $publication)\n

\n”;
*/
$res .= ”

\n”;

if ($pg>1)
$res .= $href.($pg-1).”‘>«  \n”;

$imin=max(1, $pg-5);
$imax=min($pg+14,floor(($nbPublis/$nbPerPage)+1));
for ($i=$imin; $i<=$imax; $i++)
{
if ($i==$pg)
$res.=" $i“;
else
$res.=$href.$i.”‘>$i“;
$res .= ”  \n”;
}

if (($pg!=-1) && ($pg<$imax))
$res .= "$href".($pg+1)."'>  »\n”;

$res .= ”

\n”;
}
/* else
$res .= ”

\n $nbPublis $publication\n

\n”;
*/

$res .= ”

 

\n”;
$res .= “