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