1
fluent
putting the date into theme.html
  • 2003/12/19 19:36

  • fluent

  • Just popping in

  • Posts: 43

  • Since: 2003/11/22



I want to put the date in a theme.html page and I've tried using {php} echo data("%Y"); {/php} but it doesnt work. Am I using the wrong tags to do this or is there another method? This is the method smarty's homepage suggested.

2
CBlue
Re: putting the date into theme.html

Put the code below into your theme.html file wherever you want the date to appear on the pages. I put mine below my logo but it can be put anywhere.

<script>

/*Current date script credit:
JavaScript Kit (www.javascriptkit.com)
Over 200+ free scripts here!
*/

var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
document.write("<font color='000000' face='Arial'><b>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+"</b></font>")

</script>

3
ackbarr
Re: putting the date into theme.html

I think the original method will work, but you need to use <{php}>...<{/php}> instead.

4
Draven
Re: putting the date into theme.html
  • 2003/12/19 21:19

  • Draven

  • Module Developer

  • Posts: 337

  • Since: 2003/5/28


Here's what I use.

<{php}>
    echo 
date("D j, Y");
<{/
php}>

Login

Who's Online

169 user(s) are online (109 user(s) are browsing Support Forums)


Members: 0


Guests: 169


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits