member-only mennu option (another core.php hack)

Forums Forums Menus member-only mennu option (another core.php hack)

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #844
    booobooo
    Member

    Editing the core file to make a page/category hybrid drop down emboldened me to try something else for another site: A menu option that only appears for registered users. I won’t bother linking since it won’t look like anything to non-members of the site but I made line 122 of core.php look like this:

    function custom4()  {if ( is_user_logged_in()) {echo    get_option(‘suckerfish_custommenu4’)    ;}} // THIS MAKES CUSTOM 4 A LOG-IN ONLY DROP DOWN…

    So custom 4 is now a members-only field that I have some special ‘insider’ sections listed in. Of course, those sections have some additional privacy added to them with other plugins (wp-private, simple:press forum).

    It strikes me that this might be a feature that you could add easily in the future if you wanted…

    #6327
    booobooo
    Member

    I changed it to this:

    function custom4()  {if ( is_user_logged_in()) {echo    get_option(‘suckerfish_custommenu4’) . ‘<li class="cat-item"><a href="’ . wp_logout_url() . ‘" title="Logout"><strong>Logout</strong></a></li></ul>    ‘;}} // THIS MAKES COUSTOM 4 A LOG-IN ONLY DROP DOWN…

    I had to leave the final </ul> out of the custom 4 field so I could close it here instead but now there’s a nice log-out feature at the end of the members-only drop down.

    #6328

    Excellent! This is a great idea and I’ll incorporate this feature into a new plugin I’m working on. I’ll add support for this in ALL of the custom code options and when a checkbox is ticked it will make that custom code box only visible to logged in users.

    #6329

    I’ve now added this feature into a test version of a new plugin I intend to release.

    #6330
    booobooo
    Member

    Sweet! Is it a different plug-in entirely or an update to the dropdown menu plugin?

    #6331

    It’s an entirely new plugin. I’ll be providing a smooth path to transition from the Multi-level Navigation plugin to the new one though. The new plugin is not only for multi-level menus, hence the name change. I’ll continue supporting the current plugin with updates for the foreseeable future though.

    #6332
    stickyshift
    Member

    Iwe been wondering something around that. How can i make certain parts only accessible for members with this menu? So when im not logged in, i can only see the item on the menu. But when i log in, i will be able to see and access the sub menus on that item.

    #6333

    You need to write a PHP script which checks whether the user is logged in and then loads an extra chunk of the menu accordingly.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.