1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

i want to Disable Visitors from watching new/threads

Discussion in 'Troubleshooting and Problems' started by tony78, May 11, 2013.

  1. tony78

    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

  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    You can edit this template to add a condition around that link:

    Admin CP -> Appearance -> Templates -> navigation

    Add the red 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">
    						<div class="muted">{xen:phrase quick_links}</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>
    14DH01 and tony78 like this.
  3. tony78

    tony78 Member

    Thank you big Brother
  4. tony78

    tony78 Member

    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 ??


    Thanks again
  5. Liam W

    Liam W Well-Known Member

    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:

    protected function _preDispatch($action)
    Add that code below this code:

    class XenForo_ControllerPublic_FindNew extends XenForo_ControllerPublic_Abstract
    In this file:

    That will stop anyone that isn't registered from viewing the what's new page :)
    Jake Bunce likes this.

Share This Page