vForums Support Banner


Visit Base Classics - Gaming Chairs

 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: Code Conflict [support] - View Topic
Topic Rating: *****
Printable View
Nick
Very Senior Member
*****

[Avatar]

Posts: 3,012
Status: Offline
Gender: Male
Location: vForums
Age: 34
Joined:  
Reputation: 62%  


pmwww
Code Conflict [support] (28th Oct 08 at 6:19pm UTC)
http://vfad.vforums.co.uk

For some reason my countup script

and Dwight's copy right/replace google search with forum search is conflicting, I tried all possible ways to fix this but it its not working

Here is my code:
Code:
 
  1. <center>
  2. <script language="JavaScript1.2">
  3.  
  4. /*Countup Script- © Infinity Codes (http://icodes.vforums.co.uk)
  5. For Virtual Forums Codes
  6. visit http://icodes.vforums.co.uk*/
  7.  
  8. function setcountup(theyear,themonth,theday){
  9. yr=theyear;mo=themonth;da=theday
  10. }
  11.  
  12. /*CONFIGURE THE countup SCRIPT HERE*/
  13.  
  14. /*STEP 1: Configure the date to count up from, in the format year, month, day:
  15. /*This date should be less than today
  16. setcountup(2007,11,29)
  17.  
  18. /*STEP 2: Configure text to be attached to count up
  19. var displaymessage="have passed since the debut of our site!"
  20.  
  21. /*STEP 3: Configure the below 5 variables to set the width, height, background color, and text style of the countup area
  22. var countupwidth='96%'
  23. var countupheight='20px' //applicable only in NS4
  24. var countupbgcolor=''
  25. var opentags='<font face="Verdana"><small>'
  26. var closetags='</small></font>'
  27.  
  28. /*DO NOT EDIT PASS THIS LINE*/
  29.  
  30. var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
  31. var crosscount=''
  32.  
  33. function start_countup(){
  34. if (document.layers)
  35. document.countupnsmain.visibility="show"
  36. else if (document.all||document.getElementById)
  37. crosscount=document.getElementById&&!document.all?document.getElementById("countupie") : countupie
  38. countup()
  39. }
  40.  
  41. if (document.all||document.getElementById)
  42. document.write('<span id="countupie" style="width:'+countupwidth+'; background-color:'+countupbgcolor+'"></span>')
  43.  
  44. window.onload=start_countup
  45.  
  46.  
  47. function countup(){
  48. var today=new Date()
  49. var todayy=today.getYear()
  50. if (todayy < 1000)
  51. todayy+=1900
  52. var todaym=today.getMonth()
  53. var todayd=today.getDate()
  54. var todayh=today.getHours()
  55. var todaymin=today.getMinutes()
  56. var todaysec=today.getSeconds()
  57. var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
  58. paststring=montharray[mo-1]+" "+da+", "+yr
  59. dd=Date.parse(todaystring)-Date.parse(paststring)
  60. dday=Math.floor(dd/(60*60*1000*24)*1)
  61. dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
  62. dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
  63. dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
  64.  
  65. if (document.layers){
  66. document.countupnsmain.document.countupnssub.document.write(opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+displaymessage+closetags)
  67. document.countupnsmain.document.countupnssub.document.close()
  68. }
  69. else if (document.all||document.getElementById)
  70. crosscount.innerHTML=opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+displaymessage+closetags
  71.  
  72. setTimeout("countup()",1000)
  73. }
  74. </script>
  75.  
  76. <ilayer id="countupnsmain" width=&{countupwidth}; height=&{countupheight}; bgColor=&{countupbgcolor}; visibility=hide><layer id="countupnssub" width=&{countupwidth}; height=&{countupheight}; left=0 top=0></layer></ilayer>
  77. </center>
 


and this is Dwights code:

Code:
 
  1. <script type="text/javascript">
  2. /*Google Search Into Quick Search
  3. Google Search has to be Activated!
  4. Created by Dwight*/
  5.  
  6. window.onload = function() {
  7. if(get('footerstats', ID)) {
  8. get('footerstats', ID).innerHTML = 'Copyright © Mage Designs 2008-09<br/ > All Rights Reserved';
  9. get('footertime', ID).style.display = 'none';
  10. get('vforums_search', ID).innerHTML = '<form action="/action/search" method="post" enctype="multipart/form-data" name="search_form"><input name="search_words" size="25" maxlength="100" value="" type="text"><br />Subject:<input name="subject" value="1" type="checkbox"> Message:<input name="message" value="1" type="checkbox"><input name="max_results" value="25" type="hidden"><input type="submit" value="Search" /></form>';
  11. }
  12. }
  13. </script>
 


What would be the problem?

The weird thing is yes I am a coder, but no I don't know much yet.

Thanks
dog199200
Guest
Re: Code Conflict [support] (29th Oct 08 at 4:32am UTC)
its the window.onload function clashing, its why I end up having to combined my codes to use them together. I would try this:

