plugin:webcomics
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:webcomics [2011-11-25 22:24] – [Download] 2001:738:2001:2072:2150:3900:: | 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 | + | |
- | * @author | + | |
- | */ | + | |
- | // 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() { | + | |
- | return array( | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ); | + | |
- | } | + | |
- | private function _listhd($type) { | + | ===== Configuration ===== |
- | require_once(DOKU_INC . ' | + | |
- | // | + | The configuration contains a list of comic names assigned to RSS feeds. The format per entry is |
- | switch($type){ | + | < |
- | case " | + | comicname="feeduri"; |
- | $url = ' | + | </code> |
- | $pre = ' | + | A linebreak after a semicolon is allowed. |
- | $post = ' | + | |
- | break; | + | |
- | case "GARFIELD": | + | |
- | $url = ' | + | |
- | | + | |
- | $post = '.gif'; | + | |
- | break; | + | |
- | case " | + | For example see the default configuration below: |
- | | + | < |
- | | + | xkcd="https:// |
- | | + | dilbert="https://www.comicsrss.com/rss/ |
- | | + | peanuts="https://www.comicsrss.com/rss/peanuts.rss" |
+ | garfield=" | ||
+ | </ | ||
- | case " | + | ===== Syntax ===== |
- | $url = ' | + | |
- | $pre | + | |
- | $post = ' | + | |
- | break; | + | |
- | + | The syntax is '' | |
- | case " | + | |
- | $url = 'http:// | + | |
- | $pre | + | |
- | $post = '.jpg'; | + | |
- | break; | + | |
- | default: return $type." | + | |
- | + | ||
- | } | + | |
- | $ch = new DokuHTTPClient(); | + | ===== Examples |
- | $piece | + | |
- | + | ||
- | $xml = simplexml_load_string($piece); | + | |
- | + | ||
- | $a = explode($pre, | + | |
- | $b = explode($post, | + | |
- | + | ||
- | $feed_contents .= '<a href="' | + | |
- | '< | + | |
- | + | ||
- | return $feed_contents; | + | |
- | } | + | |
- | + | ||
- | function connectTo($mode) { | + | |
- | $this-> | + | |
- | $this-> | + | |
- | $this-> | + | |
- | $this-> | + | |
- | $this-> | + | |
- | + | ||
- | } | + | |
- | + | ||
- | function getType() { return ' | + | |
- | + | ||
- | function getSort() { return 667; } | + | |
- | + | ||
- | function handle($match, | + | |
- | $match = str_replace(array(" | + | |
- | return array($match, | + | |
- | } | + | |
- | + | ||
- | function render($mode, | + | |
- | + | ||
- | if ($mode == ' | + | |
- | $renderer-> | + | |
- | return true; | + | |
- | } | + | |
- | return false; | + | |
- | } | + | |
- | } | + | |
+ | < | ||
+ | < | ||
</ | </ | ||
- | |||
- | ===== Example ===== | ||
- | ^ Exampe Iamge ^ Syntax ^ | ||
- | | {{http:// | ||
- | | {{http:// | ||
- | | {{http:// | ||
- | | {{http:// | ||
- | |||
- | |||
plugin/webcomics.1322256259.txt.gz · Last modified: 2011-11-25 22:24 by 2001:738:2001:2072:2150:3900::