Skip to content

Commit

Permalink
V1.2
Browse files Browse the repository at this point in the history
fix bugs
  • Loading branch information
fghrsh committed Apr 20, 2017
1 parent 9a0e098 commit 1e0ea65
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions function.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function parseCallback($post, $config) {
$data['autoplay'] = isset($atts['autoplay']) ? self::str2bool($atts['autoplay']) : (bool)$config->autoplay;
$data['mutex'] = isset($atts['mutex']) ? self::str2bool($atts['mutex']) : (bool)$config->mutex;
$data['theme'] = isset($atts['theme']) ? $atts['theme'] : $config->theme;
$data['mode'] = $config->mode==1 ? 'random' : ($config->mode==2 ? 'single' : ($config->mode==3 ? 'circulation' : 'order'));
$data['mode'] = isset($atts['mode']) ? $atts['mode'] : ($config->mode==1 ? 'random' : ($config->mode==2 ? 'single' : ($config->mode==3 ? 'circulation' : 'order')));
$data['preload'] = isset($atts['preload']) ? $atts['preload'] : $config->preload==1 ? 'metadata' : ($config->preload==2 ? 'none' : 'auto');
isset($atts['listmaxheight']) ? $data['listmaxheight'] = $atts['listmaxheight'] : 0;
$data['music'] = array();
Expand All @@ -31,7 +31,7 @@ function parseCallback($post, $config) {
$atts = self::shortcode_parse_atts($all[3][$k]);
if (isset($atts['url'])) {
$tmp = array('url' => $atts['url']);
$tmp['pic'] = isset($atts['cover']) ? $atts['cover'] : isset($atts['pic']) ? $atts['pic'] : '';
$tmp['pic'] = isset($atts['cover']) ? $atts['cover'] : (isset($atts['pic']) ? $atts['pic'] : '');
$data['showlrc'] = isset($atts['lrc']) ? ($tmp['lrc'] = $atts['lrc']) ? 3 : 3 :
($tmp['lrc'] = (preg_match('/\[(lrc)](.*?)\[\/\\1]/si', $all[5][$k], $lrc)) && $lrc[2] ?
$lrc[2] : "[00:00.00]暂无歌词\n[99:00.00] ") ? 1 : 1;
Expand All @@ -56,11 +56,12 @@ function parseCallback($post, $config) {
isset($atts['title']) ? $data['music']['title'] = $atts['title'] : 0;
isset($atts['artist']) ? $data['music']['author'] = $atts['artist'] :
(isset($atts['author']) ? $data['music']['author'] = $atts['author'] : 0);
$data['music']['pic'] = isset($atts['cover']) ? isset($atts['pic']) ? $atts['pic'] : $atts['cover'] : '';
$data['music']['lrc'] = isset($atts['lrc']) ? $atts['lrc'] : "[00:00.00]暂无歌词\n[99:00.00] ";
$data['music']['pic'] = isset($atts['cover']) ? $atts['cover'] : (isset($atts['pic']) ? $atts['pic'] : '');
$data['showlrc'] = isset($atts['lrc']) ? 3 : 1;
isset($atts['lrc']) ? $data['music']['lrc'] = $atts['lrc'] : $data['showlrc'] = 0;
}
}
$data['showlrc'] = $atts['lrc']=='false' ? 0 : $data['showlrc'];
if ($data['music']) $js .= "\nAPlayerOptions.push(".json_encode($data, JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT).");\n";
$out = empty($out) ?
self::str_replace_once($matches[0][$i], "<div id=\"ap".$data['id']."\" class=\"aplayer\"></div>", $post):
Expand Down

0 comments on commit 1e0ea65

Please sign in to comment.