i want to Disable Visitors from watching new/threads

tony78

Member
Hello guys ,
I got lots of CPU problems from the Visitors because of watching new/threads

so how can i Disable it and keep it just for Registered users

/index.php?find-new/threads
 
You can edit this template to add a condition around that link:

Admin CP -> Appearance -> Templates -> navigation

Add the red code:

Rich (BB code):
		<!-- forums -->
		<xen:if is="{$tabs.forums}">
			<li class="navTab forums {xen:if $tabs.forums.selected, 'selected', 'Popup PopupControl PopupClosed'}">
			
				<a href="{$tabs.forums.href}" class="navLink">{$tabs.forums.title}</a>
				<a href="{$tabs.forums.href}" class="SplitCtrl" rel="Menu"></a>
				
				<div class="{xen:if {$tabs.forums.selected}, 'tabLinks', 'Menu JsOnly tabMenu'} forumsTabLinks">
					<div class="primaryContent menuHeader">
						<h3>{$tabs.forums.title}</h3>
						<div class="muted">{xen:phrase quick_links}</div>
					</div>
					<ul class="secondaryContent blockLinksList">
					<xen:hook name="navigation_tabs_forums">
						<xen:if is="{$visitor.user_id}"><li><a href="{xen:link 'forums/-/mark-read', $forum, 'date={$serverTime}'}" class="OverlayTrigger">{xen:phrase mark_forums_read}</a></li></xen:if>
						<xen:if is="{$canSearch}"><li><a href="{xen:link search, '', 'type=post'}">{xen:phrase search_forums}</a></li></xen:if>
						<xen:if is="{$visitor.user_id}"><li><a href="{xen:link 'watched/threads'}">{xen:phrase watched_threads}</a></li></xen:if>
						<xen:if is="{$visitor.user_id}"><li><a href="{xen:link 'find-new/threads'}" rel="nofollow">{xen:phrase whats_new}</a></li></xen:if>
					</xen:hook>
					</ul>
				</div>
			</li>
		</xen:if>
 
i still have the problem and i did what you said but still can access the page ,so i had to Block China and get rid of them

i have no idea what are they doing in my site , i have different language they can't read or understand anything ??

weird


Thanks again
 
i still have the problem and i did what you said but still can access the page ,so i had to Block China and get rid of them

i have no idea what are they doing in my site , i have different language they can't read or understand anything ??

weird


Thanks again

That code change by Jake would have hidden the link, but not denied them access. To deny them access you'll have to edit the PHP code:

PHP:
protected function _preDispatch($action)
{
    $this->_assertRegistrationRequired();
}

Add that code below this code:

Code:
<?php
 
class XenForo_ControllerPublic_FindNew extends XenForo_ControllerPublic_Abstract
{

In this file:

Code:
library/XenForo/ControllerPublic/FindNew.php

That will stop anyone that isn't registered from viewing the what's new page :)
 
Top Bottom