Advertisement:

Author Topic: How to Disable Recent Posts  (Read 4738 times)

Offline Rohan_

  • Sophist Member
  • *****
  • Posts: 1,328
  • Gender: Male
  • I Love SMF :)
How to Disable Recent Posts
« 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
Proud To Be An Indian

Offline JBlaze

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,159
  • Gender: Male
    • @fragicide on Twitter
Re: How to Disable Recent Posts
« Reply #1 on: June 11, 2009, 06:27:21 AM »
Admin -> Features and Options -> Recent posts to display

Set to "0"
Jason Clemons
Former Lead Customizer/Support Specialist
Twitter | Facebook | Instagram

Offline Afro

  • SMF Hero
  • ******
  • Posts: 1,855
  • Gender: Male
  • http://twitter.com/afrowall
    • Global Runs
Re: How to Disable Recent Posts
« Reply #2 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.

Offline Rohan_

  • Sophist Member
  • *****
  • Posts: 1,328
  • Gender: Male
  • I Love SMF :)
Re: How to Disable Recent Posts
« Reply #3 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
Proud To Be An Indian

Offline Kermit

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,365
  • Gender: Male
Re: How to Disable Recent Posts
« Reply #4 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>
My Mods
Please don't PM/mail me for support,unless i invite you
Formerly known as Duncan85
Quote
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

A. Einstein

Offline Rohan_

  • Sophist Member
  • *****
  • Posts: 1,328
  • Gender: Male
  • I Love SMF :)
Re: How to Disable Recent Posts
« Reply #5 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 
Proud To Be An Indian

Offline Kermit

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 4,365
  • Gender: Male
Re: How to Disable Recent Posts
« Reply #6 on: June 11, 2009, 07:09:12 AM »
./Sources/Recent.php

Code: (find) [Select]
?>

Code: (replace with) [Select]
is_not_guest();
?>
My Mods
Please don't PM/mail me for support,unless i invite you
Formerly known as Duncan85
Quote
"Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."

A. Einstein

Offline Rohan_

  • Sophist Member
  • *****
  • Posts: 1,328
  • Gender: Male
  • I Love SMF :)
Re: How to Disable Recent Posts
« Reply #7 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
Proud To Be An Indian

Offline simon36

  • Jr. Member
  • **
  • Posts: 111
Re: How to Disable Recent Posts
« Reply #8 on: November 16, 2009, 12:39:15 PM »
Thanks, this has helped me also.

Offline oOo--STAR--oOo

  • Full Member
  • ***
  • Posts: 645
  • Perfectionist
    • Developing Uniquez
Re: How to Disable Recent Posts
« Reply #9 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"

Code: [Select]
// Get all the most recent posts.
and replaced it with

Code: [Select]
// 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

Code: [Select]
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.

Code: [Select]
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
You can't fool a sufficiently talented fool.

http://www.uniquez-home.com
In Design Phase!

Mods I am designing,  No refresh Collapse Categories , Poll Redesign , Pure CSS Breadcrumb , Profile Statuses, Profile Views.

Offline The QE2 Story Forum

  • Charter Member
  • Jr. Member
  • *
  • Posts: 151
    • The QE2 Story
Re: How to Disable Recent Posts
« Reply #10 on: May 02, 2018, 05:56:14 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).