Jump to content

Photo
* * * * * 1 votes

Hide menu from non members


  • Please log in to reply
14 replies to this topic

#1 Bangash

Bangash

    Blue Team Bravo 1

  • Moderators
  • Level
  • 1,488 points
  • 1,741 posts
    • Gender:Male
    • Location:Peshawar, Pakistan
    • Software:SE 4.1.x


Users Awards

Posted 14 November 2010 - 08:07 PM

If you dont want to show menu to guests/non members then simply follow these steps.

1: open header.tpl
2: find
<ul> <li style="padding-left:10px;"><a href='user_home.php'>{lang_print id=645}</a></li>
       {* SHOW ANY PLUGIN MENU ITEMS *}
      
   {hook_foreach name=menu_main var=menu_main_args complete=menu_main_complete max=8}
     <li> <a href='{$menu_main_args.file}' >{lang_print id=$menu_main_args.title}</a></li>
 
   {/hook_foreach}
3: Replace it with
<div class='codemain'>{if $user->user_exists != 0}
     <ul> <li style="padding-left:10px;"><a href='home.php'>{lang_print id=645}</a></li>
       {* SHOW ANY PLUGIN MENU ITEMS *}
      
   {hook_foreach name=menu_main var=menu_main_args complete=menu_main_complete max=8}
     <li> <a href='{$menu_main_args.file}' >{lang_print id=$menu_main_args.title}</a></li>
 
   {/hook_foreach}
   {/if}
   </div>

4: Save & upload.

Thank You...

Im like an open book. You must meet me if u wanna read me :)


#2 HellBound

HellBound

    Level 1

  • Members
  • Level
  • 12 points
  • 21 posts

Posted 06 December 2010 - 03:09 PM

Please be more specific i tried your code and got error.

Posted Image


#3 zoldos

zoldos

    Level 7

  • Premium
  • Level
  • 266 points
  • 1,181 posts
    • Gender:Male
    • Location:the US south
    • Software:SE 4.8.x


Users Awards

Posted 19 December 2010 - 12:38 AM

Please be more specific i tried your code and got error.

What error did you get? And this can be done *without* the:

<div class='codemain'>
 ..content
 </div>

Be glad you still have your mind...and your soul...

#4 akaoshi

akaoshi

    Level 2

  • Members
  • Level
  • 7 points
  • 37 posts

Posted 12 January 2011 - 06:48 PM

If you dont want to show menu to guests/non members then simply follow these steps.

1: open header.tpl
2: find

<ul> <li style="padding-left:10px;"><a href='user_home.php'>{lang_print id=645}</a></li>
        {* SHOW ANY PLUGIN MENU ITEMS *}
       
    {hook_foreach name=menu_main var=menu_main_args complete=menu_main_complete max=8}
      <li> <a href='{$menu_main_args.file}' >{lang_print id=$menu_main_args.title}</a></li>
  
    {/hook_foreach}
3: Replace it with
<div class='codemain'>{if $user->user_exists != 0}
      <ul> <li style="padding-left:10px;"><a href='home.php'>{lang_print id=645}</a></li>
        {* SHOW ANY PLUGIN MENU ITEMS *}
       
    {hook_foreach name=menu_main var=menu_main_args complete=menu_main_complete max=8}
      <li> <a href='{$menu_main_args.file}' >{lang_print id=$menu_main_args.title}</a></li>
  
    {/hook_foreach}
    {/if}
    </div>

4: Save & upload.

Thank You...


where is the header.tpl is located ?

#5 sheikhu01

sheikhu01

    Level 2

  • Members
  • Level
  • 11 points
  • 31 posts

Posted 14 March 2011 - 10:11 PM

where is the header.tpl is located ?


Go to your socialengine admin panel

Just below the layout settings, select HTML templates

there you will find header.tpl

#6 leprakhauns

leprakhauns

    Level 4

  • Members
  • Level
  • 15 points
  • 110 posts
    • Gender:Male
    • Location:NY


Users Awards

Posted 16 March 2011 - 09:31 PM

Go to your socialengine admin panel

Just below the layout settings, select HTML templates

there you will find header.tpl


If you or someone else has done any custom coding, you would be better off opening header.tpl by downloading it and opening it with a text tool or dreamweaver, editing it and then putting it back up that way just because if you have custom PHP code in there like {php}echo "hello";{/php} or anything like that, then it will be gone once edited inside Social Engine's template editing system. If you haven't done any custom coding then you should be fine though.
LepsLair

#7 hardi

hardi

    Level 2

  • Members
  • Level
  • 14 points
  • 35 posts

Posted 28 August 2011 - 10:43 PM

thanks

#8 ILoveSE

ILoveSE

    Level 4

  • Members
  • Level
  • 14 points
  • 141 posts

Posted 20 November 2011 - 10:08 AM

Go to your socialengine admin panel

Just below the layout settings, select HTML templates

there you will find header.tpl


I still can not find header.tpl ANYWHERE !!!

PLEASE help me where is header.tpl located?


Many thanks :)

#9 ILoveSE

ILoveSE

    Level 4

  • Members
  • Level
  • 14 points
  • 141 posts

Posted 20 November 2011 - 10:28 AM

I still can not find header.tpl ANYWHERE !!!

PLEASE help me where is header.tpl located?


Many thanks :)


YAHOOoo, i have done another trick and it worked perfectly: for 4.x.x and hope will work for all versions ! just try if u like :)


Modify the file application/modules/Core/widgets/menu-main/index.tpl

and write the following instead of the code you'll find in the original.

 <?php if( $this->viewer()->getIdentity() ):
 echo $this->navigation()
 ->menu()
 ->setContainer($this->navigation)
 ->setPartial(null)
 ->render(); ?>
 
 
 <?php endif; ?>

Enjoy :ninja:

#10 MaleXachi

MaleXachi

    Level 5

  • Members
  • Level
  • 129 points
  • 326 posts
    • Gender:Not Telling


Users Awards

Posted 20 November 2011 - 03:45 PM

YAHOOoo, i have done another trick and it worked perfectly: for 4.x.x and hope will work for all versions ! just try if u like :)


Modify the file application/modules/Core/widgets/menu-main/index.tpl

and write the following instead of the code you'll find in the original.

   <?php if( $this->viewer()->getIdentity() ):
   echo $this->navigation()
   ->menu()
   ->setContainer($this->navigation)
   ->setPartial(null)
   ->render(); ?>
   
   
   <?php endif; ?>

Enjoy :ninja:


lol.. Thats for SE4, not SE3, but you can find header.tpl in: ./templates/header.tpl on FTP.

Edited by MaleXachi, 20 November 2011 - 03:46 PM.

<?php if(BeforeAsk(You) == true){
Search(You);
TryToFindOutFirst(You);
} else {DontMakeAMess();} ?>




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users


All the resources listed here are just for testing purpose and they shouldn't be used at any commercial environment without a valid license.
Those are for users who wants to try them before buy. Help the developer to build it better by purchasing them from original authors.