Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-14-2004, 04:51 PM
ice chrono ice chrono is offline
 
Join Date: Jul 2004
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default need help in adding java in post/show thread

i am trying to add a simple Java scirpt in a skin i made for a forum

this Scirpt make images float around the page.. is there away to add it in?
Reply With Quote
  #2  
Old 09-14-2004, 05:48 PM
Jolten Jolten is offline
 
Join Date: Mar 2004
Posts: 749
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Add it to either your header or headinclude template
Reply With Quote
  #3  
Old 09-15-2004, 01:59 AM
ice chrono ice chrono is offline
 
Join Date: Jul 2004
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i tryed that.. seems it dosint want to work
this is the java i am trying to use
Code:
<script language="javascript" type="text/javascript">
<!-- Beginning of JavaScript -

// URLs of floating images. Add as many images as you like.
// ATTENTION: Too many images will slow down the floating effect)
var your_image=new Array()
your_image[0]="http://www.pjrpg.com/spam.gif"
your_image[1]="http://www.pjrpg.com/spam.gif"
your_image[2]="http://www.pjrpg.com/spam.gif"
your_image[3]="http://www.pjrpg.com/spam.gif"
your_image[4]="http://www.pjrpg.com/spam.gif"


// You may add links for each image separately.
// In case you do not want to link a picture just add a '#' instead of an URL (see sample below)
var your_image_link=new Array()
your_image_link[0]="#"
your_image_link[1]="#"
your_image_link[2]="#"
your_image_link[3]="#"
your_image_link[4]="#"


// average speed of the floating images. Higher means faster. Change ONLY the number below.
var floatingspeed=5

// do not edit the variables below
var tempo=20
var numberofimages=your_image.length-1
var stepx=new Array()
var stepy=new Array()
for (i=0;i<=numberofimages;i++) {
	stepx[i]=randommaker(floatingspeed)
	stepy[i]=randommaker(floatingspeed)
}
var imgwidth=new Array()
var imgheight=new Array()
for (i=0;i<=numberofimages;i++) {
	imgwidth[i]=10
	imgheight[i]=10
}
var x,y
var marginbottom
var marginleft=0
var margintop=0
var marginright
var timer
var spancontent=new Array()
var imgpreload=new Array()
for (i=0;i<=your_image.length;i++) {
	imgpreload[i]=new Image()
	imgpreload[i].src=your_image[i]
}

for (i=0;i<=numberofimages;i++) {
	spancontent[i]="<a href='"+your_image_link[i]+"'><img src='"+your_image[i]+"' border='0'></a>"
}

function setValues() {
	if (document.all) {
    	marginbottom=document.body.clientHeight-5
    	marginright=document.body.clientWidth-5
		for (i=0;i<=numberofimages;i++) {             
			var thisspan = eval("document.all.span"+i)
    		thisspan.innerHTML=spancontent[i]
			var thisspan = eval("document.all.span"+(i)+".style")
           	thisspan.posLeft=randommaker(marginright)
			thisspan.posTop=randommaker(marginbottom)  
		}
		for (i=0;i<=numberofimages;i++) {
			var thisspan = eval("document.all.span"+i)
			imgwidth[i]=thisspan.offsetWidth
			imgheight[i]=thisspan.offsetHeight
			
		}
		checkmovement()
	}
	if (document.layers) {
    	marginbottom=window.innerHeight-5
    	marginright=window.innerWidth-5
		for (i=0;i<=numberofimages;i++) {             
			var thisspan=eval("document.span"+i+".document")
    		thisspan.write(spancontent[i])
			thisspan.close()
			var thisspan=eval("document.span"+i)
           	thisspan.left=randommaker(marginright)
			thisspan.top=randommaker(marginbottom)  
		}
		for (i=0;i<=numberofimages;i++) {
			var thisspan=eval("document.span"+i+".document")
			imgwidth[i]=thisspan.width
			imgheight[i]=thisspan.height
		}
    	checkmovement()
	}
}

function randommaker(range) {		
	rand=Math.floor(range*Math.random())
	if (rand==0) {rand=Math.ceil(range/2)}
    return rand
}

function checkmovement() {
	if (document.all) {
		checkposition()
		movepictures()
    	timer=setTimeout("checkmovement()",tempo)
	}
	if (document.layers) {
		checkposition()
   		movepictures()
    	timer=setTimeout("checkmovement()",tempo)
	}
}

function movepictures() {
		if (document.all) {
			for (i=0;i<=numberofimages;i++) {  
    			var thisspan=eval("document.all.span"+(i)+".style")
    			thisspan.posLeft+=stepx[i]
				thisspan.posTop+=stepy[i]
    		}
		}
		if (document.layers) {
			for (i=0;i<=numberofimages;i++) {  
    			var thisspan = eval("document.span"+i)
    			thisspan.left+=stepx[i]
				thisspan.top+=stepy[i]
    		}
		}
}

function checkposition() {
	if (document.all) {
		for (i=0;i<=numberofimages;i++) {             
			var thisspan=eval("document.all.span"+i+".style")
			if (thisspan.posLeft>marginright-imgwidth[i]) {
				thisspan.posLeft-=Math.abs(stepx[i]+1)
				stepx[i]=randommaker(floatingspeed)*-1	
			}
			if (thisspan.posLeft<marginleft) {
				thisspan.posLeft+=Math.abs(stepx[i])
				stepx[i]=randommaker(floatingspeed)			
			}	
			if (thisspan.posTop>marginbottom-imgheight[i]) {
				thisspan.posTop-=Math.abs(stepy[i])
				stepy[i]=randommaker(floatingspeed)*-1

			}
			if (thisspan.posTop<margintop) {
				thisspan.posTop+=Math.abs(stepy[i])
				stepy[i]=randommaker(floatingspeed)
			}
		}
	}
	if (document.layers) {
		for (i=0;i<=numberofimages;i++) {             
			var thisspan=eval("document.span"+i)
			if (thisspan.left>marginright-imgwidth[i]) {
				thisspan.left-=Math.abs(stepx[i]+1)
				stepx[i]=randommaker(floatingspeed)*-1	
			}
			if (thisspan.left<marginleft) {
				thisspan.left+=Math.abs(stepx[i])
				stepx[i]=randommaker(floatingspeed)			
			}	
			if (thisspan.top>marginbottom-imgheight[i]) {
				thisspan.top-=Math.abs(stepy[i])
				stepy[i]=randommaker(floatingspeed)*-1

			}
			if (thisspan.top<margintop) {
				thisspan.top+=Math.abs(stepy[i])
				stepy[i]=randommaker(floatingspeed)
			}
		}
	}
}

// - End of JavaScript - -->
</script>
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:51 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.03454 seconds
  • Memory Usage 2,186KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete