Not logged in. · Lost password · Register
Forum: General Help and Support Templates and Layout Template Wishlist RSS
"Closed wiki"-feature in actual dokuwiki-template
Avatar
virk #1
Member since Aug 2008 · 631 posts · Location: Aachen, Germany
Group memberships: Members
Show profile · Link to this post
Subject: "Closed wiki"-feature in actual dokuwiki-template
I like this feature in vector-template and would like to see it in dokuwiki-template, too. As soon as this feature is implemented, we could use dokuwiki for as well our homepage - visitors do not need to log in but cannot do anything but reading - and for our internal purposes. Of course this could also be done by acl settings but it will not be nice, if the visitor sees buttons which he cannot make use of.
Kind regards from Aachen, Germany
Heiner
Avatar
turnermm (Moderator) #2
Member since Oct 2009 · 4696 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
You can check for $_SERVER['REMOTE_USER'], which tells you if a user is logged in.  The following, for instance, will conceal all the action links except "back to top" in the new dokuwiki template.  Search the forum for _SERVER['REMOTE_USER'] for other examples and explanations.

       <?php
                        if ($_SERVER['REMOTE_USER']) {
                            tpl_action('edit',      1, 'li', 0, '<span>', '</span>');
                            tpl_action('revert',    1, 'li', 0, '<span>', '</span>');
                            tpl_action('revisions', 1, 'li', 0, '<span>', '</span>');
                            tpl_action('backlink',  1, 'li', 0, '<span>', '</span>');
                            tpl_action('subscribe', 1, 'li', 0, '<span>', '</span>');
                         }
                            tpl_action('top',       1, 'li', 0, '<span>', '</span>');
      ?>

These types of links and buttons will be found in either main.php or the above in tp_header.php, depending on your template.
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
virk #3
Member since Aug 2008 · 631 posts · Location: Aachen, Germany
Group memberships: Members
Show profile · Link to this post
Thank you, Myron. That helped a lot. I could adjust the template "dokuwiki" into the direction I would like it to be. I'm making progress :-)
Avatar
ach (Administrator) #4
Member since May 2006 · 1931 posts · Location: Folkestone, UK
Group memberships: Administrators, Members, Super Mods, Wiki Managers
Show profile · Link to this post
In reply to post #1
As this functionality is part of the starter template, it was actually part of the dokuwiki template as well at first (because the dokuwiki template was based on the starter template). I very much liked having it there, but was unfortunately overruled to remove it again... :-/
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-09-16, 22:39:44 (UTC +02:00)