The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How can I implement javascript into php?
I am using vbadvanced for my front page (site is http://www.wiredonhonda.com
I wanted to add to the big bulletin board section, where it starts with the "welcome to wiredonhonda.com" and then lists all the news/info about the site, a rotating banner. allow me to elaborate: Sites like: formulad.com or tunerzine.com use the "rotating banner" for their annoucements and that is what i would like to use on the front page while keeping the right section of the vbadvance module (log in, user cp etc) as they are. I have the javascript code but when I paste it into the vbadvanced section it does not work. all of these codes are on for this section only: vB code is On Smilies are On [IMG] code is On HTML code is On But: when i put the rotating banner code withing "code" tags then it works but looks something like this would you please let me know how i can use the javascript code without the "code" tags because it just doesnt look right. It has the greyed out background and says "code" on top. I look forward to your feedback! here's the javascript code just in case HTML Code:
<script type="text/javascript"> var imgs1 = new Array("http://www.wiredonhonda.com/photos/eibach08/slides/eibach08001.jpg","http://www.wiredonhonda.com/photos/tonygarciacrx/slides/tonygarciacrx001.jpg","http://www.wiredonhonda.com/photos/tgpraces/slides/tgpraces095.jpg"); var lnks1 = new Array("http://www.wiredonhonda.com/vb/showthread.php?t=1185","http://www.wiredonhonda.com/vb/showthread.php?t=1133","http://www.wiredonhonda.com/vb/showthread.php?t=1079"); var alt1 = new Array(); var currentAd1 = 0; var imgCt1 = 3; function cycle1() { if (currentAd1 == imgCt1) { currentAd1 = 0; } var banner1 = document.getElementById('adBanner1'); var link1 = document.getElementById('adLink1'); banner1.src=imgs1[currentAd1] banner1.alt=alt1[currentAd1] document.getElementById('adLink1').href=lnks1[currentAd1] currentAd1++; } window.setInterval("cycle1()",3000); </script> <a href=""http://www.wiredonhonda.com/vb/showthread.php?t=1185"" id="adLink1" target="_blank"> <img src="http://www.wiredonhonda.com/photos/eibach08/slides/eibach08001.jpg" id="adBanner1" border="0" width="468"></a> |
#2
|
||||
|
||||
Script tags are not allowed, and are filtered even when you enable HTML. That looks like a bug that may exist in vBulletin.
|
#3
|
|||
|
|||
thanks for the reply. i am using vb 3.6.8 does anyone know if the latest upgrade fixes this problem? (upgrade to 3.7).. Or does anyone know how to fix the bug?
|
#4
|
|||
|
|||
Hmm I am not sure but on the 2nd from last line you have:
Code:
<a href=""http://www.wiredonhonda.com/vb/showthread.php?t=1185"" id="adLink1" target="_blank"> Code:
<a href="http://www.wiredonhonda.com/vb/showthread.php?t=1185" id="adLink1" target="_blank"> |
#5
|
|||
|
|||
no still doesnt work :-( the problem is that i cannot post javascript into vbadvanced even though HTML code is allowed.
|
#6
|
|||
|
|||
I don't think javascript is allowed in order to prevent people from abusing the right to post HTML and cause damage to your site or people browsing it.
You might be able to create some custom BBCode or something, I think that allows you to use Javascript. Otherwise you will need to include your Javascript in a template and post the rest of the HTML in the post. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|