XF 1.1 How do I set Parent node to 'Media tab', for created pages which default to Forum tab?

CritiKiL

Active member
Ok. I created sub-link 'pages' and have them as sub-links on the Media tab. But when I click on those sub-links it shows the correct page, but the parent node goes to the Forum tab always. I would like (when they are clicked) for them to stay on the tab to which I placed the links, so how can I "make my Media tab" (the tab where I have the sub-links located) as the Parent node, since the Media tab is not included as a parent node choice? The site location where I have this problem is Below and the sub-link created pages are 'Clanradio', 'Clancast', 'ClanKill TV' and 'UFreqTV':

http://sck-mobile.com/community/index.php?media/
 
Link forums don't feature tab-selection. They are merely redirects.
If you post the code from that script then I can look it over.

Here is the script code for the ezstats2_bf3.php:

PHP:
<?php
    $startTime = microtime(true);
    $kotomi_indexFile = "./";
    $kotomi_container = true;
    $fileDir = dirname(__FILE__)."/{$kotomi_indexFile}";
    require "{$fileDir}/library/Dark/Kotomi/KotomiHeader.php";
 
    /* ezStats Start */
    $ch = curl_init("http://sck-mobile.com/community/ezStats2/");
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $output = curl_exec($ch);
    curl_close($ch);
    echo $output;
    /* ezStats End */
 
    require "{$fileDir}/library/Dark/Kotomi/KotomiFooter.php";
?>

ALSO: The ezStats2 plug-in allows for me to make that script a TAB, but I don't want to use it as a tab. This is the actual 'tab' link, but I'm afraid it's also a redirect: http://sck-mobile.com/community/index.php?link-forums/bf3-leaderboard.105/ (it only redirects to: http://sck-mobile.com/community/ezstats2_bf3.php though :()
 
Here is the script code for the ezstats2_bf3.php:

PHP:
<?php
    $startTime = microtime(true);
    $kotomi_indexFile = "./";
    $kotomi_container = true;
    $fileDir = dirname(__FILE__)."/{$kotomi_indexFile}";
    require "{$fileDir}/library/Dark/Kotomi/KotomiHeader.php";
 
    /* ezStats Start */
    $ch = curl_init("http://sck-mobile.com/community/ezStats2/");
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $output = curl_exec($ch);
    curl_close($ch);
    echo $output;
    /* ezStats End */
 
    require "{$fileDir}/library/Dark/Kotomi/KotomiFooter.php";
?>

ALSO: The ezStats2 plug-in allows for me to make that script a TAB, but I don't want to use it as a tab. This is the actual 'tab' link, but I'm afraid it's also a redirect: http://sck-mobile.com/community/index.php?link-forums/bf3-leaderboard.105/ (it only redirects to: http://sck-mobile.com/community/ezstats2_bf3.php though :()

That uses the kotomi script. I haven't tested this but...

library/Dark/Kotomi/FrontController.php

