diff --git a/wp-content/plugins/wp-footnotes/LICENSE b/wp-content/plugins/wp-footnotes/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..99fb2388698b507deea0c5b7e140570e943dc91e --- /dev/null +++ b/wp-content/plugins/wp-footnotes/LICENSE @@ -0,0 +1,280 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/wp-content/plugins/wp-footnotes/footnotes.php b/wp-content/plugins/wp-footnotes/footnotes.php new file mode 100644 index 0000000000000000000000000000000000000000..f2449a37a8515f797b51db5c838e22f7a8a76fec --- /dev/null +++ b/wp-content/plugins/wp-footnotes/footnotes.php @@ -0,0 +1,352 @@ +<?php +/* +Plugin Name: WP-Footnotes +Plugin URI: http://www.elvery.net/drzax/more-things/wordpress-footnotes-plugin/ +Version: 4.2.2 +Description: Allows a user to easily add footnotes to a post. +Author: Simon Elvery +Author URI: http://www.elvery.net/drzax/ +*/ + +/* + * This file is part of WP-Footnotes a plugin for WordPress + * Copyright (C) 2007-2012 Simon Elvery + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +// Some important constants +define('WP_FOOTNOTES_OPEN', " (("); //You can change this if you really have to, but I wouldn't recommend it. +define('WP_FOOTNOTES_CLOSE', "))"); //Same with this one. +define('WP_FOOTNOTES_VERSION', '4.2'); + +// Instantiate the class +$swas_wp_footnotes = new swas_wp_footnotes(); + +// Encapsulate in a class +class swas_wp_footnotes { + var $current_options; + var $default_options; + + /** + * Constructor. + */ + function swas_wp_footnotes() { + + // Define the implemented option styles + $this->styles = array( + 'decimal' => '1,2...10', + 'decimal-leading-zero' => '01, 02...10', + 'lower-alpha' => 'a,b...j', + 'upper-alpha' => 'A,B...J', + 'lower-roman' => 'i,ii...x', + 'upper-roman' => 'I,II...X', + 'symbol' => 'Symbol' + ); + + // Define default options + $this->default_options = array('superscript'=>true, + 'pre_backlink'=>' [', + 'backlink'=>'↩', + 'post_backlink'=>']', + 'pre_identifier'=>'', + 'list_style_type'=>'decimal', + 'list_style_symbol'=>'†', + 'post_identifier'=>'', + 'pre_footnotes'=>'', + 'post_footnotes'=>'', + 'style_rules'=>'ol.footnotes{font-size:0.8em; color:#666666;}', + 'no_display_home'=>false, + 'no_display_archive'=>false, + 'no_display_date'=>false, + 'no_display_category'=>false, + 'no_display_search'=>false, + 'no_display_feed'=>false, + 'combine_identical_notes'=>false, + 'priority'=>11, + 'version'=>WP_FOOTNOTES_VERSION); + + // Get the current settings or setup some defaults if needed + if (!$this->current_options = get_option('swas_footnote_options')){ + $this->current_options = $this->default_options; + update_option('swas_footnote_options', $this->current_options); + } else { + + // Set any unset options + if ($this->current_options['version'] != WP_FOOTNOTES_VERSION) { + foreach ($this->default_options as $key => $value) { + if (!isset($this->current_options[$key])) { + $this->current_options[$key] = $value; + } + } + $this->current_options['version'] = WP_FOOTNOTES_VERSION; + update_option('swas_footnote_options', $this->current_options); + } + } + + if (!empty($_POST['save_options'])){ + $footnotes_options['superscript'] = (array_key_exists('superscript', $_POST)) ? true : false; + + $footnotes_options['pre_backlink'] = $_POST['pre_backlink']; + $footnotes_options['backlink'] = $_POST['backlink']; + $footnotes_options['post_backlink'] = $_POST['post_backlink']; + + $footnotes_options['pre_identifier'] = $_POST['pre_identifier']; + $footnotes_options['list_style_type'] = $_POST['list_style_type']; + $footnotes_options['post_identifier'] = $_POST['post_identifier']; + $footnotes_options['list_style_symbol'] = $_POST['list_style_symbol']; + + $footnotes_options['pre_footnotes'] = stripslashes($_POST['pre_footnotes']); + $footnotes_options['post_footnotes'] = stripslashes($_POST['post_footnotes']); + $footnotes_options['style_rules'] = stripslashes($_POST['style_rules']); + + $footnotes_options['no_display_home'] = (array_key_exists('no_display_home', $_POST)) ? true : false; + $footnotes_options['no_display_archive'] = (array_key_exists('no_display_archive', $_POST)) ? true : false; + $footnotes_options['no_display_date'] = (array_key_exists('no_display_date', $_POST)) ? true : false; + $footnotes_options['no_display_category'] = (array_key_exists('no_display_category', $_POST)) ? true : false; + $footnotes_options['no_display_search'] = (array_key_exists('no_display_search', $_POST)) ? true : false; + $footnotes_options['no_display_feed'] = (array_key_exists('no_display_feed', $_POST)) ? true : false; + + $footnotes_options['combine_identical_notes'] = (array_key_exists('combine_identical_notes', $_POST)) ? true : false; + $footnotes_options['priority'] = $_POST['priority']; + + update_option('swas_footnote_options', $footnotes_options); + }elseif(!empty($_POST['reset_options'])){ + update_option('swas_footnote_options', ''); + update_option('swas_footnote_options', $this->default_options); + } + + // Hook me up + add_action('the_content', array($this, 'process'), $this->current_options['priority']); + add_action('admin_menu', array($this, 'add_options_page')); // Insert the Admin panel. + add_action('wp_head', array($this, 'insert_styles')); + } + + + /** + * Searches the text and extracts footnotes. + * Adds the identifier links and creats footnotes list. + * @param $data string The content of the post. + * @return string The new content with footnotes generated. + */ + function process($data) { + global $post; + + // Check for and setup the starting number + $start_number = (preg_match("|<!\-\-startnum=(\d+)\-\->|",$data,$start_number_array)==1) ? $start_number_array[1] : 1; + + // Regex extraction of all footnotes (or return if there are none) + if (!preg_match_all("/(".preg_quote(WP_FOOTNOTES_OPEN)."|<footnote>)(.*)(".preg_quote(WP_FOOTNOTES_CLOSE)."|<\/footnote>)/Us", $data, $identifiers, PREG_SET_ORDER)) { + return $data; + } + + // Check whether we are displaying them or not + $display = true; + if ($this->current_options['no_display_home'] && is_home()) $display = false; + if ($this->current_options['no_display_archive'] && is_archive()) $display = false; + if ($this->current_options['no_display_date'] && is_date()) $display = false; + if ($this->current_options['no_display_category'] && is_category()) $display = false; + if ($this->current_options['no_display_search'] && is_search()) $display = false; + if ($this->current_options['no_display_feed'] && is_feed()) $display = false; + + $footnotes = array(); + + // Check if this post is using a different list style to the settings + if ( array_key_exists(get_post_meta($post->ID, 'footnote_style', true), $this->styles) ) { + $style = get_post_meta($post->ID, 'footnote_style', true); + } else { + $style = $this->current_options['list_style_type']; + } + + // Create 'em + for ($i=0; $i<count($identifiers); $i++){ + // Look for ref: and replace in identifiers array. + if (substr($identifiers[$i][2],0,4) == 'ref:'){ + $ref = (int)substr($identifiers[$i][2],4); + $identifiers[$i]['text'] = $identifiers[$ref-1][2]; + }else{ + $identifiers[$i]['text'] = $identifiers[$i][2]; + } + + // if we're combining identical notes check if we've already got one like this & record keys + if ($this->current_options['combine_identical_notes']){ + for ($j=0; $j<count($footnotes); $j++){ + if ($footnotes[$j]['text'] == $identifiers[$i]['text']){ + $identifiers[$i]['use_footnote'] = $j; + $footnotes[$j]['identifiers'][] = $i; + break; + } + } + } + + + + if (!isset($identifiers[$i]['use_footnote'])){ + // Add footnote and record the key + $identifiers[$i]['use_footnote'] = count($footnotes); + $footnotes[$identifiers[$i]['use_footnote']]['text'] = $identifiers[$i]['text']; + $footnotes[$identifiers[$i]['use_footnote']]['symbol'] = $identifiers[$i]['symbol']; + $footnotes[$identifiers[$i]['use_footnote']]['identifiers'][] = $i; + } + } + + // Footnotes and identifiers are stored in the array + + $use_full_link = false; + if (is_feed()) $use_full_link = true; + + if (is_preview()) $use_full_link = false; + + // Display identifiers + foreach ($identifiers as $key => $value) { + $id_id = "identifier_".$key."_".$post->ID; + $id_num = ($style == 'decimal') ? $value['use_footnote']+$start_number : $this->convert_num($value['use_footnote']+$start_number, $style, count($footnotes)); + $id_href = ( ($use_full_link) ? get_permalink($post->ID) : '' ) . "#footnote_".$value['use_footnote']."_".$post->ID; + $id_title = str_replace('"', """, htmlentities(html_entity_decode(strip_tags($value['text']), ENT_QUOTES, 'UTF-8'), ENT_QUOTES, 'UTF-8')); + $id_replace = $this->current_options['pre_identifier'].'<a href="'.$id_href.'" id="'.$id_id.'" class="footnote-link footnote-identifier-link" title="'.$id_title.'">'.$id_num.'</a>'.$this->current_options['post_identifier']; + if ($this->current_options['superscript']) $id_replace = '<sup>'.$id_replace.'</sup>'; + if ($display) $data = substr_replace($data, $id_replace, strpos($data,$value[0]),strlen($value[0])); + else $data = substr_replace($data, '', strpos($data,$value[0]),strlen($value[0])); + } + + // Display footnotes + if ($display) { + $start = ($start_number != 1) ? 'start="'.$start_number.'" ' : ''; + $data = $data.$this->current_options['pre_footnotes']; + + $data = $data . '<ol '.$start.'class="footnotes">'; + foreach ($footnotes as $key => $value) { + $data = $data.'<li id="footnote_'.$key.'_'.$post->ID.'" class="footnote"'; + if ($style == 'symbol') { + $data = $data . ' style="list-style-type:none;"'; + } elseif($style != $this->current_options['list_style_type']) { + $data = $data . ' style="list-style-type:' . $style . ';"'; + } + $data = $data . '>'; + if ($style == 'symbol') { + $data = $data . '<span class="symbol">' . $this->convert_num($key+$start_number, $style, count($footnotes)) . '</span> '; + } + $data = $data.$value['text']; + if (!is_feed()){ + foreach($value['identifiers'] as $identifier){ + $data = $data.$this->current_options['pre_backlink'].'<a href="'.( ($use_full_link) ? get_permalink($post->ID) : '' ).'#identifier_'.$identifier.'_'.$post->ID.'" class="footnote-link footnote-back-link">'.$this->current_options['backlink'].'</a>'.$this->current_options['post_backlink']; + } + } + $data = $data . '</li>'; + } + $data = $data . '</ol>' . $this->current_options['post_footnotes']; + } + + return $data; + } + + /** + * Really insert the options page. + */ + function footnotes_options_page() { + $this->current_options = get_option('swas_footnote_options'); + foreach ($this->current_options as $key=>$setting) { + $new_setting[$key] = htmlentities($setting); + } + $this->current_options = $new_setting; + unset($new_setting); + include (dirname(__FILE__) . '/options.php'); + } + + /** + * Insert the options page into the admin area. + */ + function add_options_page() { + // Add a new menu under Options: + add_options_page('Footnotes', 'Footnotes', 8, __FILE__, array($this, 'footnotes_options_page')); + } + + + function upgrade_post($data){ + $data = str_replace('<footnote>',WP_FOOTNOTES_OPEN,$data); + $data = str_replace('</footnote>',WP_FOOTNOTES_CLOSE,$data); + return $data; + } + + function insert_styles(){ + ?> + <style type="text/css"> + <?php if ($this->current_options['list_style_type'] != 'symbol'): ?> + ol.footnotes li {list-style-type:<?php echo $this->current_options['list_style_type']; ?>;} + <?php endif; ?> + <?php echo $this->current_options['style_rules'];?> + </style> + <?php + } + + function convert_num ($num, $style, $total){ + switch ($style) { + case 'decimal-leading-zero' : + $width = max(2, strlen($total)); + return sprintf("%0{$width}d", $num); + case 'lower-roman' : + return $this->roman($num, 'lower'); + case 'upper-roman' : + return $this->roman($num); + case 'lower-alpha' : + return $this->alpha($num, 'lower'); + case 'upper-alpha' : + return $this->alpha($num); + case 'symbol' : + $sym = ''; + for ($i = 0; $i<$num; $i++) { + $sym .= $this->current_options['list_style_symbol']; + } + return $sym; + } + } + + /** + * Convert to a roman numeral. + * + * Thanks to Indi.in.the.Wired for the improved algorithm. + * http://plugins.trac.wordpress.org/ticket/1177 + * + * @param int $num The number to convert. + * @param string $case Upper or lower case. + * @return string The roman numeral + */ + function roman($num, $case= 'upper'){ + $num = (int) $num; + $conversion = array('M'=>1000, 'CM'=>900, 'D'=>500, 'CD'=>400, 'C'=>100, 'XC'=>90, 'L'=>50, 'XL'=>40, 'X'=>10, 'IX'=>9, 'V'=>5, 'IV'=>4, 'I'=>1); + $roman = ''; + + foreach ($conversion as $r => $d){ + $roman .= str_repeat($r, (int)($num / $d)); + $num %= $d; + } + + return ($case == 'lower') ? strtolower($roman) : $roman; + } + + function alpha($num, $case='upper'){ + $j = 1; + for ($i = 'A'; $i <= 'ZZ'; $i++){ + if ($j == $num){ + if ($case == 'lower') + return strtolower($i); + else + return $i; + } + $j++; + } + + } +} \ No newline at end of file diff --git a/wp-content/plugins/wp-footnotes/options.php b/wp-content/plugins/wp-footnotes/options.php new file mode 100644 index 0000000000000000000000000000000000000000..273c29c533c76c6824bc4b1741a08108d474d986 --- /dev/null +++ b/wp-content/plugins/wp-footnotes/options.php @@ -0,0 +1,163 @@ +<?php +/* + * This file is part of WP-Footnotes a plugin for WordPress + * Copyright (C) 2007-2012 Simon Elvery + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +?> +<script type="text/javascript" language="javascript"> + /* <![CDATA[ */ + + jQuery(document).ready(function() { + jQuery('#list_style_type').change(function() { + if (jQuery(this).val() == 'symbol') { + jQuery('#list_style_symbol_container').slideDown(); + } else { + jQuery('#list_style_symbol_container').slideUp(); + } + }); + }); + + /* ]]> */ +</script> + +<?php if (!empty($_POST['save_options'])): ?> +<div class="updated"><p><strong>Options saved.</strong></p></div> +<?php elseif (!empty($_POST['reset_options'])): ?> +<div class="updated"><p><strong>Options reset.</strong></p></div> +<?php endif; ?> + +<div class="wrap"> + <div id="icon-options-general" class="icon32"><br></div> + <h2>WP-Footnotes Options</h2> + <form method="post"> + <h3 class="title">Identifier</h3> + <fieldset style="border:none; line-height:20px; margin-bottom:9px; padding:10px; background:#EAF3FA; -moz-border-radius:5px; -webkit-border-radius: 5px; border-radius: 5px;"> + <table> + <tr> + <th><label for="pre_identifier">Before</label></th> + <th><label for="list_style_type">Style</label></th> + <th><label for="post_identifier">After</label></th> + <th> </th> + </tr> + <tr> + <td><input type="text" id="pre_identifier" name="pre_identifier" size="3" value="<?php echo $this->current_options['pre_identifier']; ?>" /></td> + <td> + <select name="list_style_type" id="list_style_type"> + <?php foreach ($this->styles as $key => $val): ?> + <option value="<?php echo $key; ?>" <?php if ($this->current_options['list_style_type'] == $key) echo 'selected="selected"'; ?> ><?php echo $val; ?></option> + <?php endforeach; ?> + </select> + </td> + <td><input type="text" name="post_identifier" id="post_identifier" size="3" value="<?php echo $this->current_options['post_identifier']; ?>" /></td> + <td><input type="checkbox" name="superscript" id="superscript" <?php if($this->current_options['superscript'] == true) echo 'checked'; ?> /> <label for="superscript">Make note identifier superscript? </label></td> + </tr> + </table> + <div id="list_style_symbol_container" <?php if ($this->current_options['list_style_type'] != 'symbol'): ?>style="display:none;"<?php endif; ?>> + <p>It's not usually a good idea to choose this type unless you never have more than a couple of footnotes per post.</p> + <table> + <tr> + <th><label for="list_style_symbol">Symbol to use for footnotes:</label></th> + <td><input type="text" id="list_style_symbol" name="list_style_symbol" value="<?php echo $this->current_options['list_style_symbol']; ?>" /></td> + </tr> + </table> + </div> + </fieldset> + <h3 class="title">Back-link </h3> + <fieldset style="border:none; line-height:20px; margin-bottom:9px; padding:10px; background:#EAF3FA; -moz-border-radius:5px; -webkit-border-radius: 5px; border-radius: 5px;"> + <p>These options affect how the back-links after each footnote look. A good back-link character is &#8617; (↩). If you want to remove the back-links all together, you can effectively do so by making all these settings blank.</p> + <table> + <tr> + <th><label for="pre_backlink">Before</label></th> + <th><label for="backlink">Link</label></th> + <th><label for="post_backlink">After</label></th> + </tr> + <tr> + <td><input type="text" id="pre_backlink" name="pre_backlink" size="3" value="<?php echo $this->current_options['pre_backlink']; ?>" /></td> + <td><input type="text" id="backlink" name="backlink" size="10" value="<?php echo $this->current_options['backlink']; ?>" /></td> + <td><input type="text" id="post_backlink" name="post_backlink" size="3" value="<?php echo $this->current_options['post_backlink']; ?>" /></td> + </tr> + </table> + </fieldset> + <h3 class="title">More</h3> + <table class="form-table"> + <tr> + <th><label for="pre_footnotes">Anything to be displayed <strong>before</strong> the footnotes at the bottom of the post can go here:</label></th> + <td><textarea rows="3" cols="60" name="pre_footnotes"><?php echo $this->current_options['pre_footnotes']; ?></textarea></td> + </tr> + <tr> + <th><label for="post_footnotes">Anything to be displayed <strong>after</strong> the footnotes at the bottom of the post can go here:</label></th> + <td><textarea rows="3" cols="60" name="post_footnotes"><?php echo $this->current_options['post_footnotes']; ?></textarea></td> + </tr> + <tr> + <th><label for="style_rules">Some CSS to style the footnotes (or anything else on the page for that matter):</label></th> + <td><textarea rows="3" cols="60" name="style_rules"><?php echo $this->current_options['style_rules']; ?></textarea></td> + </tr> + <tr> + <th>Do not display footnotes at all when the page being shown is:</th> + <td> + <ul style="list-style-type:none;"> + <li><label for="no_display_home"><input type="checkbox" name="no_display_home" id="no_display_home" <?php if($this->current_options['no_display_home'] == true) echo 'checked'; ?> /> the home page</label></li> + <li><label for="no_display_search"><input type="checkbox" name="no_display_search" id="no_display_search" <?php if($this->current_options['no_display_search'] == true) echo 'checked'; ?> /> search results</label></li> + <li><label for="no_display_feed"><input type="checkbox" name="no_display_feed" id="no_display_feed" <?php if($this->current_options['no_display_feed'] == true) echo 'checked'; ?> /> a feed (RSS, Atom, etc)</label></li> + <li><label for="no_display_archive"><input type="checkbox" name="no_display_archive" id="no_display_archive" <?php if($this->current_options['no_display_archive'] == true) echo 'checked'; ?> /> an archive page of any kind</label></li> + <li> + <ul style="list-style-type:none;"> + <li><label for="no_display_category"><input type="checkbox" name="no_display_category" id="no_display_category" <?php if($this->current_options['no_display_category'] == true) echo 'checked'; ?> /> a category archive</label></li> + <li><label for="no_display_date"><input type="checkbox" name="no_display_date" id="no_display_date" <?php if($this->current_options['no_display_date'] == true) echo 'checked'; ?> /> a date based archive page</label></li> + </ul> + </li> + </ul> + </td> + </tr> + <tr> + <th><label for="combine_identical_notes">Combine identical notes? </label></th> + <td><input type="checkbox" name="combine_identical_notes" id="combine_identical_notes" <?php if ($this->current_options['combine_identical_notes'] == true): ?> checked="checked"<?php endif; ?> /></td> + </tr> + <tr> + <th><label for="priority">Priority: </label></th> + <td> + <input size="3" type="text" name="priority" id="priority" value="<?php echo $this->current_options['priority']; ?>" /> (Default: 11) + <p><small>(This setting controls the order in which the WP-Footnotes plugin executes in relation to other plugins. Modifying this setting may affect the behaviour of other plugins.)</small></p> + </td> + </tr> + </table> + <p class="submit"><input type="submit" name="reset_options" value="Reset Options to Defaults" /> <input type="submit" name="save_options" value="Save Changes" class="button-primary" /></p> + </form> + + <hr/> + <form action="https://www.paypal.com/cgi-bin/webscr" method="post" style="display:block; float: right;"> + <input type="hidden" name="cmd" value="_s-xclick" /> + <input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" /> + <img alt="" border="0" src="https://www.paypal.com/en_AU/i/scr/pixel.gif" width="1" height="1" style="display:block; margin:auto;" /> + <input type="hid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9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTA3MDQxNzAwMTczMVowIwYJKoZIhvcNAQkEMRYEFPyJWaTB49feq0RstWocrFDNvmWBMA0GCSqGSIb3DQEBAQUABIGAKWdxKM94C+5JhmL90vRLVpjhefGr8d46gtbkB8666ijuEgFoGo0ESt61EtUzDVp8iAcKqBCq1rKtQH3MOnCEr502BC9pF2kHAy6uw8aKO5nYvVoTVjTIDdRCO5hgzIEb2A+CiTbujFI5SfwzFnhwRntGMdlQsAbiUKcP4kd+VxU=-----END PKCS7-----" /> + </form> + + <h3 class="title">Bug Reports & Feature Requests</h3> + <p>You should report any bugs you find and submit feature requests to <a href="http://plugins.trac.wordpress.org/newticket?component=wp-footnotes&owner=drzax">the WordPress Plugins bug tracker</a> (if you're not already you will need to be <a href="http://wordpress.org/extend/plugins/register.php" title="Sign up to the WordPress Plings Directory">signed up</a> and signed in at wordpress.org/extend/plugins).</p> + <p>If you have a general enquiry that isn't a bug or feature request, the best place is the <a href="http://wordpress.org/tags/wp-footnotes?forum_id=10" title="General Support">WordPress.org support forums for WP-Footnotes</a>. + + <h3 class="title">Contributing</h3> + <p>The plugin is primarily maintained on <a href="https://github.com/drzax/WP-Footnotes">GitHub</a> with each new release synced to the WordPress Plugins repository. If you've got the <a href="http://www.youtube.com/watch?feature=player_detailpage&v=ZHDi_AnqwN4#t=3s">skillz</a> please contribute, it's as simple as making a <a href="https://help.github.com/articles/using-pull-requests">pull request</a>.</p> + + <h3 class="title">Documentation & Support</h3> + <p>You can view <a href="http://elvery.net/drzax/more-things/wordpress-footnotes-plugin/" title="WP-Footnotes documentation">the documentation</a> at <a href="http://elvery.net/drzax" title="sw'as">sw'as</a>, the author's website. Support is available via the community <a href="http://wordpress.org/tags/wp-footnotes?forum_id=10" title="General Support">WordPress.org support forums for WP-Footnotes</a>. I do monitor posts there and respond when I can.</p> + + <h3 class="title">Licensing & Copyright</h3> + <p>Copyright © 2007-<?php echo date_format(new DateTime(), 'Y'); ?> <a href="http://elvery.net">Simon Elvery</a></p> + <p>WP-Footnotes is licensed under the <a href="http://www.gnu.org/licenses/gpl.html">GNU GPL</a>. WP-Footnotes comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. See the <a href="http://www.gnu.org/licenses/gpl.html">license</a> for details.</p> + +</div> \ No newline at end of file diff --git a/wp-content/plugins/wp-footnotes/readme.txt b/wp-content/plugins/wp-footnotes/readme.txt new file mode 100644 index 0000000000000000000000000000000000000000..f6ffeb570172d339ce7d02760031b344f2a0644c --- /dev/null +++ b/wp-content/plugins/wp-footnotes/readme.txt @@ -0,0 +1,159 @@ +=== WP-Footnotes === +Contributors: drzax +Tags: footnotes, post, posts, notes, reference, formatting, referencing, bibliography +Requires at least: 2.0 +Tested up to: 3.4.2 +Stable tag: 4.2.2 + +Allows post authors to easily add and manage footnotes in posts. + +== Description == + +Easily add footnotes to any post using a simple mark-up which degrades (kind of) gracefully in the event that for +some horrifying reason this plugin no longer works. + +== Installation == + +WordPress should take care of this for you if you install it via the admin area, but if you want to do it manually, go ahead with the instructions below. + +1. Upload the `wp-footnotes` folder and all it's contents to the `/wp-content/plugins/` directory +2. Activate the plugin through the 'Plugins' menu in WordPress. +3. You're good to go! + +== Frequently Asked Questions == + += How do I use this plugin? = + +That's totally simple. Go and check out [the manual](http://elvery.net/drzax/wordpress-footnotes-plugin). + += Can I make a suggestion for a new feature? = + +Sure can! Feature requests (and bug reports) are best made via <a href="http://plugins.trac.wordpress.org/newticket?component=wp-footnotes&owner=drzax">the WordPress Plugins bug tracker</a>. + +If you fancy being even more helpful, you can write some code and submit a pull request. + += Why aren't there more FAQs? = + +Because answers to pretty much all the questions that get asked frequently are in [the manual](http://elvery.net/drzax/wordpress-footnotes-plugin). + += Licence? = + +This plugin is licensed under [the same license as WordPress](http://wordpress.org/about/license/) itself, the GPLv2 (or later). + +== Change Log == + += 4.2.1 = + +- Update readme.txt and admin screen notes regarding [contribution](https://github.com/drzax/WP-Footnotes). +- Update licensing info. + += 4.2 = + +- Bug fix for compatibilty with PHP < 5.2 (Note, that WP will soon require this anyway). + += 4.1 = + +- Minor bug fixe. See ticket #1174 +- Improvement on roman numerals processing. See ticket #1177 Thanks to Indi.in.the.Wired + += 4.0 = + +- A well overdue update do cater for changes in WP3.0. +- Minor bug fixes and re-organisation. + += 3.3 = + +- Bug fix: Not setting default options on install. + += 3.2 = + +- Bug fix[49]: Made PHP 4.x compatible. Seems I've been living in the world of PHP 5 for so long I forgot there was an older *far* less OO world out there. +- Bug fix[#880]: Footnote before and after blocks will not display anylonger if there are no footnotes (i.e. back to how it was before). + += 3.1 = + +- Urgent bug fix release for 3.0. + += 3.0 = + +- Major reorganisation to encapsulate the plugin in a class. +- Removal of 'smooth scroll feature'. I decided this was better put into a theme if you want it. Instructions here: http://www.learningjquery.com/2007/09/animated-scrolling-with-jquery-12 +- Pretty up the options screen to look more WP2.5ish. +- Bug fix [37]: The notorious 'a' bug hopefully squashed forever. +- Bug fix [47]: Removed all html tags from footnote before adding to title element. +- Bug fix [46]: Replaced all double quotes (") with it's entity reference to ensure title attribute isn't closed early. +- Feature [45]: Added ability to use symbols for footnotes and ability to change footnote style for individual posts. +- Feature [1]: Added decimal-leading-zero as a style option. + += 2.2 = + +- Bug fix: smooth scroll fixed (hopefully) + += 2.1 = + +- Bug fix (already): updated variable name in admin page. + += 2.0 = + +- Major updates to the way footnotes are extracted from text and generated. +- Added option for whether or not identical footnotes are combined. +- Added option to control the plugin's execution priority. +- Changed a bunch of variable names to make conflects less likely. +- Missing options now set at runtime when version is changed. +- Added ability to reset options to default with one click. +- Identifiers aren't links and backlinks don't exist when footnotes are displayed in feeds because most feed readers distroy intra-page links. +- Multiple line footnotes are now possible. + += 1.4 = + +- Enhancement: Added ability to turn off display of footnotes on certain kinds of pages. + += 1.3.1 = + +- Bug fix: Removed errant testing echo. + += 1.3 = + +- Bug fix: Links within footnotes now possible. + += 1.2 = + +- Bug fix: Stopped creation of footnote on posts without any. Bug was introduced in v1.1. + += 1.1 = + +- Bug fix: Link title text now correctly displayed. +- Bug fix: Numbering issues when ref: style references used fixed. +- Major change to the way ref: style references are processed. + += 1.0.1 = + +- Minor updates to imbeded documentation. + += 1.0 = + +- Changed method of extracting footnotes to use regex (should be more robust). +- Support for different footnote numbering styles (decimal, lower-alpha, upper-alpha, lower-roman and upper-roman). +- Reconfiguration of options page. +- Added smooth-scroll feature. +- Added default (and configurable) CSS for footnotes list. +- Added options for adding text (or other markup) before and after the footnotes list. +- Added classes to all markup generated by the plugin for easy styling. +- Automatic legacy support. + + += 0.9.1 = + +- Fixed problems with display of back link text. +- Fixed problems with display of pre and post link text. + += 0.9 = + +- Compatability with WordPress 2.0.x (includes legacy support). +- Change of mark up style. +- Additional options, including before and after link text. +- Basic support for paginated posts. + += 0.1 = + +- The original seriously old-school release! \ No newline at end of file