Pruning Old Posts

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
Brian1969
Regular
Posts: 78
Joined: Tue Mar 22, 2005 7:03 pm
Contact:

Pruning Old Posts

Post by Brian1969 » Wed Oct 11, 2006 9:39 pm

Is there an easy way to go back and prune old, outdated posts in Serendipity? Say like have it auto-delete posts over x-amount of days old (I'm thinking around a year ago)?
Brian

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Pruning Old Posts

Post by garvinhicking » Wed Oct 11, 2006 10:58 pm

Hi!

There's an event plugin serendipity_event_outdate_entries that you can use to purge old entries.

However of course that is not the way a weblog usually works *g*

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

Brian1969
Regular
Posts: 78
Joined: Tue Mar 22, 2005 7:03 pm
Contact:

Post by Brian1969 » Wed Oct 11, 2006 11:00 pm

Yeah, I know.

The reason I want to get rid of some stuff is because I'm approaching the limits on my server, and my first year of blogging was pretty much a non-event. lol
Brian

Brian1969
Regular
Posts: 78
Joined: Tue Mar 22, 2005 7:03 pm
Contact:

Post by Brian1969 » Wed Oct 11, 2006 11:07 pm

Uhm....where would I find this plug-in? Because I'm not seeing it anywhere....
Brian

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking » Wed Oct 11, 2006 11:35 pm

Hi!

The name is "Hide entries for non-registered users". Now that I read the description, I see that it does not completely do what you wanted. :)

Thus you might need to modify that plugin to delete entries instead of "hiding" them? Or you just manually delete old entries? Dunno. :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

Brian1969
Regular
Posts: 78
Joined: Tue Mar 22, 2005 7:03 pm
Contact:

Post by Brian1969 » Wed Oct 11, 2006 11:41 pm

Nope, that's not what I needed. It's close, though. =D

Any idea how I could modify it to delete instead of hide? I don't know PHP or anything like that, so I'd be very hard-pressed to try anything with it.
Brian

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking » Wed Oct 11, 2006 11:47 pm

Hi!

Modifying the PHP code would take me some time - have you thought about just using phpMyAdmin to quickly delete more entries?

DELETE FROM serendipity_entries WHERE timestamp < (UNIX_TIMESTAMP(NOW()) - 86400*360)

would delete all entries older than one year from the current timestamp onwards...

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/

Brian1969
Regular
Posts: 78
Joined: Tue Mar 22, 2005 7:03 pm
Contact:

Post by Brian1969 » Wed Oct 11, 2006 11:50 pm

Yes, I started to do that, and I can still go ahead. But I thought it might be easier to see if there was something that would do it automatically for me.

I know a lot of other CMS' have something that allows admins to prune posts and stuff, I thought it might be a neat feature to have.

Not a huge deal, though, I can go through and do it manually. =D
Brian

Brian1969
Regular
Posts: 78
Joined: Tue Mar 22, 2005 7:03 pm
Contact:

Post by Brian1969 » Wed Oct 11, 2006 11:54 pm

One more question, if I may.

What would I edit to have the blog redirect readers from the deleted posts to the front page (index page)?
Brian

User avatar
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert » Thu Oct 12, 2006 3:09 am

Nothing. 8)

If you use mod_rewrite, everything not found redirects to the frontpage. If you don't use mod_rewrite, index.php?<whatever> will redirect to the frontpage if it's not found.
Judebert
---
Website | Wishlist | PayPal

Brian1969
Regular
Posts: 78
Joined: Tue Mar 22, 2005 7:03 pm
Contact:

Post by Brian1969 » Thu Oct 12, 2006 3:28 am

Ok, where would I find that setting then?
Brian

User avatar
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert » Thu Oct 12, 2006 3:43 am

Ermm... since you don't have to do anything, you don't have to touch the setting.
If you don't use mod_rewrite, index.php?<whatever> will redirect to the frontpage if it's not found.


If you want to change it anyway, it's in the Admin page under Configure.
Judebert
---
Website | Wishlist | PayPal

Brian1969
Regular
Posts: 78
Joined: Tue Mar 22, 2005 7:03 pm
Contact:

Post by Brian1969 » Thu Oct 12, 2006 3:49 am

Well, right now it just gives a page that says "post not found" or something like that. Mind you, it's not the 404 generic error that says "page not found", it still shows a page on my blog.

But I know that in the past if I deleted something, and then tried to go to that post, it would redirect me to the front page. Since I last updated, it doesn't do that anymore.

So, my question is, how do I get it to do that again?
Brian

User avatar
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert » Thu Oct 12, 2006 3:51 pm

Okay; sorry, I didn't realize it was functioning this way. It's probably because a post ID was actually found in the URL, leading us to actually mention there was a problem. I think this was part of the SEO effort: if two different URLs point to the same thing, they get ranked low. So we made incorrect posts point to an error page, so the main page doesn't get down-ranked.

I'm betting this will require a change in the core code. I can't promise to look into it at this moment, but you're next on my list. (Others are welcome to fix it instead, of course.) If nobody gets it in about a week, I've forgotten despite my PDA. Bump this topic then to kick me in the butt.
Judebert
---
Website | Wishlist | PayPal

Post Reply