plugin:goto:old_discussion
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
plugin:goto:old_discussion [2019-03-15 21:09] – 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 ===== |
- | The default pause length, before the redirect, and the minimum pause length | + | Right now this plugin |
- | 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? | ||
+ | >>> | ||
- | ===== Syntax ===== | + | Sorry, but this Plugin is a Crap. Why did you not use the all Wiki Standardcode like : |
- | You can put the GOTO string anywhere in the document, but it probably makes the most sense to put it at the top. | + | #redirect [[Articlename]] |
- | ~~GOTO> | + | ?? |
- | The above will force the document | + | The code you use is to complex and nobody |
- | It is possible to link to a subheading of the page: | ||
- | ~~GOTO> | ||
- | You can change the number of seconds on the fly like so: | + | > You're welcome to do better. |
- | ~~GOTO>wiki: | + | |
- | This will redirect the page after a 15 second pause. | + | > If there actually existed something like an "all Wiki Standardcode", |
+ | >> Ever head of [[http:// | ||
- | By default, users can't set the pause length | + | >>You have to now "# |
+ | >>Use " | ||
+ | >>The only thing is, that such a basic function should by part of the basecode. | ||
- | ===== Revision History ===== | + | ---- |
+ | $seconds and $minSeconds could by inserted in to the admin-configuration. | ||
- | * 2006-06-30 --- Released. | + | ---- |
- | * 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 | + | |
+ | 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 to external sites? ==== | ||
- | ===== Issues ===== | + | Specifying an URL like '' |
+ | Is it a bug or a feature? | ||
+ | --- [[user> | ||
- | * The viewer' | + | ==== Why not using HTTP redirects? ==== |
- | * Currently, the plugin only works correctly for internal links. | + | |
- | ===== Updated Version ===== | + | If you add |
+ | ob_start(); | ||
+ | ob_implicit_flush(FALSE); | ||
+ | |||
+ | to '' | ||
+ | |||
+ | - No need to enable JavaScript | ||
+ | - No extra clicks for visitors, if they disabled JavaScript | ||
+ | |||
+ | 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 and mouse clicks, assume 80% of the population will be unable to utilize the feature. | ||
+ | ==== 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[' | ||
+ | //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 made my day. Only issue is that I cannot remember the syntax, #REDIRECT would have been better. | ||
+ | |||
+ | ==== 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.1552680599.txt.gz · Last modified: 2019-03-15 21:09 by turnermm