Unable to load the 'main' template.

Started by glennmckenna, August 21, 2016, 06:59:49 PM

Previous topic - Next topic

glennmckenna

i'm currently trying add a new page to smf.
i've currently added a link to the index page and put the page in sources.
but every time i load the page i get the same error
unable to load the 'main' template

here is a copy of the code:
function template_mainview(){

    global $scripturl, $boardurl, $txt, $context, $modSettings;


    // Permissions

    $g_manage = allowedTo('genevent');


    if ($g_manage)

    {
        echo'123';
    }elseif (file_exists(dirname(dirname(__FILE__)) . '/Settings.php'))
    {
        // Found it!
        require(dirname(dirname(__FILE__)) . '/Settings.php');
        header('Location: ' . $boardurl);
    }
// Can't find it... just forget it.
    else
        exit;
};


i'm not sure if this code is correct cause i inspired it from smf gallery and index.php in sources

Advertisement: