2012-12-05, 02:50 PM
2012-12-05, 02:52 PM
(2012-12-05, 02:50 PM)wils172 Wrote: [ -> ]How can I display the current month (i.e. December) on the forum index? Do I need a plugin?
You could use a Javascript clock if you wanted.
2012-12-05, 02:57 PM
2012-12-05, 03:32 PM
You could do it with HTML5?
Or you could not do that because I misunderstood what you wanted.
Or you could not do that because I misunderstood what you wanted.
2012-12-05, 03:36 PM
(2012-12-05, 03:32 PM)Xanth Wrote: [ -> ]You could do it with HTML5?
That would be javascript, not HTML5.
2012-12-05, 03:41 PM
$month = date('F');
You'd either need to modify a core file (e.g. global.php or index.php) or use the above code in a plugin. Then use {$month} in your template.
2012-12-05, 03:48 PM
You don't need a plugin if you want to make a simple edit to global.php and add one line:
find:
and insert above it:
and then put {$month} in the template you want and it will only show on the index page. FYI, I put it in global.php so that it can be used in the header and related templates
find:
eval("\$headerinclude = \"".$templates->get("headerinclude")."\";");
and insert above it:
$month = (THIS_SCRIPT == 'index.php' ? my_date('F', TIME_NOW, '', false) : '');
and then put {$month} in the template you want and it will only show on the index page. FYI, I put it in global.php so that it can be used in the header and related templates
2012-12-05, 04:04 PM
Thanks paveman that worked great!