Skip to content

Instantly share code, notes, and snippets.

@xtrasmal
Created January 27, 2013 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xtrasmal/4648577 to your computer and use it in GitHub Desktop.
Save xtrasmal/4648577 to your computer and use it in GitHub Desktop.
CS Cart MP3 player in shop. For this you need the following.
/* Xander Smalbil */
// description.tpl
{* $Id: description.tpl 11191 2010-11-11 11:56:01Z klerik $ *}
{** block-description:description **}
{if $attachments_data}
<div id="mp3_attachments">
{foreach from=$attachments_data item="file"}
{if $file.filename|strstr:'.mp3'}
{literal}
<script type="text/javascript" src="http://wpaudioplayer.com/wp-content/plugins/audio-player/assets/audio-player.js?ver=2.0.4.1"></script>
<script type="text/javascript">
<!--
AudioPlayer.setup("http://wpaudioplayer.com/wp-content/plugins/audio-player/assets/player.swf?ver=2.0.4.1", {width:"290"});
//-->
</script>
{/literal}
{assign var=mp3location value="`$config.http_location`/var/attachments/product/`$_REQUEST.product_id`/`$file.filename`"}
<p id="audioplayer_{$file.attachment_id}">Mp3 sample is unable to load</p>
{literal}
<script type="text/javascript">
<!--
AudioPlayer.embed("{/literal}audioplayer_{$file.attachment_id}{literal}", {soundFile: "{/literal}{$mp3location}{literal}"});
//-->
</script>
{/literal}
{/if}
{/foreach}
</div>
{/if}
{$product.full_description|default:$product.short_description|unescape}
/* Xander Smalbil */
// var/.htacces
Order deny,allow
Deny from all
<Files ~ "\.js$">
order allow,deny
allow from all
</Files>
<Files ~ "\.mp3$">
order allow,deny
allow from all
</Files>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment