Site loads the default index and then the plugin index

Does anyone know how to stop the default index (login box, ect) loading and then the plugin loading on top of it? When the browser loads or you refresh the page you can see the default login box load and then dissapear and be replaced with the index page I made.

Any help would be appreiciated.

 

Thanks,

Vaughan

  • Are you returning true for the custom index hook?

  • Here's what I've got, should make it easier.

     

    <?php

    function mcsindex_init() {
    // Replace the default index page
    elgg_register_plugin_hook_handler('index', 'system', 'new_index');
    }

    function new_index() {
    if (!include_once(dirname(dirname(__FILE__)) . "/mcsindex/pages/index.php"))
    return false;

    return true;
    }

    // register for the init, system event when our plugin start.php is loaded
    elgg_register_event_handler('init', 'system', 'mcsindex_init');
    ?>