Hello,
If I understand you correctly you want to be able to overwrite the default number of months to show that is defined in the admin. Is that correct?
If so, you can do the following:
1. in the
calendar >
index.php file (or the file where you are actually showing the calendar) add this line right BEFORE you include the cal.inc.php file:
- Code: Select all
$num_months=4;
Then you need to open up the
ac-includes >
common.inc.php file and change this line (ln 29):
- Code: Select all
define("CAL_MONTHS_TO_SHOW" , "".$row_config["num_months"]."");
to this:
- Code: Select all
if(isset($num_months)){
define("CAL_MONTHS_TO_SHOW" , "".$num_months."");
}else{
define("CAL_MONTHS_TO_SHOW" , "".$row_config["num_months"]."");
}
Hopefully you will see that that last change simply checks to see if the $num_months vairable has been defined and uses it, otherwise it uses the admin defined value.
Now, you might want to actually pass the num months to the calendar via the iframe (I don't really know what you are doing so I am not sure of the exact solution in your case). If so, change the line that we added earlier:
- Code: Select all
$num_months=4;
to something like this:
- Code: Select all
if(isset($_GET["num_months"])){
$num_months=$_GET["num_months"];
}
(you should also validate that the variable has a numeric value)
Then, simply append the num_months variable to your iframe url something like this:
- Code: Select all
src="/calendar/index.php=num_months=4"
Let me know if this is not what you wanted or if you have any problems.
Chris