vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How can I implement javascript into php? (https://vborg.vbsupport.ru/showthread.php?t=180856)

credenscel 05-29-2008 03:26 AM

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

http://i33.photobucket.com/albums/d5...nscel/code.jpg


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>


Dismounted 05-29-2008 06:22 AM

Script tags are not allowed, and are filtered even when you enable HTML. That looks like a bug that may exist in vBulletin.

credenscel 05-29-2008 04:55 PM

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?

Opserty 05-29-2008 06:30 PM

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">
but it should be:
Code:

<a href="http://www.wiredonhonda.com/vb/showthread.php?t=1185" id="adLink1" target="_blank">
Maybe that might help? Bit of a wild guess...

credenscel 05-29-2008 07:00 PM

no still doesnt work :-( the problem is that i cannot post javascript into vbadvanced even though HTML code is allowed.

Opserty 05-29-2008 07:06 PM

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.


All times are GMT. The time now is 06:49 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01511 seconds
  • Memory Usage 1,727KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete