Advertisement:

Author Topic: How to hide something from guest?  (Read 876 times)

Offline fanSte-

  • Semi-Newbie
  • *
  • Posts: 37
How to hide something from guest?
« on: May 01, 2012, 01:43:07 PM »
How to hide something from guest
Code: [Select]
<div id="nav">
',template_menu(),'
</div>
<a class="ucp" href="http://summer-life.info/ucp/"></a>
</div>
<div id="userinfo">';
Quote
<a class="ucp" href="http://summer-life.info/ucp/"></a>
This is my code, how to hide it from guests?

Offline K@

  • Lead Support Specialist
  • SMF Master
  • *
  • Posts: 46,164
  • Gender: Male
  • Yum!
Re: How to hide something from guest?
« Reply #1 on: May 01, 2012, 03:14:36 PM »
Something like...

   if ($context['user']['is_guest'])
      redirectexit('action=login');

 ???

Offline fanSte-

  • Semi-Newbie
  • *
  • Posts: 37
Re: How to hide something from guest?
« Reply #2 on: May 01, 2012, 06:37:40 PM »
-.- nothing

Offline fanSte-

  • Semi-Newbie
  • *
  • Posts: 37
Re: How to hide something from guest?
« Reply #3 on: May 06, 2012, 01:08:28 PM »
Refresh

Offline Storman™

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 2,027
Re: How to hide something from guest?
« Reply #4 on: May 07, 2012, 04:51:12 AM »
Quote
-.- nothing

K@ made a suggestion so did it not work for you ?
Any Backup method is bettter than no Backup method....

Offline Colin

  • Customizer
  • SMF Hero
  • *
  • Posts: 6,575
  • Gender: Male
  • SMF Customizer
    • colinschoen on GitHub
Re: How to hide something from guest?
« Reply #5 on: May 07, 2012, 09:32:23 AM »
Will you copy and paste the entire code you have on that page including the PHP snippet K@ gave you.
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.