From 31acf416d699037bbe637807b363c25cc559622c Mon Sep 17 00:00:00 2001 From: Martin Monperrus Date: Thu, 10 Oct 2019 11:51:34 +0200 Subject: [PATCH] doc: improve doc about ordering --- bibtexbrowser-documentation.wiki | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/bibtexbrowser-documentation.wiki b/bibtexbrowser-documentation.wiki index 4703dbc..031e0a2 100755 --- a/bibtexbrowser-documentation.wiki +++ b/bibtexbrowser-documentation.wiki @@ -357,27 +357,18 @@ Add in ''bibtexbrowser.local.php'': ====How to configure the order of Bibtex entries?==== -You can set the default order function in ''bibtexbrowser.local.php'': -
-<?php
-// can be @define('ORDER_FUNCTION','compare_bib_entry_by_title');
-define('ORDER_FUNCTION','compare_bib_entry_by_bibtex_order');
-?>
-
-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'':
 <?php
-$_GET['library']=1;
-require_once('bibtexbrowser.php');
-$db = new BibDataBase();
-$db->load('biblio.bib');
-$query = array('year'=>'2014');
-$entries=$db->multisearch($query);
-uasort($entries, 'compare_bib_entries');
-foreach ($entries as $bibentry) {
-  echo $bibentry->getYear().'
'; + +function my_own_order($a, $b) { + return strcmp($a->getKey(),$b->getkey()); } + +define('ORDER_FUNCTION','my_own_order'); ?>