Revision [16688]

This is an old revision of DennysCalendarExperiments made by Kt8Aze on 2007-05-31 10:36:16.

 

Oh No! Not more calendar experiments!


Why This Page?


I've already been to JwCalendarWithPageCreation a few times tonight, and rather than clutter up the page, I decided to post ideas here.

Idea Number One


It would be nice if the created pages could include an overview for the calendar display. This overview would be ideal if it was relatively transparent to the user and also allowed for wiki text formatting.

However, the problem with this is that we don't want to run the wiki engine's Format() method 28 times. Have you seen that thing? Monster! Rarrrr!

Fortunately, there is workaround. Instead of calling it a thousand times, we simply gather everything into one big text variable, pass it through the formatter, and then split it back into individual items. Here is the first attempt, which should be inserted around line 87...

%%(php)
$existingPages = array();
$result = $this->Query('SELECT tag, body FROM ' . $this->config['table_prefix'] . "pages WHERE tag REGEXP('$calendar_name\[0-9]{8,8}') AND latest = 'Y'");
if (mysql_num_rows($result))
{
while ($row = mysql_fetch_array($result))
{
$tags[] = $row['tag'];
$bodies[] = preg_match('/(=){3,5}overview(=){3,5}(.*)(\n\n)/ismU', $row['body'], $matches) ? $matches[3] : 'empty_body';
}
}
if (count($tags))
{
$glue = '#
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki