plugin:autostart
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
plugin:autostart [2023-12-15 09:01] – einhirn | plugin:autostart [2024-03-15 15:25] (current) – removed old stuff einhirn | ||
---|---|---|---|
Line 29: | Line 29: | ||
===== Source Code ===== | ===== Source Code ===== | ||
- | Create a directory '' | + | See link above. |
- | <file php action.php> | + | I changed download link to gihtub repo into my account, when the author |
- | <?php | + | |
- | /** | + | |
- | * Autostart Plugin: Redirects | + | |
- | * | + | |
- | * @author | + | |
- | */ | + | |
- | + | ||
- | if (!defined(' | + | |
- | if (!defined(' | + | |
- | require_once (DOKU_PLUGIN . ' | + | |
- | + | ||
- | class action_plugin_autostart extends DokuWiki_Action_Plugin | + | |
- | { | + | |
- | function getInfo() { | + | |
- | return array ( | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ); | + | |
- | } | + | |
- | + | ||
- | function page_exists($id) { | + | |
- | if (function_exists(' | + | |
- | return page_exists($id); | + | |
- | else | + | |
- | return @file_exists(wikiFN($id)); | + | |
- | } | + | |
- | + | ||
- | function register(Doku_Event_Handler $controller) { | + | |
- | $controller-> | + | |
- | } | + | |
- | + | ||
- | function preprocess(& | + | |
- | global $conf; | + | |
- | global $ID; | + | |
- | if (!$this-> | + | |
- | { | + | |
- | if($this-> | + | |
- | | + | |
- | $id = $ID.':' | + | |
- | elseif($this-> | + | |
- | | + | |
- | $id = $ID.':' | + | |
- | if ($id) header(' | + | |
- | } | + | |
- | } | + | |
- | + | ||
- | } | + | |
- | </ | + | |
- | ===== Discussion ===== | ||
- | Great extension, been using for several years. | ||
- | |||
- | ---- | ||
- | |||
- | Nice work! Thanks! - Jason Xun Xu < | ||
- | |||
- | ---- | ||
- | \\ | ||
- | Very handy plugin, great work! By the way: redirecting into a namespace (e.g. foobar -> foobar: | ||
- | |||
- | < | ||
- | --- lib/ | ||
- | +++ lib/ | ||
- | @@ -36,7 +36,7 @@ | ||
- | | ||
- | | ||
- | | ||
- | - if (!$this-> | ||
- | + if (!$this-> | ||
- | { | ||
- | | ||
- | // start page inside namespace | ||
- | </ | ||
- | |||
- | Andreas de Pretis < | ||
- | |||
- | > Thanks, I'm using the plugin with Andreas' | ||
- | |||
- | > This has some side effects. They will only appear on rare conditions, but never the less: if you deleted the Page ID “wiki: | ||
- | ---- | ||
- | |||
- | I changed download link to gihtub repo into my account, when the author want it i will transfer to him account | ||
- | |||
- | [[https:// | ||
- | |||
- | --- [[user> |
plugin/autostart.txt · Last modified: 2024-03-15 15:25 by einhirn