With hook I know myself not like. Therefore, this approach.
Create the following files
root/sources/controllers/MyPage.controller.php
<?php
/**
* Handles the moving of topics from board to board
*
* @name ElkArte Forum
* @copyright ElkArte Forum contributors
* @license BSD http://opensource.org/licenses/BSD-3-Clause
*
* This software is a derived product, based on:
*
* Simple Machines Forum (SMF)
* copyright: 2011 Simple Machines (http://www.simplemachines.org)
* license: BSD, See included LICENSE.TXT for terms and conditions.
*
* @version 1.0
*
*/
if (!defined('ELK'))
die('No access...');
class MyPage_Controller extends Action_Controller
{
/**
* Default action handler: just help.
*
* @see Action_Controller::action_index()
*/
public function action_index()
{
$this->action_mypage();
}
/**
* Prepares the help page.
* Uses Help template and Manual language file.
* It is accessed by ?action=help.
*/
public function action_mypage()
{
global $txt, $context, $language, $scripturl;
loadTemplate('MyPage');
loadLanguage('Addons');
// Build the link tree.
$context['linktree'][] = array(
'url' => $scripturl . '?action=mypage',
'name' => $txt['mypage_page'],
);
// Lastly, set up some template stuff.
$context['page_title'] = $txt['mypage_page'];
}
}
root/themes/default/MyPage.template.php
<?php
/**
* @name ElkArte Forum
* @copyright ElkArte Forum contributors
* @license BSD http://opensource.org/licenses/BSD-3-Clause
*
* This software is a derived product, based on:
*
* Simple Machines Forum (SMF)
* copyright: 2011 Simple Machines (http://www.simplemachines.org)
* license: BSD, See included LICENSE.TXT for terms and conditions.
*
* @version 1.0
*
*/
function template_main()
{
global $context, $txt;
// your content
echo '
<div class="wrapper">
<h2>', $txt['mypage_content'], '</h2>
</div>';
}
open root/sources/SiteDispatcher.class.php
find
'movetopic2' => array('MoveTopic.controller.php', 'MoveTopic_Controller', 'action_movetopic2'),
add after
'mypage' => array('MyPage.controller.php', 'MyPage_Controller', 'action_mypage'),
open root/sources/Subs.php
find
'register' => array(
'title' => $txt['register'],
'href' => $scripturl . '?action=register',
'data-icon' => '',
'show' => $user_info['is_guest'] && $context['can_register'],
),
add after
'mypage' => array(
'title' => $txt['mypage_page'],
'href' => $scripturl . '?action=mypage',
'data-icon' => '',
'show' => true,
),
open root/themes/default/language/english/Addons.english.php
add
//MyPage
$txt['mypage_page'] = 'My Page';
$txt['mypage_content'] = 'My content';
'data-icon' => '', More icons => http://fortawesome.github.io/Font-Awesome/cheatsheet/