Mattia Del Franco
Member
Hi!
I'm new to XenForo, so I don't have much experience with this platform and his plugins.
I'm trying to edit the /library/XenForo/NodeHandler/Forum.php file with a plugin (because I have many files to edit, to get a rendering depth > of 2) and in particular this function:
(I need to edit the "2" with "3").
How to achieve this with a plugin?
I'm trying following this guide: https://xenforo.com/community/threads/creating-an-addon.5416/ and I ended getting 2 files:
library/NodeLvl/XenForo/NodeHandler/NodeLvl.php
library/NodeLvl/Listener/LoadClassController.php
But nothing seems to happen, any advice?
I'm new to XenForo, so I don't have much experience with this platform and his plugins.
I'm trying to edit the /library/XenForo/NodeHandler/Forum.php file with a plugin (because I have many files to edit, to get a rendering depth > of 2) and in particular this function:
PHP:
public function renderNodeForTree(XenForo_View $view, array $node, array $permissions,
array $renderedChildren, $level
)
{
$templateLevel = ($level <= 2 ? $level : 'n');
return $view->createTemplateObject('node_forum_level_' . $templateLevel, array(
'level' => $level,
'forum' => $node,
'renderedChildren' => $renderedChildren
));
}
(I need to edit the "2" with "3").
How to achieve this with a plugin?
I'm trying following this guide: https://xenforo.com/community/threads/creating-an-addon.5416/ and I ended getting 2 files:
library/NodeLvl/XenForo/NodeHandler/NodeLvl.php
PHP:
<?php
class NodeLvl_XenForo_NodeHandler_NodeLvl extends XenForo_NodeHandler_Forum
{
public function renderNodeForTree(XenForo_View $view, array $node, array $permissions,
array $renderedChildren, $level
)
{
$templateLevel = ($level <= 3 ? $level : 'n');
return $view->createTemplateObject('node_forum_level_' . $templateLevel, array(
'level' => $level,
'forum' => $node,
'renderedChildren' => $renderedChildren
));
}
}
?>
library/NodeLvl/Listener/LoadClassController.php
PHP:
<?php
class NodeLvl_Listener_LoadClassController
{
public static function loadClassListener($class, &$extend)
{
if ($class == 'XenForo_NodeHandler_Forum')
{
$extend[] = 'NodeLvl_XenForo_NodeHandler_NodeLvl';
}
}
}
?>
But nothing seems to happen, any advice?
Last edited: