Nodes As Tabs

Nodes As Tabs 1.5.1

No permission to download
@Jake Bunce , i added my main forums under my NEW POSTS tab and they went hidden most likely because i have the NEW POSTS (Link Forum) not showing in the node list (No Check in "Display in the node list")

when i moved a set of my forums under the new posts link forum , indeed it added a new post count on the tab but it hid the forums from the node list , how can i get around this?
 
OK i see the setting
Define Root Node

i put new posts in there and it seems to be working ok

thanks

Mark forums read only took it from 3000 to 3 , i had to hit mark forums read twice to get it to go to 0 any idea why that would be?
 
Its my news feeds forum, How can i Exclude a forum from the count? i tried to make my news feeds forum a root node and move it but the new posts tab was still counting it
 
Its my news feeds forum, How can i Exclude a forum from the count? i tried to make my news feeds forum a root node and move it but the new posts tab was still counting it

Hmm. You can edit the code.

library/NodesAsTabs/Model/Options.php

Add the red code (and specify the node_id of the news feed forum):

Rich (BB code):
	// BASED ON XenForo_Model_Forum::getUnreadThreadCountInForum
	// THREADS ARE THE ONLY THING TO COUNT FOR THE DEFAULT NODE TYPES
	// ADDONS THAT ADD NEW NODE TYPES CAN EXTEND THIS FUNCTION, COUNT THEIR OWN UNREAD CONTENT, AND ADD IT TO THE UNREAD COUNT THAT IS RETURNED
	public function getUnreadCount($nodeIds, $userId, $ignored = false)
	{
		if (!$userId)
		{
			return false;
		}

		if ($ignored && is_string($ignored))
		{
			$ignored = unserialize($ignored);
			$ignored = array_keys($ignored);
		}

		$db = $this->_getDb();
		$visitor = XenForo_Visitor::getInstance();
		$threadModel = XenForo_Model::create('XenForo_Model_Thread');

		$autoReadDate = XenForo_Application::$time - (XenForo_Application::get('options')->readMarkingDataLifetime * 86400);

		$unreadThreads = $db->fetchAll('
			SELECT thread.*, permission.cache_value AS node_permission_cache
			FROM xf_thread AS thread


			LEFT JOIN xf_permission_cache_content AS permission
				ON (permission.permission_combination_id = ?
				AND permission.content_type = \'node\'
				AND permission.content_id = thread.node_id)


			LEFT JOIN xf_thread_read AS thread_read ON
				(thread_read.thread_id = thread.thread_id AND thread_read.user_id = ?)
			LEFT JOIN xf_forum_read AS forum_read ON
				(forum_read.node_id = thread.node_id AND forum_read.user_id = ?)
			WHERE thread.node_id IN (' . $db->quote($nodeIds) . ')
				AND (thread.last_post_date > ' . strval($autoReadDate) . ' AND (forum_read.forum_read_date IS NULL OR thread.last_post_date > forum_read.forum_read_date))
				AND (thread_read.thread_id IS NULL OR thread.last_post_date > thread_read.thread_read_date)
				' . ($ignored ? 'AND thread.user_id NOT IN (' . $db->quote($ignored) . ')' : '') . '
				AND thread.discussion_state = \'visible\'
				AND thread.discussion_type <> \'redirect\'
				AND thread.node_id NOT IN (7)
		', array($visitor['permission_combination_id'], $userId, $userId));

		$count = 0;
		foreach ($unreadThreads AS $thread)
		{
			$visitor->setNodePermissions($thread['node_id'], $thread['node_permission_cache']);

			if ($threadModel->canViewThreadAndContainer($thread, array('node_id' => $thread['node_id'])))
			{
				$count++;
			}
		}

		return $count;
	}

A code hack isn't ideal but it works...
 
AND thread.node_id NOT IN (26)

My News Feed Forum is 26

I have 2 tabs in my navbar one is New Posts and one is News

both have the counter and i have the news set to not show in new posts

when i made your change, both counters disappeared

can you help?

@Jake Bunce
 
My News Feed Forum is 26

I have 2 tabs in my navbar one is New Posts and one is News

both have the counter and i have the news set to not show in new posts

when i made your change, both counters disappeared

can you help?

@Jake Bunce

In that case, undo the previous code edit and do this one instead:

library/NodesAsTabs/NavTabs.php

Fill in your node_ids. I know the news forum is 26. Change 10 to the root tab for which you want to remove the news forum from the count.

Rich (BB code):
			// DO UNREAD COUNT
			$unreadCount = 0;
			if ($nodeTab['nat_unreadcount'])
			{
				$nodeIds = array();
				if ($nodeTab['nat_childnodes'])
				{
					foreach(explode(',', $nodeTab['nat_childnodes']) AS $nodeId)
					{
						$nodeIds[] = intval($nodeId);
					}
				}
				$nodeIds[] = $nodeTab['node_id'];

				$ignored = ($visitor['user_id'] ? $visitor['ignored'] : false);

				// REMOVE NEWS FORUM ONLY FOR THE ROOT TAB
				if ($nodeTab['node_id'] == 10)
				{
					if ( ($key = array_search(26, $nodeIds)) !== false )
					{
						unset($nodeIds[$key]);
					}
				}
				$unreadCount = $optionsModel->getUnreadCount($nodeIds, $visitor['user_id'], $ignored);
			}
 
@Jake Bunce

Hi Jake,

I'm using your plugin and the plugin Kotomi (bridge) and I would like to add tabs and links but I don't know how do I have to do this?
I know how to add normal tabs but what about Kotomi?

There is a lot of boxes to check and I tried everything but I did not find a way to put some links to an existing tab (tab which is not linked to a Xenforo link but to a php page).
I don't know if it is clear but the problem I have is perhaps elsewhere because I don't see links under tabs when I browse to an extern page?

Thanks for your help. :)
 
@Jake Bunce

Hi Jake,

I'm using your plugin and the plugin Kotomi (bridge) and I would like to add tabs and links but I don't know how do I have to do this?
I know how to add normal tabs but what about Kotomi?

There is a lot of boxes to check and I tried everything but I did not find a way to put some links to an existing tab (tab which is not linked to a Xenforo link but to a php page).
I don't know if it is clear but the problem I have is perhaps elsewhere because I don't see links under tabs when I browse to an extern page?

Thanks for your help. :)

Try this:

https://xenforo.com/community/threads/nodes-as-tabs.26687/page-57#post-937593
 
I dont understand this mod.. does this alow you to rearrange the tabs and rename the ones you already have? Cause thats what I need.
 
Hi, when I add the node is it possible to have the threads in that node be a dropdown, lets say like 5 thread links?

Nvm found a solution, just made a child link forum that no one can see and it was added to the dropdown, thanks!
 
Last edited:
In the overview it says - Publish your own static or dynamic content to the navbar (page nodes).

What's that about please? I've been using this wonderful addon for years but this bit is new to me.
I also know about page nodes.
So what is this saying apart from I can add any node to the navbar, top or dropdown list?
 
In the overview it says - Publish your own static or dynamic content to the navbar (page nodes).

What's that about please? I've been using this wonderful addon for years but this bit is new to me.
I also know about page nodes.
So what is this saying apart from I can add any node to the navbar, top or dropdown list?

Page nodes can contain any HTML content that you wish. Because it's a node you can use this addon to link the page in the navbar. That's all.
 
Top Bottom