cache_smileycodes.php 687 B

123456789101112131415161718192021222324252627
  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_smileycodes.php 24968 2011-10-19 09:51:28Z zhengqingpeng $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. function build_cache_smileycodes() {
  12. $data = array();
  13. foreach(C::t('forum_imagetype')->fetch_all_by_type('smiley', 1) as $type) {
  14. foreach(C::t('common_smiley')->fetch_all_by_type_code_typeid('smiley', $type['typeid']) as $smiley) {
  15. if($size = @getimagesize('./static/image/smiley/'.$type['directory'].'/'.$smiley['url'])) {
  16. $data[$smiley['id']] = $smiley['code'];
  17. }
  18. }
  19. }
  20. savecache('smileycodes', $data);
  21. }
  22. ?>