common_edu.php 1.1 KB

123456789101112131415161718192021222324252627
  1. <?php
  2. function remove_emoji($text)
  3. {
  4. return preg_replace('/([0-9#][\x{20E3}])|[\x{00ae}\x{00a9}\x{203C}\x{2047}\x{2048}\x{2049}\x{3030}\x{303D}\x{2139}\x{2122}\x{3297}\x{3299}][\x{FE00}-\x{FEFF}]?|[\x{2190}-\x{21FF}][\x{FE00}-\x{FEFF}]?|[\x{2300}-\x{23FF}][\x{FE00}-\x{FEFF}]?|[\x{2460}-\x{24FF}][\x{FE00}-\x{FEFF}]?|[\x{25A0}-\x{25FF}][\x{FE00}-\x{FEFF}]?|[\x{2600}-\x{27BF}][\x{FE00}-\x{FEFF}]?|[\x{2900}-\x{297F}][\x{FE00}-\x{FEFF}]?|[\x{2B00}-\x{2BF0}][\x{FE00}-\x{FEFF}]?|[\x{1F000}-\x{1F6FF}][\x{FE00}-\x{FEFF}]?/u',
  5. '', $text);
  6. }
  7. function upload_edu_video($file_id, $table, $field, $id)
  8. {
  9. $GLOBALS['db']->autoExecute(DB_PREFIX . 'edu_video', array(
  10. 'file_id' => $file_id,
  11. 'callback_info' => json_encode(array(
  12. 'table' => $table,
  13. 'field' => $field,
  14. 'id' => $id,
  15. )),
  16. 'create_time' => NOW_TIME,
  17. ));
  18. $last_id = $GLOBALS['db']->insert_id();
  19. fanwe_require(APP_ROOT_PATH . 'mapi/lib/core/video_factory.php');
  20. $video_factory = new VideoFactory();
  21. $video_factory->ModifyVodInfo($file_id, array('id' => 'edu_' . $last_id, 'begin_time' => NOW_TIME));
  22. }