Welcome to Geeklog, Anonymous Friday, March 29 2024 @ 06:40 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.

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
 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
 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
 Quote

Status: offline

UL

Forum User
Junior
Registered: 09/09/04
Posts: 22
Thanks to everyone for your help, I got it to work.
 Quote

All times are EDT. The time is now 06:40 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