News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

How to Disable Recent Posts

Started by Rohan_, June 11, 2009, 06:25:31 AM

Previous topic - Next topic

Rohan_

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

JBlaze

Admin -> Features and Options -> Recent posts to display

Set to "0"
Jason Clemons
Former Team Member 2009 - 2012

Afro

admin cpanel >> current theme>>Number of recent posts to display on board index:

set it to zero and save.

Rohan_

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

Kermit

.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

Rohan_

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

Kermit

./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

Rohan_

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

simon36


oOo--STAR--oOo

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

Rob Lightbody

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).

Advertisement: