Flash audio buttons in posts

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
YaKnowGuy
Regular
Posts: 13
Joined: Mon Dec 13, 2004 12:28 pm

Flash audio buttons in posts

Post by YaKnowGuy »

Hi,

Im wanting to use flash audio buttons in posts. When I paste the HTML code in text mode, the preview shows all fine including the buttons (which work), but once I Save the post, the blog just shows a scroll box instead of the buttons.

The full path of the swf file is specified in the code...http://.....etc

Thanks,
Greg
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Flash audio buttons in posts

Post by garvinhicking »

If you give us a URL to look at with that code, we may be able to help you...

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
YaKnowGuy
Regular
Posts: 13
Joined: Mon Dec 13, 2004 12:28 pm

Here is the offending code :)

Post by YaKnowGuy »

Thanks so much for the reply Gavin. Here is the offending code.
The main part we need to look at is the <OBJECT section I think.
I have seen flash buttons being used in a MT user forum and it work. I would much rather stay with you guys!

Thanks Greg


<p align="center" style="margin-top:0; margin-bottom:0"><b><span style="background-color: #E6E6D9"><font face="Arial" size="1" color="#800000"><br>
</font><font face="Arial" size="2" color="#800000"> Click the play button below to listen <br>
 to Greg's </font><font face="Arial" size="2" color="#0000FF"><i>1 minute</i></font><font face="Arial" size="2" color="#800000"> audio message </font>
</span><font face="Arial" size="2">
<br>
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="https://download.macromedia.com/pub/sho ... on=6,0,0,0"
WIDTH="130"
HEIGHT="40"
id="MiniCourseIntroFinal"
ALIGN="middle">
<PARAM NAME=movie VALUE="http://www.sharedmemories.com.au/audio/ ... oFinal.swf">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#FFFFFF>
<PARAM NAME=wmode VALUE="transparent">
<EMBED
src="http://www.sharedmemories.com.au/audio/ ... oFinal.swf"
quality=high
bgcolor=#FFFFFF
NAME="MiniCourseIntroFinal"
WIDTH="130"
HEIGHT="40"
ALIGN="middle"
WMODE="transparent"
TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>
<!-- End Cut and Paste Voice File Code -->
</font></b></p>
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Here is the offending code :)

Post by garvinhicking »

The fix is quite easy: Either you need to remove the "nl2br markup plugin" or you need to remove the linebreaks within the <object> tag.

As it is now, your object tag will contain

Code: Select all

<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"<br />
  <br />codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"<br />
  WIDTH="130"<br />
  HEIGHT="40"<br />
  id="MiniCourseIntroFinal"<br />
  ALIGN="middle"><br />
Which is no valid HTML markup. Easiest thing would be to remove the redundant linebreaks, because the nl2br plugin *does* have its good uses :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
YaKnowGuy
Regular
Posts: 13
Joined: Mon Dec 13, 2004 12:28 pm

Still a problem

Post by YaKnowGuy »

Hi Gavin,

Thanks so much for the reply. I really appreciate your time on this.

Still a problem though. Maybe I'm missing something here, but this is what I've done.

1. Removed any line breaks, so the code flowed. Nope!
2. Removed nl2br and repasted the code in WYSIWG mode (text). Nope!

I'm getting exactly the same result. Is there something I can do to help you help me. If you would like, I can create a logon for you or what ever. I feel so frustrated that something so difficult now will be so simple once I find out!

FYI the blog url is:

http://www.sharedmemories.info/blog

Thanks again Gavin,
Greg
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Still a problem

Post by garvinhicking »

Looking at your HTML Code, the problem is this:

You use a classid="clsid:D27CDB6E..." attribute in your object tag. Serendipity does automatic Smilie transformation, and hits you ful on the ":D" part which it tries to transform into a laughing smilie.

There are three ways you can to do solve this:

1. Turn off smilie transformations (disable plugin Markup: Emoticate)
2. Try to write the attribute as 'classid="clsid: D27CDB6E..."' by inserting a space to separete the smilie
3. Fix the regular expression that parses the smilie so it needs spacings/tabs before the smilies. That's what I have just committed to CVS. To do this open your plugins/serendipity_event_emoticate/serendipity_event_emoticate.php file and on line 133 change this line:

Code: Select all

                                $element = preg_replace("/([\t\ ]?)" . preg_quote($key, '/') . "([\t\ \!\.\)]?)/m",
to this:

Code: Select all

                                $element = preg_replace("/([\t\s]+)" . preg_quote($key, '/') . "([\t\s\!\.\)]+)/m",
HTH,
Garvin.
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
YaKnowGuy
Regular
Posts: 13
Joined: Mon Dec 13, 2004 12:28 pm

Post by YaKnowGuy »

Success!!

Gavin,

The answer was the emoticon file edit. I did that 1st and bingo!
What on earth made you think of that?!? I know, being in IT 30 years I run across these *simple* probs all the time. Once you know the answer its just soooo simple.

Thanks you again for your help and patience.

Regards,
Greg
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

You're welcome. It was just that I looked at the code, and that <img> in between made me curious. :)

But now you got it working: Go ahead and post, and have fun! :-)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply