From b8bbb2787182ae7df16e1c4676feb42c9e4f02f3 Mon Sep 17 00:00:00 2001 From: brent s Date: Fri, 18 Mar 2016 21:07:47 -0400 Subject: [PATCH] check in --- bts_podcast/bts_podcast.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/bts_podcast/bts_podcast.php b/bts_podcast/bts_podcast.php index babc77d..d7ed79e 100644 --- a/bts_podcast/bts_podcast.php +++ b/bts_podcast/bts_podcast.php @@ -41,7 +41,7 @@ h5. bts_podcast_filename The filename of the media file. Automatically generated from the title by default. Attributes: - *ext=* + *type=* File extension. Recommended is either _mp3_ or _ogg_. Default is _mp3_. *name=* @@ -107,16 +107,16 @@ function bts_podcast_path($atts) { function bts_podcast_filename($atts) { extract(lAtts(array( - 'ext' => 'mp3', + 'type' => 'mp3', 'name' => NULL, ), $atts)); if (! $name) { - $raw_name = strtolower(title()); + $raw_name = strtolower(title($atts)); $stripped = trim($raw_name); $replaced = preg_replace('(\s+|[^A-Za-z0-9\.\-]+)','.',$stripped); $name = preg_replace('(\.+)','.',$replaced); } - return $name . '.' . $ext; + return $name . '.' . $type; } @@ -129,7 +129,7 @@ function bts_podcast_guid ($atts) { if (($byte == '1' && $db == '1') || ($string == '')) { //$checksum = safe_query('select checksum from sha256 where url_title = \'' . article_url_title() . '\' and filename = \'' . bts_podcast_filename() . '\''); - $checksum = fetch('checksum','sha256','filename',bts_podcast_filename()); + $checksum = fetch('checksum','sha256','filename',bts_podcast_filename($atts)); } elseif ($byte == '1') { $checksum = hash_file('sha256',$string); } else { @@ -140,9 +140,11 @@ return $checksum; function bts_podcast_media_uri ($atts) { - extract(lAtts(array( - 'uri' => site_url() . bts_podcast_path() . bts_podcast_filename(), - ), $atts)); + $default_vals = array('type' => 'mp3'); + //$default_vals['uri'] = site_url($atts) . bts_podcast_path($type=$default_vals['type']) . bts_podcast_filename($type=$default_vals['type']); + $default_vals['uri'] = site_url($atts) . bts_podcast_path($atts) . bts_podcast_filename($atts); + extract(lAtts(array($default_vals), $atts)); + //if ($uri == site_url() . return $uri; }