references.php 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <?php
  2. //
  3. // +------------------------------------------------------------------------+
  4. // | phpBIB
  5. // | $Id: references.php,v 2.0 2005/07/22 08:58:54 dfolio Exp $
  6. // | Creation Date : Tue Apr 28 2005
  7. // | LastUpdate $Date: 2005/07/22 08:58:54 $
  8. // +------------------------------------------------------------------------+
  9. // | Copyright (c) 2003-2005 David FOLIO, Antre Team
  10. // | Email dfolio@free.fr
  11. // | Web http://dfolio.free.fr
  12. // +------------------------------------------------------------------------+
  13. // | This source file is subject to BSD License, that is available
  14. // | at http://opensource.org/licenses/bsd-license.php
  15. // | or http://dfolio.free.fr/license.txt
  16. // +------------------------------------------------------------------------+
  17. //
  18. /** phpBIB references pages
  19. *
  20. * This script provide the main phpBIB output design.
  21. * Use {@link ) $BIB_BIBFILES} global variable to define the bibfile list to
  22. * include.
  23. *
  24. * You can include this page into your desired target page between the
  25. * <var><body></var> tag.
  26. * You may customize this file, or design your own inspired by this one.
  27. *
  28. * Becarefull, this 'example' is mainly designed to be used with phpAntre, so
  29. * take a caution on how some link are build.
  30. *
  31. * @version $Revision: 2.0 $
  32. * @author David FOLIO <dfolio@free.fr>
  33. * @copyright Copyright &copy; 2003-2005, Antre Team
  34. * @license http://dfolio.free.fr/license.txt
  35. *
  36. * @package phpBIB
  37. * @todo a search engine
  38. */
  39. /** Need the {@link BibtexParser "bibtex parser"} */
  40. require_once(dirname(__FILE__)."/bibtexParser.php");
  41. /** Need the {@link Bibliography} */
  42. require_once(dirname(__FILE__).'/bibliography.php');
  43. if (!isset($BIB_BIBFILES))
  44. $BIB_BIBFILES=(isset($GLOBALS["BIB_BIBFILES"]))?$GLOBALS["BIB_BIBFILES"] :array(dirname(__FILE__)."/references.bib",);
  45. /** back*/
  46. if (!empty($_SERVER["HTTP_REFERER"]))
  47. $back_index='<a href="'.Bibliography::href($_SERVER["HTTP_REFERER"]).'" title="Back">&lt; '.__("Back")."</a>";
  48. else
  49. $back_index='<a href="'.Bibliography::href('',array("index"=>'')).'" title="Back to references index">&lt; '.__("References index")."</a>";
  50. /** get showBib query string or set to default */
  51. $showBib=isset($_REQUEST["showBib"])? true: (isset($GLOBALS["showBib"]) ? $GLOBALS["showBib"]:false);
  52. /** get showSubItem query string or set to default */
  53. $showSubItem=isset($_REQUEST["showSubItem"])? true: (isset($GLOBALS["showBib"]) ? $GLOBALS["showSubItem"]:true);
  54. /** get sort query string or set to default */
  55. $sort=isset($_REQUEST["sort"])? $_REQUEST["sort"]: "author";
  56. //$useCache=BIB_USE_CACHE&&(!isset($_REQUEST["nocache"]));
  57. $useCache=false;
  58. /** Build the biblio */
  59. $myBIB=new Bibliography($BIB_BIBFILES,$useCache);
  60. if (isset($_REQUEST["biblio"])||isset($_REQUEST["sort"])){
  61. //display all bibliography entries
  62. echo ' <h2>'.__("Bibiography").": ".__("sort by")." $sort".'</h2> '."\n";
  63. echo '<p style="text-align:center;font-size:75%;">'.$myBIB->sortList("::")."</p>";
  64. echo $back_index."<br/>\n";
  65. echo $myBIB->dump($sort, $showBib, true);
  66. }elseif(isset($_REQUEST["bibkey"])){
  67. //display only the bibkey entry
  68. echo ' <h2>'.$_REQUEST["bibkey"].'</h2> '."\n";
  69. echo $back_index."<br/>\n";
  70. echo ' <p id="bibview">'.$myBIB->item2str($_REQUEST["bibkey"])
  71. .$myBIB->getAbstract($_REQUEST["bibkey"])
  72. .$myBIB->getKeywords($_REQUEST["bibkey"])."";
  73. // if ($showBib)
  74. echo $myBIB->item2bib($_REQUEST["bibkey"]);
  75. echo "</p>\n";
  76. }elseif(isset($_REQUEST["category"])){
  77. //display only the keyword entry
  78. echo ' <h2>'.__($_REQUEST["category"]).' </h2> '."\n";
  79. echo $back_index."<br/>\n";
  80. echo $myBIB->categoryView($_REQUEST["category"], $showBib, true);
  81. }elseif(isset($_REQUEST["year"])){
  82. //display only the keyword entry
  83. echo ' <h2>'.__("Publication of year").' &quot;'.$_REQUEST["year"].'&quot; </h2> '."\n";
  84. echo $back_index."<br/>\n";
  85. echo $myBIB->yearView($_REQUEST["year"], $showBib, true);
  86. }elseif(isset($_REQUEST["keyword"])){
  87. //display only the keyword entry
  88. echo ' <h2>'.__("Publication about").' &quot;'.$_REQUEST["keyword"].'&quot; </h2> '."\n";
  89. echo $back_index."<br/>\n";
  90. echo $myBIB->keywordView($_REQUEST["keyword"], $showBib, true);
  91. }elseif(isset($_REQUEST["author"])){
  92. //display authors
  93. if (empty($_REQUEST["author"])){
  94. echo ' <h2 id="author">'.__('Selection by author')." </h2>\n";
  95. echo $back_index."<br/>\n";
  96. echo 'Authors list: '.$myBIB->authorsList();
  97. }/*elseif (strlen($_REQUEST["author"])<2){
  98. echo ' <h2 id="author">'.__('Selection by author initial').' &quot;'.$_REQUEST["author"]."&quot; </h2>\n";
  99. echo $back_index."<br/>\n";
  100. echo 'Authors list: '.$myBIB->authorsList($_REQUEST["author"]);
  101. }*/else{
  102. echo ' <h2>'.__("Publication of").' &quot;'.$_REQUEST["author"].'&quot; </h2> '."\n";
  103. echo $back_index."<br/>\n";
  104. echo $myBIB->authorView($_REQUEST["author"], $showBib, true);
  105. }
  106. }else{
  107. // default show index view
  108. //if(isset($_REQUEST["index"])){
  109. //reference index page
  110. echo ' <h1 id="index">'.__("Index").'</h1> '."\n";
  111. // echo '<div style="text-align:center;"><a href="'.Bibliography::href("biblio").'" title="View complete bibliography"> '.__("Complete Bibliography")."</a></div><br/>\n";
  112. ?>
  113. <ul id="index_menu">
  114. <li><a href="<?=Bibliography::href('',array("biblio"=>''))?>" title="View complete bibliography"><?=__("Complete Bibliography")?></a></li>
  115. <li><a href="<?=Bibliography::href('',array("index"=>''))?>#category" title="Selection by category"><?=__("Selection by category")?></a></li>
  116. <li><a href="<?=Bibliography::href('',array("index"=>''))?>#year" title="Selection by year"><?=__("Selection by year")?></a></li>
  117. <li><a href="<?=Bibliography::href('',array("index"=>''))?>#author" title="Selection by author"><?=__("Selection by author")?></a></li>
  118. </ul><br/>
  119. <?php
  120. echo ' <h2 id="category">'.__('Selection by category')."</h2>\n";
  121. echo $myBIB->categoriesList();
  122. echo ' <h2 id="year">'.__('Selection by year')."</h2>\n";
  123. echo $myBIB->yearsList();
  124. echo ' <h2 id="keyword">'.__('Selection by keyword')."</h2>\n";
  125. echo $myBIB->keywordsList();
  126. echo ' <h2 id="author">'.__('Selection by author')."</h2>\n";
  127. echo 'Alphabetical list: '.$myBIB->authorsList(true);
  128. echo '<a href="'.Bibliography::href('',array("author"=>'')).'" title="View complete authors list"> '.__("Complete authors list")."</a><br/>\n";
  129. /*echo "<!-- form test !--> \n";
  130. if (isset($_REQUEST["author"])) echo "<!-- Request ".$_REQUEST["author"]." --> \n";
  131. if (isset($_REQUEST["qauthor"])) echo "<!-- REQUEST, q ".$_REQUEST["qauthor"]." --> \n";
  132. if (isset($_POST["qauthor"])) echo "<!-- POST:".$_POST["qauthor"]." --> \n";
  133. */
  134. ?>
  135. <!--
  136. <p>
  137. <form action="<?=Bibliography::href() ?>" method="post">
  138. <label for="bibf_search_author"><?= __('Query author') ?>: </label>
  139. <input name="qauthor" id="bibf_search_author" type="text" maxlength="256" value="<?= isset($_REQUEST["author"])?$_REQUEST["author"]:"" ?>" />
  140. <input type="submit" value="<?= __('ok'); ?>" />
  141. </form>
  142. </p>
  143. <p class="comment">
  144. <ul>
  145. <li>Use can use partial author query.<br/>
  146. Exemple: query &quot;thor&quot;, for &quot;Author&quot;.
  147. </li>
  148. <li>Use &quot;OR&quot; (use capital) to search several authors publication.<br/>
  149. Exemple: Author1 OR Author2
  150. </li>
  151. </ul>
  152. </p>
  153. -->
  154. <?php
  155. }//end :default show index view
  156. // now don't need biblio any more
  157. //unset($myBIB);
  158. $myBIB->destroy(!$useCache);
  159. /*disclaimer*/
  160. //echo '<h2 id="disclaimer">'. __("Disclaimer").'</h2>';
  161. //echo __("disclaimer_contents");
  162. ?>
  163. <br/><hr/>
  164. <p style="font-size:85%;padding:4px;text-align:center">
  165. <a href="http://dfolio.free.fr/phpBIB" title="phpBIB"><img src="<?= BIB_ICONS_PATH?>/phpBIB.png" alt="phpBIB powered"/></a><br/>
  166. This document are automaticaly generated from a BibTeX file and powered by <a href="http://dfolio.free.fr/phpBIB" title="phpBIB">phpBIB</a>.
  167. </p>