Code:
 
  1. <center>
  2. <script language="JavaScript1.2">
  3.  
  4. /*Countup Script- © Infinity Codes (http://icodes.vforums.co.uk)
  5. For Virtual Forums Codes
  6. visit http://icodes.vforums.co.uk*/
  7.  
  8. function setcountup(theyear,themonth,theday){
  9. yr=theyear;mo=themonth;da=theday
  10. }
  11.  
  12. /*CONFIGURE THE countup SCRIPT HERE*/
  13.  
  14. /*STEP 1: Configure the date to count up from, in the format year, month, day:
  15. /*This date should be less than today
  16. setcountup(2007,11,29)
  17.  
  18. /*STEP 2: Configure text to be attached to count up
  19. var displaymessage="have passed since the debut of our site!"
  20.  
  21. /*STEP 3: Configure the below 5 variables to set the width, height, background color, and text style of the countup area
  22. var countupwidth='96%'
  23. var countupheight='20px' //applicable only in NS4
  24. var countupbgcolor=''
  25. var opentags='<font face="Verdana"><small>'
  26. var closetags='</small></font>'
  27.  
  28. /*DO NOT EDIT PASS THIS LINE*/
  29.  
  30. var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
  31. var crosscount=''
  32.  
  33. function start_countup(){
  34. if (document.layers)
  35. document.countupnsmain.visibility="show"
  36. else if (document.all||document.getElementById)
  37. crosscount=document.getElementById&&!document.all?document.getElementById("countupie") : countupie
  38. countup()
  39. }
  40.  
  41. if (document.all||document.getElementById)
  42. document.write('<span id="countupie" style="width:'+countupwidth+'; background-color:'+countupbgcolor+'"></span>')
  43.  
  44. window.onload=start_countup
  45.  
  46.  
  47. function countup(){
  48. var today=new Date()
  49. var todayy=today.getYear()
  50. if (todayy < 1000)
  51. todayy+=1900
  52. var todaym=today.getMonth()
  53. var todayd=today.getDate()
  54. var todayh=today.getHours()
  55. var todaymin=today.getMinutes()
  56. var todaysec=today.getSeconds()
  57. var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
  58. paststring=montharray[mo-1]+" "+da+", "+yr
  59. dd=Date.parse(todaystring)-Date.parse(paststring)
  60. dday=Math.floor(dd/(60*60*1000*24)*1)
  61. dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
  62. dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
  63. dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
  64.  
  65. if (document.layers){
  66. document.countupnsmain.document.countupnssub.document.write(opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+displaymessage+closetags)
  67. document.countupnsmain.document.countupnssub.document.close()
  68. }
  69. else if (document.all||document.getElementById)
  70. crosscount.innerHTML=opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+displaymessage+closetags
  71.  
  72. setTimeout("countup()",1000)
  73. }
  74. if(get('footerstats', ID)) {
  75. get('footerstats', ID).innerHTML = 'Copyright © Mage Designs 2008-09<br/ > All Rights Reserved';
  76. get('footertime', ID).style.display = 'none';
  77. get('vforums_search', ID).innerHTML = '<form action="/action/search" method="post" enctype="multipart/form-data" name="search_form"><input name="search_words" size="25" maxlength="100" value="" type="text"><br />Subject:<input name="subject" value="1" type="checkbox"> Message:<input name="message" value="1" type="checkbox"><input name="max_results" value="25" type="hidden"><input type="submit" value="Search" /></form>';
  78. }
  79. }
  80. </script>
  81.  
  82. <ilayer id="countupnsmain" width=&{countupwidth}; height=&{countupheight}; bgColor=&{countupbgcolor}; visibility=hide><layer id="countupnssub" width=&{countupwidth}; height=&{countupheight}; left=0 top=0></layer></ilayer>
  83. </center>
 

Nick
Very Senior Member
*****

[Avatar]

Posts: 3,012
Status: Offline
Gender: Male
Location: vForums
Age: 34
Joined:  
Reputation: 62%  


pmwww
Re: Code Conflict [support] (29th Oct 08 at 5:00am UTC)
Does not show up now.
dog199200
Guest
Re: Code Conflict [support] (29th Oct 08 at 8:11am UTC)
Ok I have just tried several different things and neither of them worked, but when I have time I was going to recode my copyright and quick search code, so for now just use your countup script and i'll recode my codes when I have a chance, as well i'll try to find a temp fix for the current problem
Nick
Very Senior Member
*****

[Avatar]

Posts: 3,012
Status: Offline
Gender: Male
Location: vForums
Age: 34
Joined:  
Reputation: 62%  


pmwww
Re: Code Conflict [support] (29th Oct 08 at 8:54am UTC)
alright.
 Printable View

All times are GMT+0 :: The current time is 6:13am
Page generated in 2.096 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums