====== Signature Plugin ====== ---- plugin ---- description: signatures for unregistered users author : Dmitry email : dmit_10@jabber.spbu.ru type : syntax lastupdate : 2006-03-29 compatible : depends : conflicts : similar : tags : users, signature ---- ===== Author ===== Author is Dmitry (dmit_10@jabber.spbu.ru). \\ I just posted this plugin to the public --- //[[bukhalenkov.a@gmail.com|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: '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; } }