vForums Support Banner Image



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Programming Discussion :: View Topic - <Script> tags allowed?
Printable View
Darkmage
Senior Member
****
I believe in vForums, and YOU should too!

Avi Updating

Posts: 1,808
Status: Offline
Gender: Male
Location: In the Shadows.
Age: 18
Joined: 25th Nov 2007
Reputation: 11%  



<Script> tags allowed? (24th Oct 08 at 10:00pm)
Info Center?
Are Script tags allowed in the "Manage Forum Templates" area?

Because I made this:
(Yeah I know this kind of script, because I know what I am working with >_>)

Code:
 
  1. <script>
  2. /*
  3. Count up script-
  4. By Infinity Codes (http://icodes.vforums.co.uk)
  5. */
  6.  
  7. var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
  8.  
  9. function countup(yr,m,d){
  10. var today=new Date()
  11. var todayy=today.getYear()
  12. if (todayy < 1000)
  13. todayy+=1900
  14. var todaym=today.getMonth()
  15. var todayd=today.getDate()
  16. var todaystring=montharray[todaym]+" "+todayd+", "+todayy
  17. var paststring=montharray[m-1]+" "+d+", "+yr
  18. var difference=(Math.round((Date.parse(todaystring)-Date.parse(paststring))/(24*60*60*1000))*1)
  19. difference+=" days"
  20. document.write("It\'s been "+difference+" since the launch of Infinity Codes!")
  21. }
  22. //enter the count up date using the format year/month/day
  23. countup(2008,3,23)
  24. </script>
  25.  
 


It works in the header/footer area, just not in the custom info center area?

Darkmageq
Back to Top - Link to Post


Image
Image

VeaZna
Junior Member
**

[Avatar]
"Pickle Weasil"

Posts: 78
Status: Offline
Location: Guess...
Joined: 2nd Oct 2008
Reputation: 1%  



Re: <Script> tags allowed? (25th Oct 08 at 3:30am)
the Templates are HTML coding

this is javascript
Back to Top - Link to Post

ImageImage
Darkmage
Senior Member
****
I believe in vForums, and YOU should too!

Avi Updating

Posts: 1,808
Status: Offline
Gender: Male
Location: In the Shadows.
Age: 18
Joined: 25th Nov 2007
Reputation: 11%  



Re: <Script> tags allowed? (25th Oct 08 at 5:24am)
I know. But for some reason, Stat Counter script codes work in the Info Center, but this code wont.
Back to Top - Link to Post


Image
Image

Ross
Administrator
*****
They say I can't speel Smiley

[Avatar]
Yes, speel was a deliberate misstake...

Posts: 2,515
Status: Offline
Gender: Male
Location: Surrey, UK
Age: 20
Joined: 13th Jun 2006

Additional Groups:
Support Team

Reputation: 38%  



Re: <Script> tags allowed? (27th Oct 08 at 10:31am)
Yes, you can use Javascript in templates. However there is currently 1 big limitation. The templates work by first stripping out any new lines as they interfere with some tags. This means that any Javascript entered also has its line breaks removed. This is only a problem if you've used either <!-- at the start and //--> at the end or a comment using a double forward slash, eg.
//enter the count up date using the format year/month/day
However using /* comment */ comments will work fine:
/* enter the count up date using the format year/month/day */
Back to Top - Link to Post

Image
Darkmage
Senior Member
****
I believe in vForums, and YOU should too!

Avi Updating

Posts: 1,808
Status: Offline
Gender: Male
Location: In the Shadows.
Age: 18
Joined: 25th Nov 2007
Reputation: 11%  



Re: <Script> tags allowed? (27th Oct 08 at 10:20pm)
Alright thanks.

So spaces

you mean like the one above?

Then why does this one work:

Code:
 
  1. <!-- Start of StatCounter Code -->
  2. <script type="text/javascript">
  3. var sc_project=4149254;
  4. var sc_invisible=0;
  5. var sc_partition=51;
  6. var sc_click_stat=1;
  7. var sc_security="4cbd58cd";
  8. </script>
  9.  
  10. <script type="text/javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><div class="statcounter"><a title="site stats" href="http://www.statcounter.com/free_web_stats.html" target="_blank"><img class="statcounter" src="http://c.statcounter.com/4149254/0/4cbd58cd/0/" alt="site stats" ></a></div></noscript>
  11. <!-- End of StatCounter Code -->
 


And thanks.

When I make a new Info Center I will be adding the new code in.
Back to Top - Link to Post


Image
Image

Dwight
Senior Member
****

[Avatar]
Mess with the best, die like the rest.

Posts: 1,056
Status: Offline
Gender: Male
Location: Behind You
Age: 16
Joined: 21st Jan 2008
Reputation: 5%  



Re: <Script> tags allowed? (27th Oct 08 at 11:56pm)
it works because the comments are on the outside of the code and not the side of it
Back to Top - Link to Post

Big Coding Project 40% Done

Image
Image
Image
Darkmage
Senior Member
****
I believe in vForums, and YOU should too!

Avi Updating

Posts: 1,808
Status: Offline
Gender: Male
Location: In the Shadows.
Age: 18
Joined: 25th Nov 2007
Reputation: 11%  



Re: <Script> tags allowed? (28th Oct 08 at 1:26am)
Ahh I see, thanks Dwight.
Back to Top - Link to Post


Image
Image

Printable View

All times are GMT+1 :: The current time is 5:11am
Page generated in 0.5348 seconds
with 18 Database Queries and 9 cache files
This Forum is Powered By vForums
Create a Forum for Free