From cbc86b57304d050e1dccc2f144148e53cbaba4bd Mon Sep 17 00:00:00 2001 From: bpiwowar Date: Thu, 7 Apr 2011 11:50:10 +0000 Subject: [PATCH] Version 0.3.6 git-svn-id: https://plugins.svn.wordpress.org/papercite/trunk@370102 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- bib2tpl/bibtex_converter.php | 12 ++++++------ papercite.php | 2 +- readme.txt | 3 +++ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/bib2tpl/bibtex_converter.php b/bib2tpl/bibtex_converter.php index d26d4cc..d589590 100644 --- a/bib2tpl/bibtex_converter.php +++ b/bib2tpl/bibtex_converter.php @@ -410,14 +410,14 @@ function _callback($match) { // Remove last IF expression value array_pop($this->_ifs); $condition = $this->_ifs[sizeof($this->_ifs)-1]; - if ($condition) + if ($condition == 1) return $match[2]; return ""; } // --- [IF] if ($match[1][0] == '?') { - if (!$condition) { + if ($condition != 1) { // Don't evaluate if not needed // -1 implies to evaluate to false the alternative (ELSE) $this->_ifs[] = -1; @@ -449,7 +449,7 @@ function _callback($match) { $condition = false; } - $this->_ifs[] = $condition; + $this->_ifs[] = $condition ? 1 : 0; if ($condition) return $match[2]; return ""; @@ -458,15 +458,15 @@ function _callback($match) { // --- [ELSE] if ($match[1][0] == ':') { // Invert the expression (if within an evaluated condition) - $condition = $condition < 0 ? -1 : !$condition; + $condition = $condition < 0 ? -1 : 1 - $condition; $this->_ifs[sizeof($this->_ifs)-1] = $condition; - if ($condition) + if ($condition == 1) return $match[2]; return ""; } // Get the current condition status - if (!$condition) return ""; + if ($condition != 1) return ""; // --- Group loop if ($match[1] == "#group") { diff --git a/papercite.php b/papercite.php index beca958..cd3a1f7 100755 --- a/papercite.php +++ b/papercite.php @@ -4,7 +4,7 @@ Plugin Name: papercite Plugin URI: http://www.bpiwowar.net/papercite Description: papercite enables to add BibTeX entries formatted as HTML in wordpress pages and posts. The input data is the bibtex text file and the output is HTML. - Version: 0.3.5 + Version: 0.3.6 Author: Benjamin Piwowarski Author URI: http://www.bpiwowar.net */ diff --git a/readme.txt b/readme.txt index 82e3056..0b9a296 100755 --- a/readme.txt +++ b/readme.txt @@ -81,6 +81,9 @@ subfolders tpl (citation list rendering) and format (entry rendering). == Changelog == += 0.3.6 = + * Bug fix when there are only two authors in the entry + * Bug fix on nested conditions in templates = 0.3.5 = * Author are formatted according to the entry template converted from OSBib