Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / need the right path in product_listing.php

need the right path in product_listing.php

Locked

Views: 4,972

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
13 Aug 2009, 10:50 PM
#1
pascal020 avatar

pascal020

New Zenner

Join Date:
Aug 2009
Posts:
43
Plugin Contributions:
0

need the right path in product_listing.php

I managed to integrate a mp3 flash player in product_listing.php,
it will be triggered by pressing the preview button, like this:

http://www.dlsounds.com/music/index.php?main_page=index&cPath=1

as you can see it is working but missing the mp3 file to load. he needs to load the correspondending file from a preview folder in the root.

I managed to load a individual mp3 file by using the full url with this code:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="165" height="38" id="niftyPlayer1" align="">
  <PARAM NAME=autostart VALUE=false>
  <param name=movie value="niftyplayer.swf?file=http://www.dlsounds.com/any_file.mp3">
  <param name=autoplay value=false>
  <param name=quality value=high>
  <param name=bgcolor value=#FFFFFF>
  <embed src="niftyplayer.swf?file=http://www.dlsounds.com/any_file.mp3 quality=high bgcolor=#FFFFFF width="165" height="38" name="niftyPlayer1" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
  </embed>
</object>

But now I need the path to the product preview files.

in product_listing.php I found this reference:

//$song_mp3='<a href= "index.php?main_page=product_music_info&products_id='.(int)$listing->fields['products_id'].'&products_preview='.$listing->fields['products_attributes_mp3_preview'].'">mp3'.'</a>';
		
		//print_r($listing->fields);
		$width = 50;
		$height = 50;
		
		if($listing->fields['products_attributes_mp3_preview']) {
			$path = 'previews/'.$listing->fields['products_attributes_mp3_preview'];
			$song = $listing->fields['products_attributes_mp3_preview'];

any clue which path i have to use here:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="165" height="38" id="niftyPlayer1" align="">
  <PARAM NAME=autostart VALUE=false>
  <param name=movie value="niftyplayer.swf?file=PATH?">
  <param name=autoplay value=false>
  <param name=quality value=high>
  <param name=bgcolor value=#FFFFFF>
  <embed src="niftyplayer.swf?file=PATH? quality=high bgcolor=#FFFFFF width="165" height="38" name="niftyPlayer1" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
  </embed>
</object>

Many thanks!!

23 Aug 2009, 1:40 AM
#2
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: need the right path in product_listing.php

I have done this with video clips as shown here by Kiddo. This is from includes/templates/MY_TEMPLATE/templates/tpl_product_info_display.php

<?php
$movie = $products_model;
$movie_file = "/home/xxxxxx/public_html/media/" . $movie . ".flv";
if(file_exists($movie_file))
{?>

<table class="videoBox" align="right"><tr><td>
<script type="text/javascript">
AC_FL_RunContent(
'class','kimplayer',
'width','500',
'height','375',
'allowFullScreen','true',
'data','/FLVplayer/player_flv_maxi.swf',
'type','application/x-shockwave-flash',
'movie','/FLVplayer/player_flv_maxi',
'flashvars','flv=/media/<?php echo $movie;?>.flv&width=500&height=375&showstop=1&showvolume=1&showfullscreen=1&showtime=1&bgcolor1=white&bgcolor2=white&startimage=/images/anchor1.gif' ); //end AC code
</script>
</td></tr></table><br class="clearBoth" />
<?php } ?>
```As you can see, the first bit of code creates a path to the file, you need to name the mp3 to the name of the product for it to work with this codes but you could modify it to use a different identifier. Set the path in $movie_file to where you have the mp3s and insert the line 
```php
<?php echo $movie ?> 
```here(assuming the mp3s are in the media directory)
```php
<param name=movie value="niftyplayer.swf?file=/media/<?php echo $movie ?>.mp3">
```and here

```php
<embed src="niftyplayer.swf?file=/media/<?php echo $movie ?>.mp3 quality=high bgcolor=#FFFFFF width="165" height="38" name="niftyPlayer1" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
3 Sep 2009, 8:32 PM
#3
gsallen101289 avatar

gsallen101289

New Zenner

Join Date:
Aug 2009
Posts:
44
Plugin Contributions:
0

Re: need the right path in product_listing.php

Which side box needs to be enabled to display this? Thank you!

5 Sep 2009, 10:31 AM
#4
pascal020 avatar

pascal020

New Zenner

Join Date:
Aug 2009
Posts:
43
Plugin Contributions:
0

Re: need the right path in product_listing.php

Thanks lankeeyankee,

I managed to trigger the files with simple javascript calls

@ gsallen101289

the flash player is not a standard of zen cart.

I use a music add on and a fully customized open source (niftyplayer) flash player.

5 Nov 2009, 3:44 PM
#5
tacousti avatar

tacousti

New Zenner

Join Date:
Nov 2009
Posts:
1
Plugin Contributions:
0

Re: need the right path in product_listing.php

I would love to see examples of Zen Cart sites with flash previews of MP3 downloads... maybe hire somebody to help with this too.

Any URLs you can suggest that I look at?