Welcome Guest [Log In] [Register]
We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Multiquote (on) Multiquote (off)
Add Reply
Hide menu from guests code help
Topic Started: Dec 10 2011, 06:10 PM (17,439 Views)
BettiePage-ZNS
Member Avatar
Member
[ * ]
I hope that I can explain this right, I am currently using this code to hide my submenu from guests.

Code: HTML
 

<script>var userlink = $('#top_info a:first').text();if(userlink=="[Log In]"){ $('#submenu').hide();}</script>


I am making a new theme that uses this menu code to replace most of the links that are currently in the submenu with the exception of one link that is to a web page that I use for my chat room.

Code: HTML
 

<script type='text/javascript'>
var listroll = ""
var dmenu = [
[" Member Tools"],
["Recent Posts","URL"],
["Calendar","URL"],
["Member List","URL"],
["Groups","URL"],
["Blogs","URL"],
["FAQ","URL"],
["Search","URL"]];
listroll+="<li id='dmenu'><a href='"+dmenu[0][1]+"'>"+dmenu[0][0]+"</a><ul>";
for(i=1;i<dmenu.length;i++){
listroll+="<li><a href='"+dmenu[i][1]+"'>"+dmenu[i][0]+"</a></li>";
};
listroll+="</ul></li>";
$('#top_menu').append(listroll)
</script>


I would like to keep that link hidden to guests, but once I remove the old submenu the hide submenu script will be rendered useless.

So, how can I hide the link from guests and where can I put it. I was thinking maybe in the top menu. If you want, I can provide a screenshot of what the header of the theme looks like so you can visualize what I mean.

Thoughts, suggestions ??? Help ?
Here is what the new header will look like when logged in

Posted Image

The submenu links along the bottom is now called "member tools" and moved into the top menu. I want to move the remaining link that is not in the member tools dropdown up into the top menu and hide it from guests and remove the submenu altogether. I am also open to suggestions to make the top area look nicer as I am not totally happy with it now.

I am on a timeline with this and need to complete the theme before Christmas. Thanks for any help.
Edited by BettiePage-ZNS, Dec 11 2011, 07:34 AM.
Offline Profile Quote Post Goto Top
 
Mwr247
Member Avatar
Cęsaris Salutis!
[ *  *  *  * ]
So are you trying to hide all the submenu links from guests still, or just the chatroom one?
Offline Profile Quote Post Goto Top
 
BettiePage-ZNS
Member Avatar
Member
[ * ]
Just the chat room one. I want to add it to the top menu where all the other links are, but want to hide that link from guests only.
Offline Profile Quote Post Goto Top
 
Quozzo-ZNS
Member Avatar
Member
[ *  * ]
Code:
 
if($('#menu_pm').length){
$('#top_menu').append("<li><a href='#'>Chat Room</a></li>");
};

or better yet
Code:
 
<script type='text/javascript'>
var listroll = ""
var dmenu = [
[" Member Tools"],
["Recent Posts","URL"],
["Calendar","URL"],
["Member List","URL"],
["Groups","URL"],
["Blogs","URL"],
["FAQ","URL"],
["Search","URL"]];
listroll+="<li id='dmenu'><a href='"+dmenu[0][1]+"'>"+dmenu[0][0]+"</a><ul>";
for(i=1;i<dmenu.length;i++){
listroll+="<li><a href='"+dmenu[i][1]+"'>"+dmenu[i][0]+"</a></li>";
};
if($('#menu_pm').length) listroll += "<li><a href='#'>Chat Room</a></li>";
listroll+="</ul></li>";
$('#top_menu').append(listroll)
</script>

change the URL in the link in the list.
Offline Profile Quote Post Goto Top
 
BettiePage-ZNS
Member Avatar
Member
[ * ]
Quozzo to the rescue!!!!! WhooHoo!!! This is sweet, thank you Q :hug: . You da man! B=)
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · ZetaBoards - Theme & Code Support · Next Topic »
Add Reply