Table of Contents
Signature Plugin
Compatible with DokuWiki
No compatibility info given!
The missing download url means that this extension cannot be installed via the Extension Manager. Please see Publishing a Plugin on dokuwiki.org. Recommended are public repository hosts like GitHub, GitLab or Bitbucket.
This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.
Author
Author is Dmitry (dmit_10@jabber.spbu.ru).
I just posted this plugin to the public — Bukhalenkov Alexander 2007-06-26 15:08
Purpose
It can be simply modified to fit many purposes - it's just a substitute plugin,
which substitutes “{{user>username}}”
to (in this modification) “ --- **//[[p:username]]//**”
(in our wiki it links on personal pages)
In another words, this plugin is mechanism for adding signatures for unregistered wiki users.
Code
It consist just one file: syntax.php:
- syntax.php
<?php 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'); class syntax_plugin_signature extends DokuWiki_Syntax_Plugin { function getInfo(){ return array( 'author' => 'dmit10', 'email' => 'dmit10@mail.ru', 'date' => '29/03/2006', 'name' => 'Signature Plugin', 'desc' => 'Add the possibility to put down a signature', 'url' => '???', ); } function getType(){ return 'substition'; } function getSort(){ return 250; } function connectTo($mode) { $this->Lexer->addSpecialPattern("{{user>[a-zA-Z0-9]+}}",$mode,'plugin_signature'); } function handle($match, $state, $pos, &$handler){ // {{user>username}} // ^^^^^^^^ // 01234567 $match = substr($match,7,-2); //Maybe it is useful to add here current date return array($match); } function render($mode, &$renderer, $data) { $renderer->doc.="— "; //this string depends on the HTML that is not good =) $renderer->strong_open(); $renderer->emphasis_open(); $renderer->internallink("p:{$data[0]}"); $renderer->emphasis_close(); $renderer->strong_close(); return true; } }