DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:externallink

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:externallink [2010-10-10 14:34] – downloadurl lupo49plugin:externallink [2022-01-18 23:16] (current) Klap-in
Line 1: Line 1:
-====== Externallink plugin ====== +====== Externallink Plugin ======
  
 ---- plugin ---- ---- plugin ----
 description: Add links to pages in same host, but outside wiki description: Add links to pages in same host, but outside wiki
 author     : Otto Vainio author     : Otto Vainio
-email      : oiv-plugins@valjakko.net+email      : otto@valjakko.net
 type       : Syntax type       : Syntax
 lastupdate : 2005-08-01 lastupdate : 2005-08-01
Line 19: Line 18:
 ===== Description ===== ===== Description =====
  
-With this [[plugins|plugin]] you can easily insert a link to pages on same server, but outside DokuWiki.+With this plugin you can easily insert a link to pages on same server, but outside DokuWiki.
  
 ===== Format ===== ===== Format =====
Line 34: Line 33:
  
 ===== Installation ===== ===== Installation =====
 +Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
-Install with Plugin Manager from [[http://koti.mbnet.fi/oiv/pubtest/externallink.zip|here]] (new version without svchk call) 
  
-Or manually  
- 
-Create a new folder ''lib/plugins/externallink/'' and place the following file in it: ''syntax.php''. 
  
 ''lib/plugins/externallink/syntax.php'': ''lib/plugins/externallink/syntax.php'':
  
-<code php>+<code php syntax.php>
 <?php <?php
 /** /**
- * Plugin bookmarkCreates a bookmark to your document.+ * Plugin ExternallinkAdd links to pages in same host, but outside wiki
  *  *
  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)  * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
Line 52: Line 48:
  */  */
    
-if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/'); 
-if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); 
-require_once(DOKU_PLUGIN.'syntax.php'); 
    
 /** /**
Line 72: Line 65:
             'name'   => 'externallink',             'name'   => 'externallink',
             'desc'   => 'Inserts a link to a page outside your wiki, but on your server with a style of wikilink. Format is [[@/pagename|optional title]]',             'desc'   => 'Inserts a link to a page outside your wiki, but on your server with a style of wikilink. Format is [[@/pagename|optional title]]',
-            'url'    => 'http://www.dokuwiki.org/wiki:plugins',+            'url'    => 'http://www.dokuwiki.org/plugin:externallink',
         );         );
     }     }
Line 94: Line 87:
      * Handle the match      * Handle the match
      */      */
-    function handle($match, $state, $pos, &$handler){+    function handle($match, $state, $pos, Doku_Handler $handler){
         $match = substr($match,3,-2); //strip [[@ from start and ]] from end         $match = substr($match,3,-2); //strip [[@ from start and ]] from end
         $match = explode("|",$match);         $match = explode("|",$match);
Line 103: Line 96:
      * Create output      * Create output
      */      */
-    function render($mode, &$renderer, $data) {+    function render($mode, Doku_Renderer $renderer, $data) {
         if($mode == 'xhtml'){         if($mode == 'xhtml'){
             $text=$this->_externallink($renderer, $data[0], $data[1]);             $text=$this->_externallink($renderer, $data[0], $data[1]);
Line 113: Line 106:
  
  
-    function _externallink(&$renderer, $url, $name = NULL) {+    function _externallink($renderer, $url, $name = NULL) {
         global $conf;         global $conf;
         // Just some basic cleaning         // Just some basic cleaning
Line 151: Line 144:
  
 } }
-?> 
 </code> </code>
  
Line 199: Line 191:
  
 -- //[[bering@ringlogic.com|Bering]] 2009-11-13 10:31// -- //[[bering@ringlogic.com|Bering]] 2009-11-13 10:31//
 +----
 +Plugin doesn't work on Release 2012-10-13 "Adora Belle"
  
 +Url leads to Dokuwiki basedir, but not web server root dir
 +
 +----
 +Fix functions arguments in ''externallink/syntax.php'' is enough to run this plugin under 2020-07-29 "Hogfather".
 +<code php>
 +function handle($match, $state, $pos, Doku_Handler $handler) {}
 +function render($mode, Doku_Renderer $renderer, $data) {}
 +</code>
 +-- //[[robert.kalinowski@sharkbits.com|rysson]] 2020-10-04 15:52//
plugin/externallink.1286714082.txt.gz · Last modified: 2010-10-10 14:34 by lupo49

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki