DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:userhomepage

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:userhomepage [2018-05-28 22:10] – [Installation] Klap-inplugin:userhomepage [2022-08-29 07:34] (current) – Added [userlink_icons] setting to choose image style Geekitude
Line 4: Line 4:
 description: Creates users' private namespace and/or public page and redirects them to their own private namespace on login. The pages are base on customizable templates. The current version added the public page feature, a helper and many ACL settings to cover common or uncommon usage. description: Creates users' private namespace and/or public page and redirects them to their own private namespace on login. The pages are base on customizable templates. The current version added the public page feature, a helper and many ACL settings to cover common or uncommon usage.
 author     : Simon Delage author     : Simon Delage
-email      : simon.geekitude@gmail.com +email      : sdelage@gmail.com 
-type       : Action +type       : Action  
-lastupdate : 2018-04-23 +lastupdate : 2022-08-29 
-compatible : Ponder Stibbons,Hrun,Detritus,Elenor Of Tsort,Frusterick Manners+compatible : Ponder Stibbons,Hrun,Detritus,Elenor Of Tsort,Frusterick Manners,!Greebo, Hogfather, Igor
 depends    :  depends    : 
 conflicts  conflicts 
Line 20: Line 20:
 screenshot_img : http://www.geekitude.fr/externe/dokuwiki/userhomepage/screenshot.jpg screenshot_img : http://www.geekitude.fr/externe/dokuwiki/userhomepage/screenshot.jpg
 ---- ----
 +
 +:!: if you installed this plugin before 2021-12-16, note that instructions in [[plugin:userhomepage#user_links|User Links]] section changed a bit to keep original user check.
  
 ===== Installation ===== ===== Installation =====
Line 41: Line 43:
 ===== Settings ===== ===== Settings =====
  
-:!: **Warning about Avatar plugin** : if local avatar images and UHP's private namespaces are stored in same place, UHP's ACL rules might block avatars for visitors. Consider changing eighter UHP's ['users_namespace'] or Avatar's ['namespace'] setting.+:!: **Warning about Avatar plugin** : if local avatar images and UHP's private namespaces are stored in same place, UHP's ACL rules might block avatars for visitors. Consider changing either UHP's ['users_namespace'] or Avatar's ['namespace'] setting.
  
 :!: **Warning about templates** : some templates include an option for users' pages namespace wich default doesn't correspond to what's expected in a standard Dokuwiki install and that might be a source of conflict (for example ''wiki:user''). Make sure to have the same namespace in template's and User Homepage options.\\ :!: **Warning about templates** : some templates include an option for users' pages namespace wich default doesn't correspond to what's expected in a standard Dokuwiki install and that might be a source of conflict (for example ''wiki:user''). Make sure to have the same namespace in template's and User Homepage options.\\
Line 65: Line 67:
   * **acl_all_templates** : ACL for @user group on plugin's templates if they are inside ''<dokuwiki_data>/pages'' [default : read]   * **acl_all_templates** : ACL for @user group on plugin's templates if they are inside ''<dokuwiki_data>/pages'' [default : read]
   * **no_acl** : absolutely no ACL rule will be automatically set (ACL options above will be ignored), including any protection on page templates. Rules allready set will have to be manually removed. Only enable this option if you know what you're doing and have a specific need not covered by the options above. [default : disabled]   * **no_acl** : absolutely no ACL rule will be automatically set (ACL options above will be ignored), including any protection on page templates. Rules allready set will have to be manually removed. Only enable this option if you know what you're doing and have a specific need not covered by the options above. [default : disabled]
-  * **redirection** : enable or disable redirection (note that it will however occur on page creation). [default : enabled] //(added on 2015/08/20)//+  * **redirection** : enable or disable redirection (note that it will however occur on page creation but never occur when an action page is requested). [default : enabled] //(added on 2015/08/20)//
   * **action** : choose wich action is used on redirection to public page right after it's creation between 'do=edit' and 'do=show' (or private namespace start page). [default : edit]   * **action** : choose wich action is used on redirection to public page right after it's creation between 'do=edit' and 'do=show' (or private namespace start page). [default : edit]
   * **userlink_replace** : if ''showuseras'' global option is set to show interwiki link to user's page (only public page in most cases), this option enables the replacement of the template link by link(s) to either or both or user's public page and/or private namespace. This will only work with templates that trigger the ''COMMON_USER_LINK'' event, [[plugin:userhomepage#Templates and COMMON_USER_LINK event|see below]] (many thanks to [[https://github.com/Klap-in?tab=repositories|Klap-in]] for pointing that event ^_^) [default : enabled]   * **userlink_replace** : if ''showuseras'' global option is set to show interwiki link to user's page (only public page in most cases), this option enables the replacement of the template link by link(s) to either or both or user's public page and/or private namespace. This will only work with templates that trigger the ''COMMON_USER_LINK'' event, [[plugin:userhomepage#Templates and COMMON_USER_LINK event|see below]] (many thanks to [[https://github.com/Klap-in?tab=repositories|Klap-in]] for pointing that event ^_^) [default : enabled]
-  * **userlink_classes** : wich CSS classes will be applied to the replacement link(s). Note that if User Homepage's icons don't match the template's ones, adding ''iw_user'' might fix it. [default : ''interwiki wikilink1''].+  * **userlink_classes** : wich CSS classes will be applied to the replacement link(s). [default : ''interwiki iw_user'']. 
 +  * **userlink_icons** : choose between old school png or modern svg images for replacement link(s). [default : ''png''].
   * **userlink_fa** : if enabled, this option will switch from image icons to Fontawesome icons for the links sent with ''COMMON_USER_LINK'' event. :!: Fontawesome has to be installed with your template or a plugin. [default : ''disabled''].   * **userlink_fa** : if enabled, this option will switch from image icons to Fontawesome icons for the links sent with ''COMMON_USER_LINK'' event. :!: Fontawesome has to be installed with your template or a plugin. [default : ''disabled''].
  
Line 139: Line 142:
   * **getComplexLoggedInAs()** returns an <li> element like the "Logged in as" element of Dokuwiki template with a specific style and links to both private namespace and public page (if either doesn't exist, will default to relevant more simple link above or to standard string if neither exists) {{http://www.geekitude.fr/externe/dokuwiki/userhomepage/helper_complex_loggedinas.jpg}} //(added on 2014/09/19, improved on 2014/09/20, hopefully fixed on 2015/02/03 if neither page exist)//   * **getComplexLoggedInAs()** returns an <li> element like the "Logged in as" element of Dokuwiki template with a specific style and links to both private namespace and public page (if either doesn't exist, will default to relevant more simple link above or to standard string if neither exists) {{http://www.geekitude.fr/externe/dokuwiki/userhomepage/helper_complex_loggedinas.jpg}} //(added on 2014/09/19, improved on 2014/09/20, hopefully fixed on 2015/02/03 if neither page exist)//
   * **getAnyPublicLink("any user login")** returns an interwiki-like link (colored according to page existence) to provided user's public page (main purpose is to replace ''showuseras'' interwiki link in case public pages are not stored in '':user'' namespace) //(added on 2014/02/23)//   * **getAnyPublicLink("any user login")** returns an interwiki-like link (colored according to page existence) to provided user's public page (main purpose is to replace ''showuseras'' interwiki link in case public pages are not stored in '':user'' namespace) //(added on 2014/02/23)//
-  * **getElements()** returns an array containing id and localized string to build your own links to Private Namespace Start Page and/or Public Page //(added on 2015/08/20)//+  * **getElements()** returns an array containing id, strings and CSS classe(s) to build your own links to Private Namespace Start Page and/or Public Page //(added on 2015/08/20)//. Provide a true boolean parameter to include default classes based on plugin's related setting)
  
 ==== User links ==== ==== User links ====
Line 153: Line 156:
 </code> </code>
 ...with... ...with...
-<code php>if (!plugin_isdisabled('userhomepage')) { +<code php>                        if (!empty($_SERVER['REMOTE_USER'])) { 
-    $userhomepageHelper = plugin_load('helper','userhomepage'); +                            if ((!plugin_isdisabled('userhomepage')) and ($userhomepageHelper == null)) { 
-+                                $userhomepageHelper = plugin_load('helper','userhomepage'); 
-// If User HomePage helper is loaded, replace standard 'Logged in as...' link (case where one or both pages don't exist is managed by User HomePage helper +                            
-if ($userhomepageHelper) { +                            // If User HomePage helper is loaded, replace standard 'Logged in as...' link (case where one or both pages don't exist is managed by User HomePage helper) 
-    echo $userhomepageHelper->getComplexLoggedInAs(); +                            if ($userhomepageHelper) { 
-} else { +                                echo $userhomepageHelper->getComplexLoggedInAs(); 
-    echo '<li class="user">'; +                            } else { 
-    tpl_userinfo(); /* 'Logged in as ...' */ +                                echo '<li class="user">'; 
-    echo '</li>'; +                                tpl_userinfo(); /* 'Logged in as ...' */ 
-}+                                echo '</li>'; 
 +                            } 
 +                        } 
 +</code> 
 + 
 +==== Editor/locker link ==== 
 + 
 +Dokuwiki's ''showuseras'' setting is the best way to display a link to last editor's public page in ''docInfo'' section but if you prefer a link showing editor's login instead of full name, here is a way to do it. 
 + 
 +The file to change depends on template but with //Dokuwiki template//, it would be the file ''...lib/tpl/dokuwiki/main.php''. Open it and replace this line : 
 +<code php>                <div class="docInfo"><?php tpl_pageinfo() ?></div> 
 +</code> 
 +...with... 
 +<code php>                <div class="docInfo"> 
 +                    <?php 
 +                        // If Userhomepage helper is loaded 
 +                        if ($userhomepageHelper != null) { 
 +                            $userhomepageHelper->getPageInfo(); 
 +                        // Else if Userhomepage helper is not loaded yet but enabled 
 +                        } elseif (!plugin_isdisabled('userhomepage')) { 
 +                            $userhomepageHelper = plugin_load('helper','userhomepage'); 
 +                            $userhomepageHelper->getPageInfo(); 
 +                        // Otherwise use plain text 
 +                        } else { 
 +                            tpl_pageinfo(); 
 +                        } 
 +                    ?> 
 +                </div>
 </code> </code>
  
Line 215: Line 245:
  
 {{rss>https://github.com/geekitude/dokuwiki-plugin-userhomepage/commits/master.atom date 5}} {{rss>https://github.com/geekitude/dokuwiki-plugin-userhomepage/commits/master.atom date 5}}
 +
 +See [[https://github.com/geekitude/dokuwiki-plugin-userhomepage/commits/master|Github]] for older data
  
 ===== Known Bugs and Issues ===== ===== Known Bugs and Issues =====
plugin/userhomepage.1527538207.txt.gz · Last modified: 2018-05-28 22:10 by Klap-in

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