CritiKiL
Active member
This is what you've helped me do with the Pages.php script (w/edits):
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('clancast', 'kilplixtv', 'clankill_tv', 'ufreqtv')))
{
$section = 'media';
}
else if (in_array($request->getParam('node_name'), array('warroom-1', 'pws-1', 'ezStats2')))
{
$section = 'xboxlive-leaderboard';
}
else if (in_array($request->getParam('node_name'), array('psngames', 'psnplayers')))
{
$section = 'xboxlive-leaderboard';
}
else if (in_array($request->getParam('node_name'), array('useralbums', 'useralbums/create', 'useralbums/own')))
{
$section = 'media';
}
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');
}
}