Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: Rohan_ on June 11, 2009, 06:25:31 AM

Title: How to Disable Recent Posts
Post by: Rohan_ on June 11, 2009, 06:25:31 AM
hey guys hi hello ..

tell me How Can I Disable The Recent Posts Option Appears on the bottom of the index page :( i am using a mod for guests cannot read the thread contents but if any guest click on recent topics so he/she can view everything :(

PLEASE TELL ME HOW DO I DISABLE IT
Title: Re: How to Disable Recent Posts
Post by: JBlaze on June 11, 2009, 06:27:21 AM
Admin -> Features and Options -> Recent posts to display

Set to "0"
Title: Re: How to Disable Recent Posts
Post by: Afro on June 11, 2009, 06:28:27 AM
admin cpanel >> current theme>>Number of recent posts to display on board index:

set it to zero and save.
Title: Re: How to Disable Recent Posts
Post by: Rohan_ on June 11, 2009, 06:32:46 AM
no i want to disable this option >> View the most recent posts on the forum.

the option you guys saying is already set on 0 but i want to disable View the most recent posts on the forum.

this option is shown in forum stats
Title: Re: How to Disable Recent Posts
Post by: Kermit on June 11, 2009, 06:59:02 AM
.in Themes/{your_theme}/BoardIndex.template.php

You can either make it just for the admins visible

Code (find) Select

<a href="', $scripturl, '?action=recent">', $txt[234], '</a>


Code (replace with) Select

<a href="', $scripturl, '?action=recent">', $context['user']['is_admin'] ? ''. $txt[234]. '' : '' ,'</a>


or remove it completely

Code (find and remove) Select

<a href="', $scripturl, '?action=recent">', $txt[234], '</a>
Title: Re: How to Disable Recent Posts
Post by: Rohan_ on June 11, 2009, 07:05:07 AM
hey thanks for your info i have done it the option is gone now but if anyone is hitting a direct url to recent posts then its showing now too :( how do i disable it for guests 
Title: Re: How to Disable Recent Posts
Post by: Kermit on June 11, 2009, 07:09:12 AM
./Sources/Recent.php

Code (find) Select

?>


Code (replace with) Select

is_not_guest();
?>
Title: Re: How to Disable Recent Posts
Post by: Rohan_ on June 11, 2009, 08:36:50 AM
hey thanks a lot and i have replaced boardIndex.Template with the default one the option is now showing to guests but if anyone clicking on this then it asking for login :)


Thanks Thanks Thanks
Title: Re: How to Disable Recent Posts
Post by: simon36 on November 16, 2009, 12:39:15 PM
Thanks, this has helped me also.
Title: Re: How to Disable Recent Posts
Post by: oOo--STAR--oOo on July 12, 2010, 09:02:02 PM
Hi a member just pointed this out to me and i have boards on the forums that are protected.

Like VIP boards and what not.
By clicking the little recent posts button at the bottom or searching in google lets say
YOURWEBSITESNAME, the name of a member, Recent Posts

Type that in google and you will see cached pages of them boards u didn't want people to see.

Now I dunno much about the software in SMF so I was searching all over to close this loop as fast as I could.
I basically found in "Recent.php"

// Get all the most recent posts.

and replaced it with

// Get all the most recent posts.
if ($user_info['is_admin'])


Now this shown the page numbers to anyone else but did not reveal the recent posts.
So thats a huge bonus

also adding the

is_not_guest();

Can anyone advise me of a propper way of doing this. Or is this method O.K.

Its basically stopped anyone other than admin vieweing recent posts just displays the page number 1 to 10

I have enabled it for multiple member groups to view this because i have mods that are o.k. to view any post in the forums.
So mayaswell give them the option to use recent posts.

if (in_array(10, $user_info['groups']) || in_array(15, $user_info['groups']) || in_array(18, $user_info['groups']) || in_array(20, $user_info['groups']) || in_array(22, $user_info['groups']) || $user_info['is_admin'])

Thanks.

Also I know this is in the 1x forum but I'm using SMF 2.0 RC2
Title: Re: How to Disable Recent Posts
Post by: Rob Lightbody on May 02, 2018, 05:56:14 AM
Quote from: Kermit on June 11, 2009, 07:09:12 AM
./Sources/Recent.php

Code (find) Select

?>


Code (replace with) Select

is_not_guest();
?>


This is fantastic - thanks, exactly what I need to try to encourage my very many guests to login (it worked on 2.0.15 too, and the same logic can be used with the search facility).