DRE
Well-known member
The default route when creating a page is forums. How can I change it so that the default route is arcade? I want to create over a hundred pages embedded with flash games.
For example: http://www.8thos.com/pages/icy-fishes/
^^^I made icy fishes a route of games using an edit suggested by Jake Bunce
This is the edit:
/public_html/library/XenForo/Route/Prefix/Pages.php
For example: http://www.8thos.com/pages/icy-fishes/
^^^I made icy fishes a route of games using an edit suggested by Jake Bunce
This is the edit:
/public_html/library/XenForo/Route/Prefix/Pages.php
Code:
<?php
/**
* Route prefix handler
*/
class XenForo_Route_Prefix_Pages implements XenForo_Route_Interface
{
/**
* Match a specific route for an already matched prefix.
*
* @see XenForo_Route_Interface::match()
*/
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
$request->setParam('node_name', basename($routePath));
if (in_array($request->getParam('node_name'), array('pixlr-editor', 'pixlr-express', 'pixlr-o-matic')))
{
$section = 'useralbums';
}
else if (in_array($request->getParam('node_name'), array('world-time-map', 'tinychat')))
{
$section = 'members';
}
else if (in_array($request->getParam('node_name'), array('kongregate', 'nuclear-outrun', 'icy-fishes')))
{
$section = 'arcade';
}
else
{
$section = 'forums';
}
return $router->getRouteMatch('XenForo_ControllerPublic_Page', 'index', $section);
}
/**
* Method to build a link to the specified page/action with the provided
* data and params.
*
* @see XenForo_Route_BuilderInterface
*/
public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
{
return XenForo_Link::buildBasicLinkWithStringParam($outputPrefix, $action, $extension, $data, 'node_name');
}
}