doc: improve doc about ordering
This commit is contained in:
@@ -357,27 +357,18 @@ Add in ''bibtexbrowser.local.php'':
|
|||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
====How to configure the order of Bibtex entries?====
|
====How to configure the order of Bibtex entries?====
|
||||||
You can set the default order function in ''bibtexbrowser.local.php'':
|
|
||||||
<pre>
|
|
||||||
<?php
|
|
||||||
// can be @define('ORDER_FUNCTION','compare_bib_entry_by_title');
|
|
||||||
define('ORDER_FUNCTION','compare_bib_entry_by_bibtex_order');
|
|
||||||
?>
|
|
||||||
</pre>
|
|
||||||
|
|
||||||
Or programmatically:
|
The default order is first by year, then by month (according to bibtexfield ''month''), see ''define('ORDER_FUNCTION',...)'' and ''define('ORDER_FUNCTION_FINE',...)''.
|
||||||
|
|
||||||
|
You can also set another order function in ''bibtexbrowser.local.php'':
|
||||||
<pre>
|
<pre>
|
||||||
<?php
|
<?php
|
||||||
$_GET['library']=1;
|
|
||||||
require_once('bibtexbrowser.php');
|
function my_own_order($a, $b) {
|
||||||
$db = new BibDataBase();
|
return strcmp($a->getKey(),$b->getkey());
|
||||||
$db->load('biblio.bib');
|
|
||||||
$query = array('year'=>'2014');
|
|
||||||
$entries=$db->multisearch($query);
|
|
||||||
uasort($entries, 'compare_bib_entries');
|
|
||||||
foreach ($entries as $bibentry) {
|
|
||||||
echo $bibentry->getYear().'<br/>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
define('ORDER_FUNCTION','my_own_order');
|
||||||
?>
|
?>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user