This topic is locked

Year Selector only goes to 1956

2/27/2006 8:07:16 PM
PHPRunner General questions
M
mckirkus author

I'm using v3.0 and it's working great but when I use the drop down for a date field the year only allows me to go back to 1956.
Not a real problem because the non-drop-down works but it would be nice to have that feature.
This software saved my ass! Well worth the price. A huge thanks from California.

Sergey Kornilov admin 2/28/2006

Kirk,
please open source/include/variables.php file and find following:

$cYearRadius = 50;



where value 50 is quantity of displaying years before and after current year.

you can replace 50 with required value.

T
thesofa 2/28/2006

Kirk,

please open source/include/variables.php file and find following:

$cYearRadius = 50;



where value 50 is quantity of displaying years before and after current year.

you can replace 50 with required value.



Is there any way to allow several years after the current year, but none before it?

Sergey Kornilov admin 3/1/2006

Hi,
open source/include/functions.php file, find WriteYears($y) function and make some changes. See my changes in Bold:

function WriteYears($y)

{

global $cYearRadius;

$tm=localtime(time(),true);

$ret='<option value=""> </option>';

for($i=$tm["tm_year"]+1900;$i<=$tm["tm_year"]+1900+$cYearRadius;$i++)

$ret.='<option value="'.$i.'" '.($i==$y?"selected":"").'>'.$i.'</option>';

return $ret;

}

M
mckirkus author 3/1/2006

Thanks for the fix, I just demoed a site I built with this and actually got an applause. Crazy <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=8288&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />

T
thesofa 8/29/2006

Kirk,

please open source/include/variables.php file and find following:

$cYearRadius = 50;



where value 50 is quantity of displaying years before and after current year.

you can replace 50 with required value.



Really sorry to dig this one up again, my copy of "source/include/variables.php" has no such variable in it at all.

Have I borked it?

Alexey admin 8/30/2006

Hi,
what version of PHPRunner do you use ?

PHPRunner 3.0 does have this variable in variables.php file.

T
thesofa 8/30/2006

Hi,

what version of PHPRunner do you use ?

PHPRunner 3.0 does have this variable in variables.php file.



3.0 build 119, yep found it, sorry