Gatekepper help...

i want my guest users don't see any informations and profiles...I am using custom_index plugin...without use walled_gaderen mode...

  • Yeah....but this plugin override to my homepage....

  • override to my homepage ... check the and change ur design ..inside the plugin

  • how to call gatekepper???

    any example..

  • You want logged-out users to see the content of the index page created by the custom_index plugin but not see the content of other pages? Have I understood you correctly?

    Then you could still use the Loginrequired plugin with some modifications. By default the Loginrequired plugin does not show the index page a logged-in user would see but displays a different index page for logged-out visitors. But you can customize what will show up on the index page for logged-out visitors easily.

    If you want exactly the same content the simply copy the content from

    mod/custom_index/index.php into mod/loginrequired/index.php and the content from

    mod/custom_index/views/default/page/layouts/custom_index.php into mod/loginrequired/views/default/page/layouts/custom_index.php.

    Then you should have the same index page both for logged-in and logged-out visitors but the access to pages like profiles will still get blocked.

  • Thanks iionly

    i have another question how to remove message options.only for friends sent message... 

  • You would have to unregister the "elgg_register_plugin_hook_handler('register', 'menu:user_hover', 'messages_user_hover_menu');" that gets added by the messages plugin and register your own. Basically, your custom handler would be almost the same with the exception that you check if the logged-in user is a friend of the other user within the handler's callback function where the menu item is registered - no friend resulting in no menu entry getting registered. Then the "Send Message" will no longer show up in the hover menu or on the profile pages of users you are not a friend of.

    Also, you could add a plugin hook for the "messages/send" action (like it's done in this plugin: that also checks if a user is allowed to send a message to the other user. You might not be able to use the code of the "messages_block_friends_only" plugin hook within the Messages control plugin directly because it was written for Elgg 1.7. But there shouldn't be much changes necessary (if only re-using this part of the plugin in your own plugin).