cache_click.php 610 B

1234567891011121314151617181920212223242526
  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: cache_click.php 24403 2011-09-16 12:32:45Z zhengqingpeng $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. function build_cache_click() {
  12. $data = $keys = array();
  13. foreach(C::t('home_click')->fetch_all_by_available() as $value) {
  14. if(count($data[$value['idtype']]) < 8) {
  15. $keys[$value['idtype']] = $keys[$value['idtype']] ? ++$keys[$value['idtype']] : 1;
  16. $data[$value['idtype']][$keys[$value['idtype']]] = $value;
  17. }
  18. }
  19. savecache('click', $data);
  20. }
  21. ?>