Jump to content

Recommended Posts

Hello...

I'm trying to use a calendar script on my website... The source-codes and origin of this calendar is at:

[a href=\"http://keithdevens.com/software/php_calendar\" target=\"_blank\"]Web Site For Script[/a]

My question is (as I cannot get it to work):

How could I make the calendar print an entire year... Whilst also showing the linked days?

I have tried using the code the author has outlined on his page to no avail... Any suggestions?

Your help is greatfully appreciated.

Thanks

MM2006
Link to comment
https://forums.phpfreaks.com/topic/5183-php-calendar/
Share on other sites

Assuming you use his function exactly, something like this should work:

[code]<table style="margin: auto">

<tr>

    <?php for ($month = 1; $month <= 12; $month++) { ?>

        <td style="vertical-align: top"><pre>

            <?php
            
            $daysinmonth = date('t', mktime(NULL, NULL, NULL, $month, NULL, $year));
            //echo $daysinmonth;
            for ($i = 1; $i <= $daysinmonth; $i++) {
                $days[$i] = array("/link/to/page/$month/$i.php", 'linked-day');
            }
            //print_r($days);
            echo generate_calendar($year, $month, $days);
            $days = array();
            
            ?>

        </td>

        <?php if($month%3 == 0 and $month<12){ ?>

            </tr><tr>

        <?php } ?>

    <?php } ?>

</tr>

</table>[/code]
Link to comment
https://forums.phpfreaks.com/topic/5183-php-calendar/#findComment-18443
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.