DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:mypage

Differences

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

Link to this comparison view

Next revision
Previous revision
plugin:mypage [2009-09-27 17:23] – created 85.228.118.248plugin:mypage [2023-10-30 23:23] (current) Klap-in
Line 1: Line 1:
-====== Mypage plugin ======+====== Mypage Plugin ======
  
 ---- plugin ---- ---- plugin ----
Line 7: Line 7:
 type       : Action type       : Action
 lastupdate : 2009-09-27 lastupdate : 2009-09-27
-compatible : 2009-02-14+compatible : Anteater
 depends    :  depends    : 
 conflicts  conflicts 
 similar    : userhomepage similar    : userhomepage
-tags       : userpage users mypage+tags       : users, userpage
 ---- ----
  
 ===== Download and Installation ===== ===== Download and Installation =====
  
-Download and install the plugin using the [[plugin:plugin|Plugin Manager]] using the following URLRefer to [[:Plugins]] on how to install plugins manually.+Download the ''action.php'' below from [[mypage#source code]] section and save that file as ''lib/plugins/mypage/action.php''
  
-  * FIXME put URL here+No download package available at the moment. 
 +===== Dependencies =====
  
-For manual installationsee [[mypage#Source code]]+No other plugins are requiredbut any plugins capable of displaying information related to a specific user are useful, such as
  
 +  * The [[editor]] plugin, to show a list of pages edited by the currently logged in user.
  
 ===== How to use it ===== ===== How to use it =====
  
-Add an action link in you template+  - Add an action link in you template <code><a href="<?php wl($ID, 'do=mypage')?>" class="action mypage" rel="nofollow" accesskey="m">My page</a></code
- +  Create a page template for the page "My page"\\ Two options
-  <a href="<?php wl($ID, 'do=mypage')?>" class="action mypage" rel="nofollow" accesskey="m">My page</a> +    Create a page with the name **''mypagetemplate''**  
- +    * or a file called **''_mypage.txt''** in the ''data/pages'' directory.
-Create a page template for the page "My page": +
- +
-====== My page ====== +
- +
-Create a page with the name ''mypagetemplate'' or a file called ''_mypage.txt'' in the ''data/pages'' directory.+
  
 This example uses the [[editor]] plugin to display a list of pages edited by the current user. This example uses the [[editor]] plugin to display a list of pages edited by the current user.
  
-<file _mypage.txt>+<code dokuwiki _mypage.txt>
 ====== My page ====== ====== My page ======
  
Line 43: Line 40:
  
 {{editor>?@USER@&header&table&firsthl&desc&comments}} {{editor>?@USER@&header&table&firsthl&desc&comments}}
-</file>+</code> 
 + 
 +  * See [[:Namespace_templates]] for supported macros in the page template.\\ Some examples: @NS@, @NAME@, @USER@, @MAIL@ and @DATE@. 
 +  * As this page is only a template, you can choose to make it invisible using the ACL. 
  
-Supported macros in the page template are @NS@@NAME@, @USER@, @MAIL@ and @DATE@.+To display the personalized user page, you add ''do=mypage'' on any page URL.\\ Examples:\\ http://wiki.example.com/doku.php?id=start&do=mypage\\ 
 +http://wiki.example.com/start?do=mypage
  
 ===== Source code ===== ===== Source code =====
  
-For manual installation, save this file as 'lib/plugins/mypage/action.php'.+For manual installation, save this file as ''lib/plugins/mypage/action.php''.
  
-<file action.php>+<file php action.php>
 <?php <?php
 /** /**
Line 62: Line 63:
  */  */
  
-// must be run within Dokuwiki+// must be run within DokuWiki
 if(!defined('DOKU_INC')) die(); if(!defined('DOKU_INC')) die();
  
Line 174: Line 175:
  
         // we need the callback to work around strftime's char limit         // we need the callback to work around strftime's char limit
-        $tpl = preg_replace_callback('/%./',create_function('$m','return strftime($m[0]);'),$tpl);+        $tpl = preg_replace('/%./e','strftime($0)',$tpl);
         return $tpl;         return $tpl;
     }     }
Line 184: Line 185:
  
 ===== Comments ==== ===== Comments ====
- 
- 
plugin/mypage.1254064989.txt.gz · Last modified: 2009-09-27 17:23 by 85.228.118.248

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