cron_security_cleanup_lastpost.php 580 B

123456789101112131415161718192021
  1. <?php
  2. /**
  3. * [Discuz!] (C)2001-2099 Comsenz Inc.
  4. * This is NOT a freeware, use is subject to license terms
  5. *
  6. * $Id: cron_security_daily.php 29568 2012-04-19 03:39:25Z songlixin $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. $queryf = C::t('forum_forum')->fetch_all_fids();
  12. foreach($queryf as $forum) {
  13. $thread = C::t('forum_thread')->fetch_by_fid_displayorder($forum['fid']);
  14. $lastpost = "$thread[tid]\t$thread[subject]\t$thread[lastpost]\t$thread[lastposter]";
  15. C::t('forum_forum')->update($forum['fid'], array('lastpost' => $lastpost));
  16. }
  17. ?>