Plugin Directory

Changeset 475475


Ignore:
Timestamp:
12/14/2011 03:43:03 PM (14 years ago)
Author:
knowledgeblog
Message:

1.4.1 release

Location:
kcite/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kcite/trunk/kcite.php

    r473946 r475475  
    44   Plugin URI: http://knowledgeblog.org/kcite-plugin
    55   Description: Add references and bibliography to blogposts
    6    Version: 1.4
     6   Version: 1.4.1
    77   Author: Simon Cockell, Phillip Lord
    88   Author URI: http://knowledgeblog.org
     
    4242  static $clear_transients = false;
    4343 
     44  // have we met any shortcodes, else block
     45  static $add_script = false;
    4446 
    4547  /**
     
    7173    add_filter('plugin_action_links', array(__CLASS__, 'refman_settings_link'), 9, 2 );
    7274
    73     // need to optionalize this...
    74     wp_enqueue_script( "xmle4x", plugins_url( "kcite-citeproc/xmle4x.js", __FILE__ ), false, null, true );
    75     wp_enqueue_script( "xmldom", plugins_url( "kcite-citeproc/xmldom.js",__FILE__  ), false, null, true );
    76     wp_enqueue_script( "citeproc", plugins_url( "kcite-citeproc/citeproc.js",__FILE__  ), false, null, true );
    77     wp_enqueue_script( "jquery" );
    78     wp_enqueue_script( "kcite_locale_style",
    79                        plugins_url( "kcite-citeproc/kcite_locale_style.js", __FILE__  ), false, null, true );
    80     wp_enqueue_script( "kcite", plugins_url( "kcite-citeproc/kcite.js",__FILE__  ), false, null, true );
    81 
    82 
     75   
     76    add_action( 'wp_footer',
     77                array( __CLASS__, 'add_script' ) );
    8378
    8479  }
     
    106101  }
    107102
     103 
     104  function add_script(){
     105      echo "<!-- Kcite Plugin Installed";
     106
     107      if( !self::$add_script ){
     108          echo ": Disabled as there are no shortcodes-->\n";
     109          return;
     110      }
     111      echo "-->\n";
     112     
     113
     114      // load enqueue the scripts
     115      wp_enqueue_script( "xmle4x", plugins_url( "kcite-citeproc/xmle4x.js", __FILE__ ), false, null, true );
     116      wp_enqueue_script( "xmldom", plugins_url( "kcite-citeproc/xmldom.js",__FILE__  ), false, null, true );
     117      wp_enqueue_script( "citeproc", plugins_url( "kcite-citeproc/citeproc.js",__FILE__  ), false, null, true );
     118      wp_enqueue_script( "jquery" );
     119      wp_enqueue_script( "kcite_locale_style",
     120                         plugins_url( "kcite-citeproc/kcite_locale_style.js", __FILE__  ), false, null, true );
     121      wp_enqueue_script( "kcite", plugins_url( "kcite-citeproc/kcite.js",__FILE__  ), false, null, true );
     122   
     123      // and print them or they won't be printed because the footers already done
     124      wp_print_scripts( "xmle4x" );
     125      wp_print_scripts( "xmldom" );
     126      wp_print_scripts( "citeproc" );
     127      wp_print_scripts( "jquery" );
     128      wp_print_scripts( "kcite_locale_style" );
     129      wp_print_scripts( "kcite" );
     130  }
     131
    108132  /**
    109133   * citation short code
     
    112136  function cite_shortcode($atts,$content)
    113137  {
     138      // we have a short code, so remember this for later
     139      self::$add_script = true;
     140
    114141      // extract attributes as local vars
    115142      extract( shortcode_atts
     
    371398                  }
    372399                 
    373 
    374400                  $cite = self::array_from_xml($cite);
    375401                  $cite = self::get_pubmed_metadata($cite);
     
    753779                 
    754780                  if ($details->getName() == 'contributors') {
    755                       $people = $details->children();
     781                      // pick out just the authors (not editors or what not)
     782                      $people = $details->xpath( '//person_name[@contributor_role="author"]' );
    756783                      foreach ($people as $person) {
     784                         
    757785                          $author = array();
    758786                          $author['given_name'] = (string)$person->given_name;
  • kcite/trunk/readme.txt

    r473946 r475475  
    44Tags: references, citations, doi, crossref, pubmed, bibliography, pmid, res-comms, scholar, academic, science
    55Requires at least: 3.0
    6 Tested up to: 3.2.1
    7 Stable tag: 1.4
     6Tested up to: 3.3
     7Stable tag: 1.4.1
    88
    99A tool for producing citations and bibliographies in Wordpress posts. Developed for the Knowledgeblog project (http://knowledgeblog.org).
     
    4545== Changelog ==
    4646
     47= 1.4.1 =
     48
     491. Loads Javascript only when there is a bibliography.
     501. Fixed bug in Crossref parser which treated editors as authors
     51
    4752= 1.4 =
    4853
Note: See TracChangeset for help on using the changeset viewer.