How to enable special pages only for logged user

Use this forum to ask questions about how to do things in GuMax skin.
Post Reply
User avatar
pirlouit
Rank 0
Rank 0
Posts: 4
Joined: November 30th, 2007, 5:46 am

How to enable special pages only for logged user

Post by pirlouit »

As in the title, does anybody could help me to do this?
I want to show "Special Pages" link only for registered member who has logged in .
I'm using gumax-3-3 skin.
Thank you :D
User avatar
Paul
Development Team Leader
Development Team Leader
Posts: 1132
Joined: October 20th, 2007, 2:23 pm

Re: How to enable special pages only for logged user

Post by Paul »

I'm not sure what you want. Do you mean you only allow special pages be accessed by logged user or the special pages only will only show for logged user?
User avatar
pirlouit
Rank 0
Rank 0
Posts: 4
Joined: November 30th, 2007, 5:46 am

Re: How to enable special pages only for logged user

Post by pirlouit »

I mean "special pages" link only visible for logged user, and guest can't see or access "special pages"
User avatar
Paul
Development Team Leader
Development Team Leader
Posts: 1132
Joined: October 20th, 2007, 2:23 pm

Re: How to enable special pages only for logged user

Post by Paul »

If it is just invisible for guest, it is easy to do it by modifying the GuMax.php, however any user can access the page through the url. If it only can be accessed by logged user. The skin cannot do that, you need an extension.
User avatar
pirlouit
Rank 0
Rank 0
Posts: 4
Joined: November 30th, 2007, 5:46 am

Re: How to enable special pages only for logged user

Post by pirlouit »

yes it is hidden for guest, may I know how to put the modified code ? sorry I just newbie :D
User avatar
Paul
Development Team Leader
Development Team Leader
Posts: 1132
Joined: October 20th, 2007, 2:23 pm

Re: How to enable special pages only for logged user

Post by Paul »

Open GuMax.php, you will find code like this:

Code: Select all

if($this->data['loggedin']==1)
Use this code inside section below to check for the special page.

Code: Select all

<div id="gumax-personal-tools">
User avatar
pirlouit
Rank 0
Rank 0
Posts: 4
Joined: November 30th, 2007, 5:46 am

Re: How to enable special pages only for logged user

Post by pirlouit »

I have checked the code, and found this code :

Code: Select all

if($this->data['loggedin']==1)
already listed on <div id="gumax-personal-tools">

Code: Select all

    <!-- =================== gumax-page-footer =================== -->
    <div id="gumax-page-footer">
        <!-- personal tools  -->
        <div id="gumax-personal-tools">
            <ul>
            <?php if($this->data['loggedin']==1) { ?>
              <?php if($this->data['notspecialpage']) { foreach( array( 'whatlinkshere', 'recentchangeslinked' ) as $special ) { ?>
              <li id="t-<?php echo $special?>"><a href="<?php
                echo htmlspecialchars($this->data['nav_urls'][$special]['href'])
                ?>"><?php echo $this->msg($special) ?></a></li>
              <?php } } ?><?php if($this->data['feeds']) { ?>
                  <li id="feedlinks"><?php foreach($this->data['feeds'] as $key => $feed) {
                  ?><span id="feed-<?php echo Sanitizer::escapeId($key) ?>"><a href="<?php
                  echo htmlspecialchars($feed['href']) ?>"><?php echo htmlspecialchars($feed['text'])?></a>&nbsp;</span><?php } ?></li> <?php } ?>
              <?php foreach( array('contributions', 'blockip', 'emailuser', 'upload', 'specialpages') as $special ) { ?> <?php
                  if($this->data['nav_urls'][$special]) {?><li id="t-<?php echo $special ?>"><a href="<?php
                  echo htmlspecialchars($this->data['nav_urls'][$special]['href'])
                  ?>"><?php $this->msg($special) ?></a> <?php
                     // if($special != 'specialpages') echo "|" ?> </li>
                <?php } ?>
              <?php }

                if(!empty($this->data['nav_urls']['permalink']['href'])) { ?>
                        <li id="t-permalink"><a href="<?php echo htmlspecialchars($this->data['nav_urls']['permalink']['href'])
                        ?>"><?php $this->msg('permalink') ?></a></li><?php
                } elseif ($this->data['nav_urls']['permalink']['href'] === '') { ?>
                        <li id="t-ispermalink"><?php $this->msg('permalink') ?></li><?php
                }
                wfRunHooks( 'MonoBookTemplateToolboxEnd', array( &$this ) ); ?>

            <?php } ?>
            </ul>
        </div>
        <!-- end of personal tools  -->
Could you inform me, how code need to be update..
User avatar
Paul
Development Team Leader
Development Team Leader
Posts: 1132
Joined: October 20th, 2007, 2:23 pm

Re: How to enable special pages only for logged user

Post by Paul »

My new skin GuMax 3.3 already has this feature.
Post Reply