SHARE
TWEET

for allenmchan: date import code from admin.php

bhengh Sep 3rd, 2013 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.                         $date_format = sb_get_option('import_filename');
  2.                         if ($date_format != '') {
  3.                                 $filename = substr($filename, 0, strrpos($filename, '.'));
  4.                                 $filename = str_replace ('--', '-', str_replace ('/', '-', $filename));
  5.                                 $filename = trim(ereg_replace('[^0-9-]', '', $filename), '-');
  6.                                 $date = explode('-', $filename, 3);
  7.                                 $id3_tags['date'] = '';
  8.                                 if (count($date) >= 3) {
  9.                                         if ($date_format == 'uk')
  10.                                                 $id3_tags['date'] = date ('Y-m-d', mktime(0, 0, 0, $date[1], $date[0], $date[2]));
  11.                                         elseif ($date_format == 'us')
  12.                                                 $id3_tags['date'] = date ('Y-m-d', mktime(0, 0, 0, $date[0], $date[1], $date[2]));
  13.                                         elseif ($date_format == 'int')
  14.                                                 $id3_tags['date'] = date ('Y-m-d', mktime(0, 0, 0, $date[1], $date[2], $date[0]));
  15.                                 }
  16.                         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top