News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

locking old posts

Started by oscar2001, August 14, 2004, 07:39:09 PM

Previous topic - Next topic

oscar2001

G`day all

I wannna lock all posts which have had no replies in a 30 day time period..
I was wondering if anyone knows a querie I can use to do so?
thanks :)

[Unknown]

Are you on MySQL 4 or 3?

-[Unknown]

oscar2001


[Unknown]

UPDATE topics AS t, messages AS m
SET t.locked = 1
WHERE m.ID_MSG = t.ID_LAST_MSG
   AND m.posterTime < UNIX_TIMESTAMP('YYYY-MM-DD');

That *should* work, but it's untested.  Just put the desired date in for YYYY-MM-DD.

-[Unknown]

oscar2001

I might be doing something wrong but I get this after running the querie

QuoteError

SQL-query : 

UPDATE topics AS t,
messages AS m SET t.locked =1 WHERE m.ID_MSG = t.ID_LAST_MSG AND m.posterTime < UNIX_TIMESTAMP( '2004-09-15' )

MySQL said:


#1146 - Table 'worldcic_yabbse.topics' doesn't exist


[Unknown]

Change "topics" to include your prefix, for example "smf_topics" or "yabbse_topics".  Same for "members".

-[Unknown]

oscar2001

Cool :)
works great after adding the prefixes to topics and messages..

Thanks a lot :)


Advertisement: