cache_smilies.php 719 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_smilies.php 24968 2011-10-19 09:51:28Z zhengqingpeng $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. function build_cache_smilies() {
  12. $data = array();
  13. $data = array('searcharray' => array(), 'replacearray' => array(), 'typearray' => array());
  14. foreach(C::t('common_smiley')->fetch_all_cache() as $smiley) {
  15. $data['searcharray'][$smiley['id']] = '/'.preg_quote(dhtmlspecialchars($smiley['code']), '/').'/';
  16. $data['replacearray'][$smiley['id']] = $smiley['url'];
  17. $data['typearray'][$smiley['id']] = $smiley['typeid'];
  18. }
  19. savecache('smilies', $data);
  20. }
  21. ?>