Welcome to Geeklog, Anonymous Friday, March 29 2024 @ 04:31 am EDT
Geeklog Forums
Javascript In Stories
Status: offline
UL
Forum User
Junior
Registered: 09/09/04
Posts: 22
Is there any possible way to add javascipt into your stories by editing the config.php file? I'm trying to add the following code into my story and haven't been able to find out how to do it.
<script>
function swap_in_video(swap_target, video_url)
{
swap_target.innerHTML = '<object id="MediaPlayer" width="320" height="290" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" standby="Loading Windows Media Player components..." type="application/x-oleobject"><param name="filename" value="' + video_url + '"/><param name="autoStart" value="true"/><param name="ShowStatusBar" value="true"/><param name="Volume" value="1"/><param name="ShowTracker" value="false"/><param name="ShowAudioControls" value="false"/><param name="ShowPositionControls" value="false"/><embed type="application/x-mplayer2" src="' + video_url + '" width="320" height="290" autoStart="true" ShowStatusBar="true" Volume="0" ShowTracker="false" ShowAudioControls="false" ShowPositionControls="false"></embed></object>';
}
</script>
Thanks
Text Formatted Code
<center><table><tr><td onclick='swap_in_video(this, "http://www.videosource.com/video.wmv")' style='cursor: pointer; cursor: hand;}'> <img src='http://www.imagesource.com/image.gif' border=0> </td></tr></table></center><script>
function swap_in_video(swap_target, video_url)
{
swap_target.innerHTML = '<object id="MediaPlayer" width="320" height="290" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" standby="Loading Windows Media Player components..." type="application/x-oleobject"><param name="filename" value="' + video_url + '"/><param name="autoStart" value="true"/><param name="ShowStatusBar" value="true"/><param name="Volume" value="1"/><param name="ShowTracker" value="false"/><param name="ShowAudioControls" value="false"/><param name="ShowPositionControls" value="false"/><embed type="application/x-mplayer2" src="' + video_url + '" width="320" height="290" autoStart="true" ShowStatusBar="true" Volume="0" ShowTracker="false" ShowAudioControls="false" ShowPositionControls="false"></embed></object>';
}
</script>
Thanks
5
6
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
You will have to allow the script tag (but only for the Admin, please!). See the FAQ: Why does Geeklog remove certain HTML tags?
There is, however, an additional built-in filter that will render all JavaScript onXXX events (onClick, etc.) invalid. You would have to disable that filter (in lib-common.php somewhere - search for "JS") if you want to use one of those. I'm not sure about the security implications of such a change, though ...
bye, Dirk
There is, however, an additional built-in filter that will render all JavaScript onXXX events (onClick, etc.) invalid. You would have to disable that filter (in lib-common.php somewhere - search for "JS") if you want to use one of those. I'm not sure about the security implications of such a change, though ...
bye, Dirk
5
5
Quote
Status: offline
beewee
Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
I believe it's possible to put Javascript in sideblocks and static pages, would that be an option?
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
5
8
Quote
All times are EDT. The time is now 04:31 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content