plugin:webcomics
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:webcomics [2018-05-26 19:26] – Aleksandr | plugin:webcomics [2023-10-31 00:34] (current) – Klap-in | ||
---|---|---|---|
Line 3: | Line 3: | ||
---- plugin ---- | ---- plugin ---- | ||
description: | description: | ||
- | author | + | author |
- | email : calbity@gmx.de | + | email : - |
type : syntax | type : syntax | ||
- | lastupdate : 2009-07-09 | + | lastupdate : 2019-02-16 |
- | compatible : | + | compatible : Greebo, Hogfather |
depends | depends | ||
conflicts | conflicts | ||
similar | similar | ||
- | tags : comic, | + | tags : comic, |
- | downloadurl: | + | downloadurl: |
- | bugtracker : | + | bugtracker : https:// |
- | sourcerepo : | + | sourcerepo : https:// |
donationurl: | donationurl: | ||
Line 21: | Line 21: | ||
---- | ---- | ||
- | ===== Purpose | + | ===== Description |
- | I love comics, and so does all other people on my private Wiki. I like to have a new comic every day. | + | This plugin lets the user add a comic to a page taken from an RSS feed. The list of supported/ |
- | The plugin includes the same functionality as the [[: | + | ===== History ===== |
- | Also the plugin | + | The plugin |
- | ===== Download===== | + | ===== Installation |
- | Copy into **webcomics/ | + | Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually. |
- | <code php syntax.php> | + | ===== Configuration ===== |
- | <?php | + | |
- | /** | + | |
- | * Webcomics Plugin | + | |
- | * | + | |
- | * @license GPL 2 (http:// | + | |
- | * @author Christoph Lang < | + | |
- | */ | + | |
- | // based on http://wiki.splitbrain.org/ | + | The configuration contains a list of comic names assigned to RSS feeds. The format per entry is |
+ | < | ||
+ | comicname=" | ||
+ | </code> | ||
+ | A linebreak after a semicolon is allowed. | ||
- | // must be run within Dokuwiki | + | For example see the default configuration below: |
- | if (! defined(' | + | < |
+ | xkcd=" | ||
+ | dilbert=" | ||
+ | peanuts=" | ||
+ | garfield=" | ||
+ | </ | ||
- | if (! defined(' | + | ===== Syntax ===== |
- | require_once (DOKU_PLUGIN . ' | + | |
- | /** | + | The syntax is ''< |
- | * All DokuWiki plugins to extend the parser/ | + | |
- | * need to inherit from this class | + | |
- | */ | + | |
- | class syntax_plugin_webcomics extends DokuWiki_Syntax_Plugin | + | |
- | { | + | |
- | function getInfo () | + | ===== Examples ===== |
- | { | + | |
- | return array( | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | } | + | |
- | private function _listhd ($type) | + | <code> |
- | { | + | <comic="garfield"> |
- | require_once (DOKU_INC . ' | + | |
- | switch ($type) | + | |
- | { | + | |
- | case " | + | |
- | $url = ' | + | |
- | $pre = ' | + | |
- | $post = ' | + | |
- | break; | + | |
- | case " | + | |
- | $url = ' | + | |
- | $pre = ' | + | |
- | $post = ' | + | |
- | break; | + | |
- | case " | + | |
- | $url = ' | + | |
- | $pre = ' | + | |
- | $post = ' | + | |
- | break; | + | |
- | case " | + | |
- | $url = ' | + | |
- | $pre = ' | + | |
- | $post = ' | + | |
- | break; | + | |
- | case " | + | |
- | $url = ' | + | |
- | $pre = ' | + | |
- | $post = ' | + | |
- | break; | + | |
- | default: | + | |
- | return $type . " will be supported soon!"; | + | |
- | } | + | |
- | + | ||
- | $ch = new DokuHTTPClient(); | + | |
- | $piece = $ch-> | + | |
- | + | ||
- | $xml = simplexml_load_string($piece); | + | |
- | + | ||
- | $a = explode($pre, | + | |
- | $b = explode($post, | + | |
- | + | ||
- | $feed_contents .= '<a href="' | + | |
- | $b[0] . $post . '" | + | |
- | + | ||
- | return $feed_contents; | + | |
- | } | + | |
- | + | ||
- | function connectTo ($mode) | + | |
- | { | + | |
- | $this-> | + | |
- | $this-> | + | |
- | ' | + | |
- | $this-> | + | |
- | ' | + | |
- | $this-> | + | |
- | ' | + | |
- | $this-> | + | |
- | ' | + | |
- | } | + | |
- | + | ||
- | function getType () | + | |
- | { | + | |
- | return ' | + | |
- | } | + | |
- | + | ||
- | function getSort () | + | |
- | { | + | |
- | return 667; | + | |
- | } | + | |
- | + | ||
- | function handle ($match, $state, $pos, & | + | |
- | { | + | |
- | $match | + | |
- | return array($match, | + | |
- | } | + | |
- | + | ||
- | function render ($mode, & | + | |
- | { | + | |
- | + | ||
- | if ($mode == ' | + | |
- | { | + | |
- | $renderer->doc .= $this-> | + | |
- | return true; | + | |
- | } | + | |
- | return false; | + | |
- | } | + | |
- | } | + | |
</ | </ | ||
- | |||
- | ===== Example ===== | ||
- | |||
- | ==== [SHACKLES] ==== | ||
- | {{http:// | ||
- | |||
- | ==== [XKCD] ==== | ||
- | |||
- | {{http:// | ||
- | |||
- | ==== [GARFIELD] ==== | ||
- | |||
- | {{http:// | ||
- | |||
- | ==== [DILBERT] ==== | ||
- | |||
- | {{http:// | ||
plugin/webcomics.1527355619.txt.gz · Last modified: 2018-05-26 19:26 by Aleksandr