Rich (BB code):
<?php
class Dark_Kotomi_FrontController extends XenForo_FrontController
{
	public function runKotomi($html)
	{
		global $kotomi_indexFile, $kotomi_container;
		
		ob_start();

		$this->setup();
		$this->_request->setBasePath(XenForo_Link::convertUriToAbsoluteUri("{$kotomi_indexFile}"));
		$this->setRequestPaths();
		$showDebugOutput = $this->showDebugOutput();

		$this->_dependencies->preLoadData();

		XenForo_CodeEvent::fire('front_controller_pre_route', array($this));
		$routeMatch = $this->route();

		$routeMatch->setSections('tabidhere');

		XenForo_CodeEvent::fire('front_controller_pre_dispatch', array($this, &$routeMatch));

		$controllerResponse = $this->dispatch($routeMatch);
		$controllerResponse = new XenForo_ControllerResponse_View();
		$controllerResponse->templateName = "dark_kotomi";
		$controllerResponse->viewName = "Dark_Kotomi_Index";
		$title = "";
		if(preg_match('/<title>(.*?)<\/title>/i', $html, $matches) && count($matches) == 2){
			$title = $matches[1];
		}
		$controllerResponse->params = array(
			'title' => $title,
			'html' => $html
		);

I have thought about making an addon to manage sections...
 
That uses the kotomi script. I haven't tested this but...

library/Dark/Kotomi/FrontController.php

Rich (BB code):
<?php
class Dark_Kotomi_FrontController extends XenForo_FrontController
{
public function runKotomi($html)
{
global $kotomi_indexFile, $kotomi_container;
 
ob_start();
 
$this->setup();
$this->_request->setBasePath(XenForo_Link::convertUriToAbsoluteUri("{$kotomi_indexFile}"));
$this->setRequestPaths();
$showDebugOutput = $this->showDebugOutput();
 
$this->_dependencies->preLoadData();
 
XenForo_CodeEvent::fire('front_controller_pre_route', array($this));
$routeMatch = $this->route();
 
$routeMatch->setSections('tabidhere');
 
XenForo_CodeEvent::fire('front_controller_pre_dispatch', array($this, &$routeMatch));
 
$controllerResponse = $this->dispatch($routeMatch);
$controllerResponse = new XenForo_ControllerResponse_View();
$controllerResponse->templateName = "dark_kotomi";
$controllerResponse->viewName = "Dark_Kotomi_Index";
$title = "";
if(preg_match('/<title>(.*?)<\/title>/i', $html, $matches) && count($matches) == 2){
$title = $matches[1];
}
$controllerResponse->params = array(
'title' => $title,
'html' => $html
);

I have thought about making an addon to manage sections...
I will 5 star that before even installing it if you do lmao
 
That uses the kotomi script. I haven't tested this but...

library/Dark/Kotomi/FrontController.php

Rich (BB code):
<?php
class Dark_Kotomi_FrontController extends XenForo_FrontController
{
public function runKotomi($html)
{
global $kotomi_indexFile, $kotomi_container;
 
ob_start();
 
$this->setup();
$this->_request->setBasePath(XenForo_Link::convertUriToAbsoluteUri("{$kotomi_indexFile}"));
$this->setRequestPaths();
$showDebugOutput = $this->showDebugOutput();
 
$this->_dependencies->preLoadData();
 
XenForo_CodeEvent::fire('front_controller_pre_route', array($this));
$routeMatch = $this->route();
 
$routeMatch->setSections('tabidhere');
 
XenForo_CodeEvent::fire('front_controller_pre_dispatch', array($this, &$routeMatch));
 
$controllerResponse = $this->dispatch($routeMatch);
$controllerResponse = new XenForo_ControllerResponse_View();
$controllerResponse->templateName = "dark_kotomi";
$controllerResponse->viewName = "Dark_Kotomi_Index";
$title = "";
if(preg_match('/<title>(.*?)<\/title>/i', $html, $matches) && count($matches) == 2){
$title = $matches[1];
}
$controllerResponse->params = array(
'title' => $title,
'html' => $html
);

I have thought about making an addon to manage sections...
What would my 'tabid' be? With the tab selected it shows this url: http://sck-mobile.com/community/index.php?link-forums/bf3-leaderboard.105...So I tried using the "bf3-leaderboard.105" as tabid, but that doesn't work ;-(
 
The tabids are what we used before, like:

'clancast', 'clankill_tv', 'ufreqtv', 'warroom-1', 'pws-1'
Ok but this is not a page where I can give it a 'url portion' name, like the others. This is a forum-link and the only thing I have to point to is:

1) http://sck-mobile.com/community/ezstats2_bf3.php (with no tab)
2) http://sck-mobile.com/community/index.php?link-forums/bf3-leaderboard.105/ (with 'tab' enabled)

What I want to do (when clicking on either link) is not allow it to leave the home-page where the link is actually at, which is here (BF3 Leaderboards):

http://sck-mobile.com/community/index.php?xboxlive-leaderboard/

If it were a page or if I had a tabid then I would've been able to just add it to the existing code you gave me for all of that ;-)
 
Can I butt in here and ask...the examples you have given are items in an array, what about for example if you have an array for one tab and a single page for another tab...what would be the syntax for the single page?

For example in this the "how-to_videos" is not in an array for the "Help" tab:
Code:
    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('about_us', 'advertising')))
        {
            $section = 'portal';
        }
        else if (in_array($request->getParam('node_name'), array('how_to_videos')))
        {
            $section = 'help';
        }
        else
        {
            $section = 'forums';
        }
 
 
        return $router->getRouteMatch('XenForo_ControllerPublic_Page', 'index', $section);
    }
 
in_array is just alternate syntax to check multiple cases, but it works for single cases too.

These are equivalent:

Code:
if (in_array($request->getParam('node_name'), array('about_us', 'advertising')))
{
	$section = 'portal';
}

Code:
if ($request->getParam('node_name') == 'about_us' OR $request->getParam('node_name') == 'advertising')
{
	$section = 'portal';
}
 
Top Bottom