Login     Sign up
Hiding Menu bar from Guests
Thakim (@thakim83)
Join date: Oct 8th 2010
Community posts: 87
View Profile
Send Message

How do I hide my menu from guests but only logged in members can see the menu that is the> Browse, News Feed, Phots, Blogs,Videos

174 months ago
Jcow Master (@falcone)
Join date: Sep 2nd 2010
Community posts: 917
View Profile
Send Message

in your phpmyadmin, table jcow_menu

in all menu's of the type community, set the field protected to 1. then in your admin area you can set who can see this pages

174 months ago
Thakim (@thakim83)
Join date: Oct 8th 2010
Community posts: 87
View Profile
Send Message

how do i set who can see the pages?

174 months ago
Ian (@eeji)
Join date: Aug 3rd 2010
Community posts: 107
View Profile
Send Message

or you can edit the code in /themes/yourtheme/page.tpl.php

find:
[code]<div id="jcow_community_menu">
<ul class="menu">
<?php
echo '<li '.check_menu_on('home/index').'>'.url(uhome(),t('Home')).'</li>';
if (is_array($community_menu)) {
foreach ($community_menu as $item) {
echo '<li '.check_menu_on($item['path']).'>'.url($item['path'],t($item['name'])).'</li>';
}
}
?>
</ul>
</div>[/code]

Replace with:
[code]<? if ($client['id']) {
echo '
<div id="jcow_community_menu">
<ul class="menu">
<li '.check_menu_on('home/index').'>'.url(uhome(),t('Home')).'</li>';
if (is_array($community_menu)) {
foreach ($community_menu as $item) {
echo '<li '.check_menu_on($item['path']).'>'.url($item['path'],t($item['name'])).'</li>';
}
}
echo '
</ul>
</div>';
}?>[/code]

174 months ago
Jcow Master (@falcone)
Join date: Sep 2nd 2010
Community posts: 917
View Profile
Send Message

http://your-url/index.php?p=admin/permissions

all menu items with the protected field set to 1 will show up. Just check the checkboxes for every role that has permission to view the menu item

174 months ago
Thakim (@thakim83)
Join date: Oct 8th 2010
Community posts: 87
View Profile
Send Message

I have upgraded to 4.1 and I have tried to change the menu and hide it from guest as earlier but I cant find the code. Please help

174 months ago
John Lawrence (@vthing)
Join date: Dec 16th 2010
Community posts: 9
View Profile
Send Message

anyone know how to do this on the facebook theme? ive tried using the script above and it just removes the menu all together

170 months ago
Alex Neave (@alexn)
Join date: Dec 17th 2010
Community posts: 10
View Profile
Send Message

[quote=vthing]anyone know how to do this on the facebook theme? ive tried using the script above and it just removes the menu all together[/quote]

I use the Facebook theme & the most efficient way to do this is by the PHPmyadmin method that falcone mentioned above.

When in phpmyadmin, click on your jcow database file in left panel, when your database file appears scroll down till you find "jcow_menu" click on this, when tables load in right panel, scroll across until you come to a column called protected. If you enter a value of 1 into every row of the field you want to make for members only, the tabs will be removed for logged out viewers.

Example: say I want to make photos for members only, I scroll to, in my case ID#5 I click edit, then enter 1 in protected field row, then press go. This tab is now for members only and will not appear to logged out viewers.

I'm sure there is a more permanent way, or proper way to do this, but this worked for me.

170 months ago
AL (@switch48)
Join date: Sep 1st 2010
Community posts: 450
View Profile
Send Message

thats what it is for what effect are you looking for???

170 months ago
AL (@switch48)
Join date: Sep 1st 2010
Community posts: 450
View Profile
Send Message

Only problem with that method is that if admin adds modules to site it resets settings and you will have to redo it again..

170 months ago
AL (@switch48)
Join date: Sep 1st 2010
Community posts: 450
View Profile
Send Message

for Facebook theme

Find this in your page.inc.php file

[code]
echo '<li '.check_menu_on('home/index').'>'.url(uhome(),t('Home')).'</li>';

if (is_array($community_menu)) {

foreach ($community_menu as $item) {

    echo '<li '.check_menu_on($item['path']).'>'.url($item['path'],t($item['name'])).'</li>';

}

}
[/code]

and change to this

[code]
if ($client['id']) {

echo '<li '.check_menu_on('home/index').'>'.url(uhome(),t('Home')).'</li>';

if (is_array($community_menu)) {

foreach ($community_menu as $item) {

    echo '<li '.check_menu_on($item['path']).'>'.url($item['path'],t($item['name'])).'</li>';

}

}
}
[/code]

170 months ago
John Lawrence (@vthing)
Join date: Dec 16th 2010
Community posts: 9
View Profile
Send Message

Im guessing you mean page.tpl.php as theres no lines in page.inc that match that. everytime i add the above code then try to view the page errors just keep coming up, and I cant even load up my phpmyadmin when i type in the url above i just get a white page

170 months ago
1 2 Next