vForums Support :: Programming & Coding :: Code Requests & Support :: Code Conflict [support] - View Topic
| |
| Nick Very Senior Member
Posts: 3,012 Status: Offline Gender: Male Location: vForums Age: 34 Joined:
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: - <center>
- <script language="JavaScript1.2">
-
- /*Countup Script- © Infinity Codes (http://icodes.vforums.co.uk)
- For Virtual Forums Codes
- visit http://icodes.vforums.co.uk*/
-
- function setcountup(theyear,themonth,theday){
- yr=theyear;mo=themonth;da=theday
- }
-
- /*CONFIGURE THE countup SCRIPT HERE*/
-
- /*STEP 1: Configure the date to count up from, in the format year, month, day:
- /*This date should be less than today
- setcountup(2007,11,29)
-
- /*STEP 2: Configure text to be attached to count up
- var displaymessage="have passed since the debut of our site!"
-
- /*STEP 3: Configure the below 5 variables to set the width, height, background color, and text style of the countup area
- var countupwidth='96%'
- var countupheight='20px' //applicable only in NS4
- var countupbgcolor=''
- var opentags='<font face="Verdana"><small>'
- var closetags='</small></font>'
-
- /*DO NOT EDIT PASS THIS LINE*/
-
- var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
- var crosscount=''
-
- function start_countup(){
- if (document.layers)
- document.countupnsmain.visibility="show"
- else if (document.all||document.getElementById)
- crosscount=document.getElementById&&!document.all?document.getElementById("countupie") : countupie
- countup()
- }
-
- if (document.all||document.getElementById)
- document.write('<span id="countupie" style="width:'+countupwidth+'; background-color:'+countupbgcolor+'"></span>')
-
- window.onload=start_countup
-
-
- function countup(){
- var today=new Date()
- var todayy=today.getYear()
- if (todayy < 1000)
- todayy+=1900
- var todaym=today.getMonth()
- var todayd=today.getDate()
- var todayh=today.getHours()
- var todaymin=today.getMinutes()
- var todaysec=today.getSeconds()
- var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
- paststring=montharray[mo-1]+" "+da+", "+yr
- dd=Date.parse(todaystring)-Date.parse(paststring)
- dday=Math.floor(dd/(60*60*1000*24)*1)
- dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
- dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
- dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
-
- if (document.layers){
- document.countupnsmain.document.countupnssub.document.write(opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+displaymessage+closetags)
- document.countupnsmain.document.countupnssub.document.close()
- }
- else if (document.all||document.getElementById)
- crosscount.innerHTML=opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+displaymessage+closetags
-
- setTimeout("countup()",1000)
- }
- </script>
-
- <ilayer id="countupnsmain" width=&{countupwidth}; height=&{countupheight}; bgColor=&{countupbgcolor}; visibility=hide><layer id="countupnssub" width=&{countupwidth}; height=&{countupheight}; left=0 top=0></layer></ilayer>
- </center>
and this is Dwights code:
Code: - <script type="text/javascript">
- /*Google Search Into Quick Search
- Google Search has to be Activated!
- Created by Dwight*/
-
- window.onload = function() {
- if(get('footerstats', ID)) {
- get('footerstats', ID).innerHTML = 'Copyright © Mage Designs 2008-09<br/ > All Rights Reserved';
- get('footertime', ID).style.display = 'none';
- 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>';
- }
- }
- </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: - <center>
- <script language="JavaScript1.2">
-
- /*Countup Script- © Infinity Codes (http://icodes.vforums.co.uk)
- For Virtual Forums Codes
- visit http://icodes.vforums.co.uk*/
-
- function setcountup(theyear,themonth,theday){
- yr=theyear;mo=themonth;da=theday
- }
-
- /*CONFIGURE THE countup SCRIPT HERE*/
-
- /*STEP 1: Configure the date to count up from, in the format year, month, day:
- /*This date should be less than today
- setcountup(2007,11,29)
-
- /*STEP 2: Configure text to be attached to count up
- var displaymessage="have passed since the debut of our site!"
-
- /*STEP 3: Configure the below 5 variables to set the width, height, background color, and text style of the countup area
- var countupwidth='96%'
- var countupheight='20px' //applicable only in NS4
- var countupbgcolor=''
- var opentags='<font face="Verdana"><small>'
- var closetags='</small></font>'
-
- /*DO NOT EDIT PASS THIS LINE*/
-
- var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
- var crosscount=''
-
- function start_countup(){
- if (document.layers)
- document.countupnsmain.visibility="show"
- else if (document.all||document.getElementById)
- crosscount=document.getElementById&&!document.all?document.getElementById("countupie") : countupie
- countup()
- }
-
- if (document.all||document.getElementById)
- document.write('<span id="countupie" style="width:'+countupwidth+'; background-color:'+countupbgcolor+'"></span>')
-
- window.onload=start_countup
-
-
- function countup(){
- var today=new Date()
- var todayy=today.getYear()
- if (todayy < 1000)
- todayy+=1900
- var todaym=today.getMonth()
- var todayd=today.getDate()
- var todayh=today.getHours()
- var todaymin=today.getMinutes()
- var todaysec=today.getSeconds()
- var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
- paststring=montharray[mo-1]+" "+da+", "+yr
- dd=Date.parse(todaystring)-Date.parse(paststring)
- dday=Math.floor(dd/(60*60*1000*24)*1)
- dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
- dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
- dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
-
- if (document.layers){
- document.countupnsmain.document.countupnssub.document.write(opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+displaymessage+closetags)
- document.countupnsmain.document.countupnssub.document.close()
- }
- else if (document.all||document.getElementById)
- crosscount.innerHTML=opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+displaymessage+closetags
-
- setTimeout("countup()",1000)
- }
- if(get('footerstats', ID)) {
- get('footerstats', ID).innerHTML = 'Copyright © Mage Designs 2008-09<br/ > All Rights Reserved';
- get('footertime', ID).style.display = 'none';
- 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>';
- }
- }
- </script>
-
- <ilayer id="countupnsmain" width=&{countupwidth}; height=&{countupheight}; bgColor=&{countupbgcolor}; visibility=hide><layer id="countupnssub" width=&{countupwidth}; height=&{countupheight}; left=0 top=0></layer></ilayer>
- </center>
| |
| Nick Very Senior Member
Posts: 3,012 Status: Offline Gender: Male Location: vForums Age: 34 Joined:
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
Posts: 3,012 Status: Offline Gender: Male Location: vForums Age: 34 Joined:
pmwww | Re: Code Conflict [support] (29th Oct 08 at 8:54am UTC) | | alright. | |
| |
| |
|