Hide blog pages?

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
nealk
Regular
Posts: 26
Joined: Sun Sep 20, 2009 1:09 am

Hide blog pages?

Post by nealk »

I have a friend who is using Serendipity for their blog. (I talked her out of using wordpress.)

She wants to start her blog over. (New theme.)

My question is: is there any way to hide old blog entries?
She'd rather not delete and start over, and she wants all of the old permanent links to work. However, she does not want these entries featured on the calendar, categories, search, or "previous entries".

Basically: if you know where the entries are (e.g., http://server/blog/index.php?/archives/7-guid.html), you can see them. But if you don't know that they exist, then they will be hidden.

Is there any easy way to do this?
(I'm also not opposed to hacking code to say "don't return results with IDs < 450" or such, or creating a plugin if someone gives me some hints.)
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Hide blog pages?

Post by yellowled »

nealk wrote:Basically: if you know where the entries are (e.g., http://server/blog/index.php?/archives/7-guid.html), you can see them. But if you don't know that they exist, then they will be hidden.
You could use registered users and the respective plugins to make these entries available for registered users only.

YL
stm999999999
Regular
Posts: 1531
Joined: Tue Mar 07, 2006 11:25 pm
Location: Berlin, Germany
Contact:

Re: Hide blog pages?

Post by stm999999999 »

nealk wrote: My question is: is there any way to hide old blog entries?
Can you tell us the reason for doing so?

reason for my question: perhaps she wants to achieve an aim, but has choosen an inaccurate technical solution? perhaps there is a smoother way.
Ciao, Stephan
abdussamad
Regular
Posts: 117
Joined: Fri Apr 21, 2006 10:11 pm
Location: Karachi, Pakistan
Contact:

Re: Hide blog pages?

Post by abdussamad »

Use the extended properties for entries plugin. Then create a custom field called hide. Set the value of hide to 'yes' for all the existing entries. You could probably do this via an SQL query if there are a lot of entries otherwise just do it manually.

Then in entries.tpl check whether its a single entry. If its not then check whether hide is set to 'yes' and if so skip the entry. If hide is set to 'no' display the entry. If its a single entry you display it regardless. That would do what your asking to do.
nealk
Regular
Posts: 26
Joined: Sun Sep 20, 2009 1:09 am

Re: Hide blog pages?

Post by nealk »

abdussamad wrote:Use the extended properties for entries plugin. Then create a custom field called hide. Set the value of hide to 'yes' for all the existing entries. You could probably do this via an SQL query if there are a lot of entries otherwise just do it manually.

Then in entries.tpl check whether its a single entry. If its not then check whether hide is set to 'yes' and if so skip the entry. If hide is set to 'no' display the entry. If its a single entry you display it regardless. That would do what your asking to do.
Excellent. Thank you for the clear guidance.

With regards to stm999999999:
She wants to start a new blog, writing on a new topic/theme. However, she wants to use the old blog URL (http://server/blog/) and she does not want all of the old permanent links to break since people do link to her old blog entries.

The idea behind hiding the pages allows her to use the same blog URL and write new topics, but the old stuff still exists and the old links to the old stuff still works.
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Re: Hide blog pages?

Post by Don Chambers »

abdussamad wrote:Then in entries.tpl check whether its a single entry. If its not then check whether hide is set to 'yes' and if so skip the entry. If hide is set to 'no' display the entry. If its a single entry you display it regardless. That would do what your asking to do.
Using a similar approach, you could compare the entry's timestamp to a specific unix timestamp, such as November 1, 2009:

Code: Select all

{if $entry.timestamp >= 1257033600}
As with abdussamad's suggestion, single entry views would be showed all the time, but over view pages, such as author view, category view, archives, etc, would not include those older entries.
=Don=
Post Reply