Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Page & Category Menu Bars »

Possible to only display Page menu to logged in users?


  #1  
Old Jun 2, 2010, 09:36 PM
Thomas
 
87 posts · Dec 2009
Send a message via Skype™ to Thomas
I've read all the posts I could find on this and most discuss hiding pages the standard way with their "numbers" - Isn't there some kind of php insert I can add that will only show the page menu bar to logged in users?

I did find one related post and I've been fiddling with bfa_header_config.php but to no avail yet..

Thanks
Thomas
  #2  
Old Jun 3, 2010, 06:04 AM
juggledad's Avatar
juggledad
 
23,682 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Do you mean that is all you want displayed? Just the page menu bar?

It is possible, and you can do it thru CSS inserts and some php in 'The LOOP' using the class that shows up on the <body HTML and using the wordpress function to see if a user is logged in.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Jun 3, 2010, 09:25 AM
Thomas
 
87 posts · Dec 2009
Send a message via Skype™ to Thomas
Thanks Juggledad - By the way, I just made a donation and I'm planning on another this month. You've been a big help.

Thomas
  #4  
Old Jun 3, 2010, 09:46 AM
Thomas
 
87 posts · Dec 2009
Send a message via Skype™ to Thomas
I think I know what to look for now but to define it a little further, my site is a free site that stores user generated content in the form of reviews. The basic search of the reviews is outside of the registration and available to visitors but a more robust search of the reviews (and the ability to submit reviews) is only available to members (those that have registered.)

So there are limited pages available to visitors: home page, basic search, contact form, FAQ, registration, etc and I can have these links in a widget. The home page for the logged in user is the same page (as the home page for the visitor) but will have more content that is hidden between shortcodes implemented with the "members" plugin based on role as in:

[access role="subscriber"] Only subscribers can see this content! [/access]

The basic search will still be available for members but they'll typically use the "Full Search" so I don't need to worry about hiding that page or link for members. The concept is that I haven't made redundant pages, just additional pages for members.

Really the most ideal thing would be to have one menu bar that displays for visitors and another version of the menu bar that displays for members. The members bar would have all of the links in the visitors bar in addition to it's own additional links.
  #5  
Old Jun 3, 2010, 10:25 AM
juggledad's Avatar
juggledad
 
23,682 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
ok, what you want to do is doable, but will take some work. We will assume that all pages normally displayed will be teh PRIVATE pages and a subset will be PUBLIC. Before you start, make sure the menus look like you want, the text color background etc.

1) go view a page then view the source of the page. Find the code that starts <div id="menu1"> and copy everything to the ending </div> to a text editor.
2) remove all the PRIVATE pages and sub pages so this only has the PUBLIC pages.
3) change the <div id="menu1"> to <div id="public_menu">
4) add this code (from the <div id="public_menu"> to the </div>) to ATO->Style & edit HEADER AREA->Configure Header Area right after the %pages
at this point, if you visit the site, you will see two page menu bars but the second looks odd.
5) go back and view the page source and copy it all to a text document. delete everything that isn't part of the CSS, then delete any css that doesn't have 'menu1' as part of the selector. I came up with about 107 lines including some blank lines. Doing this will give you all teh CSS styling for teh ID 'menu1'
6) do a global replace of 'menu1' with 'public_menu
7) add all of that to the CSS Inserts
8) add the following to the CSS Inserts
HTML Code:
#menu1 {display:none;}
body.logged-in #menu1 {display:block;}
body.logged-in #public_menu {display:none;}
at this point if you are not logged in, you will only see the public menu, if you are logged in you will see the normal menu not the public menu.

One Cavaet - If someone knows enough to look at teh source of the page, the will see the html for both menu's and can get the page links. If you want to prevent that, then you will have to dig into the code and construct the menu via PHP
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #6  
Old Jun 3, 2010, 11:16 AM
Thomas
 
87 posts · Dec 2009
Send a message via Skype™ to Thomas
Thanks Juggledad - I'm going to try this today. Is this process in any way helped by the "Members" plugin that restricts page access based on user role? In my case it's Administrator, Subscriber, or Visitor.

I have attached the Members plugin documentation which is members.html if you wanted to take a peek at that and also an image snippit of the role access checkboxes at the bottom of each of my pages (added by the Members plugin)

Thanks
Thomas
Attached Thumbnails
Click image for larger version

Name:	access.png
Views:	511
Size:	8.1 KB
ID:	518  
__________________
Hotels-Onsale.com - The Latest Breaking Discounted Hotel Rates on Over 118,000 Hotels Along With Thousands of Traveler Reviews
  #7  
Old Jun 3, 2010, 11:25 AM
Thomas
 
87 posts · Dec 2009
Send a message via Skype™ to Thomas
I'm not sure if the documentation came over - Here's a site that has it displayed - It looks like the same information..

http://digitalliteracyproject.com/members_readme.html

The documentation is an html readme file in the install at http://justintadlock.com/archives/20...rdpress-plugin
__________________
Hotels-Onsale.com - The Latest Breaking Discounted Hotel Rates on Over 118,000 Hotels Along With Thousands of Traveler Reviews
  #8  
Old Jul 5, 2010, 02:54 AM
mediamaveric
 
2 posts · May 2010
This is the real way to do it and it works like a charm.

I looked through dozens of forums and tried everything, and finally found the solution that worked at http://pixopoint.com/forum/index.php?topic=561.0

If you're logged in and have the capability to view a private page, it shows up in the menu ... otherwise the page is not visible in the menu.

For those interested, the change is in wp-includes/post.php in the function get_pages() ...

Original:
Code: [Select]
$query = "SELECT * FROM $wpdb->posts $join WHERE (post_type = 'page' AND post_status = 'publish') $where ";

Modified (or added right after):
Code: [Select]
$query = "SELECT * FROM $wpdb->posts $join WHERE (post_type = 'page' AND " . get_private_posts_cap_sql('page') . ") $where ";
I'm going to take a look at a nightly build from 2.7 and see if the fix is included.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Comments link not showing when not logged in sargemarcori Forum How-To 1 Jun 2, 2010 04:27 PM
ecommerce users how do you organize Athena account2 eCommerce & Atahualpa 1 May 9, 2010 02:15 AM
[SOLVED] I need page menu bar area to display on only certain pages donlebi Header configuration & styling 7 Apr 9, 2010 05:04 PM
child categories of menu bar are underneath first post's swf for mac users... voodoo Page & Category Menu Bars 0 Feb 19, 2010 09:19 AM
Is there a "Logged In" timeout for the Forum? Shepherd Jim Forum How-To 4 Mar 24, 2009 10:21 AM


All times are GMT -6. The time now is 04:00 PM.


Powered by vBulletin® Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.