plugin:goto:old_discussion
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
plugin:goto:old_discussion [2019-03-15 23:55] – [Updated Version] turnermm | plugin:goto:old_discussion [2019-03-16 00:48] (current) – turnermm | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Installation ===== | ||
- | Search and install the plugin using the [[plugin: | + | ===== Discussion ===== |
- | ===== Requirements ===== | + | Right now this plugin can only redirect to internal wiki pages. I'd like it to be able to redirect to external pages, but I'm a little hazy on how DokuWiki processes URLs. Any help is appreciated. |
- | This plugin requires | + | I don't see the point of a page with a ~~GOTO~~ and then some additional content. I'd suggest that if a page contains only an internal link, make an HTTP-header (HTTP 301 response code) redirection and then show a " |
+ | >I agree, that does sound nice. However, there are a couple reasons I didn't use an http header redirection. As far as I know, it's impossible | ||
+ | >>How about a parameter that disables the redirect, e.g. redirect=no? | ||
+ | >>> | ||
- | The '' | + | Sorry, but this Plugin is a Crap. Why did you not use the all Wiki Standardcode like : |
+ | #redirect [[Articlename]] | ||
- | ===== Syntax ===== | + | ?? |
- | You can put the GOTO string anywhere in the document, but it probably makes the most sense to put it at the top. | + | The code you use is to complex and nobody can remember this. |
- | ~~GOTO> | ||
- | The above will force the document | + | > You're welcome |
- | It is possible | + | > If there actually existed something like an "all Wiki Standardcode", |
- | | + | >> Ever head of [[http:// |
- | You can change | + | >>You have to now "# |
- | | + | >>Use " |
+ | >>The only thing is, that such a basic function should by part of the basecode. | ||
- | This will redirect | + | ---- |
+ | $seconds and $minSeconds could by inserted in to the admin-configuration. | ||
- | === Pause length === | + | ---- |
- | By default, users can't set the pause length | + | Note that the download links (to yeahway.com) are **broken** as of 2013-07-11. I'm not touching them as I don't know what policy is. |
+ | ---- | ||
+ | |||
+ | ==== Why not allow to redirect | ||
- | ===== Revision History ===== | + | Specifying an URL like '' |
+ | Is it a bug or a feature? | ||
+ | --- [[user> | ||
- | * 2006-06-30 --- Released. | + | ==== Why not using HTTP redirects? ==== |
- | * 2006-07-19 --- Made it easier to customize the displayed redirect message. | + | |
- | * 2016-10-02 --- Moved to GitHub, added compability for PHP 7, added redirection to headlines, integration of language files, integration of configuration manager for settings, avoid redirection while editing | + | |
+ | If you add | ||
- | ===== Issues ===== | + | ob_start(); |
+ | ob_implicit_flush(FALSE); | ||
- | * The viewer's web browser must have JavaScript enabled in order to automatically redirect. | + | to '' |
- | * Currently, the plugin only works correctly for internal links. | + | |
- | ===== Updated Version ===== | + | - No need to enable JavaScript |
- | There is an updated version of '' | + | - No extra clicks |
- | For documentation | + | The issue " |
+ | |||
+ | === User stupidity === | ||
+ | |||
+ | Simple - You can't rely on the fact that all users will be able to know how to use the address bar correctly. If you can't access it through visual scanning | ||
+ | ==== Languages ==== | ||
+ | |||
+ | < | ||
+ | Change | ||
+ | |||
+ | $message = "< | ||
+ | |||
+ | to | ||
+ | |||
+ | $message = "< | ||
+ | </ | ||
+ | |||
+ | |||
+ | and | ||
+ | |||
+ | Input this in the Path " | ||
+ | |||
+ | |||
+ | == en == | ||
+ | <code php> | ||
+ | <?php | ||
+ | /* | ||
+ | English language file | ||
+ | |||
+ | %d will be replaced with a link to the destination. | ||
+ | %s will be replaced with the number of seconds before redirect. | ||
+ | */ | ||
+ | $lang['redirect']="You will be redirected to %d in approximately %s seconds."; | ||
+ | //Setup VIM: ex: et ts=2 enc=utf-8 : | ||
+ | ?> | ||
+ | </ | ||
+ | |||
+ | |||
+ | == de == | ||
+ | <code php> | ||
+ | <?php | ||
+ | /* | ||
+ | German language file | ||
+ | |||
+ | %d will be replaced with a link to the destination. | ||
+ | %s will be replaced with the number of seconds before redirect. | ||
+ | */ | ||
+ | $lang[' | ||
+ | //Setup VIM: ex: et ts=2 enc=utf-8 : | ||
+ | ?> | ||
+ | </ | ||
+ | |||
+ | == fr == | ||
+ | <code php> | ||
+ | <?php | ||
+ | /* | ||
+ | french language file | ||
+ | |||
+ | %d will be replaced with a link to the destination. | ||
+ | %s will be replaced with the number of seconds before redirect. | ||
+ | */ | ||
+ | $lang[' | ||
+ | //Setup VIM: ex: et ts=2 enc=utf-8 : | ||
+ | ?> | ||
+ | </ | ||
+ | |||
+ | == es == | ||
+ | <code php> | ||
+ | <?php | ||
+ | /* | ||
+ | Spanish language file | ||
+ | |||
+ | %d will be replaced with a link to the destination. | ||
+ | %s will be replaced with the number of seconds before redirect. | ||
+ | */ | ||
+ | $lang[' | ||
+ | //Setup VIM: ex: et ts=2 enc=utf-8 : | ||
+ | ?> | ||
+ | </ | ||
+ | |||
+ | ==== Great ==== | ||
+ | Great, this plugin | ||
+ | |||
+ | ==== Support for Anchors ==== | ||
+ | The # character is replaced by %23 in the URL, so I've made the following modification to the render function. | ||
+ | |||
+ | function render($format, | ||
+ | $message = str_replace(" | ||
+ | $message = str_replace(" | ||
+ | $renderer-> | ||
+ | $urlArr = split('#', | ||
+ | $url = wl($urlArr[0]); | ||
+ | if (count($urlArr) > 1) { | ||
+ | $url .= '#' | ||
+ | } | ||
+ | $renderer-> | ||
+ | } | ||
+ | |||
+ | ==== Support for external pages ==== | ||
+ | |||
+ | Minor modifications which allow: | ||
+ | - external pages to be referenced. | ||
+ | - doesn' | ||
+ | |||
+ | < | ||
+ | --- ./ | ||
+ | +++ ./ | ||
+ | @@ -48,18 +48,29 @@ | ||
+ | $matches = explode("?", | ||
+ | if (is_numeric($matches[1])){ $seconds = $matches[1]; } | ||
+ | if ($seconds < $minSeconds){ $seconds = $minSeconds; | ||
+ | - | ||
+ | + if (substr($matches[0], | ||
+ | + | ||
+ | $message = str_replace(" | ||
+ | $message = str_replace(" | ||
+ | return array($matches[0], | ||
+ | } | ||
+ | |||
+ | function render($format, | ||
+ | - | ||
+ | - | ||
+ | - | ||
+ | - | ||
+ | + global $ACT; | ||
+ | + if (substr($data[0], | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + if ($ACT != ' | ||
+ | + | ||
+ | + } else { | ||
+ | + | ||
+ | + | ||
+ | + | ||
+ | + if ($ACT != ' | ||
+ | + | ||
+ | + } | ||
+ | } | ||
+ | |||
+ | } | ||
+ | </ |
plugin/goto/old_discussion.1552690528.txt.gz · Last modified: 2019-03-15 23:55 by turnermm