plugin:wikindx
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:wikindx [2009-10-06 10:40] – tag cleanup laynee | plugin:wikindx [2024-02-20 02:17] (current) – +Kaos compatibility 2001:41d0:fe9d:6700:dd5:214c:9e49:4aee | ||
---|---|---|---|
Line 2: | Line 2: | ||
---- plugin ---- | ---- plugin ---- | ||
- | description: | + | description: |
- | author | + | author |
- | email : Andreas.Wagner@em.uni-frankfurt.de | + | email : Andreas.Wagner@em.uni-frankfurt.de, lkppo@users.sourceforge.net |
type : Syntax | type : Syntax | ||
- | lastupdate : 2008-11-26 | + | lastupdate : 2024-01-27 |
- | compatible : | + | compatible : Hogfather, Igor, Jack Jackrum, Kaos+ |
depends | depends | ||
conflicts | conflicts | ||
similar | similar | ||
- | tags : | + | tags : |
+ | downloadurl: | ||
+ | bugtracker : https:// | ||
+ | sourcerepo : https:// | ||
+ | donationurl: | ||
---- | ---- | ||
- | === usage === | + | This plugin allows |
- | you can call on the wikindx | + | |
- | You can specify particular sections in that resource like this: %%{{wikindx> | + | ===== Compatibility ===== |
- | You can specify several resources by separating them with ;: %%{{wikindx> | + | This plugin is compliant |
- | Now you can also use a tag %%{{wikindxbib}}%% to have it output a list of all references used on this page. | + | ===== Usage ===== |
- | Update 2008-11-26: With the version at the bottom, now you can use %%{{wxbib}}%% and %%{{wxcite> | + | === References === |
+ | By putting things like '' | ||
- | === syntax.php === | + | You can specify |
- | You have to specify | + | |
- | Old version: | + | You can specify several resources by separating them with a semicolon (';' |
- | <code php> | + | '' |
- | <?php | + | |
- | /** | + | Which can give for example: |
- | * Wikindx Citation Module | + | |
- | * Derived from: Refworks Plugin by Daniel Terry, Amazon Plugin by Andreas Gohr | + | <code> |
- | * | + | (1-4 Du Mesnil Du Buisson 1958, chapter 5 de La Hylais 1895–1990) |
- | * @license | + | |
- | * @author | + | |
- | * | + | |
- | * TODO: SECURITY checking!!! | + | |
- | * | + | |
- | * Also directly access notes, quotes, musings etc., authors, categories, lists etc. | + | |
- | * | + | |
- | */ | + | |
- | + | ||
- | if(!defined('DOKU_INC')) define(' | + | |
- | if(!defined(' | + | |
- | require_once(DOKU_PLUGIN.' | + | |
- | + | ||
- | /* have an array ready to keep track of all cited works on the page */ | + | |
- | global $WKX_USED_IDS; | + | |
- | + | ||
- | /** | + | |
- | * All DokuWiki plugins to extend the parser/ | + | |
- | * need to inherit from this class | + | |
- | */ | + | |
- | class syntax_plugin_wikindx extends DokuWiki_Syntax_Plugin | + | |
- | { | + | |
- | var $WKX_URL = ' | + | |
- | + | ||
- | //Report module information | + | |
- | function getInfo() | + | |
- | | + | |
- | return array( | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ); | + | |
- | } | + | |
- | + | ||
- | function getType() | + | |
- | + | ||
- | // Just after build in links | + | |
- | function getSort() | + | |
- | + | ||
- | // Grab everything between {{wikindx> | + | |
- | function connectTo($mode) | + | |
- | { | + | |
- | $this-> | + | |
- | } | + | |
- | + | ||
- | /** | + | |
- | * Handle the match | + | |
- | */ | + | |
- | function handle($match, | + | |
- | { | + | |
- | global $WKX_USED_IDS; | + | |
- | if($match==' | + | |
- | { | + | |
- | $callingmodus=" | + | |
- | $ids=array_unique($WKX_USED_IDS); | + | |
- | } | + | |
- | else | + | |
- | { | + | |
- | $callingmodus=" | + | |
- | $data = trim(substr($match, | + | |
- | $data = trim($data,";" | + | |
- | $ids = split(";", | + | |
- | } | + | |
- | + | ||
- | //Error checking?? | + | |
- | //if (!$data) { | + | |
- | // trigger_error(' | + | |
- | // return FALSE; | + | |
- | //} | + | |
- | + | ||
- | //Lookup data | + | |
- | $http = new DokuHTTPClient(); | + | |
- | foreach($ids as $id) | + | |
- | { | + | |
- | list($resId, | + | |
- | if($callingmodus!=" | + | |
- | $WKX_USED_IDS[] = $resId; | + | |
- | $callmode[] = $callingmodus; | + | |
- | $resourceId[] = $resId; | + | |
- | $pages[] = $page; | + | |
- | $linkUrl[] = $this-> | + | |
- | $queryUrl | + | |
- | $html = $http-> | + | |
- | if(!empty($html)) | + | |
- | { | + | |
- | $array = unserialize(base64_decode($html)); | + | |
- | foreach($array as $rid => $item) | + | |
- | { | + | |
- | $resourceHtml[] = $item; | + | |
- | | + | |
- | } | + | |
- | } | + | |
- | return array($resourceId, | + | |
- | } | + | |
- | + | ||
- | /** | + | |
- | * Create output | + | |
- | */ | + | |
- | function render($mode, | + | |
- | { | + | |
- | if($mode != 'xhtml') { return false; } | + | |
- | + | ||
- | | + | |
- | $output = ""; | + | |
- | + | ||
- | | + | |
- | { | + | |
- | | + | |
- | if($data[2][$i]) | + | |
- | $output .= ", " . $data[2][$i]; | + | |
- | $output .= "</ | + | |
- | if(($data[4][$i]==" | + | |
- | $output .= "; "; | + | |
- | if($data[4][$i]==" | + | |
- | $output .= "< | + | |
- | } | + | |
- | $renderer-> | + | |
- | return true; | + | |
- | } | + | |
- | } | + | |
- | + | ||
- | //Setup VIM: ex: et ts=4 enc=utf-8 : | + | |
</ | </ | ||
+ | === Bibliography === | ||
- | New Version 2008-11-26: | + | To create |
- | <code php> | + | |
- | <?php | + | |
- | /** | + | |
- | * Wikindx Citation Module | + | |
- | * Derived from: Refworks Plugin by Daniel Terry, Amazon Plugin by Andreas Gohr | + | |
- | * | + | |
- | * @license | + | |
- | * @author | + | |
- | * | + | |
- | * TODO: | + | |
- | * SECURITY checking!!! | + | |
- | * | + | |
- | * Provide switch to only insert a short citation | + | |
- | * Allow inclusion | + | |
- | * Allow to put bibliography before | + | |
- | * | + | |
- | */ | + | |
- | + | ||
- | if(!defined(' | + | |
- | if(!defined(' | + | |
- | require_once(DOKU_PLUGIN.' | + | |
- | + | ||
- | /* have an array ready to keep track of all cited works on the page */ | + | |
- | global $WKX_USED_IDS; | + | |
- | + | ||
- | /** | + | |
- | * All DokuWiki plugins to extend the parser/ | + | |
- | * need to inherit from this class | + | |
- | */ | + | |
- | class syntax_plugin_wikindx extends DokuWiki_Syntax_Plugin | + | |
- | { | + | |
- | var $WKX_URL = ' | + | |
- | + | ||
- | //Report module information | + | |
- | function getInfo() | + | |
- | { | + | |
- | return array( | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | | + | |
- | ); | + | |
- | } | + | |
- | + | ||
- | function getType() | + | |
- | + | ||
- | // Just after build in links | + | |
- | function getSort() | + | |
- | + | ||
- | // Grab everything between {{wikindx> | + | |
- | function connectTo($mode) | + | |
- | { | + | |
- | // $this-> | + | |
- | $this-> | + | |
- | } | + | |
- | + | ||
- | /** | + | |
- | * Handle | + | |
- | */ | + | |
- | function handle($match, | + | |
- | { | + | |
- | global $WKX_USED_IDS; | + | |
- | if ($match==' | + | |
- | $callingmodus=" | + | |
- | $ids=array_unique($WKX_USED_IDS); | + | |
- | } | + | |
- | else { | + | |
- | switch(substr($match, | + | |
- | case ' | + | |
- | $callingmodus=" | + | |
- | $data = trim(substr($match, | + | |
- | break; | + | |
- | case ' | + | |
- | $callingmodus=" | + | |
- | $data = trim(substr($match, | + | |
- | break; | + | |
- | case ' | + | |
- | $callingmodus=" | + | |
- | $data = trim(substr($match, | + | |
- | break; | + | |
- | } | + | |
- | $data = trim($data,";" | + | |
- | $ids = split(";", | + | |
- | } | + | |
- | // | + | |
- | //if (!$data) { | + | |
- | // trigger_error(' | + | |
- | // return FALSE; | + | |
- | //} | + | |
- | + | ||
- | //Lookup data | + | |
- | $http = new DokuHTTPClient(); | + | |
- | foreach($ids as $id) | + | |
- | { | + | |
- | list($resId, | + | |
- | if($callingmodus!=" | + | |
- | $WKX_USED_IDS[] = $resId; | + | |
- | $callmode[] = $callingmodus; | + | |
- | $resourceId[] = $resId; | + | |
- | $pages[] = $page; | + | |
- | $linkUrl[] = $this-> | + | |
- | switch($callingmodus) { | + | |
- | case ' | + | |
- | $queryUrl | + | |
- | $htmlIsCoded = FALSE; | + | |
- | $htmlIsArray = FALSE; | + | |
- | break; | + | |
- | case ' | + | |
- | default: | + | |
- | $queryUrl | + | |
- | $htmlIsCoded = TRUE; | + | |
- | $htmlIsArray = TRUE; | + | |
- | } | + | |
- | $html = $http-> | + | |
- | if(!empty($html)) | + | |
- | { | + | |
- | if($htmlIsCoded) | + | |
- | $html = base64_decode($html); | + | |
- | if(!$htmlIsArray) | + | |
- | $resourceHtml[] = $html; | + | |
- | else { | + | |
- | $array = unserialize($html); | + | |
- | foreach($array as $rid => $item) | + | |
- | $resourceHtml[] = $item; | + | |
- | } | + | |
- | } | + | |
- | } | + | |
- | return array($resourceId, | + | |
- | } | + | |
- | + | ||
- | /** | + | |
- | * Create output | + | |
- | */ | + | |
- | function render($mode, | + | |
- | { | + | |
- | if($mode != ' | + | |
- | + | ||
- | global $WKX_USED_IDS; | + | |
- | $output = ""; | + | |
- | for($i=0; | + | === Abstract, Notes === |
- | { | + | |
- | | + | You can use '' |
- | if($data[2][$i]) | + | |
- | $output | + | |
- | $output | + | === Quotes, Musings, Paraphrases === |
- | | + | |
- | | + | You can display quotes and such like this: '' |
- | | + | |
- | | + | ===== Configuration ===== |
- | } | + | |
- | | + | You have to use the Configuration Manager to set the **base_url** of your WIKINDX website and you preferred **bibliography style**. |
- | | + | |
- | } | + | If the main page of your personal WIKINDX website is [[https:// |
- | } | + | |
- | + | ===== Limitation ===== | |
- | //Setup VIM: ex: et ts=4 enc=utf-8 : | + | |
- | </ | + | * Depending on your installation, |
+ | * Only officials styles are supported. | ||
+ | * The plugin is design for a single user WIKINDX / Dokuwiki installation. | ||
+ | * Footnote styles are not rendering as footnotes in v1 of the plugin. | ||
+ | * This plugin is still experimental. | ||
+ | * Unimplemented Hooks: getAll, getCategory, | ||
+ | |||
+ | ===== License ===== | ||
+ | |||
+ | This plugin is licensed under the terms of the GNU General Public License version 2. | ||
+ | |||
+ | |||
+ | ===== Changes ===== | ||
+ | |||
+ | * //2024-01-27// -- Finish v2 of the plugin for WIKINDX 6.6.0 and higher (for Hogfather, Igor, Jack Jackrum+) | ||
+ | * // | ||
+ | |||
+ | * // | ||
+ | | ||
+ | |||
+ | |||
+ | ===== To Do ===== | ||
+ | |||
+ | * Provide switch to not insert a citation into the tracking array | ||
+ | * Allow to put bibliography before all the citations? | ||
- | wikindx3 diff in order to get the new Version 2008-11-26 to work: | ||
- | < | ||
- | --- cmsprint.php.old 2008-04-15 10: | ||
- | +++ cmsprint.php 2008-11-26 23: | ||
- | @@ -38,7 +38,7 @@ | ||
- | | ||
- | $db = new SQL(); | ||
- | |||
- | -// Check if request is to parse text for [cite]...[/ | ||
- | +// Check if request is to parse text for [cite]...[/ | ||
- | | ||
- | | ||
- | else if($_GET[' | ||
- | @@ -55,7 +55,21 @@ | ||
- | | ||
- | // Force HTTP to UTF-8 charset overriding any AddDefaultCharset set in Apache. | ||
- | | ||
- | -print CMS:: | ||
- | +// old: print CMS:: | ||
- | + | ||
- | +if($_GET[' | ||
- | + include_once(" | ||
- | + $html = new HTML(); | ||
- | + $resultset = $db-> | ||
- | + $resultrow = $db-> | ||
- | + print "Note: " . $html-> | ||
- | +} | ||
- | +else | ||
- | +// | ||
- | + print CMS:: | ||
- | +// | ||
- | +// print CMS:: | ||
- | + | ||
- | die; | ||
- | |||
- | /** | ||
- | --- core/ | ||
- | +++ core/ | ||
- | @@ -269,14 +269,15 @@ | ||
- | | ||
- | | ||
- | | ||
- | - if($_GET[' | ||
- | - { | ||
- | + $sql = ""; | ||
- | + | ||
- | + switch($_GET[' | ||
- | + case ' | ||
- | | ||
- | // Ignore limit in this case | ||
- | | ||
- | - } | ||
- | - else if($_GET[' | ||
- | - { | ||
- | + break; | ||
- | + case ' | ||
- | | ||
- | | ||
- | | ||
- | @@ -285,9 +286,17 @@ | ||
- | | ||
- | | ||
- | | ||
- | - } | ||
- | - else if($_GET[' | ||
- | - { | ||
- | + break; | ||
- | + case ' | ||
- | + $sql = $db-> | ||
- | +// | ||
- | +// NB MySQL bug: http:// | ||
- | +// | ||
- | +// | ||
- | +// | ||
- | + break; | ||
- | +// | ||
- | + case ' | ||
- | | ||
- | | ||
- | | ||
- | @@ -296,9 +305,8 @@ | ||
- | | ||
- | | ||
- | | ||
- | - } | ||
- | - else if($_GET[' | ||
- | - { | ||
- | + break; | ||
- | + case ' | ||
- | // NB MySQL bug: http:// | ||
- | | ||
- | | ||
- | @@ -313,9 +321,8 @@ | ||
- | | ||
- | | ||
- | | ||
- | - } | ||
- | - else if($_GET[' | ||
- | - { | ||
- | + break; | ||
- | + case ' | ||
- | // ' | ||
- | | ||
- | | ||
- | @@ -324,12 +331,12 @@ | ||
- | | ||
- | | ||
- | | ||
- | - } | ||
- | - else if($_GET[' | ||
- | + break; | ||
- | + case ' | ||
- | | ||
- | | ||
- | - else if($_GET[' | ||
- | - { | ||
- | + break; | ||
- | + case ' | ||
- | | ||
- | { | ||
- | | ||
- | @@ -340,9 +347,11 @@ | ||
- | | ||
- | | ||
- | | ||
- | - } | ||
- | - else | ||
- | + break; | ||
- | + default: | ||
- | | ||
- | + } | ||
- | + | ||
- | | ||
- | { | ||
- | // ' | ||
- | @@ -352,6 +361,7 @@ | ||
- | | ||
- | | ||
- | } | ||
- | + if(!$sql) | ||
- | | ||
- | | ||
- | // | ||
- | </ |
plugin/wikindx.1254818448.txt.gz · Last modified: 2009-10-06 10:40 by laynee