Zen Cart Logo
Forums / General Questions / Need help with Audio preview hack - product display

Need help with Audio preview hack - product display

Locked

Views: 3,531

Results 1 to 17 of 17
This thread is locked. New replies are disabled.
1 Dec 2008, 8:39 AM
#1
maxima avatar

maxima

New Zenner

Join Date:
Jun 2006
Posts:
86
Plugin Contributions:
0

Need help with Audio preview hack - product display

(didn't see a forum for 'core hacks')

I want to have an audio sample player (AdobeFlash) display in product_info and I have been trying all kinds of ways but all fails and I need some assistance please.

My Concept (can be visually reviewed at zuagoo.com/zc
I want to mimmick a portion of the media manager where there is an upload field for media files on the add products page which delivers to the media folder in root. Then drop select to choose from a list of media extensions.

The Flash file can be configured to play mp3, flv, wmv so a series of 'IF' conditions would exist in the output file to choose the proper string based on the extension selected.

I tried to copy codes from all the files I found related to media manager and place them in the product_info but all return errors and after 5 days of this I now need guru help


I currently have previews working with the flash player using a hack I did to the media manager and one could consider this ok but using the media manager is a bit tedious especially if I forget to assign the item to products_music, then I have to delete and do it all over.

Here is the hack I did;
file: includes/templates/mine/templates/tpl_modules_media_manager.php line 31 I replaced

      
<div class="mediaTypeLink"><a href="<?php echo zen_href_link(DIR_WS_MEDIA  . $za_clip['clip_filename'], '', 'NONSSL', false, true, true); ?>" target="_blank"><?php echo '<span class="mediaClipFilename">' . $za_clip['clip_filename'] . '</span>' . (!empty($za_clip['clip_type']) ? '<span class="mediaClipType"> (' . $za_clip['clip_type'] . ')</span>' : ''); ?></a></div>

with

<div class="mediaTypeLink">
      <embed width="25" flashvars="mp3=<?php echo DIR_WS_MEDIA  . $za_clip['clip_filename'], ''; ?>&width=25&bgcolor1=ffcc00&bgcolor2=222222&showslider=0&volume=200" pluginspage="http://www.macromedia.com/go/getflashplayer" allowscriptaccess="always" allowfullscreen="true" bgcolor="" quality="high" height="20" src="media/player.swf"></embed>
      </div>

This now allows the mp3 files to be played via embedded Flash player and not download or try to open some other locally installed application as did the previous hyperlink. Ofcourse you need to get the Flash media player from any of the many free sites around.

1 Dec 2008, 6:55 PM
#2
maxima avatar

maxima

New Zenner

Join Date:
Jun 2006
Posts:
86
Plugin Contributions:
0

Re: Need help with Audio preview hack - product display

I have seen 2 oscommerce websites with the preview player but can't tell if it is done automatically or manually. This would be a great plugin. Seeking help.....

2 Dec 2008, 10:39 PM
#3
maxima avatar

maxima

New Zenner

Join Date:
Jun 2006
Posts:
86
Plugin Contributions:
0

Re: Need help with Audio preview hack - product display

So does anyone want to get on this?

3 Dec 2008, 8:10 AM
#4
maxima avatar

maxima

New Zenner

Join Date:
Jun 2006
Posts:
86
Plugin Contributions:
0

Re: Need help with Audio preview hack - product display

Maybe my concept is not fully understood so see the image for clarity

4 Dec 2008, 6:32 PM
#5
maxima avatar

maxima

New Zenner

Join Date:
Jun 2006
Posts:
86
Plugin Contributions:
0

Re: Need help with Audio preview hack - product display

Just any idea would be a start here...

5 Dec 2008, 7:20 PM
#6
maxima avatar

maxima

New Zenner

Join Date:
Jun 2006
Posts:
86
Plugin Contributions:
0

Re: Need help with Audio preview hack - product display

The quest continues. This is a vital plugin people!

6 Dec 2008, 4:08 PM
#7
maxima avatar

maxima

New Zenner

Join Date:
Jun 2006
Posts:
86
Plugin Contributions:
0

Re: Need help with Audio preview hack - product display

What does it take to get some attention here?

6 Dec 2008, 4:15 PM
#8
charmedbytina2 avatar

charmedbytina2

Totally Zenned

Join Date:
Mar 2007
Location:
AZ
Posts:
1,890
Plugin Contributions:
0

Re: Need help with Audio preview hack - product display

maxima:

What does it take to get some attention here?

Have you posted in the Commercial Help Wanted Section?

Tina

6 Dec 2008, 4:27 PM
#9
maxima avatar

maxima

New Zenner

Join Date:
Jun 2006
Posts:
86
Plugin Contributions:
0

Re: Need help with Audio preview hack - product display

I wasn't seeking commercial help but is that why this thread is being ignored? There are so many other threads like this where someone get help with some hack they are attempting so why do I have to seek commercial? I figured there were other users who may have attempted this hack and have it working successfully or in the process and we can exchange efforts to make it work! Isn't that what the forum is about?

6 Dec 2008, 4:29 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Need help with Audio preview hack - product display

maxima:

I figured there were other users who may have attempted this hack and have it working successfully or in the process and we can exchange efforts to make it work! Isn't that what the forum is about?Yup, that's exactly what it's about.
And, apparently thus far you're the only one trying to do that particular hack.

7 Dec 2008, 2:13 AM
#11
maxima avatar

maxima

New Zenner

Join Date:
Jun 2006
Posts:
86
Plugin Contributions:
0

Re: Need help with Audio preview hack - product display

Ok... but the gurus as yourself, DrByte, have offered assistance even when others have not sought the the modification another is attempting and that is what I am looking for. I have posted my concept and those who know the script can offer some ideas. I'll make the effort as I have been and will publish any successful resource.

8 Jan 2009, 2:24 PM
#12
previewlounge avatar

previewlounge

New Zenner

Join Date:
Jan 2009
Posts:
25
Plugin Contributions:
0

Re: Need help with Audio preview hack - product display

hi Maxima,
i am interested in what you are attempting here ...
very much so!
i am too much of a noob to know if it is all just too much,
however i do not think it is impossible ..
indeed, quite possible, surely.

8 Jan 2009, 2:29 PM
#13
previewlounge avatar

previewlounge

New Zenner

Join Date:
Jan 2009
Posts:
25
Plugin Contributions:
0

Re: Need help with Audio preview hack - product display

maxima:

The Flash file can be configured to play mp3, flv, wmv so a series of 'IF' conditions would exist in the output file to choose the proper string based on the extension selected.

okay quick question here, i am thinking like a java programmer .. or a flash actionscripter ..

surely there is a more elegant way than a series of 'if' statements? (no offense intended .. what you have done is more elegant than i could hope to achieve at this time ... just trying to help eh.)

perhaps... i dno ... like a repeating array search method that may be more friendly to the zen cart backend?

.. oh, if only i knew PHP.

27 Dec 2009, 5:17 AM
#16
dready80 avatar

dready80

New Zenner

Join Date:
Dec 2009
Posts:
4
Plugin Contributions:
0

Re: Need help with Audio preview hack - product display

maxima:

The quest continues. This is a vital plugin people!
Click on my signature below to view functionality of the above script (Demo under Categories>Downloadable Media).

Guess what Maxima! Let's end this quest here and NOW!
Why? Because I've solved it for us. I know this is an old thread, but I think and still hope you and all those that replied your call are still available to benefit from this. Well, below are my modifications and additions to tpl_modules_media_manager.php (save a copy of this file before anything!).

Replace the code below:

<div class="mediaTypeLink"><a href="<?php echo zen_href_link(DIR_WS_MEDIA  . $za_clip['clip_filename'], '', 'NONSSL', false, true, true); ?>" target="_blank"><?php echo '<span class="mediaClipFilename">' . $za_clip['clip_filename'] . '</span>' . (!empty($za_clip['clip_type']) ? '<span class="mediaClipType"> (' . $za_clip['clip_type'] . ')</span>' : ''); ?></a></div>

With the code below:
(I have more information below this code)

<?php
     switch ($za_clip['clip_type']) {
	case "MP3":
	case "OGG":
	case "WAV":
	case "MID":
	case "WMA":
	case "AIF":
	case "AIFF":
	case "RA":
 ?>
      <div class="mediaTypeLink"><embed src="<?php echo zen_href_link(DIR_WS_MEDIA  . $za_clip['clip_filename'], '', 'NONSSL', false, true, true); ?>" autostart="false" ENDTIME="00:45" VOLUME="65" width="72" height="26"><br> Play Preview (45 Sec.): <?php echo '<span class="mediaClipFilename">' . $za_clip['clip_filename'] . '</span>' . (!empty($za_clip['clip_type']) ? '<span class="mediaClipType"> (' . $za_clip['clip_type'] . ')</span>' : ''); ?></embed>.<br>As Recorded by <?php echo '<span class="mediaClipFilename">' . $products_artist_name . '</span>' ?><br></div><br><p>
 <?php
           break;
	case "AVI":
	case "MPG":
	case "FLV":
	case "MOV":
	case "3G2":
	case "3GP":
	case "ASF":
	case "ASX":
	case "MP4":
	case "MPEG":
	case "RM":
	case "SWF":
	case "VOB":
	case "WMV":
 ?>
      <div class="mediaTypeLink"><embed src="<?php echo zen_href_link(DIR_WS_MEDIA  . $za_clip['clip_filename'], '', 'NONSSL', false, true, true); ?>" autostart="false" ENDTIME="00:45" VOLUME="65"> Play Preview (45 Sec.): <?php echo '<span class="mediaClipFilename">' . $za_clip['clip_filename'] . '</span>' . (!empty($za_clip['clip_type']) ? '<span class="mediaClipType"> (' . $za_clip['clip_type'] . ')</span>' : ''); ?></embed>.<br>As Presented by <?php echo '<span class="mediaClipFilename">' . $products_artist_name . '</span>' ?></div><br><p>
 <?php
           break;
	case "JPG":
	case "BMP":
	case "PNG":
	case "TIFF":
	case "GIF":
 ?>
      <div class="mediaTypeLink"><table background="<?php echo zen_href_link(DIR_WS_MEDIA  . $za_clip['clip_filename'], '', 'NONSSL', false, true, true); ?>"><SPAN onMouseOver="document.pic1.src='someimagefilepath.gif'" onMouseOut="document.pic1.src='<?php echo zen_href_link(DIR_WS_MEDIA  . $za_clip['clip_filename'], '', 'NONSSL', false, true, true); ?>'" ><img src="<?php echo zen_href_link(DIR_WS_MEDIA  . $za_clip['clip_filename'], '', 'NONSSL', false, true, true); ?>" alt="Picture/Image" width=360 height=240 name="pic1"></span></table><br>Image Preview: <?php echo '<span class="mediaClipFilename">' . $za_clip['clip_filename'] . '</span>' . (!empty($za_clip['clip_type']) ? '<span class="mediaClipType"> (' . $za_clip['clip_type'] . ')</span>' : ''); ?>.<br>As Illustrated by <?php echo '<span class="mediaClipFilename">' . $products_artist_name . '</span>' ?></div><br><p>
 <?php
           break; 
 }
 ?>

I used the switch case function to identify sound files, video files and image files, and modified the original code 3 ways to display the different groups of files uniquely. Note that these are all files I upload through the media manager module (Extras) and add to products.
One more thing...
In the last DIV tag:

<div class="mediaTypeLink"><table background="<?php echo zen_href_link(DIR_WS_MEDIA  . $za_clip['clip_filename'], '', 'NONSSL', false, true, true); ?>"><SPAN onMouseOver="document.pic1.src='someimagefilepath.gif'" onMouseOut="document.pic1.src='<?php echo zen_href_link(DIR_WS_MEDIA  . $za_clip['clip_filename'], '', 'NONSSL', false, true, true); ?>'" ><img src="<?php echo zen_href_link(DIR_WS_MEDIA  . $za_clip['clip_filename'], '', 'NONSSL', false, true, true); ?>" alt="Picture/Image" width=360 height=240 name="pic1"></span></table><br>Image Preview: <?php echo '<span class="mediaClipFilename">' . $za_clip['clip_filename'] . '</span>' . (!empty($za_clip['clip_type']) ? '<span class="mediaClipType"> (' . $za_clip['clip_type'] . ')</span>' : ''); ?>.<br>As Illustrated by <?php echo '<span class="mediaClipFilename">' . $products_artist_name . '</span>' ?></div>

Locate someimagefilepath.gif, and replace it with an image file of your choice that fits the width and height of your image display. Ensure you have such an image at the path you specify (if anywhere other than in the templates folder where tpl_modules_media_manager.php resides). It contributes to the safety of images you upload (not foolproof) in case you intend to have people buy them. You could also get a free no-right-click script to disable any rightclick and savefileas attempts against your site.
Click on my signature below to view functionality of the above script (Demo under Categories>Downloadable Media).
:cheers::clap:

13 Mar 2010, 3:19 PM
#17
flipperry avatar

flipperry

New Zenner

Join Date:
Feb 2009
Posts:
79
Plugin Contributions:
0

Re: Need help with Audio preview hack - product display

One option that works with the media manager is this: FREE SOFTWARE ADDONS > Search for the "Media Manager MP3 Player" and THERE YOU GO!!!