remove all content_actions for people not loged in?

Use this forum to ask questions about how to do things in GuMax skin.

remove all content_actions for people not loged in?

Postby aapezzuto » April 2nd, 2008, 1:13 pm

I have found the section in GuMax.php
Code: Select all
    <div id="gumax-content-actions">
        <ul>
            <?php $lastkey = end(array_keys($this->data['content_actions'])) ?>
            <?php foreach($this->data['content_actions'] as $key => $action) if($this->data['loggedin']==1) { ?>
               <li id="ca-<?php echo Sanitizer::escapeId($key) ?>" <?php
                   if($action['class']) { ?>class="<?php echo htmlspecialchars($action['class']) ?>"<?php } ?>
               ><a href="<?php echo htmlspecialchars($action['href']) ?>"><?php
                   echo htmlspecialchars($action['text']) ?></a> <?php
                   // if($key != $lastkey) echo "&#8226;" ?></li>
            <?php } ?>
        </ul>
    </div>


But I dont see how that is leaving some content_actions and not others... is there an array somewhere that I am not finding?

I want to hide everything in the content actions group from users who are not logged in.
User avatar
aapezzuto
Rank 0
Rank 0
 
Posts: 3
Joined: March 26th, 2008, 2:05 pm

Re: remove all content_actions for people not loged in?

Postby Paul » April 2nd, 2008, 11:38 pm

Move this: if($this->data['loggedin']==1) outside of the <div id="gumax-content-actions">, it will do the job.

It will look similar like this:

<?php if($this->data['loggedin']==1) { ?>

<div id="gumax-content-actions">
......
</div>

<?php } ?>

That's it.
User avatar
Paul
Development Team Leader
Development Team Leader
 
Posts: 1132
Joined: October 20th, 2007, 2:23 pm

Re: remove all content_actions for people not loged in?

Postby aapezzuto » April 3rd, 2008, 12:34 am

You have some strange magical css power... What a strange super hero you are!
User avatar
aapezzuto
Rank 0
Rank 0
 
Posts: 3
Joined: March 26th, 2008, 2:05 pm

Re: remove all content_actions for people not loged in?

Postby Paul » April 3rd, 2008, 8:04 am

Thank you. :D
User avatar
Paul
Development Team Leader
Development Team Leader
 
Posts: 1132
Joined: October 20th, 2007, 2:23 pm

Re: remove all content_actions for people not loged in?

Postby mediawikinewb » January 12th, 2012, 3:17 am

Im not sure I understand Paul, sorry to open an old topic. I have tried to figure this out and I can not seem to hide the gumax-content-actions tab "pages" for anonymous users. If I remove everything between <gumax-content-actions Begin> and <end> it removes it, but then users logged in can not edit pages as the edit tab becomes missing. I am using mw v1.16 and gumax v3.4.5
User avatar
mediawikinewb
Rank 0
Rank 0
 
Posts: 2
Joined: January 12th, 2012, 2:58 am

Re: remove all content_actions for people not loged in?

Postby Paul » January 12th, 2012, 6:27 pm

Here is the change for GuMax 3.4.5

Find this in GuMax.php:
Code: Select all
<!-- gumax-content-actions -->
<?php //if($this->data['loggedin']==1) { ?>
...
<?php //} ?>


You will see the code is there, just remove the "//" and it will look like this:

Code: Select all
<?php if($this->data['loggedin']==1) { ?>
...
<?php } ?>


or use the attachment to replace the origin file
Attachments
GuMax.zip
(5.98 KiB) Downloaded 277 times
User avatar
Paul
Development Team Leader
Development Team Leader
 
Posts: 1132
Joined: October 20th, 2007, 2:23 pm

Re: remove all content_actions for people not loged in?

Postby mediawikinewb » January 12th, 2012, 11:31 pm

Paul, I tried out your response when I recieved it. It worked great! I have never before posted in a forum and appreciate your swift reply and professional conduct. Thank you for helping me with my problem.
User avatar
mediawikinewb
Rank 0
Rank 0
 
Posts: 2
Joined: January 12th, 2012, 2:58 am

Re: remove all content_actions for people not loged in?

Postby vagabondlives » July 14th, 2012, 10:33 am

Is it possible to hide content actions from none admin or sysop?
User avatar
vagabondlives
Rank 0
Rank 0
 
Posts: 3
Joined: May 20th, 2012, 3:01 pm

Re: remove all content_actions for people not loged in?

Postby jemozkelon » August 8th, 2012, 8:11 am

Paul wrote:Here is the change for GuMax 3.4.5

Find this in GuMax.php:
Code: Select all
<!-- gumax-content-actions -->
<?php //if($this->data['loggedin']==1) { ?>
...
<?php //} ?>


You will see the code is there, just remove the "//" and it will look like this:

Code: Select all
<?php if($this->data['loggedin']==1) { ?>
...
<?php } ?>


or use the attachment to replace the origin file



This means that for logged in users status 1 and for logged off users status 0. Binary operation.
User avatar
jemozkelon
Rank 0
Rank 0
 
Posts: 1
Joined: August 8th, 2012, 7:42 am
Location: Jersey City, NJ 07305 0, UNITED STATES


Return to GuMax 'How Do I' Questions

Who is online

Users browsing this forum: No registered users and 1 guest

cron