Changeset 475475
- Timestamp:
- 12/14/2011 03:43:03 PM (14 years ago)
- Location:
- kcite/trunk
- Files:
-
- 2 edited
-
kcite.php (modified) (7 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kcite/trunk/kcite.php
r473946 r475475 4 4 Plugin URI: http://knowledgeblog.org/kcite-plugin 5 5 Description: Add references and bibliography to blogposts 6 Version: 1.4 6 Version: 1.4.1 7 7 Author: Simon Cockell, Phillip Lord 8 8 Author URI: http://knowledgeblog.org … … 42 42 static $clear_transients = false; 43 43 44 // have we met any shortcodes, else block 45 static $add_script = false; 44 46 45 47 /** … … 71 73 add_filter('plugin_action_links', array(__CLASS__, 'refman_settings_link'), 9, 2 ); 72 74 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' ) ); 83 78 84 79 } … … 106 101 } 107 102 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 108 132 /** 109 133 * citation short code … … 112 136 function cite_shortcode($atts,$content) 113 137 { 138 // we have a short code, so remember this for later 139 self::$add_script = true; 140 114 141 // extract attributes as local vars 115 142 extract( shortcode_atts … … 371 398 } 372 399 373 374 400 $cite = self::array_from_xml($cite); 375 401 $cite = self::get_pubmed_metadata($cite); … … 753 779 754 780 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"]' ); 756 783 foreach ($people as $person) { 784 757 785 $author = array(); 758 786 $author['given_name'] = (string)$person->given_name; -
kcite/trunk/readme.txt
r473946 r475475 4 4 Tags: references, citations, doi, crossref, pubmed, bibliography, pmid, res-comms, scholar, academic, science 5 5 Requires at least: 3.0 6 Tested up to: 3. 2.17 Stable tag: 1.4 6 Tested up to: 3.3 7 Stable tag: 1.4.1 8 8 9 9 A tool for producing citations and bibliographies in Wordpress posts. Developed for the Knowledgeblog project (http://knowledgeblog.org). … … 45 45 == Changelog == 46 46 47 = 1.4.1 = 48 49 1. Loads Javascript only when there is a bibliography. 50 1. Fixed bug in Crossref parser which treated editors as authors 51 47 52 = 1.4 = 48 53
Note: See TracChangeset
for help on using the changeset viewer.