PDA

View Full Version : Enable Javascript in CMS


Paidy
03-06-2011, 02:10 AM
Hi, I am trying to enable Javascript in articles in my CMS. I want to basically place a music player in some of my blog posts, but it doesn't render.


Example:

<script type="text/javascript">var hcode="7f9uf2itkk62";var htitle="The Game - No Seeds (Prod. By Dre & Vidal) - STUDIOLEAKS.INFO.mp3";var hwidth="410";var zombie="raven";</script><script type="text/javascript" src="http://play.hulkshare.com/embed.js"></script>


Thanks

Lynne
03-06-2011, 02:30 AM
And what is the result of adding that - can we get a link to see it? And, does your usergroup have permission to post html in articles?

Paidy
03-06-2011, 03:09 AM
I am an admin and yup the permissions are set.

The result of that code is a media player like here: http://hulkshare.com/l5y5kx6n8nu2

I found other people have placed mp3 players in their forums by adding an mp3 BBcode tag with <embed src="{param}" /> but when I do that it works fine in the BBCODE preview window but when I post on my forums it comes up as:

http://www1.hulkshare.com/d/6wg7ekoe5kuss3pdfwbacwrfujhvclx3246ksc7vr4/The%20Game%20-%20No%20Seeds%20(Produced%20by%20dr.dre)%20Studiol eaks.info.mp3" />

So I'm not too sure. I need an MP3 media player

Lynne
03-06-2011, 03:43 AM
I'm confused by your first statement. You say you want to be able to put javascript in your CMS articles. Then you say you want to put it in your blog posts. The CMS articles and blog posts have nothing to do with each other. Then you talk about making BBCode and told us what the result is, but didn't both to tell us what you used in your bbcode and what the expected result should have been.

Exactly what is it that you want to be able to do? I cannot tell at all what you want from your descriptions.

Paidy
03-06-2011, 03:05 PM
My apologies for being confusing, I was just trying 100 different things at once and ended up getting confused in what I was trying to say.

I have managed to embed a media player using a custom BBCode on my CMS site but I am getting one peculiar error. On the main page of my CMS, my post with the media player in it shows a big black border around it and I'm not sure why.:

http://img834.imageshack.us/img834/540/85647344.png

When I go into the physical post, the black border is gone:

http://img269.imageshack.us/img269/1112/10209635.png

Why would the black border show up on my CMS home page but not inside the actual post? I checked the source code of both pages and the html is the exact same.

For reference, the code I custom BBCode I am using is:

<object type="application/x-shockwave-flash" data="/misc/audio-player/player.swf" id="audioplayer" height="24" width="290">
<param name="movie" value="/misc/audio-player/player.swf">
<param name="FlashVars" value="playerID=audioplayer&amp;soundFile={param}">
<param name="quality" value="high">
<param name="menu" value="false">
<param name="wmode" value="transparent">
</object>

and I have the following options selected:

Disable BB Code Within This BB Code: Yes
Disable Smilies Within This BB Code: Yes
Disable Word Wrapping Within This BB Code: Yes


Thanks for your help. Hopefully I was less confusing this time.

Lynne
03-06-2011, 03:50 PM
I would need a link to the CMS article in order to see why you are getting a black border. it's probably just some CSS on the page that you would be able to change. You could see it yourself if you have firebug for firefox to look at CSS.

Paidy
03-06-2011, 04:43 PM
Yup, my object on the main page was inheriting the .showobjectpreview css style which was giving it a weird size and border. Thanks for your help