hi'
With Oledrion, each product can have his own attached files. It is possible to upload all kind of file :
• doc, pdf, ...
• jpg, gif, ...
• and
mp3Oledrion is able (should be able) to detect if attached file is :
• a mp3
• or not
If a mp3 file is found then,
DewPlayer is displayed and customers can listen the file (or playlist if serveral files are detected).
... but actually, it does not work properly :
• module seems to not distinguish mp3 files and others
• so, all files are listed equally and so, Dewplayer is never displayed
I believe that issue comes from these two conditions :
• <{if $product.attached_mp3_count > 0}> : never above 0. If I delete this condition, Dewplayer is displayed but no mp3 is associated
• <{if !$attachedFile.file_is_mp3}> : always positive, even for mp3
There is the code :
Template : oledrion_product.html <{if count($product.attached_files) > 0}>
<div class="margin20">
<h3><{$smarty.const._OLEDRION_ATTACHED_FILES}>h3>
<{if $product.attached_mp3_count > 0}>
<div>
<{$smarty.const._OLEDRION_MUSIC}>
<div id='DewPlayerContainer'>div>
div>
<script type="text/javascript">
var paramsDew = {
wmode: "transparent"
};
jQuery().ready(function() {
jQuery('#DewPlayerContainer').flash({
swf: '<{$smarty.const.OLEDRION_URL}>dewplayer/<{if $product.attached_mp3_count > 1}>dewplayer-multi.swf<{else}>dewplayer.swf<{/if}>',
hasVersion: 9,
height: <{$smarty.const.OLEDRION_DEWPLAYER_HEIGHT}>,
width : <{$smarty.const.OLEDRION_DEWPLAYER_WIDTH}>,
params: paramsDew,
flashvars: {
mp3: '<{$mp3FilesList}>'
}
});
});
script>
<{/if}>
<{if $product.attached_non_mp3_count > 0}>
<div>
<{foreach item=attachedFile from=$product.attached_files}>
<{if !$attachedFile.file_is_mp3}>
<a href="javascript:openWithSelfMain('<{$smarty.const.OLEDRION_URL}>media.php?product_id=<{$product.product_id}>&type=attachment&file_id=<{$attachedFile.file_id}>', '',<{$smarty.const.OLEDRION_POPUP_MEDIA_WIDTH}>, <{$smarty.const.OLEDRION_POPUP_MEDIA_HEIGHT}>);" rel="nofollow">
<{$attachedFile.file_description}>
a>
<{/if}>
<{/foreach}>
div>
<{/if}>
div>
<{/if}>
And php code related (product.php)
// Search attached files *******************************************************
$attachedFiles = $mp3AttachedFilesList = $attachedFilesForTemplate = array();
$attachedFilesCount = $h_oledrion_files->getProductFilesCount($product->getVar('product_id'));
if($attachedFilesCount > 0) {
$attachedFiles = $h_oledrion_files->getProductFiles($product->getVar('product_id'));
foreach($attachedFiles as $attachedFile) { // Search MP3 files
if($attachedFile->isMP3()) {
$mp3AttachedFilesList[] = $attachedFile->getURL();
}
$attachedFilesForTemplate[] = $attachedFile->toArray();
}
if(count($mp3AttachedFilesList) > 0) {
oledrion_utils::callJavascriptFile('jquery.swfobject/jquery.swfobject.min.js');
$xoopsTpl->assign('mp3FilesList', implode('|', $mp3AttachedFilesList));
}
}
// Informations du produit **************************************************************************
$tbl_tmp = array();
$tbl_tmp = $product->toArray();
// Fichiers attachés
$tbl_tmp['attached_mp3_count'] = count($mp3AttachedFilesList);
$tbl_tmp['attached_non_mp3_count'] = count($attachedFilesForTemplate) - count($mp3AttachedFilesList);
$tbl_tmp['attached_files'] = $attachedFilesForTemplate; // Full list of attached files
I hope you understand the issue.
Thanks in advance
nb : I have tried to compress my mp3 in 44.100 and below. No effect, same issue