PDA

View Full Version : Date only goes up to 2008 in News Editor!


picman
1st of January 2009 (Thu), 07:00
Hi to all and a Happy New Year,

For some reason the dropdown date in the news editor only spans from 2002 to 2008. How can I change this to include 2009 and future years?

I have searched through the files on the server and had a look in the database but I cannot see where to make any changes.

Any ideas?

triadib
1st of January 2009 (Thu), 07:14
Hi,

search EDITOR_news.php in directory /backend (former /adminstrator you should have been renamed)

Near line 507 you'll find:
<option value="2008"<?php if ($year == "2008") print " selected"; ?>>2008</option>

Duplicate, modify and append as line 508 like this:
<option value="2009"<?php if ($year == "2009") print " selected"; ?>>2009</option>

That's it :-)

Regards from Germany
Dirk

picman
1st of January 2009 (Thu), 12:54
Hi,

Thanks for clearing that up for me.

When I searched earlier I tried terms like; 'date' and 'dropdown' but did not think to search for '2008'.

I hope I will have my thinking hat on for the rest of the year.

All the best for 2009.

fanta
6th of May 2011 (Fri), 16:03
I know this thread is old, but I tweaked the news editor so that I wouldn't need to edit the code every year. I changed the newsyear select options in the EDITOR_news.php file to:

<?php
for ($n = 2002; $n < date('Y') + 5; $n++) {
print "<option value=\"" . $n . "\"";
if ($year == $n) print " selected";
print ">" . $n . "</option>\n";
}
?>

This way, years get shown in the combo from 2002 to 5 years from the current year.