Activity for logged in user only on Elgg 1.8.11

Hi, everyone here. Are you know how to make activity accessible for logged in user only. I know about using of gatekeeper();

But I can't find which mod that handle activity onn Elgg 1.8.11. I have searching on Google, but what I found can't be applied on Elgg 1.8.11 

  • @Cim: I place your script on bottom of my engine/start.php and it now work.. Thank you :)

    Bad move:


    Use a plugin, hook into the 'route', 'activity' plugin hook, do your check there and redirect as necessary.

  • Btw, anyone here..
    Are you know what cause this error? I get it from my error_log
    [02-Jan-2013 06:16:59 UTC] PHP WARNING: 2013-01-02 01:16:59 (EST): "Invalid argument supplied for foreach()" in file /home/blabla/public_html/engine/lib/elgglib.php (line 713)
    I got many this error happened every time with the time range between each error about 10-25 minutes.
    But i did not found any error on my site. 

  • @Matt: o.O
    I can't find a plugin that work as I expected, any recommendation? 

  • Re: your php warning - it's a core bug fixed in the next release.  Nothing to worry about though, it's just adding to your logs nothing more.

    Re: plugin - I didn't say there was a plugin that did this already, I was suggesting you create one to do your forwarding instead of modifying core.  I was pointing you in the right direction as to how to do it using a plugin.  I assumed since you were adding code to core files that you must have some competency with code itself and that you just needed assistance doing it the elgg way.


  • @Matt: Really? Glad to hear that XD
    Ou.. =.="
    I can't create a plugin by my self yet, maybe one day after learn the php I can..
    For now, I will use the method above until someone can have another idea. It was an tidypics error, so I cover it by this way.

  • @DRAFHA you can create a plugin with only just start.php and the plugin's xml file, download a plugin called "disable more" in the plugins page and change the xml to whatever plugin name you want. then in the start.php of that plugin you can change the function name to whatever you wanna call the plugin. that plugin is the most lightweight plugin ever, you can paste my little code i gave you in there instead of engine/start.php

  • @DC: You can try this simple elgg plugin tutorial and replace the code inside the init() with 

    if((elgg_get_context() == 'activity') && !elgg_is_logged_in()) {

  • Inside the init()?
    Nothing inside the init()
    elgg_register_event_handler('init', 'system', 'jQueryCDN_init');
    function jQueryCDN_init() {
    // Unregister Elgg's Jquery
    // Register CDN jQuery
    elgg_register_js('jquery-cdn', '', 'head');
    // Load CDN jQuery
    // Unregister Elgg's Jquery UI
    // Register CDN jQuery UI
    elgg_register_js('jquery-ui-cdn', '', 'head');
    // Load CDN jQuery UI

  • @TW: ;-)

    RE: Team Webgalli 48 minutes ago
    @DC: You can try this simple elgg plugin tutorial and replace the code inside the init() with
        if((elgg_get_context() == 'activity') && !elgg_is_logged_in()) {

    In the english language idioms this is called
    ' barking up the wrong tree ' lolz ;-P
    it is little drafha who's looking for the tips and handholding teehee!:
    and here yew are teaching grandfather ?
    guess its your joke of the new year !;oO 
    yeh drafha ke baccha to php code bahut kam jaante hain !;-P
    kucch sikhaa dena.