Hiding "Members" from not log in

searched FAQ with not much luck but, is there an easy way to hide "members" from non logged in users?? , So a Non member/logged in user can not see members??  TIA

Getting there, THANKS FOR THE AWESOME SUPPORT

  • Hi,

    Restrict pages only to logged in users. Here's a quick guide to do that:

    http://blog.arvixe.com/how-to-make-everything-private-in-elgg-1-8/

    Rodolfo Hernandez
    Arvixe/Elgg Community Liaison

  • Thanks for the fast reply.. I understand how to make the whole network private but, I really dont want to completly close it down. I am happy with the current toggles in Elgg. and I really want to keep areas open to public viewers.  At this point I just dont want a 'NON-LOGGED" to be able to see current members or members  without logging in or creating an account....

     

    TIA

  • Try using the gatekeeper() function to do that. More info here:

    http://docs.elgg.org/wiki/Gatekeeper

    Rodolfo Hernandez

    Arvixe/Elgg Community Liaison

  • Simply unregister the members page handler and reregister it with a gatekeeper()

  • OK Sounds easy enuff but, PLEASE keep in mind I am really a noob when it comes to code. this http://docs.elgg.org/wiki/Gatekeeper pretty vague for me..

    Sorry for being a pain but, thanks for the help

  • Ok,start with your first elgg plugin development

    • create a new folder insde your mod directory called "my_new_members"
    • Copy the manifest.xml and start.php from some other plugin
    • Edit the manifest.xml file to enter your plugin's name, details etc..
    • Remove the complete code from start.php and add the following code.
    • Run http://yoursite.com/upgrade.php after enabling your plugin. (Make sure your plugin is placed under the members plugin)

    Code to add in start.php

        elgg_register_event_handler('init', 'system', 'my_new_members_init');
        function my_new_members_init() {
            elgg_unregister_page_handler('members');
            elgg_register_page_handler('members', 'my_new_members_page_handler');
        }
        function my_new_members_page_handler($page) {
            gatekeeper();
            $base = elgg_get_plugins_path() . 'members/pages/members';
            if (!isset($page[0])) {
                $page[0] = 'newest';
            }
            $vars = array();
            $vars['page'] = $page[0];
            if ($page[0] == 'search') {
                $vars['search_type'] = $page[1];
                require_once "$base/search.php";
            } else {
                require_once "$base/index.php";
            }
            return true;
        }   

     

  • OK, did exactly what you said above,,  this is what I get in my plugin list>>>

     

    • my_new_members

      my_new_members is not a valid Elgg plugin. Check the Elgg documentation for troubleshooting tips.

      Location: /home1/infoweas/public_html/marketplace/mod/my_new_members/

      Error parsing manifest with API version 1.7 in plugin my_new_members.

  • You've copied from a plugin written for 1.7.x and are using it on an elgg 1.8.x environment. The manifest files are a little different.

    A suitable manifest file should look something like the following:

    <?xml version="1.0" encoding="UTF-8"?>

    <plugin_manifest xmlns="http://www.elgg.org/plugin_manifest/1.8"&gt;

    <name>Blog</name>

    <author>Core developers</author>

    <version>1.8</version>

    <category>bundled</category>

    <category>content</category>

    <category>widget</category>

    <blurb>Blog plugin</blurb>

    <description>Adds simple blogging capabilities to your Elgg installation.</description>

    <website>http://elgg.org/</website&gt;

    <copyright>See COPYRIGHT.txt</copyright>

    <license>GNU General Public License version 2</license>

    <requires>

    <type>elgg_release</type>

    <version>1.8</version>

    </requires>

    <activate_on_install>true</activate_on_install>

    </plugin_manifest>

    The above is from the blog plugin for 1.8.3 You can copy the above and edit the necessaries to fit your "my_new_members" plugin details.
  • So can I just change my current manifest or do I need to delete the other mess off my server and start from scratch..  IF I can just change the manifest, do I need to run upgrade.php again??   THANK YOU

  • well that didnt work  opps

    elgg_register_event_handler('init', 'system', 'my_new_members_init'); function my_new_members_init() { elgg_unregister_page_handler('members'); elgg_register_page_handler('members', 'my_new_members_page_handler'); } function members_page_handler($page) { gatekeeper(); $base = elgg_get_plugins_path() . 'members/pages/members'; if (!isset($page[0])) { $page[0] = 'newest'; } $vars = array(); $vars['page'] = $page[0]; if ($page[0] == 'search') { $vars['search_type'] = $page[1]; require_once "$base/search.php"; } else { require_once "$base/index.php"; } return true; }

    Fatal Error.

    Redirect could not be issued due to headers already being sent. Halting execution for security. Search http://docs.elgg.org/ for more information.