The problem with Easy PHP Calendar is that when you place any IU content after inclusion of calendar script, that content can not be shown. For example, if you have placed content in your page and you open your php file, and you see something like this:
<?php WriteContent('members_only_content'); // Instant Update ?> <div align="center"><?php require("../calendar/calendar.php");?> <br /></div> <?php WriteContent('members_only_highlights'); // Instant Update ?>
First and third line in above code represent IU content displaying code, while second line includes (and displays) Easy PHP Calendar script. If you have situation like this one, only content from first row will be shown while content from third line displays IU error.
First solution is to organize page in that way that you include calendar script at the very end of your page. However, sometimes this may be difficult to achieve, so we have another solution:
Second solution for this problem is little bit dirty, but it works: For each content displayed below calendar inclusion code you need to place three lines of PHP code above calendar inclusion code and one line of code at the place where you want content to appear:
Code before calendar:
<?php ob_start(); ?> - start output buffering <?php WriteContent('CONTENT_NAME'); // Instant Update ?> - regular IU content displaying code <?php $CONTENT_NAME = ob_get_clean(); ?> - get content from buffer
Content after calendar:
<?php echo $CONTENT_NAME; ?> - display content from buffer
So, above code (with problem) should look something like this:
<?php WriteContent('members_only_content'); // Instant Update ?> <?php ob_start(); ?> <?php WriteContent('members_only_highlights'); // Instant Update ?> <?php $members_only_highlights = ob_get_clean(); ?> <div align="center"><?php require("../calendar/calendar.php");?> <br /></div> <?php echo $members_only_highlights; ?>
| |
|---|
| Everything after minus sign (-) are comments in codes displayed above! |