Skip to content

Commit

Permalink
Version 0.3.6
Browse files Browse the repository at this point in the history
git-svn-id: https://plugins.svn.wordpress.org/papercite/trunk@370102 b8457f37-d9ea-0310-8a92-e5e31aec5664
  • Loading branch information
bpiwowar committed Apr 7, 2011
1 parent 4f81346 commit cbc86b5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
12 changes: 6 additions & 6 deletions bib2tpl/bibtex_converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -449,7 +449,7 @@ function _callback($match) {
$condition = false;
}

$this->_ifs[] = $condition;
$this->_ifs[] = $condition ? 1 : 0;
if ($condition)
return $match[2];
return "";
Expand All @@ -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") {
Expand Down
2 changes: 1 addition & 1 deletion papercite.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cbc86b5

Please sign in to comment.