".get_np($text, $what, $prev, $next)."".$top_btn, 'subtit'); echo " "; if (!$user) tabela_pub($res, "y", "y", "" ,"", "", "", $bibtex, $start_elem); else tabela_pub($res, "y", "", "y" ,"y", "", "", $bibtex, $start_elem); echo " "; $entries = mysql_num_rows($res); mysql_free_result($res); return $entries; } function get_np($txt, $what, $prev, $next) { global $show_sc; return "\n".((!empty($prev) or $prev=='0')?"":'').'<<'.((!empty($prev) or $prev=='0')?" ":' ').$txt.' '.((!empty($next) or $next=='0')?"":'').'>>'.((!empty($next) or $next=='0')?"":'')."\n"; } echo get_header($main_page_title); ob_end_flush(); $year = getParam("year", $var_methods_type[0]); $author_id = getParam("author_id", $var_methods_type[0]); $author = getParam("author", $var_methods_type[0]); $keyword = getParam("keyword", $var_methods_type[0]); $entry_type = getParam("entry_type", $var_methods_type[0]); $type = getParam("type", $var_methods_type[0]); $id = getParam("id", $var_methods_type[0]); $start_elem = 0; $o = getParam("o", $var_methods_type[1]); $operation = getParam("p", $var_methods_type[1]); $oper = getParam("op", $var_methods_type[0]); if (empty($operation)) { if (empty($oper)) $operation = 'n'; else $operation=$oper; } echo " "; if ($link = check_ok()){ if ($year!=""){ $res=mysql_db_query($db_bibliography, "SELECT DISTINCT year FROM $tb_publications WHERE year > $year ORDER BY YEAR ASC LIMIT 1;"); if(!empty($res) and mysql_num_rows($res)==1) { $row=mysql_fetch_object($res); $prev=$row->year; } else $prev = ''; $res=mysql_db_query($db_bibliography, "SELECT DISTINCT year FROM $tb_publications WHERE year < $year ORDER BY YEAR DESC LIMIT 1;"); if(!empty($res) and mysql_num_rows($res)==1) { $row=mysql_fetch_object($res); $next=$row->year; } else $next = ''; titlu("left", "$title_bg", "FFFFFF", ''.$publication.'s '.(empty($year)?"with no year defined (default ".get_np('0', "$show_sc?year=", $prev, $next).")":"of Year ".get_np($year, "$show_sc?year=", $prev, $next))."   $dwn_btn"); $next='';$prev=''; $res = mysql_db_query($db_bibliography, "SELECT DISTINCT entry_type FROM $tb_publications WHERE year='$year';"); $i=0; while ($row=mysql_fetch_object($res)) $entr[$i++]=$row->entry_type; for ($i=0; $i 0) { $next = ''; if ($i".$entries_list[$i]."","", '', $start_elem, $prev, $next); $prev=$entries_list[$i]; } } } } else if (!empty($author_id) or !empty($author)) { $ord = getParam("ord", $var_methods_type[0]); if (!empty($author_id)) $res = mysql_db_query($db_bibliography, "SELECT * FROM $tb_authors WHERE id='".$author_id."';"); else $res = mysql_db_query($db_bibliography, "SELECT * FROM $tb_authors WHERE ident='".$author."';"); if (empty($res) or mysql_num_rows($res)===0) { titlu("left", "$title_bg", "FFFFFF", "There is no such author. Try here"); } else { $row = mysql_fetch_object($res); if (empty($author_id)) $author_id = $row->id; if (empty($author)) $author = $row->ident; $surname = $row->surname; $name = $row->name; $ident = $row->ident; $indexed = $row->indexed; mysql_free_result($res); if ($indexed != $status_list[2] || !$pubs_type_biblio){ titlu("left", "$title_bg", "FFFFFF", ''.$publication.'s of '. (empty($row->homepage)?"":"homepage."\" title=\"Home page of ".$surname." " .$name."\" target=\"_blank\">"). ($indexed == $status_list[2] ? "":"").$surname." ".$name."". ($indexed == $status_list[2] ? "":""). (empty($row->homepage)?"":""). ($indexed == $status_list[1] ? " (past $team_name member)":""). (!empty($user) ? " (edit)":""). "   $dwn_btn "; $keyword = str_replace(",", "','", $keyword); $query = "SELECT $tb_publications.*, count($tb_publications.id) as nr_keyw FROM ".$tb_publications. ", $tb_pub_to_keyw, $tb_keywords WHERE $tb_keywords.name in ('".$keyword. //"') AND $tb_pub_to_keyw.id_keyw in ('".$keyword. "') AND $tb_pub_to_keyw.id_pub=".$tb_publications.".id ". " AND $tb_pub_to_keyw.id_keyw=$tb_keywords.id "; if ($ord == "year") { $res = mysql_db_query($db_bibliography, "SELECT DISTINCT year FROM $tb_publications ORDER BY year DESC;"); if (mysql_num_rows($res) > 0) while ($row = mysql_fetch_object($res)){ $querye = $query." AND ".$tb_publications.".year='".$row->year."' GROUP BY $tb_publications.id ORDER by $tb_publications.id;"; $ress = mysql_db_query($db_bibliography, $querye); if (mysql_num_rows($ress) > 0){ $doit = true; if ($operation=='a'){ $ids = ""; while ($roww = mysql_fetch_object($ress)) { if ($roww->nr_keyw == count($keywords)){ $ids .= "','".$roww->id; } } if (!empty($ids)) { $ress = mysql_db_query($db_bibliography, "SELECT * FROM $tb_publications WHERE id IN ('$ids');"); } else { $doit = false; } } if ($doit) { titlu("center", "$subt_col", "000000", "year."\" title=\"".$publication."s of year ".$row->year."\">".$row->year."".$top_btn); echo ""; } } mysql_free_result($ress); } mysql_free_result($res); } else { for ($i=0; $i 0){ $doit = true; if ($operation=='a'){ $ids = ""; while ($row = mysql_fetch_object($ress)) { if ($row->nr_keyw == count($keywords)){ $ids .= "','".$row->id; } } if (!empty($ids)) { $ress = mysql_db_query($db_bibliography, "SELECT * FROM $tb_publications WHERE id IN ('$ids');"); } else { $doit = false; } } if ($doit) { titlu("center", "$subt_col", "000000", "".$entries_list[$i]."".$top_btn); echo ""; } } mysql_free_result($ress); } } } else if (!empty($entry_type)) { $pos = array_search($entry_type, $entries_list); $res = mysql_db_query($db_bibliography, "SELECT DISTINCT entry_type FROM $tb_publications;"); $prev='';$next=''; while ($row=mysql_fetch_object($res)) { $poss=array_search($row->entry_type, $entries_list); if ($poss < $pos and (empty($prev) or $prev < $poss)) $prev=$poss; if ($poss > $pos and (empty($next) or $next > $poss)) $next=$poss; } if (is_int($next)) $next=$entries_list[$next]; if (is_int($prev)) $prev=$entries_list[$prev]; titlu("left", "$title_bg", "FFFFFF", "".get_np($entry_type, "$show_sc?entry_type=", $prev, $next). ' '.$publicationl."s sorted by year   $dwn_btn"); $res = mysql_db_query($db_bibliography, "SELECT DISTINCT year FROM $tb_publications WHERE entry_type='$entry_type' ORDER BY year DESC;"); $prev='';$i=0; if (mysql_num_rows($res) > 0){ while ($row = mysql_fetch_object($res)){ $next=''; $i++; if ($i < mysql_num_rows($res)){ $roww=mysql_fetch_object($res); $next=$roww->year; mysql_data_seek($res, $i); } $ress=mysql_db_query($db_bibliography, "SELECT * FROM $tb_publications WHERE entry_type='$entry_type' AND year='".$row->year."';"); $start_elem += display_entries($ress, "year."\" title=\"All ".$publicationl.'s '.(empty($row->year)?"with no year defined":"of year ".$row->year)."\">".$row->year."","", "", $start_elem, $prev, $next); $prev=$row->year; } } mysql_free_result($res); } else if (!empty($id)){ $type = getParam("type", $var_methods_type[0]); titlu("left", "$title_bg", "FFFFFF", "$publication no #".$id."   $dwn_btn"; echo ""; } mysql_free_result($res); } else if (!empty($type)) { $ord = getParam("ord", $var_methods_type[0]); titlu("left", "$title_bg", "FFFFFF", 'All '.$publicationl.'s   '. "( " . (($type=="bib" or $type == "both") ? "" : ""). "Html". (($type=="bib" or $type == "both") ? "":""). " | ". ($type != "bib" ? "":""). "Bibtex". ($type != "bib" ? "" : ""). " | ". ($type != "both" ? "":""). "Both". ($type != "both" ? "" : "")." )". "   $dwn_btn
Order by:   ". ($ord == "year" ? "" :"")."Type".($ord == "year" ? "":"")." | ". ($ord != "year" ? "":"")."Year".($ord != "year" ? "":"")); $query = "SELECT $tb_publications.* FROM ".$tb_publications. ", $tb_pub_to_auth, $tb_authors WHERE $tb_authors.id='". $author_id."' AND $tb_pub_to_auth.id_author='".$author_id. "' AND $tb_pub_to_auth.id_pub=".$tb_publications.".id"; if ($ord == "year") { $res = mysql_db_query($db_bibliography, "SELECT DISTINCT $tb_publications.year FROM $tb_publications, $tb_authors, $tb_pub_to_auth WHERE $tb_authors.id='$author_id' AND $tb_pub_to_auth.id_author='$author_id' AND $tb_pub_to_auth.id_pub=$tb_publications.id ORDER BY year DESC;"); $prev='';$i=0; if (mysql_num_rows($res) > 0){ while ($row = mysql_fetch_object($res)){ $next=''; $i++; if ($i < mysql_num_rows($res)){ $roww=mysql_fetch_object($res); $next=$roww->year; mysql_data_seek($res, $i); } $querye = $query." AND ".$tb_publications.".year='".$row->year."';"; $ress = mysql_db_query($db_bibliography, $querye); $start_elem += display_entries($ress, "year."\" title=\"All ".$publicationl."s ".(empty($row->year)?"with no year defined":"of year ".$row->year)."\">".$row->year."","", "", $start_elem, $prev, $next); $prev=$row->year; } } if (!empty($res)) mysql_free_result($res); } else { $next='';$prev=''; $res = mysql_db_query($db_bibliography, "SELECT DISTINCT $tb_publications.entry_type FROM $tb_publications, $tb_authors, $tb_pub_to_auth WHERE $tb_authors.id='$author_id' AND $tb_pub_to_auth.id_author='$author_id' AND $tb_pub_to_auth.id_pub=$tb_publications.id;"); $i=0; while ($row=mysql_fetch_object($res)) $entr[$i++]=$row->entry_type; for ($i=0; $i 0) { $next = ''; if ($i".$entries_list[$i]."","", ($type == "bib" ? "y" : ""), $start_elem, $prev, $next); $prev=$entries_list[$i]; } } } } } else if (empty($name)) { titlu("left", "$title_bg", "FFFFFF", "Author #". $author_id." not indexed."); } else { titlu("left", "$title_bg", "FFFFFF", "Author '". $surname." ".$name."' not indexed."); } } } else if (!empty($keyword)) { $ord = getParam("ord", $var_methods_type[0]); $keywords = explode(",", $keyword); $titlul = ''.$publication.'s related to'. (count($keywords)<2?" ":":
"); $lin = ""; for ($i=0; $i".$keywords[$i]."'". (empty($user) ? "":"\"Edit\""); if ($i<(count($keywords)-1)){ if ($i==(count($keywords)-2)){ $titlul .= ($operation == 'a' ? " and " : " or "); } else { $titlul .= ", "; } } } titlu("left", "$title_bg", "FFFFFF", $titlul . "
  $dwn_btn
Order by:   ". ($ord == "year" ? "" :"")."Type".($ord == "year" ? "":"")." | ". ($ord != "year" ? "":"")."Year".($ord != "year" ? "":"")); require_once('./fc_enum.php'); echo "
". linie_enum($tb_keywords, "", "o\" onchange=\"keywSubmit(false)", $keyword, "", "", "left", "", "", "y", ""). "
           related to:
"; if (!$user) tabela_pub($ress, "y", "y", "" ,"", "", "", "", $start_elem); else tabela_pub($ress, "y", "", "y" ,"y", "", "", "", $start_elem); $start_elem += mysql_num_rows($ress); echo "
"; if (!$user) tabela_pub($ress, "y", "y", "" ,"", "", "", "", $start_elem); else tabela_pub($ress, "y", "", "y" ,"y", "", "", "", $start_elem); $start_elem += mysql_num_rows($ress); echo "
Type :   ". ((!empty($type) and ($type == "bib" or $type == "both")) ? "" :"")."Html".((!empty($type) and ($type == "bib" or $type == "both")) ? "":"")." | ". ($type != "bib" ? "":"")."Bib".($type != "bib" ? "":"") ." | ". ($type != "both" ? "":"")."Both".($type != "both" ? "":"")); $res = mysql_db_query($db_bibliography, "SELECT * FROM $tb_publications WHERE id='".$id."';"); if (mysql_num_rows($res) > 0){ $row=mysql_fetch_object($res); mysql_data_seek($res, 0); echo "
    Created: ".get_user_name($row->id_user_c) ."".($user?", ":''). $row->date_c.($user?(empty($row->computer_c)?"":", ".$row->computer_c.""):'').($row->date_lm!=$row->date_c?"     Modified: ".get_user_name($row->id_user_lm)."".($user?", ":'').$row->date_lm.($user?(empty($row->computer_lm)?"":", ".$row->computer_lm.""):""):'').(((($modifs_approve && $user) || $modifs_save_copy && $user_admin) && !empty($row->date_approved))?"     Approved: ".get_user_name($row->id_admin_approved).", ".$row->date_approved:'')."
"; if (!$user){ if ($type == "bib") { tabela_pub($res, "y", "y", "" ,"", "", "", "y", $id - 1); } else if ($type == "both") { tabela_pub($res, "y", "y", "" ,"", "", "", "", $id - 1); } else if (empty($type) or ($type != "bib" and $type != "both")) { tabela_pub($res, "y", "y", "" ,"", "", "", "", $id - 1); } } else { if ($type == "bib") { tabela_pub($res, "y", "", "y" ,"y", "", "", "y", $id - 1); } else if ($type == "both") { tabela_pub($res, "y", "", "y" ,"y", "", "", "", $id - 1); } else if (empty($type) or ($type != "bib" and $type != "both")) { tabela_pub($res, "y", "", "y" ,"y", "", "", "", $id - 1); } } echo "
Order by:   ". ($ord == "year" ? "" :"")."Type".($ord == "year" ? "":"")." | ". ($ord != "year" ? "":"")."Year".($ord != "year" ? "":"")); if ($ord == "year"){ $res = mysql_db_query($db_bibliography, "SELECT DISTINCT year FROM $tb_publications ORDER BY year DESC;"); $prev='';$i=0; if (mysql_num_rows($res) > 0) while ($row = mysql_fetch_object($res)) {//todo $next=''; $i++; if ($i < mysql_num_rows($res)){ $roww=mysql_fetch_object($res); $next=$roww->year; mysql_data_seek($res, $i); } $ress=mysql_db_query($db_bibliography, "SELECT * FROM $tb_publications WHERE year='".$row->year."';"); $start_elem += display_entries($ress, "year."\" title=\"Only ".$publicationl.'s '.(empty($row->year)?"with no year defined":"of year ".$row->year)."\">".$row->year."","", ($type == "bib" ? "y" : ""), 0, $prev, $next); $prev=$row->year; } mysql_free_result($res); } else { $next='';$prev=''; $res = mysql_db_query($db_bibliography, "SELECT DISTINCT entry_type FROM $tb_publications;"); $i=0; while ($row=mysql_fetch_object($res)) $entr[$i++]=$row->entry_type; for ($i=0; $i 0) { $next = ''; if ($i".$entries_list[$i]."","", ($type == "bib" ? "y" : ""), 0, $prev, $next); $prev=$entries_list[$i]; } } } } } else erroare("Bad or no parameters for the script!", "  Click here to return to main page."); //Header("Location: $main_script"); mysql_close($link); } echo "
"; echo get_footer(); ?>