Revision history for GmBowenWikkaAsPIM


Revision [20731]

Last edited on 2009-06-28 17:03:18 by DanieleCruciani
Additions:
In mytasks.php use something like this:
global $tableprefix;
$tableprefix = $this->config["table_prefix"];
and inside function use global $tableprefix; and in query "... FROM ${tableprefix}task ...." **do not use $this->config["table_prefix"] inside function PHP 5.1.x do not understand**


Revision [19363]

Edited on 2008-01-28 00:15:26 by GmBowen [Modified links pointing to docs server]

No Differences

Revision [17574]

Edited on 2007-10-01 17:07:13 by GmBowen [Modified links pointing to docs server]
Additions:
http://gmbtst.msvu.ca/wikitest/scheduler.jpg
http://gmbtst.msvu.ca/wikitest/dayschedule.jpg
http://gmbtst.msvu.ca/wikitest/monthview.jpg
http://gmbtst.msvu.ca/wikitest/taskmanager.jpg
Deletions:
http://gmbowen.educ.unb.ca/wikitest/scheduler.jpg
http://gmbowen.educ.unb.ca/wikitest/dayschedule.jpg
http://gmbowen.educ.unb.ca/wikitest/monthview.jpg
http://gmbowen.educ.unb.ca/wikitest/taskmanager.jpg


Revision [14740]

Edited on 2006-06-29 12:08:41 by NilsLindenberg [line numbers]
Additions:
%%(php;1)
%%(php;1)
<P>
if($row->user == $username && $row->month == $month && $row->day == $today && $row->year == $year)
$up = 1;
$ro = $row->id;
}
$query = "UPDATE ".$this->config['table_prefix']."scheduler SET dayschedule='$dayschedule' WHERE user='$username' AND id='$ro'";
$result = mysql_query($query);
$query = "INSERT into ".$this->config['table_prefix']."scheduler (user,dayschedule,month,day,year) VALUES ('$username','$dayschedule','$month','$today','$year')";
$result = mysql_query($query);
<td valign="top">
<td colspan="7">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr BGCOLOR="#ffffff">
<td width="20"><a href="<?php echo $this->href("", "", "month="); echo (($month-1)<1) ? 12 : $month-1 ; ?>&year=<?php echo (($month-1)<1) ? $year-1 : $year ; ?>"><<<</a></td>
<td align="center"><font size="2"><?php echo "$monthname $year"; ?></font></td>
<td width="20"><a href="<?php echo $this->href("", "", "month="); echo (($month+1)>12) ? 1 : $month+1 ; ?>&year=<?php echo (($month+1)>12) ? $year+1 : $year ; ?>">>>></a></td>
</tr>
</table>
<td width="22">Su</td>
<td width="22">Mo</td>
<td width="22">Tu</td>
<td width="22">We</td>
<td width="22">Th</td>
<td width="22">Fr</td>
<td width="22">Sa</td>
/*== set up blank days for first week ==*/
if ($firstweek) {
print " <tr BGCOLOR=\"#ffffff\">";
for ($i=1; $i<=$firstwday; $i++)
{ print " <td><font size=\"2\"> </font></td>"; }
$firstweek = false;
/*== Sunday start week with <tr> ==*/
if ($wday==0) { print " <tr BGCOLOR=\"#ffffff\">\n"; }
/*== check for event ==*/
print " <td>";
if($day<10) {
if($month<10) {
$tag = "$year:0$month:0$day";
} else {
$tag = "$year:$month:0$day";
}
} else {
if($month<10) {
$tag = "$year:0$month:$day";
} else {
$tag = "$year:$month:$day";
}

$todaydate = date("Y:m:d",mktime());
if($tag==$todaydate)
$font1 = "<font color=\"#FF0000\"><b>";
$font2 = "</b></font>";
$font1 = "";
$font2 = "";
print "<a href=".$site_base.$thispage."&day=$day&month=$month&year=$year>$font1$day$font2</a>";
print "</td>\n";
/*== Saturday week with </tr> ==*/
if ($wday==6) { print " </tr>\n"; }
$wday++;
$wday = $wday % 7;
$day++;
<br><a href="<?php echo $this->href("", "", "day="); echo (($today-1)<1) ? $lastday : $today-1 ; ?>&year=<?php echo $year; ?>&month=<?php echo $month; ?>"><<</a>
%%(php;1)
<P>
%%(php;1)
<P>
if($row->user == $username && $row->month == $month && $row->day == $today && $row->year == $year)
$up = 1;
$ro = $row->id;
}
$query = "UPDATE ".$this->config['table_prefix']."scheduler SET dayschedule='$dayschedule' WHERE user='$username' AND id='$ro'";
$result = mysql_query($query);
$query = "INSERT into ".$this->config['table_prefix']."scheduler (user,dayschedule,month,day,year) VALUES ('$username','$dayschedule','$month','$today','$year')";
$result = mysql_query($query);
<td valign="top">
<td colspan="7">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="20"><a href="<?php echo $this->href("", "", "month="); echo (($month-1)<1) ? 12 : $month-1 ; ?>&year=<?php echo (($month-1)<1) ? $year-1 : $year ; ?>"><<<</a></td>
<td align="center"><font size="2"><strong><? echo $username ?>'s Calendar for <?php echo "$monthname $year"; ?></strong></font></td>
<td width="20"><a href="<?php echo $this->href("", "", "month="); echo (($month+1)>12) ? 1 : $month+1 ; ?>&year=<?php echo (($month+1)>12) ? $year+1 : $year ; ?>">>>></a></td>
</tr>
</table>
<td>Sunday</td>
<td>Monday</td>
<td>Tuesday</td>
<td>Wednesday</td>
<td>Thursday</td>
<td>Friday</td>
<td>Saturday</td>
/*== set up blank days for first week ==*/
if ($firstweek) {
print " <tr>";
for ($i=1; $i<=$firstwday; $i++)
{ print " <td VALIGN=top ALIGN=left HEIGHT=70><font size=\"2\"> </font></td>"; }
$firstweek = false;
/*== Sunday start week with <tr> ==*/
if ($wday==0) { print " <tr>\n"; }
/*== check for event ==*/
print " <td VALIGN=top ALIGN=left WIDTH=150 HEIGHT=70>";
if($day<10) {
if($month<10) {
$tag = "$year:0$month:0$day";
} else {
$tag = "$year:$month:0$day";
}
} else {
if($month<10) {
$tag = "$year:0$month:$day";
} else {
$tag = "$year:$month:$day";
}

$todaydate = date("Y:m:d",mktime());
if($tag==$todaydate)
$font1 = "<font color=\"#FF0000\"><b>";
$font2 = "</b></font>";
$font1 = "";
$font2 = "";
print "<table width=\"100%\"><TR BGCOLOR=\"#E4DFDA\"><td><a href=".$site_base.$thispage."&day=$day&month=$month&year=$year#EntryBox> $font1$day$font2</a> $printme</td</tr><tr><td><small>$dayoutput</small></td></tr></table>";
print "</td>\n";
/*== Saturday week with </tr> ==*/
if ($wday==6) { print " </tr>\n"; }
$wday++;
$wday = $wday % 7;
$day++;
%%(php;1)
<td align=left>
<td align=right><input type=text size=15 value=\"keyword\" name=\"keyword\"><input type=submit value=\"Search\"></td>
</tr></table>

echo "<br>Your keyword is: <b>".$keyword."</b><P>\n";
echo "<table width=75% cellpadding=4 cellspacing=2 border=0>\n";
while($mykey = mysql_fetch_array($results)){

//list the results
echo "<tr>\n";
echo "<td bgcolor=\"#E9E9E9\" align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>\n";

switch ($mykey["task_status"]) {
case "Incomplete":
echo "<font color=red>".$mykey["task_status"]."</font>\n";
break;

case "In Progress":
echo "<font color=blue>".$mykey["task_status"]."</font>\n";
break;

case "Complete":
echo "<font color=green>".$mykey["task_status"]."</font>\n";
break;
}

echo "</nobr></font></td>\n";
echo "<td bgcolor=\"#F3F0F9\" align=left valign=top width=75%><a href=\"".$linktm."&task_id=".$mykey["task_id"]."&tm_page=$page\">".$mykey["task_title"]."</a> (posted on:".$mykey["task_timestamp"].")</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<P><font color=red>SORRY, NO MATCH!</font><P>\n";

echo "<table width=100% cellpadding=1 cellspacing=1 border=0>\n";
echo "<tr><td bgcolor=\"#E9E9E9\" width=120px align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>  \n";
switch ($item->task_status) {
case "Incomplete":
echo "<font color=red>".$item->task_status."</font>\n";
break;
case "In Progress":
echo "<font color=blue>".$item->task_status."</font>\n";
break;
case "Complete":
echo "<font color=green>".$item->task_status."</font>\n";
break;

echo "<tr><td bgcolor=\"#F3F0F9\" align=left valign=top colspan=2><nobr><a href=\"".$linktm."&edit_id=".$item["task_id"]."&tm_page=$tm_page\"><b>EDIT</b></a> | \n";
echo "<a href=\"javascript: if(confirm('Are you sure you want to delete this item?')){ window.self.location='$linktm&delete_id=".$item["task_id"]."&tm_page=$tm_page' }\"><b>DELETE</b></a></nobr></td></tr>\n";

$tm_order = "task_timestamp";
$tm_direction = "DESC";
echo "<td bgcolor=\"#BBBDD9\" valign=top><b>MODIFY</b> <img src=\"images/trs.gif\" width=11 height=16 border=0></td>\n";

//items status case
switch ($todo["task_status"]) {
case "Incomplete":
echo "<td bgcolor=\"#E9E9E9\" valign=top><font color=red>".$todo["task_status"]."</font></td>\n";
break;
case "In Progress":
echo "<td bgcolor=\"#E9E9E9\" valign=top><font color=blue>".$todo["task_status"]."</font></td>\n";
break;
case "Complete":
echo "<td bgcolor=\"#E9E9E9\" valign=top><font color=green>".$todo["task_status"]."</font></td>\n";
break;

echo "<td bgcolor=\"#F3F0F9\" valign=top><nobr>[<a href=\"".$linktm."&task_id=".$todo["task_id"]."&tm_page=$tm_page\"><b>view</b></a>|<a href=\"".$linktm."&edit_id=".$todo["task_id"]."&tm_page=$tm_page\"><b>edit</b></a></font>|";
echo "<a href=\"javascript: if(confirm('Are you sure you want to delete this item?')){ window.self.location='$linktm&delete_id=".$todo["task_id"]."&tm_page=$tm_page' }\"><b>delete</b></a>]</nobr></td>\n";
<span style='color:gray; font-size:10px; font-family:verdana,arial;'>
<span style='color:gray; font-size:10px; font-family:verdana,arial;'>\n";
$buffer = fgets($fd, 4096);
$line++;
%%(php;1)
<td align=left>
<td align=right><input type=text size=10 value=\"keyword\" name=\"keyword\"><input type=submit value=\"Search\"></td>
</tr></table>
$buffer = fgets($fd, 4096);
$line++;
%%(php;1)

echo "<br>Your keyword is: <b>".$keyword."</b><P>\n";
echo "<table width=75% cellpadding=4 cellspacing=2 border=0>\n";
while($mykey = mysql_fetch_array($results)){

//list the results
echo "<tr>\n";
echo "<td bgcolor=\"#E9E9E9\" align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>\n";

switch ($mykey["task_status"]) {
case "Incomplete":
echo "<font color=red>".$mykey["task_status"]."</font>\n";
break;

case "In Progress":
echo "<font color=blue>".$mykey["task_status"]."</font>\n";
break;

case "Complete":
echo "<font color=green>".$mykey["task_status"]."</font>\n";
break;
}

echo "</nobr></font></td>\n";
echo "<td bgcolor=\"#F3F0F9\" align=left valign=top width=75%><a href=\"".$linktm."&task_id=".$mykey["task_id"]."&tm_page=$page\">".$mykey["task_title"]."</a> X(posted:".$mykey["task_timestamp"].")</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<P><font color=red>SORRY, NO MATCH!</font><P>\n";

echo "<table width=100% cellpadding=1 cellspacing=1 border=0>\n";
echo "<tr><td bgcolor=\"#E9E9E9\" width=120px align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>  \n";
switch ($item->task_status) {
case "Incomplete":
echo "<font color=red>".$item->task_status."</font>\n";
break;
case "In Progress":
echo "<font color=blue>".$item->task_status."</font>\n";
break;
case "Complete":
echo "<font color=green>".$item->task_status."</font>\n";
break;

echo "<table width=100% cellpadding=1 cellspacing=1 border=0>\n";
echo "<tr><td bgcolor=\"#E9E9E9\" width=120px align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>  \n";
switch ($item->task_status) {
case "Incomplete":
echo "<font color=red>".$item->task_status."</font>\n";
break;
case "In Progress":
echo "<font color=blue>".$item->task_status."</font>\n";
break;
case "Complete":
echo "<font color=green>".$item->task_status."</font>\n";
break;

echo "<table width=100% cellpadding=1 cellspacing=1 border=0>\n";
echo "<tr><td bgcolor=\"#E9E9E9\" width=120px align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>  \n";
switch ($item->task_status) {
case "Incomplete":
echo "<font color=red>".$item->task_status."</font>\n";
break;
case "In Progress":
echo "<font color=blue>".$item->task_status."</font>\n";
break;
case "Complete":
echo "<font color=green>".$item->task_status."</font>\n";
break;

echo "<table width=100% cellpadding=1 cellspacing=1 border=0>\n";
echo "<tr><td bgcolor=\"#E9E9E9\" width=120px align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>  \n";
switch ($item->task_status) {
case "Incomplete":
echo "<font color=red>".$item->task_status."</font>\n";
break;
case "In Progress":
echo "<font color=blue>".$item->task_status."</font>\n";
break;
case "Complete":
echo "<font color=green>".$item->task_status."</font>\n";
break;
$tm_order = "task_timestamp";
$tm_direction = "DESC";

//items status case
switch ($todo["task_status"]) {
case "Incomplete":
echo "<td bgcolor=\"#E9E9E9\" valign=top><font color=red>".$todo["task_status"]."</font></td>\n";
break;
case "In Progress":
echo "<td bgcolor=\"#E9E9E9\" valign=top><font color=blue>".$todo["task_status"]."</font></td>\n";
break;
case "Complete":
echo "<td bgcolor=\"#E9E9E9\" valign=top><font color=green>".$todo["task_status"]."</font></td>\n";
break;
Deletions:
<P>
if($row->user == $username && $row->month == $month && $row->day == $today && $row->year == $year)
{
$up = 1;
$ro = $row->id;
}
$query = "UPDATE ".$this->config['table_prefix']."scheduler SET dayschedule='$dayschedule' WHERE user='$username' AND id='$ro'";
$result = mysql_query($query);
$query = "INSERT into ".$this->config['table_prefix']."scheduler (user,dayschedule,month,day,year) VALUES ('$username','$dayschedule','$month','$today','$year')";
$result = mysql_query($query);
<td valign="top">
<td colspan="7">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr BGCOLOR="#ffffff">
<td width="20"><a href="<?php echo $this->href("", "", "month="); echo (($month-1)<1) ? 12 : $month-1 ; ?>&year=<?php echo (($month-1)<1) ? $year-1 : $year ; ?>"><<<</a></td>
<td align="center"><font size="2"><?php echo "$monthname $year"; ?></font></td>
<td width="20"><a href="<?php echo $this->href("", "", "month="); echo (($month+1)>12) ? 1 : $month+1 ; ?>&year=<?php echo (($month+1)>12) ? $year+1 : $year ; ?>">>>></a></td>
</tr>
</table>
<td width="22">Su</td>
<td width="22">Mo</td>
<td width="22">Tu</td>
<td width="22">We</td>
<td width="22">Th</td>
<td width="22">Fr</td>
<td width="22">Sa</td>
/*== set up blank days for first week ==*/
if ($firstweek) {
print " <tr BGCOLOR=\"#ffffff\">";
for ($i=1; $i<=$firstwday; $i++)
{ print " <td><font size=\"2\"> </font></td>"; }
$firstweek = false;
}
/*== Sunday start week with <tr> ==*/
if ($wday==0) { print " <tr BGCOLOR=\"#ffffff\">\n"; }
/*== check for event ==*/
print " <td>";
if($day<10) {
if($month<10) {
$tag = "$year:0$month:0$day";
} else {
$tag = "$year:$month:0$day";
}
} else {
if($month<10) {
$tag = "$year:0$month:$day";
} else {
$tag = "$year:$month:$day";
}
}

$todaydate = date("Y:m:d",mktime());
if($tag==$todaydate)
{
$font1 = "<font color=\"#FF0000\"><b>";
$font2 = "</b></font>";
}
else
{
$font1 = "";
$font2 = "";
}
print "<a href=".$site_base.$thispage."&day=$day&month=$month&year=$year>$font1$day$font2</a>";
print "</td>\n";
/*== Saturday week with </tr> ==*/
if ($wday==6) { print " </tr>\n"; }
$wday++;
$wday = $wday % 7;
$day++;
</td>
<br><a href="<?php echo $this->href("", "", "day="); echo (($today-1)<1) ? $lastday : $today-1 ; ?>&year=<?php echo $year; ?>&month=<?php echo $month; ?>"><<</a>
<P>
<P>
if($row->user == $username && $row->month == $month && $row->day == $today && $row->year == $year)
{
$up = 1;
$ro = $row->id;
}
$query = "UPDATE ".$this->config['table_prefix']."scheduler SET dayschedule='$dayschedule' WHERE user='$username' AND id='$ro'";
$result = mysql_query($query);
$query = "INSERT into ".$this->config['table_prefix']."scheduler (user,dayschedule,month,day,year) VALUES ('$username','$dayschedule','$month','$today','$year')";
$result = mysql_query($query);
<td valign="top">
<td colspan="7">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="20"><a href="<?php echo $this->href("", "", "month="); echo (($month-1)<1) ? 12 : $month-1 ; ?>&year=<?php echo (($month-1)<1) ? $year-1 : $year ; ?>"><<<</a></td>
<td align="center"><font size="2"><strong><? echo $username ?>'s Calendar for <?php echo "$monthname $year"; ?></strong></font></td>
<td width="20"><a href="<?php echo $this->href("", "", "month="); echo (($month+1)>12) ? 1 : $month+1 ; ?>&year=<?php echo (($month+1)>12) ? $year+1 : $year ; ?>">>>></a></td>
</tr>
</table>
<td>Sunday</td>
<td>Monday</td>
<td>Tuesday</td>
<td>Wednesday</td>
<td>Thursday</td>
<td>Friday</td>
<td>Saturday</td>
/*== set up blank days for first week ==*/
if ($firstweek) {
print " <tr>";
for ($i=1; $i<=$firstwday; $i++)
{ print " <td VALIGN=top ALIGN=left HEIGHT=70><font size=\"2\"> </font></td>"; }
$firstweek = false;
}
/*== Sunday start week with <tr> ==*/
if ($wday==0) { print " <tr>\n"; }
/*== check for event ==*/
print " <td VALIGN=top ALIGN=left WIDTH=150 HEIGHT=70>";
if($day<10) {
if($month<10) {
$tag = "$year:0$month:0$day";
} else {
$tag = "$year:$month:0$day";
}
} else {
if($month<10) {
$tag = "$year:0$month:$day";
} else {
$tag = "$year:$month:$day";
}
}

$todaydate = date("Y:m:d",mktime());
if($tag==$todaydate)
{
$font1 = "<font color=\"#FF0000\"><b>";
$font2 = "</b></font>";
}
else
{
$font1 = "";
$font2 = "";
}
print "<table width=\"100%\"><TR BGCOLOR=\"#E4DFDA\"><td><a href=".$site_base.$thispage."&day=$day&month=$month&year=$year#EntryBox> $font1$day$font2</a> $printme</td</tr><tr><td><small>$dayoutput</small></td></tr></table>";
print "</td>\n";
/*== Saturday week with </tr> ==*/
if ($wday==6) { print " </tr>\n"; }
$wday++;
$wday = $wday % 7;
$day++;
</td>
<td align=left>
<td align=right><input type=text size=15 value=\"keyword\" name=\"keyword\"><input type=submit value=\"Search\"></td>
</tr></table>

echo "<br>Your keyword is: <b>".$keyword."</b><P>\n";
echo "<table width=75% cellpadding=4 cellspacing=2 border=0>\n";
while($mykey = mysql_fetch_array($results)){

//list the results
echo "<tr>\n";
echo "<td bgcolor=\"#E9E9E9\" align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>\n";

switch ($mykey["task_status"]) {
case "Incomplete":
echo "<font color=red>".$mykey["task_status"]."</font>\n";
break;

case "In Progress":
echo "<font color=blue>".$mykey["task_status"]."</font>\n";
break;

case "Complete":
echo "<font color=green>".$mykey["task_status"]."</font>\n";
break;
}

echo "</nobr></font></td>\n";
echo "<td bgcolor=\"#F3F0F9\" align=left valign=top width=75%><a href=\"".$linktm."&task_id=".$mykey["task_id"]."&tm_page=$page\">".$mykey["task_title"]."</a> (posted on:".$mykey["task_timestamp"].")</td>\n";
echo "</tr>\n";
}
echo "</table>\n";
echo "<P><font color=red>SORRY, NO MATCH!</font><P>\n";


echo "<table width=100% cellpadding=1 cellspacing=1 border=0>\n";
echo "<tr><td bgcolor=\"#E9E9E9\" width=120px align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>  \n";
switch ($item->task_status) {
case "Incomplete":
echo "<font color=red>".$item->task_status."</font>\n";
break;
case "In Progress":
echo "<font color=blue>".$item->task_status."</font>\n";
break;
case "Complete":
echo "<font color=green>".$item->task_status."</font>\n";
break;

echo "<tr><td bgcolor=\"#F3F0F9\" align=left valign=top colspan=2><nobr><a href=\"".$linktm."&edit_id=".$item["task_id"]."&tm_page=$tm_page\"><b>EDIT</b></a> | \n";
echo "<a href=\"javascript: if(confirm('Are you sure you want to delete this item?')){ window.self.location='$linktm&delete_id=".$item["task_id"]."&tm_page=$tm_page' }\"><b>DELETE</b></a></nobr></td></tr>\n";

$tm_order = "task_timestamp";
$tm_direction = "DESC";
echo "<td bgcolor=\"#BBBDD9\" valign=top><b>MODIFY</b> <img src=\"images/trs.gif\" width=11 height=16 border=0></td>\n";

//items status case
switch ($todo["task_status"]) {
case "Incomplete":
echo "<td bgcolor=\"#E9E9E9\" valign=top><font color=red>".$todo["task_status"]."</font></td>\n";
break;
case "In Progress":
echo "<td bgcolor=\"#E9E9E9\" valign=top><font color=blue>".$todo["task_status"]."</font></td>\n";
break;
case "Complete":
echo "<td bgcolor=\"#E9E9E9\" valign=top><font color=green>".$todo["task_status"]."</font></td>\n";
break;
}

echo "<td bgcolor=\"#F3F0F9\" valign=top><nobr>[<a href=\"".$linktm."&task_id=".$todo["task_id"]."&tm_page=$tm_page\"><b>view</b></a>|<a href=\"".$linktm."&edit_id=".$todo["task_id"]."&tm_page=$tm_page\"><b>edit</b></a></font>|";
echo "<a href=\"javascript: if(confirm('Are you sure you want to delete this item?')){ window.self.location='$linktm&delete_id=".$todo["task_id"]."&tm_page=$tm_page' }\"><b>delete</b></a>]</nobr></td>\n";
<span style='color:gray; font-size:10px; font-family:verdana,arial;'>
<span style='color:gray; font-size:10px; font-family:verdana,arial;'>\n";
$buffer = fgets($fd, 4096);
$line++;
<td align=left>
<td align=right><input type=text size=10 value=\"keyword\" name=\"keyword\"><input type=submit value=\"Search\"></td>
</tr></table>
$buffer = fgets($fd, 4096);
$line++;

echo "<br>Your keyword is: <b>".$keyword."</b><P>\n";
echo "<table width=75% cellpadding=4 cellspacing=2 border=0>\n";
while($mykey = mysql_fetch_array($results)){

//list the results
echo "<tr>\n";
echo "<td bgcolor=\"#E9E9E9\" align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>\n";

switch ($mykey["task_status"]) {
case "Incomplete":
echo "<font color=red>".$mykey["task_status"]."</font>\n";
break;

case "In Progress":
echo "<font color=blue>".$mykey["task_status"]."</font>\n";
break;

case "Complete":
echo "<font color=green>".$mykey["task_status"]."</font>\n";
break;
}

echo "</nobr></font></td>\n";
echo "<td bgcolor=\"#F3F0F9\" align=left valign=top width=75%><a href=\"".$linktm."&task_id=".$mykey["task_id"]."&tm_page=$page\">".$mykey["task_title"]."</a> X(posted:".$mykey["task_timestamp"].")</td>\n";
echo "</tr>\n";
}
echo "</table>\n";
echo "<P><font color=red>SORRY, NO MATCH!</font><P>\n";


echo "<table width=100% cellpadding=1 cellspacing=1 border=0>\n";
echo "<tr><td bgcolor=\"#E9E9E9\" width=120px align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>  \n";
switch ($item->task_status) {
case "Incomplete":
echo "<font color=red>".$item->task_status."</font>\n";
break;
case "In Progress":
echo "<font color=blue>".$item->task_status."</font>\n";
break;
case "Complete":
echo "<font color=green>".$item->task_status."</font>\n";
break;


echo "<table width=100% cellpadding=1 cellspacing=1 border=0>\n";
echo "<tr><td bgcolor=\"#E9E9E9\" width=120px align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>  \n";
switch ($item->task_status) {
case "Incomplete":
echo "<font color=red>".$item->task_status."</font>\n";
break;
case "In Progress":
echo "<font color=blue>".$item->task_status."</font>\n";
break;
case "Complete":
echo "<font color=green>".$item->task_status."</font>\n";
break;


echo "<table width=100% cellpadding=1 cellspacing=1 border=0>\n";
echo "<tr><td bgcolor=\"#E9E9E9\" width=120px align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>  \n";
switch ($item->task_status) {
case "Incomplete":
echo "<font color=red>".$item->task_status."</font>\n";
break;
case "In Progress":
echo "<font color=blue>".$item->task_status."</font>\n";
break;
case "Complete":
echo "<font color=green>".$item->task_status."</font>\n";
break;


echo "<table width=100% cellpadding=1 cellspacing=1 border=0>\n";
echo "<tr><td bgcolor=\"#E9E9E9\" width=120px align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>  \n";
switch ($item->task_status) {
case "Incomplete":
echo "<font color=red>".$item->task_status."</font>\n";
break;
case "In Progress":
echo "<font color=blue>".$item->task_status."</font>\n";
break;
case "Complete":
echo "<font color=green>".$item->task_status."</font>\n";
break;
$tm_order = "task_timestamp";
$tm_direction = "DESC";

//items status case
switch ($todo["task_status"]) {
case "Incomplete":
echo "<td bgcolor=\"#E9E9E9\" valign=top><font color=red>".$todo["task_status"]."</font></td>\n";
break;
case "In Progress":
echo "<td bgcolor=\"#E9E9E9\" valign=top><font color=blue>".$todo["task_status"]."</font></td>\n";
break;
case "Complete":
echo "<td bgcolor=\"#E9E9E9\" valign=top><font color=green>".$todo["task_status"]."</font></td>\n";
break;
}


Revision [5944]

Edited on 2005-02-12 12:50:29 by JavaWoman [Added warning about using the correct prefix for table creation]
Additions:
~&**Make sure you replace the prefix "wakka_" in this code with whatever prefix is set in the configuration for your Wikka installation!** --JavaWoman


Revision [5888]

Edited on 2005-02-10 19:27:42 by PolVazo [Added warning about using the correct prefix for table creation]
Additions:
=====Tools To Use Wiki As a Pim=====
{{lastedit show="3"}}
One use of Wikka is as a Personal Information Manager. For some things the free-form writing nature of a wiki is useful (and, dare-I-say, liberating). However, as some of our usage at this site suggests, there are tools that can be developed AS actions in wikka that can make some aspects of information management a bit easier. In the past six months I've modified/developed two tools (with more forthcoming) with this purpose. One tool is a collection of actions so that schedules can be kept and organized on line. Its components include a "rapid entry" tool (##scheduler.php##, which should be kept on a page called ""ScheDuler""), a monthly schedule view (##monthschedule.php## which should be kept on a page called ""MonthSchedule"") and a day view (##dayview.php## which should be kept on a page called ""DaySchedule""). These actions depend on a function which must be included as a file in the ##scripts## directory. A year-view calendar is also available at GmBowenCalendar.

The other available action is a task manager (based on gbtask). The badwordfunction is at the bottom of the page (and currently is needed by the task manager & must be included in wikka.php).

=====Scheduler=====
Scheduler is an action which allows a person to keep a day calendar (or diary for that matter). Although the entry formatting is simple, at the same time it provides flexibility. A user can enter a day schedule.....

8:00 am - meeting with joe
9:00 am - coffee with angie
10:00 am - clients from budapest

or use it to keep a to-do list, or even a diary for the day. The schedule for a day can be viewed with the entry tool, in the monthly view, or in the day view. The day viewer is formatted for printing out usable schedules, & you can designate a specific user with it and see somebody else's schedule (I intend on modifying this so that there will be an easy-to-use text entry box for entering user names).
http://gmbowen.educ.unb.ca/wikitest/scheduler.jpg
Code for table in data base.....
%%(sql)
CREATE TABLE `wakka_scheduler` (
`id` int(10) NOT NULL auto_increment,
`user` varchar(80) NOT NULL default '',
`day` tinyint(2) NOT NULL default '0',
`month` tinyint(2) NOT NULL default '0',
`year` mediumint(4) NOT NULL default '0',
`dayschedule` text,
PRIMARY KEY (`id`)
) TYPE=MyISAM;
%%

These actions rely on a "bad word function" which must be placed as a file called ##badwordfunction.php## located in a directory called ##scripts## located in the wiki root directory.
%%(php)
<?php
//remove bad word filter
//Must be called badwordfunction.php and be placed in a directory called "scripts" in wakka root.

function BadWordFunction($RemoveBadWordText) {
$RemoveBadWordText = eregi_replace("fuc?k|[kc]unt|motherfucker|cocksucker|bitch|son of a bitch|asshole|shit|fag|wank|dick|pu[zs]?[zs][yi]|bastard|s[kc]rew|mole[zs]ter|mole[sz]t|coc?k", "", $RemoveBadWordText);
return $RemoveBadWordText;
}
?>
%%

below code added to actions directory as ##scheduler.php##. The action should be placed on a page called "ScheDule".
%%(php)
<?php
// Scheduler Version 1.1f - Jan 7, 2005 - bad word function call
// The original parts of this script were developed by G. Michael Bowen And Mark Kasper for a SSHRC research project using wikka wiki.
// As far as it is possible to tell (because the code exists all over the web), we provide credit to the original calendar code for the
// to Marcus Kazmierczak and released at www.blazonry.com, although this script builds considerably on that code.
// Code additions copyright GMBowen & Mark Kasper, 2004. Released to public domain under GPL. Modify, improve, change as you wish.
// There are two complementary actions. dayschedule.php allows anyone to designate an owner & date to see their schedule (see line 140)
// and the should be placed on a page named "DaySchedule". The other action, monthschedule.php, is a
// larger version of the dayschedule action which shows entries for an entire month on one page.
?>
<div align="center">
<P><TABLE BORDER=0>
<TR>
<TD>
<P>
<?php
$month = (!isset($_GET['month'])) ? date("n",mktime()) : $_GET['month'];
$year = (!isset($_GET['year'])) ? date("Y",mktime()) : $_GET['year'];
$today = (!isset($_GET['day'])) ? date("d",mktime()) : $_GET['day'];

$site_base = $this->GetConfigValue("base_url");
$thispage=$this->GetPageTag();

// badword array for replacing badwords (not initialized as currently using added function in wakka.php)
//$badwords = Array ('/motherfucker/i', '/cunt/i', '/fuck/i', '/cocksucker/i', '/bitch/i', '/son of a bitch/i', '/asshole/i', '/shit/i', '/fag/i', '/wank/i', '/dick/i', '/pussy/i', '/bastard/i', '/molester/i', '/molezter/i', '/cock/i');
//$changeto = '****';

// gets username
$username = $this->GetUserName();

// kasper
// NOTE VERY IMPORTANT, if the table is totally empty the function will not work, you
// must add one in maually, for this function to work
// I could add it in the code but very messy, will come up with better way.

$dayschedule = $_POST['dayscheduleX'];

include_once("./scripts/badwordfunction.php");
$dayschedule = BadWordFunction($dayschedule);
$dayschedule = addslashes($dayschedule); // for single quotes to work


// replace above function call with line below if wakka.php doesn't have a bad word function code in it
//$dayschedule = preg_replace($badwords, $changeto, $dayschedule);

$query = "select * from ".$this->config['table_prefix']."scheduler";
$result = mysql_query($query);

if ($_POST['save']){
// Kasper added to delete the empty schedule
$del = "delete from ".$this->config['table_prefix']."scheduler where dayschedule = ''";
$delresult = mysql_query($del);
$up = 0;
while ($row = mysql_fetch_object($result))
{
if($row->user == $username && $row->month == $month && $row->day == $today && $row->year == $year)
{
$up = 1;
$ro = $row->id;
}
}

if($up == 1)
{
$query = "UPDATE ".$this->config['table_prefix']."scheduler SET dayschedule='$dayschedule' WHERE user='$username' AND id='$ro'";
$result = mysql_query($query);
}else{
$query = "INSERT into ".$this->config['table_prefix']."scheduler (user,dayschedule,month,day,year) VALUES ('$username','$dayschedule','$month','$today','$year')";
$result = mysql_query($query);
}
}

// end kasper
?>

<table BGCOLOR="#DDccbb">
<tr>
<td valign="top">
<?php
/*== get what weekday the first is on ==*/
$tmpd = getdate(mktime(0,0,0,$month,1,$year));
$monthname = $tmpd["month"];
$firstwday= $tmpd["wday"];
$lastday = mk_getLastDayofMonth($month,$year);
?>
<table cellpadding="2" cellspacing="0" border="1">
<tr BGCOLOR="#ffffff">
<td colspan="7">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr BGCOLOR="#ffffff">
<td width="20"><a href="<?php echo $this->href("", "", "month="); echo (($month-1)<1) ? 12 : $month-1 ; ?>&year=<?php echo (($month-1)<1) ? $year-1 : $year ; ?>"><<<</a></td>
<td align="center"><font size="2"><?php echo "$monthname $year"; ?></font></td>
<td width="20"><a href="<?php echo $this->href("", "", "month="); echo (($month+1)>12) ? 1 : $month+1 ; ?>&year=<?php echo (($month+1)>12) ? $year+1 : $year ; ?>">>>></a></td>
</tr>
</table>
</td>
</tr>
<tr BGCOLOR="#DDccbb">
<td width="22">Su</td>
<td width="22">Mo</td>
<td width="22">Tu</td>
<td width="22">We</td>
<td width="22">Th</td>
<td width="22">Fr</td>
<td width="22">Sa</td>
</tr>
<?php
$day = 1;
$wday = $firstwday;
$firstweek = true;

/*== loop through all the days of the month ==*/
while ( $day <= $lastday)
{
/*== set up blank days for first week ==*/
if ($firstweek) {
print " <tr BGCOLOR=\"#ffffff\">";
for ($i=1; $i<=$firstwday; $i++)
{ print " <td><font size=\"2\"> </font></td>"; }
$firstweek = false;
}

/*== Sunday start week with <tr> ==*/
if ($wday==0) { print " <tr BGCOLOR=\"#ffffff\">\n"; }

/*== check for event ==*/
print " <td>";
if($day<10) {
if($month<10) {
$tag = "$year:0$month:0$day";
} else {
$tag = "$year:$month:0$day";
}
} else {
if($month<10) {
$tag = "$year:0$month:$day";
} else {
$tag = "$year:$month:$day";
}
}

$todaydate = date("Y:m:d",mktime());
if($tag==$todaydate)
{
$font1 = "<font color=\"#FF0000\"><b>";
$font2 = "</b></font>";
}
else
{
$font1 = "";
$font2 = "";
}
print "<a href=".$site_base.$thispage."&day=$day&month=$month&year=$year>$font1$day$font2</a>";
print "</td>\n";

/*== Saturday week with </tr> ==*/
if ($wday==6) { print " </tr>\n"; }

$wday++;
$wday = $wday % 7;
$day++;
}
?>
</tr>
</table>

</td>
</tr>
</table>

<?php
/*== get the last day of the month ==*/
function mk_getLastDayofMonth($mon,$year)
{
for ($tday=28; $tday <= 31; $tday++)
{
$tdate = getdate(mktime(0,0,0,$mon,$tday,$year));
if ($tdate["mon"] != $mon) break;
}
$tday--;
return $tday;
}
?>
<!-- Comment line below out if you don't want to link to the formatted schedule page-->
<center><a href=<? echo $site_base; ?>DaySchedule&<? echo "month=".$month."&day=".$today."&year=".$year; ?>><small>Day Schedule</small></a>
 | 
<a href=<? echo $site_base; ?>MonthSchedule&<? echo "month=".$month."&day=".$today."&year=".$year; ?>><small>Month Schedule</small></a></center>
</TD>
<TD WIDTH=500>
<P>

<?php
if ($user = $this->GetUser())
{
$dayschedule = str_replace("\n", ",", $_POST['dayschedule']);

// title over textarea box
$printowner = $username."'s Schedule for ";
$dayschedule = $this->LoadSingle("SELECT dayschedule FROM ".$this->config["table_prefix"]."scheduler WHERE user='".$username."' AND day='".$today."' AND month='".$month."' AND year='".$year."'");
// replaced a comma with XXZXX below....I don't know what the purpose of the code is...
$dayschedule = str_replace("XXZXX", "\n", $dayschedule[dayschedule]);
$output = str_replace(",", " ", $dayschedule[dayschedule]);
?>
<br><a href="<?php echo $this->href("", "", "day="); echo (($today-1)<1) ? $lastday : $today-1 ; ?>&year=<?php echo $year; ?>&month=<?php echo $month; ?>"><<</a>
<b><? echo "$printowner$monthname $today, $year:"; ?></b>
<a href="<?php echo $this->href("", "", "day="); echo (($today+1)>$lastday) ? 1 : $today+1 ; ?>&year=<?php echo $year; ?>&month=<?php echo $month; ?>">>></a>
<form action="" method="post">
<textarea cols="65" rows="12" name="dayscheduleX"><?php echo $dayschedule; ?></textarea>
<input type="submit" value="Submit" />
<input type="hidden" name="save" value="true" />
</form>
<?
}
else
{
echo "<em>The Scheduler only works for logged-in users.</em>";
} ?>
</P>
</TD>
</TR>
</TABLE>
</div>
%%

The following is the action which shows a formatted output for a selected day....the current day (by default) or for any other day (using a link from the ##scheduler.php## & ##monthview.php## actions)....it should be saved into the actions directory as ##dayschedule.php## and for proper functioning with ##scheduler.php## should be placed on a page called ""DaySchedule"".
%%(php)
<?php
// This script was developed by G. Michael Bowen for a SSHRC research project using wikka wiki.
// This action complements the scheduler.php action showing the day schedule for that user.
// DaySchedule Version 1c -- Jan 6, 2005
// This action should be placed on a page called "DaySchedule" to work with the scheduler.
// Code copyright GMBowen. Released to public domain under GPL. Modify, improve, change as you wish.

$month = (!isset($_GET['month'])) ? date("n",mktime()) : $_GET['month'];
// $monthname = $month;
$tmpd = getdate(mktime(0,0,0,$month,1,$year));
$monthname = $tmpd["month"];
$year = (!isset($_GET['year'])) ? date("Y",mktime()) : $_GET['year'];
$today = (!isset($_GET['day'])) ? date("d",mktime()) : $_GET['day'];
$site_base = $this->GetConfigValue("base_url");
$thispage=$this->GetPageTag();
$lastday = getLastDayofMonth($month,$year);

/*== get the last day of the month ==*/
function getLastDayofMonth($mon,$year)
{
for ($tday=28; $tday <= 31; $tday++)
{
$tdate = getdate(mktime(0,0,0,$mon,$tday,$year));
if ($tdate["mon"] != $mon) break;
}
$tday--;
return $tday;
}

// gets username
$username = $this->GetUserName();
$user = $username;

$dayschedule = $this->LoadSingle("SELECT dayschedule FROM ".$this->config["table_prefix"]."scheduler WHERE user='".$username."' AND day='".$today."' AND month='".$month."' AND year='".$year."'");
$printout = str_replace("\n", "<HR></TD></TR><TR ALIGN='left'><TD>", $dayschedule[dayschedule]);
$printowner = $username."'s entries for ";
?>
<div align="center">
<center> <a href="<?php echo $this->href("", "", "day="); echo (($today-1)<1) ? $lastday : $today-1 ; ?>&year=<?php echo $year; ?>&month=<?php echo $month; ?>"><<</a>
<b><? echo "$printowner$monthname $today, $year:"; ?></b>
<a href="<?php echo $this->href("", "", "day="); echo (($today+1)>$lastday) ? 1 : $today+1 ; ?>&year=<?php echo $year; ?>&month=<?php echo $month; ?>">>></a>

<TABLE class='box' width='600' border='1' CELLSPACING='1' CELLPADDING='7' BGCOLOR='#DDccbb'>
<TR>
<TD>
<P><TABLE class='box' width='100%' border='0' CELLSPACING='0' CELLPADDING='2' BGCOLOR='#ffffff'>
<TR ALIGN='left'>
<TD>
<P>
<?
if ($user = $this->GetUser())
{
if(!empty($printout))
{
echo $printout;
}
else
{
echo "There are no entries on this day.";
}
}
else
{
echo "<em>Showing the day schedule only works for logged-in users.</em>";
}
?>
</P>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<center><a href=<? echo $site_base; ?>ScheDuler&<? echo "month=".$month."&day=".$today."&year=".$year; ?>><small>Small Scheduler</small></a>
 | 
<a href=<? echo $site_base; ?>MonthSchedule&<? echo "month=".$month."&day=".$today."&year=".$year; ?>><small>Month Scheduler</small></a></center>
</center></div>
%%
This is a screenshot of the ##dayschedule.php## output...
http://gmbowen.educ.unb.ca/wikitest/dayschedule.jpg

This final action show a month-view with all of the entries. It should be saved into the actions directory as ##monthscheduler.php## and for proper functioning with ##scheduler.php## the action should be placed on a page called ""MonthSchedule"".
%%(php)
<?php
// Month Scheduler Version 1.0c - Jan 7, 2005 - bad word function call
// The original parts of this script were developed by G. Michael Bowen And Mark Kasper for a SSHRC research project using wikka wiki.
// As far as it is possible to tell (because the code exists all over the web), we provide credit for the original calendar code
// to Marcus Kazmierczak which was released at www.blazonry.com, although this script builds considerably on that code.
// Code additions copyright GMBowen & Mark Kasper, 2004. Released to public domain under GPL. Modify, improve, change as you wish.
// There are two complementary actions. dayschedule.php allows anyone to designate an owner & date to see their schedule (see line 140)
// and it should be placed on a page named "DaySchedule". The other action, scheduler.php, is a small version of the calendar action
// which allows easy and fast entering of data on different days.
?>
<div align="center">
<P><TABLE BORDER=0 width=100%>
<TR>
<TD>
<P>
<?php
$month = (!isset($_GET['month'])) ? date("n",mktime()) : $_GET['month'];
$year = (!isset($_GET['year'])) ? date("Y",mktime()) : $_GET['year'];
$today = (!isset($_GET['day'])) ? date("d",mktime()) : $_GET['day'];

$site_base = $this->GetConfigValue("base_url");
$thispage=$this->GetPageTag();
$username = $this->GetUserName();

// badword array for replacing badwords (not initialized as currently using added function in wakka.php)
//$badwords = Array ('/motherfucker/i', '/cunt/i', '/fuck/i', '/cocksucker/i', '/bitch/i', '/son of a bitch/i', '/asshole/i', '/shit/i', '/fag/i', '/wank/i', '/dick/i', '/pussy/i', '/bastard/i', '/molester/i', '/molezter/i', '/cock/i');
//$changeto = '****';

// gets username
$username = $this->GetUserName();

// kasper
// NOTE VERY IMPORTANT, if the table is totally empty the function will not work, you
// must add one in maually for this function to work.
// I could add it in the code but very messy, will come up with better way.

$dayschedule = $_POST['dayscheduleX'];
include_once("./scripts/badwordfunction.php");
$dayschedule = BadWordFunction($dayschedule);
$dayschedule = addslashes($dayschedule); // for single quotes to work


// replace above function call with line below if wakka.php doesn't have a bad word function code in it
//$dayschedule = preg_replace($badwords, $changeto, $dayschedule);

$query = "select * from ".$this->config['table_prefix']."scheduler";
$result = mysql_query($query);

if ($_POST['save']){
// Kasper added to delete the empty schedule
$del = "delete from ".$this->config['table_prefix']."scheduler where dayschedule = ''";
$delresult = mysql_query($del);
$up = 0;
while ($row = mysql_fetch_object($result))
{
if($row->user == $username && $row->month == $month && $row->day == $today && $row->year == $year)
{
$up = 1;
$ro = $row->id;
}
}

if($up == 1)
{
$query = "UPDATE ".$this->config['table_prefix']."scheduler SET dayschedule='$dayschedule' WHERE user='$username' AND id='$ro'";
$result = mysql_query($query);
}else{
$query = "INSERT into ".$this->config['table_prefix']."scheduler (user,dayschedule,month,day,year) VALUES ('$username','$dayschedule','$month','$today','$year')";
$result = mysql_query($query);
}
}
// end kasper
?>
<table>
<tr>
<td valign="top">
<?php
/*== get what weekday the first is on ==*/
$tmpd = getdate(mktime(0,0,0,$month,1,$year));
$monthname = $tmpd["month"];
$firstwday= $tmpd["wday"];
$lastday = mk_getLastDayofMonth($month,$year);
?>
<table cellpadding="2" cellspacing="0" border="1">
<tr>
<td colspan="7">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="20"><a href="<?php echo $this->href("", "", "month="); echo (($month-1)<1) ? 12 : $month-1 ; ?>&year=<?php echo (($month-1)<1) ? $year-1 : $year ; ?>"><<<</a></td>
<td align="center"><font size="2"><strong><? echo $username ?>'s Calendar for <?php echo "$monthname $year"; ?></strong></font></td>
<td width="20"><a href="<?php echo $this->href("", "", "month="); echo (($month+1)>12) ? 1 : $month+1 ; ?>&year=<?php echo (($month+1)>12) ? $year+1 : $year ; ?>">>>></a></td>
</tr>
</table>
</td>
</tr>
<tr BGCOLOR="#DDccbb">
<td>Sunday</td>
<td>Monday</td>
<td>Tuesday</td>
<td>Wednesday</td>
<td>Thursday</td>
<td>Friday</td>
<td>Saturday</td>
</tr>
<?php
$day = 1;
$wday = $firstwday;
$firstweek = true;

/*== loop through all the days of the month ==*/
while ( $day <= $lastday)
{
/*== set up blank days for first week ==*/
if ($firstweek) {
print " <tr>";
for ($i=1; $i<=$firstwday; $i++)
{ print " <td VALIGN=top ALIGN=left HEIGHT=70><font size=\"2\"> </font></td>"; }
$firstweek = false;
}

/*== Sunday start week with <tr> ==*/
if ($wday==0) { print " <tr>\n"; }

/*== check for event ==*/
print " <td VALIGN=top ALIGN=left WIDTH=150 HEIGHT=70>";
if($day<10) {
if($month<10) {
$tag = "$year:0$month:0$day";
} else {
$tag = "$year:$month:0$day";
}
} else {
if($month<10) {
$tag = "$year:0$month:$day";
} else {
$tag = "$year:$month:$day";
}
}

$todaydate = date("Y:m:d",mktime());
if($tag==$todaydate)
{
$font1 = "<font color=\"#FF0000\"><b>";
$font2 = "</b></font>";
$token="yes";
}
else
{
$font1 = "";
$font2 = "";
$token="no";
}
// code to determine what data should be entered into each cell
$thisdayschedule = $this->LoadSingle("SELECT dayschedule FROM ".$this->config["table_prefix"]."scheduler WHERE user='".$username."' AND day='".$day."' AND month='".$month."' AND year='".$year."'");
$dayoutput = str_replace("\n", "<br> ", $thisdayschedule[dayschedule]);
if ($token=="yes")
{
$printme="<a href=".$site_base."DaySchedule&month=".$month."&day=".$today."&year=".$year."><small>[Print Day]</small></a>";
}
else
{
$printme="";
}
print "<table width=\"100%\"><TR BGCOLOR=\"#E4DFDA\"><td><a href=".$site_base.$thispage."&day=$day&month=$month&year=$year#EntryBox> $font1$day$font2</a> $printme</td</tr><tr><td><small>$dayoutput</small></td></tr></table>";
print "</td>\n";

/*== Saturday week with </tr> ==*/
if ($wday==6) { print " </tr>\n"; }

$wday++;
$wday = $wday % 7;
$day++;
}
?>
</tr>
</table>

</td>
</tr>
</table>
<?php
/*== get the last day of the month ==*/
function mk_getLastDayofMonth($mon,$year)
{
for ($tday=28; $tday <= 31; $tday++)
{
$tdate = getdate(mktime(0,0,0,$mon,$tday,$year));
if ($tdate["mon"] != $mon) break;
}
$tday--;
return $tday;
}
?>
<!-- Comment below 3 lines out if you don't want to link to the formatted schedule page & scheduler page.-->
<center><a href=<? echo $site_base; ?>DaySchedule&<? echo "month=".$month."&day=".$today."&year=".$year; ?>><small>Formatted Day Page</small></a>
 | 
<a href=<? echo $site_base; ?>Scheduler&<? echo "month=".$month."&day=".$today."&year=".$year; ?>><small>Small Monthly Calendar</small></a></center>

</TD>
</tr><tr>
<TD WIDTH=500>
<P>
<?
if ($user = $this->GetUser())
{
$dayschedule = str_replace("\n", ",", $_POST['dayschedule']);

// title over textarea box
$printowner = $username."'s Schedule for ";
$dayschedule = $this->LoadSingle("SELECT dayschedule FROM ".$this->config["table_prefix"]."scheduler WHERE user='".$username."' AND day='".$today."' AND month='".$month."' AND year='".$year."'");
// replaced a comma with XXZXX below....I don't know what the purpose of the code is...
$dayschedule = str_replace("XXZXX", "\n", $dayschedule[dayschedule]);
$output = str_replace(",", " ", $dayschedule[dayschedule]);
?>
<center><A NAME=EntryBox></A>
<a href="<?php echo $this->href("", "", "day="); echo (($today-1)<1) ? $lastday : $today-1 ; ?>&year=<?php echo $year; ?>&month=<?php echo $month; ?>"><<</a>
<b><? echo "$printowner$monthname $today, $year:"; ?></b>
<a href="<?php echo $this->href("", "", "day="); echo (($today+1)>$lastday) ? 1 : $today+1 ; ?>&year=<?php echo $year; ?>&month=<?php echo $month; ?>">>></a>
<center><form action="" method="post">
<textarea cols="65" rows="12" name="dayscheduleX"><?php echo $dayschedule; ?></textarea>
<input type="submit" value="Submit" />
<input type="hidden" name="save" value="true" />
</form></center>
</center>
<?
}
else
{
echo "<em>The Scheduler only works for logged-in users.</em>";
}
?>
</P>
</TD>
</TR>
</TABLE>
</div>
%%
The following is a screen shot of the monthscheduler.
http://gmbowen.educ.unb.ca/wikitest/monthview.jpg

====Task Manager====
The task manager has two components. One is called mytasks.php which shows the task list of the logged in user & allows you to edit your task lists. The other is a (highly) modified version called usertasks.php which can be used to look at the task list of other users. It allows multiple instances of the action on the same page (so you can keep the task lists of all 3 people on the project in one page at once). It **REQUIRES** the usertasksfunctions.php file to be placed in a directory called "scripts" in the wiki root directory. The functions in it have been re-named from those in mytasks.php so you can have mytasks.php & usertasks.php on the same page (but only ONE copy of mytasks.php).
http://gmbowen.educ.unb.ca/wikitest/taskmanager.jpg

**Note that** there is a function code conflict in the mytasks.php action that causes problems if two copies are put on one page. JavaWoman steered me towards include_once() and require_once() which I implemented in wikkaforum & usertasks.php which works quite well. I'll work at implementing it here for the mytasks.php manager code in the coming week.

~&-replaced every //wakka_task// with //".$this->config["table_prefix"]."task//. Remember that it is possible to freely choose the table_prefix and the standard is //wikka_// The form used now prevents the necessity of renaming the file manually.
~&-set the table prefix for the creation-sql-command to wikka_ (default for wikka) and added a note.
~&--NilsLindenberg

Save the below code as ##mytasks.php## and place in the actions directory (REMEMBER, it needs the Bad Word Function included in ##wakka.php## for now...the code is at the bottom of the page).
%%(php)
<?
// This {{action}} script for derivations of wakka wiki is heavily modified from a standalone single-script package
// produced by and provided by the author identified in the text box below....although it is released by her as a "free to use"
// script, no mention is made of any problems with commercial use. If you intend on using this action script modified from the
// geniusbug code, especially for commercial purposes, you should contact the original author for permission to use the original
// components. All modifications of the original script by G. Michael Bowen & Mark Kasper are provided under a GPL license.
// Ongoing attribution of authorial contributions in any future modifications would be appreciated.
////////////////////////////////////////
// GBTask Task Manager //
// Naomi C. Martinson //
// 2002 © http://www.geniusbug.com //
// Don't remove this message //
// Contact: naomi@geniusbug.com //
////////////////////////////////////////
if ($this->method == "show") {
global $linktm;
$linktm = $this->config["base_url"].$this->MiniHref($method, $tag);
$delete_id = $_REQUEST['delete_id'];
$edit_id = $_REQUEST['edit_id'];
$task_id = $_REQUEST['task_id'];
$add_id = $_POST['add_id'];
$task_title = $_POST['task_title'];
$task_content = $_POST['task_content'];
$task_status = $_POST['task_status'];
$order1 = $_REQUEST['order1'];
$dir1 = $_REQUEST['dir1'];

$task_owner = $this->GetUserName();

// kasper
if($_REQUEST['tm_page'] == '' || $_REQUEST['tm_page'] == NULL){$tm_page = '1';}else{$tm_page = $_REQUEST['tm_page'];}

$update_id = $_POST[update_id];
$tm_direction = $_REQUEST[dir];
$keyword = $_POST[keyword];
if ($items == '' || $items =='0') { $items = 10;}
$items_per_page = $items;
session_start();

session_register("records_page");
$records_page = $items_per_page;

if(isset($tm_order)){
session_register("list_order");
$list_order = $tm_order;
}

if(isset($tm_direction)){
session_register("list_dir");
$list_dir = $tm_direction;
}

if(isset($set_theme)){
session_register("theme");
$theme = $set_theme;
}

if (isset($showsource)) {
show_source($HTTP_SERVER_VARS["SCRIPT_FILENAME"]);
exit;
}

//delete statement
if (strlen($delete_id) > 0){
$strSQL = "UPDATE ".$this->config["table_prefix"]."task SET task_delete = '1' WHERE task_id = ".$delete_id;
mysql_query($strSQL);
}

if (strlen($update_id) > 0){

// Bad Word Filter For Messages - Just erase the below line if you want people to be able to enter bad words.
$task_content = BadWordFunc($task_content);
$task_title = BadWordFunc($task_title);

$strSQL = "UPDATE ".$this->config["table_prefix"]."task SET user = '".$task_owner."', task_title = '".$task_title."', task_content = '".$task_content."', task_status = '".$task_status."' WHERE task_id=".$update_id;
mysql_query($strSQL);

//redirect sending a header to the server
header("Location: ".$linktm."&tm_page=".$tm_page);
exit;
}

$delete_id = $_REQUEST['delete_id'];
$edit_id = $_REQUEST['edit_id'];
//$tm_page = $_REQUEST['tm_page'];
$task_id = $_REQUEST['task_id'];
$add_id = $_POST['add_id'];
$task_title = $_POST['task_title'];
$task_content = $_POST['task_content'];
$task_status = $_POST['task_status'];
//$task_owner = $this->GetPageOwner();

//add statement
if (strlen($add_id) > 0){
$task_timestamp = date("Y-m-d H:i:s",mktime());

//$task_status = "Incomplete";

// Bad Word Filter For Messages - Just erase the below line if you want people to be able to enter bad words.
$task_content = BadWordFunc($task_content);
$task_title = BadWordFunc($task_title);

$strSQL = "INSERT Into ".$this->config["table_prefix"]."task (user, task_timestamp, task_title, task_content, task_status) VALUES ('$task_owner','$task_timestamp', '$task_title', '$task_content', '$task_status')";
mysql_query($strSQL);

//redirect sending a header to the server
header("Location: ".$linktm."&tm_page=".$tm_page);
exit;
}

//resume to 10 items per page
if(!isset($records_page)){
$records_page = 10;
}

// GMB Changed below line to include "where" statement

$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE user = '$task_owner' AND task_delete = '0'";
$query = mysql_query($strSQL);

$total_records = mysql_num_rows($query);
mysql_free_result($query);

if (!isset($tm_page)) {
$tm_page=1;
}
$num_pages = ceil($total_records / $records_page);
for ($i=1;$i<=$num_pages;$i++) {
$tm_page_nav = $tm_page_nav."[<a href=\"".$linktm."&tm_page=".$i."\">".$i."</a>] \n";
}

//header
echo "<html><head>\n";
//echo "<style type=\"text/css\">\n";
echo "<!-- \n";
echo "body {color:gray; font-size:10px; font-family:verdana,arial;}\n";
echo "td {color:gray; font-size:10px; font-family:verdana,arial;}\n";
echo "--> \n";
echo "</style>\n";
echo "</head>\n";
echo "<body bgcolor=\"white\">\n";

echo "<table width=90% cellpadding=0 cellspacing=0 border=0 align=center><tr><td bgcolor=white align=\"center\" valign=top>\n";

//html header, search form items, per page form
echo "<form method=post action=\"".$linktm."\">\n";
echo "<span style='color:gray; font-size:10px; font-family:verdana,arial;'> Task Owner: $task_owner </span>";
echo "<table width=75% cellpadding=0 cellspacing=0 border=0 valign=bottom><tr>\n";
echo "<td bgcolor=\"#949AE7\" valign=bottom><img src=\"images/trs.gif\" width=1 height=1></td>\n";
echo "</tr></table>\n";
echo "<table width=75% cellpadding=0 cellspacing=0 border=0><tr>\n";
echo "<td bgcolor=\"E9EBF3\">
<table width=100%><tr>
<td align=left>
<span style='color:gray; font-size:10px; font-family:verdana,arial;'> <!-- Page Owner: $task_owner -->
Pages: $tm_page_nav <a href=\"$linktm#tip1\"><font color=\"red\"><b><u>*</u></b></font></a> (Pg: $tm_page)</td>
<td align=center><a href=\"$linktm\"><b>
<span style='color:gray; font-size:10px; font-family:verdana,arial;'>
[HOME]</b></a>  <a href=\"".$linktm."&task_id=ALL&tm_page=$tm_page&order1=task_title&dir1=DESC\"><b><span style='color:gray; font-size:10px; font-family:verdana,arial;'>[SHOW ALL]</b></a></td>
<td align=right><input type=text size=15 value=\"keyword\" name=\"keyword\"><input type=submit value=\"Search\"></td>
</tr></table>
</td>\n";
echo "</tr></table>\n";
echo "</form>\n";

//search function
function get_results($keyword, $linktm, $tm_page, $task_owner, $owner) {
//search the database
$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE task_delete = '0' AND user = '$task_owner' AND task_title LIKE '%".$keyword."%' OR task_content LIKE '%".$keyword."%'";
$results = mysql_query($strSQL);

if (mysql_num_rows($results) > 0) {

echo "<br>Your keyword is: <b>".$keyword."</b><P>\n";
echo "<table width=75% cellpadding=4 cellspacing=2 border=0>\n";
while($mykey = mysql_fetch_array($results)){

//list the results
echo "<tr>\n";
echo "<td bgcolor=\"#E9E9E9\" align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>\n";

switch ($mykey["task_status"]) {
case "Incomplete":
echo "<font color=red>".$mykey["task_status"]."</font>\n";
break;

case "In Progress":
echo "<font color=blue>".$mykey["task_status"]."</font>\n";
break;

case "Complete":
echo "<font color=green>".$mykey["task_status"]."</font>\n";
break;
}

echo "</nobr></font></td>\n";
echo "<td bgcolor=\"#F3F0F9\" align=left valign=top width=75%><a href=\"".$linktm."&task_id=".$mykey["task_id"]."&tm_page=$page\">".$mykey["task_title"]."</a> (posted on:".$mykey["task_timestamp"].")</td>\n";
echo "</tr>\n";
}
echo "</table>\n";
}else{
echo "<P><font color=red>SORRY, NO MATCH!</font><P>\n";
}
mysql_free_result($results);
}

//view item after search function
function item($task_id, $linktm, $tm_page, $task_owner, $owner, $order1, $dir1) {
if($task_id == 'ALL'){

$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE task_delete = '0' AND user='$task_owner' ORDER By $order1 $dir1"; //kasper AND task_id =".$task_id;
$query = mysql_query($strSQL);

echo "<table width=75% cellpadding=4 cellspacing=2 border=0>\n";
echo "<tr>";
echo "<td bgcolor=\"#BBBDD9\" width=112px valign=top><b>STATUS <a href=\"".$linktm."&task_id=ALL&order1=task_title&dir1=DESC&num=\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=ALL&order1=task_title&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top><b>TASK</b> <a href=\"".$linktm."&task_id=ALL&order1=task_status&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=ALL&order1=task_status&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" width=192px valign=top><b>ENTERED ON</b> <a href=\"".$linktm."&task_id=ALL&order1=task_timestamp&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=ALL&order1=task_timestamp&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "
</tr>
</table>";


while ($item = mysql_fetch_object($query)){

echo "<table width=76% cellpadding=4 cellspacing=2 border=0><tr><td>\n";
echo "<table width=100% cellpadding=1 cellspacing=1 border=0>\n";
echo "<tr><td bgcolor=\"#E9E9E9\" width=120px align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>  \n";

switch ($item->task_status) {
case "Incomplete":
echo "<font color=red>".$item->task_status."</font>\n";
break;

case "In Progress":
echo "<font color=blue>".$item->task_status."</font>\n";
break;

case "Complete":
echo "<font color=green>".$item->task_status."</font>\n";
break;
}

echo "</nobr></font></td>\n";
echo "<td bgcolor=\"#BBBDD9\" align=left valign=top ><font color=white><b>  ".strtoupper($item->task_title)."</b></font></td>";
echo "<td width=200px bgcolor=\"#E9E9E9\" align=left valign=top ><center><font color=black>".$item->task_timestamp."</font></center></td></tr></table>\n";
echo "<table width=100% cellpadding=1 cellspacing=1 border=0><tr><td colspan=3 bgcolor=\"#E9E9E9\" align=left valign=top colspan=2>    ".str_replace("\n", "<br>", $item->task_content)."</td></tr>\n";
echo "</table></tr></td></table>\n";
}
}
else
{
$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE task_delete = '0' AND user='$task_owner' AND task_id =".$task_id;
$query = mysql_query($strSQL);
$item = mysql_fetch_array($query);
echo "<table width=75% cellpadding=4 cellspacing=2 border=0>\n";
echo "<td width=5% bgcolor=\"#E9E9E9\" align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>\n";

switch ($item["task_status"]) {
case "Incomplete":
echo "<font color=red>".$item["task_status"]."</font>\n";
break;

case "In Progress":
echo "<font color=blue>".$item["task_status"]."</font>\n";
break;

case "Complete":
echo "<font color=green>".$item["task_status"]."</font>\n";
break;
}
echo "</nobr></font></td>\n";
echo "<td bgcolor=\"#BBBDD9\" align=left valign=top width=75%><font color=white><b>".strtoupper($item["task_title"])."</b> (posted on: ".$item["task_timestamp"].")</font></td></tr>\n";
echo "<tr><td bgcolor=\"#F3F0F9\" align=left valign=top colspan=2>".str_replace("\n", "<br>", $item["task_content"])."</td></tr>\n";

echo "<tr><td bgcolor=\"#F3F0F9\" align=left valign=top colspan=2><nobr><a href=\"".$linktm."&edit_id=".$item["task_id"]."&tm_page=$tm_page\"><b>EDIT</b></a> | \n";
echo "<a href=\"javascript: if(confirm('Are you sure you want to delete this item?')){ window.self.location='$linktm&delete_id=".$item["task_id"]."&tm_page=$tm_page' }\"><b>DELETE</b></a></nobr></td></tr>\n";

echo "</table>\n";
}
}

//list items function
function list_todo($tm_order, $tm_direction, $linktm, $tm_page, $records_page, $task_timestamp, $task_status, $task_owner, $owner) {

if (!isset($tm_order)) {
$tm_order = "task_timestamp";
}

if (!isset($tm_direction)) {
$tm_direction = "DESC";
}

$begin = (($tm_page-1)*$records_page);
$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE task_delete = '0' AND user = '$task_owner' ORDER By $tm_order $tm_direction LIMIT $begin,$records_page";
$query = mysql_query($strSQL);

//ECHO 'START of list of items in the cell header information';

echo "<table width=75% cellpadding=2 cellspacing=2 border=0>\n";
echo "<tr>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top>\n";
echo "<b>TASK <a href=\"".$linktm."&order=task_title&dir=DESC&num=\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&order=task_title&dir=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top>\n";
echo "<b>ENTERED ON</b> <a href=\"".$linktm."&order=task_timestamp&dir=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&order=task_timestamp&dir=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top>\n";
echo "<b>STATUS</b> <a href=\"".$linktm."&order=task_status&dir=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&order=$task_status&dir=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";

echo "<td bgcolor=\"#BBBDD9\" valign=top><b>MODIFY</b> <img src=\"images/trs.gif\" width=11 height=16 border=0></td>\n";

echo "</tr>\n";

//ECHO 'START of list of items after HEADER information (why is this in the wrong place??)';
//list todo items
while ($todo = mysql_fetch_array($query)) {
echo "<tr>\n";
echo "<td align=left bgcolor=\"#F3F0F9\" valign=top><span title=\"Description: ".$todo["task_content"]."\">".$todo["task_title"]."</span></td>\n";

echo "<td bgcolor=\"#F3F0F9\" valign=top>".$todo["task_timestamp"]."</td>\n";

//items status case
switch ($todo["task_status"]) {
case "Incomplete":
echo "<td bgcolor=\"#E9E9E9\" valign=top><font color=red>".$todo["task_status"]."</font></td>\n";
break;

case "In Progress":
echo "<td bgcolor=\"#E9E9E9\" valign=top><font color=blue>".$todo["task_status"]."</font></td>\n";
break;

case "Complete":
echo "<td bgcolor=\"#E9E9E9\" valign=top><font color=green>".$todo["task_status"]."</font></td>\n";
break;
}

//modify action

echo "<td bgcolor=\"#F3F0F9\" valign=top><nobr>[<a href=\"".$linktm."&task_id=".$todo["task_id"]."&tm_page=$tm_page\"><b>view</b></a>|<a href=\"".$linktm."&edit_id=".$todo["task_id"]."&tm_page=$tm_page\"><b>edit</b></a></font>|";
echo "<a href=\"javascript: if(confirm('Are you sure you want to delete this item?')){ window.self.location='$linktm&delete_id=".$todo["task_id"]."&tm_page=$tm_page' }\"><b>delete</b></a>]</nobr></td>\n";

echo "</tr>\n";
}
echo "</table>\n";
mysql_free_result($query);

//add todo item form


echo "<form method=post action=\"$linktm\">\n";
echo "<input type=hidden name=\"add_id\" value=1>\n";
echo "<input type=hidden name=\"page\" value=\"$page\">\n";
echo "<table width=75% cellpadding=4 cellspacing=1 border=0>\n";
echo "<tr><td bgcolor=\"#DADBEB\" align=right valign=top>\n";
echo "<font color=\"#000000\"><b>\n";
echo "NEW TITLE: </b></font></td>\n";
echo "<td bgcolor=\"#DADBEB\" align=left valign=top>\n";
echo "<input type=text size=30 name=\"task_title\"></td>\n";
echo "</tr><tr>\n";
echo "<td bgcolor=\"#DADBEB\" align=right valign=top>\n";
echo "<font color=\"#000000\"><b>\n";
echo "DESCRIPTION: </b></font></td>\n";
echo "<td bgcolor=\"#DADBEB\" align=left valign=top>\n";
echo "<textarea rows=10 cols=60 name=\"task_content\"></textarea> </td>\n";
echo "</tr><tr>\n";
echo "<td bgcolor=\"#DADBEB\" align=right valign=top>\n";
echo "<font color=\"#000000\"><b>\n";
echo "SELECT STATUS: </b></font></td>\n";
echo "<td bgcolor=\"#DADBEB\" align=left valign=top>\n";

echo "<select name=task_status>\n";
echo "<option selected>Incomplete</option>\n";
echo "<option>In Progress</option>\n";
echo "<option>Complete</option>\n";
echo "</select> </td>\n";
echo "</tr><tr>\n";
echo "<td bgcolor=\"#DADBEB\" align=left valign=bottom>
<span style='color:gray; font-size:10px; font-family:verdana,arial;'>
Modified from code<br> © <a href=\"http://www.geniusbug.com\" target=\"_new\">geniusbug</a>\n";
echo "</td>\n";
echo "<td bgcolor=\"#DADBEB\" align=left valign=top>
<span style='color:gray; font-size:10px; font-family:verdana,arial;'>\n";
echo "<input type=submit value=\"Add\"><div align=\"right\"><a name=\"tip1\"><font color=red><b><u>*</u></b></font></a> Each page holds ".$records_page." items.</div></td>\n";
echo "</form>\n";
echo "</td><tr>\n";
echo "</table>\n";
}

//edit item function
function edit_todo($edit_id, $linktm, $tm_page, $edittodo, $task_status, $task_owner, $owner) {
$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE user = '$task_owner' AND task_id = ".$edit_id;
$query = mysql_query($strSQL);
$edittodo = mysql_fetch_array($query);


//edit item form

echo "<table width=75% cellpadding=4 cellspacing=1 border=0>\n";
echo "<div align=left> EDITING: <b>".strtoupper($edittodo["task_title"])." </b></div>\n";
echo "<form method=post action=\"$linktm\">\n";
echo "<input type=hidden name=\"update_id\" value=\"".$edittodo["task_id"]."\">\n";
echo "<input type=hidden name=\"page\" value=\"$tm_page\">\n";
echo "<tr><td bgcolor=\"#DADBEB\" align=right valign=top>\n";
echo "<font color=\"#000000\"><b>\n";
echo "TITLE: </b></font></td>\n";
echo "<td bgcolor=\"#DADBEB\" align=left valign=top>\n";
echo "<input type=text size=30 name=\"task_title\" value=\"".$edittodo["task_title"]."\"> </td>\n";
echo "</tr><tr>\n";
echo "<td bgcolor=\"#DADBEB\" align=right valign=top>\n";
echo "<font color=\"#000000\"><b>\n";
echo "DESCRIPTION: </b></font></td>\n";
echo "<td bgcolor=\"#DADBEB\" align=left valign=top>\n";
echo "<textarea rows=15 cols=40 name=\"task_content\">".$edittodo["task_content"]."</textarea> </td>\n";
echo "</tr><tr>\n";
echo "<td bgcolor=\"#DADBEB\" align=right valign=top>\n";
echo "<font color=\"#000000\"><b>\n";
echo "SELECT STATUS: </b></font></td>\n";
echo "<td bgcolor=\"#DADBEB\" align=left valign=top>\n";
echo "<select name=\"task_status\">\n";

if ($edittodo["task_status"] == "Incomplete") {
echo "<option selected>Incomplete</option>\n";
}else{
echo "<option>Incomplete</option>\n";
}

if ($edittodo["task_status"] == "In Progress") {
echo "<option selected>In Progress</option>\n";
}else{
echo "<option>In Progress</option>\n";
}

if ($edittodo["task_status"] == "Complete") {
echo "<option selected>Complete</option>\n";
}else{
echo "<option>Complete</option>\n";
}

echo "</select> </td>\n";
echo "</tr><tr>\n";
echo "<td bgcolor=\"#DADBEB\" valign=top>\n";
echo "  </td>\n";
echo "<td bgcolor=\"#DADBEB\" align=left valign=top>\n";
echo "<input type=submit value=\"Update\">\n";
echo "</form>\n";
echo "</td><tr>\n";
echo "</table>\n";

mysql_free_result($query);
}

//organize events order
if (strlen($edit_id) > 0) {
edit_todo($edit_id, $linktm, $tm_page, $edittodo, $task_status, $task_owner, $owner);

}elseif(strlen($keyword) > 0) {
get_results($keyword, $linktm, $tm_page, $task_owner, $owner);

}elseif(strlen($task_id) > 0) {
item($task_id, $linktm, $tm_page, $task_owner, $owner, $order1, $dir1);

}else{
list_todo($list_order, $list_dir, $linktm, $tm_page, $records_page, $task_timestamp, $task_status, $task_owner, $owner);
}

$fd = fopen ($HTTP_SERVER_VARS["SCRIPT_FILENAME"], "r");

$line=0;
if($fd){
while (!feof ($fd)) {
$buffer = fgets($fd, 4096);
$line++;
}
fclose ($fd);

}
echo "</table>";
echo "</body>";
echo "</html>";
}
?>
%%

**NOTE** that ##usertasks.php## also **requires** the file ##usertasksfunctions.php## (code farther below) to be placed in a directory called ##scripts## in the wikka root.

The following code is for ##usertasks.php## which should be placed in the actions directory...it allows you to look at others' schedules using the parameter="username" as in ""{{usertasks owner="username"}}""...you can place several copies of it on the same page to see task lists for several people (like all members of a working group) at once.

The code requires three gif files: ##up.gif##, ##down.gif## and ##trs.gif##.

%%(php)
<?
<?
// usertasks.php Version 2.0 - January 7, 2005 - removed code for editing, removed functions
// USE: {{usertasks [owner="UserName"] [items="#"]}}, owner & items parameters are optional
// Multiple instances may occur on a single page.
// REQUIRES usertasksfunctions.php which should be placed in the "scripts" directory in the wikka root
// Owner parameter is to allow seeing someone else's to-do list, items parameter is for # items on a page (default 10)
// Modified by GmBowen for use in wikka wiki for a SSHRC researh project. Modifications copyright 2005, provided under a GPL license.
// Ongoing attribution of authorial contribution in any future modifications would be appreciated.
// This {{action}} script for derivations of wakka wiki is heavily modified from a standalone single-script package
// produced by and provided by the author identified in the text box below....although it is released by her as a "free to use"
// script, no mention is made of any problems with commercial use. If you intend on using this action script modified from the
// geniusbug code, especially for commercial purposes, you should contact the original author for permission to use
// the original components.
////////////////////////////////////////
// GBTask Task Manager //
// Naomi C. Martinson //
// 2002 © http://www.geniusbug.com //
// Don't remove this message //
// Contact: naomi@geniusbug.com //
////////////////////////////////////////
$table=$this->config["table_prefix"];
global $linktm, $use;
$linktm = $this->config["base_url"].$this->MiniHref($method, $tag);
$task_id = $_REQUEST['task_id'];
$task_title = $_POST['task_title'];
$task_content = $_POST['task_content'];
$task_status = $_POST['task_status'];
$order1 = $_REQUEST['order1'];
$dir1 = $_REQUEST['dir1'];
$dir = $_REQUEST['dir'];

if($owner != NULL){$task_owner = $owner; }else { $task_owner = $this->GetPageOwner();}

if($_REQUEST['tm_page'] == '' || $_REQUEST['tm_page'] == NULL){$tm_page = '1';}else{$tm_page = $_REQUEST['tm_page'];}

$tm_direction = $_REQUEST[dir];
$tm_order = $_REQUEST[order];
$keyword = $_POST[keyword];
if ($items == '' || $items =='0') { $items = 10;}
$items_per_page = $items;
session_start();

session_register("records_page");
$records_page = $items_per_page;

if(isset($tm_order)){
session_register("list_order");
$list_order = $tm_order;
}

if(isset($tm_direction)){
session_register("list_dir");

$list_dir = $tm_direction;
}

if(isset($set_theme)){
session_register("theme");
$theme = $set_theme;
}

if (isset($showsource)) {
show_source($HTTP_SERVER_VARS["SCRIPT_FILENAME"]);
exit;
}



$task_id = $_REQUEST['task_id'];
$add_id = $_POST['add_id'];
$task_title = $_POST['task_title'];
$task_content = $_POST['task_content'];
$task_status = $_POST['task_status'];

//resume to 10 items per page
if(!isset($records_page)){
$records_page = 10;
}

$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE user = '$task_owner' AND task_delete = '0'";
$query = mysql_query($strSQL);

$total_records = mysql_num_rows($query);
mysql_free_result($query);

if (!isset($tm_page)) {
$tm_page=1;
}
$num_pages = ceil($total_records / $records_page);
for ($i=1;$i<=$num_pages;$i++) {
$tm_page_nav = $tm_page_nav."[<a href=\"".$linktm."&tm_page=".$i."\">".$i."</a>] \n";
}

echo "<table width=95% cellpadding=0 cellspacing=0 border=0 align=center><tr><td bgcolor=white align=\"center\" valign=top>\n";

//html header, search form items, per page form
echo "<form method=post action=\"".$linktm."\">\n";
echo "<span style='color:gray; font-size:10px; font-family:verdana,arial;'> <strong>Task Owner: $task_owner </strong></span>";
echo "<table width=75% cellpadding=0 cellspacing=0 border=0 valign=bottom><tr>\n";
echo "<td bgcolor=\"#949AE7\" valign=bottom><img src=\"images/trs.gif\" width=1 height=1></td>\n";
echo "</tr></table>\n";
echo "<table width=75% cellpadding=0 cellspacing=0 border=0><tr>\n";
echo "<td bgcolor=\"E9EBF3\">
<table width=100%><tr>
<td align=left>
<span style='color:gray; font-size:10px; font-family:verdana,arial;'> <!-- Page Owner: $task_owner -->
Pages: $tm_page_nav (Pg: $tm_page)</td>
<td align=center><a href=\"$linktm\"><b>
<span style='color:gray; font-size:10px; font-family:verdana,arial;'>
[HOME]</b></a>  SHOW:[<a href=\"".$linktm."&task_id=ALL&tm_page=$tm_page&order1=task_title&dir1=DESC\"><b><span style='color:gray; font-size:10px; font-family:verdana,arial;'>ALL</b></a>|<a href=\"".$linktm."&task_id=INCOMPLETE&tm_page=$tm_page&order1=task_title&dir1=DESC\"><b><span style='color:gray; font-size:10px; font-family:verdana,arial;'>INCOMPLETE</b></a>|<a href=\"".$linktm."&task_id=INPROGRESS&tm_page=$tm_page&order1=task_title&dir1=DESC\"><b><span style='color:gray; font-size:10px; font-family:verdana,arial;'>IN PROGRESS</b></a>|<a href=\"".$linktm."&task_id=COMPLETE&tm_page=$tm_page&order1=task_title&dir1=DESC\"><b><span style='color:gray; font-size:10px; font-family:verdana,arial;'>COMPLETE</b></a>]
</td>
<td align=right><input type=text size=10 value=\"keyword\" name=\"keyword\"><input type=submit value=\"Search\"></td>
</tr></table>
</td>\n";
echo "</tr></table>\n";
echo "</form>\n";

// functions include
include_once("./scripts/usertasksfunctions.php");

//organize events order
if (strlen($keyword) > 0) {
get_results2($keyword, $linktm, $tm_page, $task_owner, $owner, $table);

}elseif(strlen($task_id) > 0) {
item2($task_id, $linktm, $tm_page, $task_owner, $owner, $order1, $dir1, $table);

}else{
list_todo2($list_order, $list_dir, $linktm, $tm_page, $records_page, $task_timestamp, $task_status, $task_owner, $owner, $table);
}

$fd = fopen ($HTTP_SERVER_VARS["SCRIPT_FILENAME"], "r");

$line=0;
if($fd){
while (!feof ($fd)) {
$buffer = fgets($fd, 4096);
$line++;
}
fclose ($fd);

}
echo "</table>";
?>
%%

In addition the following file (##usertasksfunctions.php##) must be placed in a directory called ##scripts## in the wikka root.
%%(php)
<?
// usertasksfunctions.php Version 1.0 - January 7, 2005
// USE: REQUIRED for usertasks.php
// Modifications for use in wikka wiki by GmBowen copyright 2005, provided under a GPL license.
// Ongoing attribution of authorial contribution in any future modifications would be appreciated.
// The functions in this script derive from GBTask produced by and provided by the author identified in the text box below
// ....although it is released by her as a "free to use" script, no mention is made of any problems with commercial use.
// If you intend on using this action script modified from the geniusbug code, especially for commercial purposes,
// you should contact the original author for permission to use the original components.
////////////////////////////////////////
// GBTask Task Manager //
// Naomi C. Martinson //
// 2002 © http://www.geniusbug.com //
// Don't remove this message //
// Contact: naomi@geniusbug.com //
////////////////////////////////////////

//search function
function get_results2($keyword, $linktm, $tm_page, $task_owner, $owner, $table) {
//search the database
$strSQL = "SELECT * From ".$table."task WHERE task_delete = '0' AND user = '$task_owner' AND task_title LIKE '%".$keyword."%' OR task_content LIKE '%".$keyword."%'";
$results = mysql_query($strSQL);

if (mysql_num_rows($results) > 0) {

echo "<br>Your keyword is: <b>".$keyword."</b><P>\n";
echo "<table width=75% cellpadding=4 cellspacing=2 border=0>\n";
while($mykey = mysql_fetch_array($results)){

//list the results
echo "<tr>\n";
echo "<td bgcolor=\"#E9E9E9\" align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>\n";

switch ($mykey["task_status"]) {
case "Incomplete":
echo "<font color=red>".$mykey["task_status"]."</font>\n";
break;

case "In Progress":
echo "<font color=blue>".$mykey["task_status"]."</font>\n";
break;

case "Complete":
echo "<font color=green>".$mykey["task_status"]."</font>\n";
break;
}

echo "</nobr></font></td>\n";

echo "<td bgcolor=\"#F3F0F9\" align=left valign=top width=75%><a href=\"".$linktm."&task_id=".$mykey["task_id"]."&tm_page=$page\">".$mykey["task_title"]."</a> X(posted:".$mykey["task_timestamp"].")</td>\n";
echo "</tr>\n";
}
echo "</table>\n";
}else{
echo "<P><font color=red>SORRY, NO MATCH!</font><P>\n";
}
mysql_free_result($results);
}

//view item after search function
function item2($task_id, $linktm, $tm_page, $task_owner, $owner, $order1, $dir1, $table) {
if($task_id == 'ALL'){

$strSQL = "SELECT * From ".$table."task WHERE task_delete = '0' AND user='$task_owner' ORDER By $order1 $dir1"; //kasper AND task_id =".$task_id;
$query = mysql_query($strSQL);

echo "<table width=75% cellpadding=4 cellspacing=2 border=0>\n";
echo "<tr>";
echo "<td bgcolor=\"#BBBDD9\" width=112px valign=top><b>STATUS <a href=\"".$linktm."&task_id=ALL&order1=task_status&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=ALL&order1=task_status&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top><b>TASK</b> <a href=\"".$linktm."&task_id=ALL&order1=task_title&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=ALL&order1=task_title&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" width=192px valign=top><b>ENTERED ON</b> <a href=\"".$linktm."&task_id=ALL&order1=task_timestamp&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=ALL&order1=task_timestamp&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "
</tr>
</table>";


while ($item = mysql_fetch_object($query)){

echo "<table width=76% cellpadding=4 cellspacing=2 border=0><tr><td>\n";
echo "<table width=100% cellpadding=1 cellspacing=1 border=0>\n";
echo "<tr><td bgcolor=\"#E9E9E9\" width=120px align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>  \n";

switch ($item->task_status) {
case "Incomplete":
echo "<font color=red>".$item->task_status."</font>\n";
break;

case "In Progress":
echo "<font color=blue>".$item->task_status."</font>\n";
break;

case "Complete":
echo "<font color=green>".$item->task_status."</font>\n";
break;
}

echo "</nobr></font></td>\n";
echo "<td bgcolor=\"#BBBDD9\" align=left valign=top ><font color=white><b>  ".strtoupper($item->task_title)."</b></font></td>";
echo "<td width=200px bgcolor=\"#E9E9E9\" align=left valign=top ><center><font color=black>".$item->task_timestamp."</font></center></td></tr></table>\n";
echo "<table width=100% cellpadding=1 cellspacing=1 border=0><tr><td colspan=3 bgcolor=\"#E9E9E9\" align=left valign=top colspan=2>    ".str_replace("\n", "<br>", $item->task_content)."</td></tr>\n";
echo "</table></tr></td></table>\n";
}
}
elseif ($task_id == 'INCOMPLETE'){

$strSQL = "SELECT * From ".$table."task WHERE task_delete = '0' AND user='$task_owner' AND task_status='Incomplete' ORDER By $order1 $dir1"; //kasper AND task_id =".$task_id;
$query = mysql_query($strSQL);

echo "<table width=75% cellpadding=4 cellspacing=2 border=0>\n";
echo "<tr>";
echo "<td bgcolor=\"#BBBDD9\" width=112px valign=top><b>STATUS <a href=\"".$linktm."&task_id=INCOMPLETE&order1=task_status&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=INCOMPLETE&order1=task_status&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top><b>TASK</b> <a href=\"".$linktm."&task_id=INCOMPLETE&order1=task_title&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=INCOMPLETE&order1=task_title&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" width=192px valign=top><b>ENTERED ON</b> <a href=\"".$linktm."&task_id=INCOMPLETE&order1=task_timestamp&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=INCOMPLETE&order1=task_timestamp&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "
</tr>
</table>";


while ($item = mysql_fetch_object($query)){

echo "<table width=76% cellpadding=4 cellspacing=2 border=0><tr><td>\n";
echo "<table width=100% cellpadding=1 cellspacing=1 border=0>\n";
echo "<tr><td bgcolor=\"#E9E9E9\" width=120px align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>  \n";

switch ($item->task_status) {
case "Incomplete":
echo "<font color=red>".$item->task_status."</font>\n";
break;

case "In Progress":
echo "<font color=blue>".$item->task_status."</font>\n";
break;

case "Complete":
echo "<font color=green>".$item->task_status."</font>\n";
break;
}

echo "</nobr></font></td>\n";
echo "<td bgcolor=\"#BBBDD9\" align=left valign=top ><font color=white><b>  ".strtoupper($item->task_title)."</b></font></td>";
echo "<td width=200px bgcolor=\"#E9E9E9\" align=left valign=top ><center><font color=black>".$item->task_timestamp."</font></center></td></tr></table>\n";
echo "<table width=100% cellpadding=1 cellspacing=1 border=0><tr><td colspan=3 bgcolor=\"#E9E9E9\" align=left valign=top colspan=2>    ".str_replace("\n", "<br>", $item->task_content)."</td></tr>\n";
echo "</table></tr></td></table>\n";
}
}
elseif ($task_id == 'INPROGRESS'){

$strSQL = "SELECT * From ".$table."task WHERE task_delete = '0' AND user='$task_owner' AND task_status='In Progress' ORDER By $order1 $dir1"; //kasper AND task_id =".$task_id;
$query = mysql_query($strSQL);

echo "<table width=75% cellpadding=4 cellspacing=2 border=0>\n";
echo "<tr>";
echo "<td bgcolor=\"#BBBDD9\" width=112px valign=top><b>STATUS <a href=\"".$linktm."&task_id=INPROGRESS&order1=task_status&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=INPROGRESS&order1=task_status&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top><b>TASK</b> <a href=\"".$linktm."&task_id=INPROGRESS&order1=task_title&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=INPROGRESS&order1=task_title&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" width=192px valign=top><b>ENTERED ON</b> <a href=\"".$linktm."&task_id=INPROGRESS&order1=task_timestamp&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=INPROGRESS&order1=task_timestamp&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "
</tr>
</table>";


while ($item = mysql_fetch_object($query)){

echo "<table width=76% cellpadding=4 cellspacing=2 border=0><tr><td>\n";
echo "<table width=100% cellpadding=1 cellspacing=1 border=0>\n";
echo "<tr><td bgcolor=\"#E9E9E9\" width=120px align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>  \n";

switch ($item->task_status) {
case "Incomplete":
echo "<font color=red>".$item->task_status."</font>\n";
break;

case "In Progress":
echo "<font color=blue>".$item->task_status."</font>\n";
break;

case "Complete":
echo "<font color=green>".$item->task_status."</font>\n";
break;
}

echo "</nobr></font></td>\n";
echo "<td bgcolor=\"#BBBDD9\" align=left valign=top ><font color=white><b>  ".strtoupper($item->task_title)."</b></font></td>";
echo "<td width=200px bgcolor=\"#E9E9E9\" align=left valign=top ><center><font color=black>".$item->task_timestamp."</font></center></td></tr></table>\n";
echo "<table width=100% cellpadding=1 cellspacing=1 border=0><tr><td colspan=3 bgcolor=\"#E9E9E9\" align=left valign=top colspan=2>    ".str_replace("\n", "<br>", $item->task_content)."</td></tr>\n";
echo "</table></tr></td></table>\n";
}
}
elseif ($task_id == 'COMPLETE'){

$strSQL = "SELECT * From ".$table."task WHERE task_delete = '0' AND user='$task_owner' AND task_status='Complete' ORDER By $order1 $dir1"; //kasper AND task_id =".$task_id;
$query = mysql_query($strSQL);

echo "<table width=75% cellpadding=4 cellspacing=2 border=0>\n";
echo "<tr>";
echo "<td bgcolor=\"#BBBDD9\" width=112px valign=top><b>STATUS <a href=\"".$linktm."&task_id=COMPLETE&order1=task_status&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=COMPLETE&order1=task_status&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top><b>TASK</b> <a href=\"".$linktm."&task_id=COMPLETE&order1=task_title&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=COMPLETE&order1=task_title&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" width=192px valign=top><b>ENTERED ON</b> <a href=\"".$linktm."&task_id=COMPLETE&order1=task_timestamp&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=COMPLETE&order1=task_timestamp&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "
</tr>
</table>";


while ($item = mysql_fetch_object($query)){

echo "<table width=76% cellpadding=4 cellspacing=2 border=0><tr><td>\n";
echo "<table width=100% cellpadding=1 cellspacing=1 border=0>\n";
echo "<tr><td bgcolor=\"#E9E9E9\" width=120px align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>  \n";

switch ($item->task_status) {
case "Incomplete":
echo "<font color=red>".$item->task_status."</font>\n";
break;

case "In Progress":
echo "<font color=blue>".$item->task_status."</font>\n";
break;

case "Complete":
echo "<font color=green>".$item->task_status."</font>\n";
break;
}

echo "</nobr></font></td>\n";
echo "<td bgcolor=\"#BBBDD9\" align=left valign=top ><font color=white><b>  ".strtoupper($item->task_title)."</b></font></td>";
echo "<td width=200px bgcolor=\"#E9E9E9\" align=left valign=top ><center><font color=black>".$item->task_timestamp."</font></center></td></tr></table>\n";
echo "<table width=100% cellpadding=1 cellspacing=1 border=0><tr><td colspan=3 bgcolor=\"#E9E9E9\" align=left valign=top colspan=2>    ".str_replace("\n", "<br>", $item->task_content)."</td></tr>\n";
echo "</table></tr></td></table>\n";
}
}
else
{
$strSQL = "SELECT * From ".$table."task WHERE task_delete = '0' AND user='$task_owner' AND task_id =".$task_id;
$query = mysql_query($strSQL);
$item = mysql_fetch_array($query);
echo "<table width=75% cellpadding=4 cellspacing=2 border=0>\n";
echo "<td width=5% bgcolor=\"#E9E9E9\" align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>\n";

switch ($item["task_status"]) {
case "Incomplete":
echo "<font color=red>".$item["task_status"]."</font>\n";
break;

case "In Progress":
echo "<font color=blue>".$item["task_status"]."</font>\n";
break;

case "Complete":
echo "<font color=green>".$item["task_status"]."</font>\n";
break;
}
echo "</nobr></font></td>\n";
echo "<td bgcolor=\"#BBBDD9\" align=left valign=top width=75%><font color=black><b>".strtoupper($item["task_title"])."</b> (posted: ".$item["task_timestamp"].")</font></td></tr>\n";
echo "<tr><td bgcolor=\"#F3F0F9\" align=left valign=top colspan=2>".str_replace("\n", "<br>", $item["task_content"])."</td></tr>\n";
echo "</table>\n";
}
}

//list items function
function list_todo2($tm_order, $tm_direction, $linktm, $tm_page, $records_page, $task_timestamp, $task_status, $task_owner, $owner, $table) {

if (!isset($tm_order)) {
$tm_order = "task_timestamp";
}

if (!isset($tm_direction)) {
$tm_direction = "DESC";
}

$begin = (($tm_page-1)*$records_page);
$strSQL = "SELECT * From ".$table."task WHERE task_delete = '0' AND user = '$task_owner' ORDER By $tm_order $tm_direction LIMIT $begin,$records_page";
$query = mysql_query($strSQL);

//ECHO 'START of list of items in the cell header information';

echo "<table width=75% cellpadding=2 cellspacing=2 border=0>\n";
echo "<tr>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top>\n";
echo "<b>TASK <a href=\"".$linktm."&order=task_title&dir=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&order=task_title&dir=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top width=192px>\n";
echo "<b>ENTERED ON</b> <a href=\"".$linktm."&order=task_timestamp&dir=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&order=task_timestamp&dir=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top width=112px >\n";
echo "<b>STATUS</b> <a href=\"".$linktm."&order=task_status&dir=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&order=task_status&dir=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top width=112px><b>View?</b> <img src=\"images/trs.gif\" width=11 height=16 border=0></td>\n";
echo "</tr>\n";

//ECHO 'START of list of items after HEADER information (why is this in the wrong place??)';
//list todo items
while ($todo = mysql_fetch_array($query)) {
echo "<tr>\n";
echo "<td align=left bgcolor=\"#F3F0F9\" valign=top><span title=\"Description: ".$todo["task_content"]."\">".$todo["task_title"]."</span></td>\n";
echo "<td bgcolor=\"#F3F0F9\" valign=top>".$todo["task_timestamp"]."</td>\n";

//items status case
switch ($todo["task_status"]) {
case "Incomplete":
echo "<td bgcolor=\"#E9E9E9\" valign=top><font color=red>".$todo["task_status"]."</font></td>\n";
break;

case "In Progress":
echo "<td bgcolor=\"#E9E9E9\" valign=top><font color=blue>".$todo["task_status"]."</font></td>\n";
break;

case "Complete":
echo "<td bgcolor=\"#E9E9E9\" valign=top><font color=green>".$todo["task_status"]."</font></td>\n";
break;
}
echo "<td bgcolor=\"#F3F0F9\" valign=top><nobr>[<a href=\"".$linktm."&task_id=".$todo["task_id"]."&tm_page=$tm_page\"><b>view</b></a>]";
echo "</tr>\n";
}
echo "</table>\n";
mysql_free_result($query);
}
?>
%%

Ultimately, it is intended that a text entry box and a submit button will be added to this code for entering user names so the schedule of any user can be easily obtained without editing the page.

**Remember**, multiple copies of mytasks.php cannot be on the same page at once.

And, of course, you need to create a new table in your database....
''Remember that you may need to replace wikka_ (first line) with your wikkas table prefix''
%%(sql)
CREATE TABLE `wikka_task` (
`task_id` int(11) NOT NULL auto_increment,
`user` text NOT NULL,
`task_timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
`task_title` varchar(255) NOT NULL default '',
`task_content` text NOT NULL,
`task_status` varchar(255) default NULL,
`task_delete` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`task_id`)

) TYPE=MyISAM;
%%
----
The mytasks.php function on this page use a "bad word function" that should be placed in the wakka.php file in the wiki root directory. The following code needs to be placed in the wakka.php file (just after the microtime function which starts "function getmicrotime" and ends with a "}". This code is placed immediately after the "}".

%%(php)
//GMB remove bad word filter
function BadWordFunc($RemoveBadWordText) {
$RemoveBadWordText = eregi_replace("fuc?k|[kc]unt|motherfucker|cocksucker|bitch|son of a bitch|asshole|shit|fag|wank|dick|pu[zs]?[zs][yi]|bastard|s[kc]rew|mole[zs]ter|mole[sz]t|coc?k", "", $RemoveBadWordText);
return $RemoveBadWordText;
%%
----
Deletions:
=====Tools To Use Wiki As a Pim=====
{{lastedit show="3"}}
One use of Wikka is as a Personal Information Manager. For some things the free-form writing nature of a wiki is useful (and, dare-I-say, liberating). However, as some of our usage at this site suggests, there are tools that can be developed AS actions in wikka that can make some aspects of information management a bit easier. In the past six months I've modified/developed two tools (with more forthcoming) with this purpose. One tool is a collection of actions so that schedules can be kept and organized on line. Its components include a "rapid entry" tool (##scheduler.php##, which should be kept on a page called ""ScheDuler""), a monthly schedule view (##monthschedule.php## which should be kept on a page called ""MonthSchedule"") and a day view (##dayview.php## which should be kept on a page called ""DaySchedule""). These actions depend on a function which must be included as a file in the ##scripts## directory. A year-view calendar is also available at GmBowenCalendar.

The other available action is a task manager (based on gbtask). The badwordfunction is at the bottom of the page (and currently is needed by the task manager & must be included in wikka.php).

=====Scheduler=====
Scheduler is an action which allows a person to keep a day calendar (or diary for that matter). Although the entry formatting is simple, at the same time it provides flexibility. A user can enter a day schedule.....

8:00 am - meeting with joe
9:00 am - coffee with angie
10:00 am - clients from budapest

or use it to keep a to-do list, or even a diary for the day. The schedule for a day can be viewed with the entry tool, in the monthly view, or in the day view. The day viewer is formatted for printing out usable schedules, & you can designate a specific user with it and see somebody else's schedule (I intend on modifying this so that there will be an easy-to-use text entry box for entering user names).
http://gmbowen.educ.unb.ca/wikitest/scheduler.jpg
Code for table in data base.....
%%(sql)
CREATE TABLE `wakka_scheduler` (
`id` int(10) NOT NULL auto_increment,
`user` varchar(80) NOT NULL default '',
`day` tinyint(2) NOT NULL default '0',
`month` tinyint(2) NOT NULL default '0',
`year` mediumint(4) NOT NULL default '0',
`dayschedule` text,
PRIMARY KEY (`id`)
) TYPE=MyISAM;
%%

These actions rely on a "bad word function" which must be placed as a file called ##badwordfunction.php## located in a directory called ##scripts## located in the wiki root directory.
%%(php)
<?php
//remove bad word filter
//Must be called badwordfunction.php and be placed in a directory called "scripts" in wakka root.

function BadWordFunction($RemoveBadWordText) {
$RemoveBadWordText = eregi_replace("fuc?k|[kc]unt|motherfucker|cocksucker|bitch|son of a bitch|asshole|shit|fag|wank|dick|pu[zs]?[zs][yi]|bastard|s[kc]rew|mole[zs]ter|mole[sz]t|coc?k", "", $RemoveBadWordText);
return $RemoveBadWordText;
}
?>
%%

below code added to actions directory as ##scheduler.php##. The action should be placed on a page called "ScheDule".
%%(php)
<?php
// Scheduler Version 1.1f - Jan 7, 2005 - bad word function call
// The original parts of this script were developed by G. Michael Bowen And Mark Kasper for a SSHRC research project using wikka wiki.
// As far as it is possible to tell (because the code exists all over the web), we provide credit to the original calendar code for the
// to Marcus Kazmierczak and released at www.blazonry.com, although this script builds considerably on that code.
// Code additions copyright GMBowen & Mark Kasper, 2004. Released to public domain under GPL. Modify, improve, change as you wish.
// There are two complementary actions. dayschedule.php allows anyone to designate an owner & date to see their schedule (see line 140)
// and the should be placed on a page named "DaySchedule". The other action, monthschedule.php, is a
// larger version of the dayschedule action which shows entries for an entire month on one page.
?>
<div align="center">
<P><TABLE BORDER=0>
<TR>
<TD>
<P>
<?php
$month = (!isset($_GET['month'])) ? date("n",mktime()) : $_GET['month'];
$year = (!isset($_GET['year'])) ? date("Y",mktime()) : $_GET['year'];
$today = (!isset($_GET['day'])) ? date("d",mktime()) : $_GET['day'];

$site_base = $this->GetConfigValue("base_url");
$thispage=$this->GetPageTag();

// badword array for replacing badwords (not initialized as currently using added function in wakka.php)
//$badwords = Array ('/motherfucker/i', '/cunt/i', '/fuck/i', '/cocksucker/i', '/bitch/i', '/son of a bitch/i', '/asshole/i', '/shit/i', '/fag/i', '/wank/i', '/dick/i', '/pussy/i', '/bastard/i', '/molester/i', '/molezter/i', '/cock/i');
//$changeto = '****';

// gets username
$username = $this->GetUserName();

// kasper
// NOTE VERY IMPORTANT, if the table is totally empty the function will not work, you
// must add one in maually, for this function to work
// I could add it in the code but very messy, will come up with better way.

$dayschedule = $_POST['dayscheduleX'];

include_once("./scripts/badwordfunction.php");
$dayschedule = BadWordFunction($dayschedule);
$dayschedule = addslashes($dayschedule); // for single quotes to work


// replace above function call with line below if wakka.php doesn't have a bad word function code in it
//$dayschedule = preg_replace($badwords, $changeto, $dayschedule);

$query = "select * from ".$this->config['table_prefix']."scheduler";
$result = mysql_query($query);

if ($_POST['save']){
// Kasper added to delete the empty schedule
$del = "delete from ".$this->config['table_prefix']."scheduler where dayschedule = ''";
$delresult = mysql_query($del);
$up = 0;
while ($row = mysql_fetch_object($result))
{
if($row->user == $username && $row->month == $month && $row->day == $today && $row->year == $year)
{
$up = 1;
$ro = $row->id;
}
}

if($up == 1)
{
$query = "UPDATE ".$this->config['table_prefix']."scheduler SET dayschedule='$dayschedule' WHERE user='$username' AND id='$ro'";
$result = mysql_query($query);
}else{
$query = "INSERT into ".$this->config['table_prefix']."scheduler (user,dayschedule,month,day,year) VALUES ('$username','$dayschedule','$month','$today','$year')";
$result = mysql_query($query);
}
}

// end kasper
?>

<table BGCOLOR="#DDccbb">
<tr>
<td valign="top">
<?php
/*== get what weekday the first is on ==*/
$tmpd = getdate(mktime(0,0,0,$month,1,$year));
$monthname = $tmpd["month"];
$firstwday= $tmpd["wday"];
$lastday = mk_getLastDayofMonth($month,$year);
?>
<table cellpadding="2" cellspacing="0" border="1">
<tr BGCOLOR="#ffffff">
<td colspan="7">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr BGCOLOR="#ffffff">
<td width="20"><a href="<?php echo $this->href("", "", "month="); echo (($month-1)<1) ? 12 : $month-1 ; ?>&year=<?php echo (($month-1)<1) ? $year-1 : $year ; ?>"><<<</a></td>
<td align="center"><font size="2"><?php echo "$monthname $year"; ?></font></td>
<td width="20"><a href="<?php echo $this->href("", "", "month="); echo (($month+1)>12) ? 1 : $month+1 ; ?>&year=<?php echo (($month+1)>12) ? $year+1 : $year ; ?>">>>></a></td>
</tr>
</table>
</td>
</tr>
<tr BGCOLOR="#DDccbb">
<td width="22">Su</td>
<td width="22">Mo</td>
<td width="22">Tu</td>
<td width="22">We</td>
<td width="22">Th</td>
<td width="22">Fr</td>
<td width="22">Sa</td>
</tr>
<?php
$day = 1;
$wday = $firstwday;
$firstweek = true;

/*== loop through all the days of the month ==*/
while ( $day <= $lastday)
{
/*== set up blank days for first week ==*/
if ($firstweek) {
print " <tr BGCOLOR=\"#ffffff\">";
for ($i=1; $i<=$firstwday; $i++)
{ print " <td><font size=\"2\"> </font></td>"; }
$firstweek = false;
}

/*== Sunday start week with <tr> ==*/
if ($wday==0) { print " <tr BGCOLOR=\"#ffffff\">\n"; }

/*== check for event ==*/
print " <td>";
if($day<10) {
if($month<10) {
$tag = "$year:0$month:0$day";
} else {
$tag = "$year:$month:0$day";
}
} else {
if($month<10) {
$tag = "$year:0$month:$day";
} else {
$tag = "$year:$month:$day";
}
}

$todaydate = date("Y:m:d",mktime());
if($tag==$todaydate)
{
$font1 = "<font color=\"#FF0000\"><b>";
$font2 = "</b></font>";
}
else
{
$font1 = "";
$font2 = "";
}
print "<a href=".$site_base.$thispage."&day=$day&month=$month&year=$year>$font1$day$font2</a>";
print "</td>\n";

/*== Saturday week with </tr> ==*/
if ($wday==6) { print " </tr>\n"; }

$wday++;
$wday = $wday % 7;
$day++;
}
?>
</tr>
</table>

</td>
</tr>
</table>

<?php
/*== get the last day of the month ==*/
function mk_getLastDayofMonth($mon,$year)
{
for ($tday=28; $tday <= 31; $tday++)
{
$tdate = getdate(mktime(0,0,0,$mon,$tday,$year));
if ($tdate["mon"] != $mon) break;
}
$tday--;
return $tday;
}
?>
<!-- Comment line below out if you don't want to link to the formatted schedule page-->
<center><a href=<? echo $site_base; ?>DaySchedule&<? echo "month=".$month."&day=".$today."&year=".$year; ?>><small>Day Schedule</small></a>
 | 
<a href=<? echo $site_base; ?>MonthSchedule&<? echo "month=".$month."&day=".$today."&year=".$year; ?>><small>Month Schedule</small></a></center>
</TD>
<TD WIDTH=500>
<P>

<?php
if ($user = $this->GetUser())
{
$dayschedule = str_replace("\n", ",", $_POST['dayschedule']);

// title over textarea box
$printowner = $username."'s Schedule for ";
$dayschedule = $this->LoadSingle("SELECT dayschedule FROM ".$this->config["table_prefix"]."scheduler WHERE user='".$username."' AND day='".$today."' AND month='".$month."' AND year='".$year."'");
// replaced a comma with XXZXX below....I don't know what the purpose of the code is...
$dayschedule = str_replace("XXZXX", "\n", $dayschedule[dayschedule]);
$output = str_replace(",", " ", $dayschedule[dayschedule]);
?>
<br><a href="<?php echo $this->href("", "", "day="); echo (($today-1)<1) ? $lastday : $today-1 ; ?>&year=<?php echo $year; ?>&month=<?php echo $month; ?>"><<</a>
<b><? echo "$printowner$monthname $today, $year:"; ?></b>
<a href="<?php echo $this->href("", "", "day="); echo (($today+1)>$lastday) ? 1 : $today+1 ; ?>&year=<?php echo $year; ?>&month=<?php echo $month; ?>">>></a>
<form action="" method="post">
<textarea cols="65" rows="12" name="dayscheduleX"><?php echo $dayschedule; ?></textarea>
<input type="submit" value="Submit" />
<input type="hidden" name="save" value="true" />
</form>
<?
}
else
{
echo "<em>The Scheduler only works for logged-in users.</em>";
} ?>
</P>
</TD>
</TR>
</TABLE>
</div>
%%

The following is the action which shows a formatted output for a selected day....the current day (by default) or for any other day (using a link from the ##scheduler.php## & ##monthview.php## actions)....it should be saved into the actions directory as ##dayschedule.php## and for proper functioning with ##scheduler.php## should be placed on a page called ""DaySchedule"".
%%(php)
<?php
// This script was developed by G. Michael Bowen for a SSHRC research project using wikka wiki.
// This action complements the scheduler.php action showing the day schedule for that user.
// DaySchedule Version 1c -- Jan 6, 2005
// This action should be placed on a page called "DaySchedule" to work with the scheduler.
// Code copyright GMBowen. Released to public domain under GPL. Modify, improve, change as you wish.

$month = (!isset($_GET['month'])) ? date("n",mktime()) : $_GET['month'];
// $monthname = $month;
$tmpd = getdate(mktime(0,0,0,$month,1,$year));
$monthname = $tmpd["month"];
$year = (!isset($_GET['year'])) ? date("Y",mktime()) : $_GET['year'];
$today = (!isset($_GET['day'])) ? date("d",mktime()) : $_GET['day'];
$site_base = $this->GetConfigValue("base_url");
$thispage=$this->GetPageTag();
$lastday = getLastDayofMonth($month,$year);

/*== get the last day of the month ==*/
function getLastDayofMonth($mon,$year)
{
for ($tday=28; $tday <= 31; $tday++)
{
$tdate = getdate(mktime(0,0,0,$mon,$tday,$year));
if ($tdate["mon"] != $mon) break;
}
$tday--;
return $tday;
}

// gets username
$username = $this->GetUserName();
$user = $username;

$dayschedule = $this->LoadSingle("SELECT dayschedule FROM ".$this->config["table_prefix"]."scheduler WHERE user='".$username."' AND day='".$today."' AND month='".$month."' AND year='".$year."'");
$printout = str_replace("\n", "<HR></TD></TR><TR ALIGN='left'><TD>", $dayschedule[dayschedule]);
$printowner = $username."'s entries for ";
?>
<div align="center">
<center> <a href="<?php echo $this->href("", "", "day="); echo (($today-1)<1) ? $lastday : $today-1 ; ?>&year=<?php echo $year; ?>&month=<?php echo $month; ?>"><<</a>
<b><? echo "$printowner$monthname $today, $year:"; ?></b>
<a href="<?php echo $this->href("", "", "day="); echo (($today+1)>$lastday) ? 1 : $today+1 ; ?>&year=<?php echo $year; ?>&month=<?php echo $month; ?>">>></a>

<TABLE class='box' width='600' border='1' CELLSPACING='1' CELLPADDING='7' BGCOLOR='#DDccbb'>
<TR>
<TD>
<P><TABLE class='box' width='100%' border='0' CELLSPACING='0' CELLPADDING='2' BGCOLOR='#ffffff'>
<TR ALIGN='left'>
<TD>
<P>
<?
if ($user = $this->GetUser())
{
if(!empty($printout))
{
echo $printout;
}
else
{
echo "There are no entries on this day.";
}
}
else
{
echo "<em>Showing the day schedule only works for logged-in users.</em>";
}
?>
</P>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<center><a href=<? echo $site_base; ?>ScheDuler&<? echo "month=".$month."&day=".$today."&year=".$year; ?>><small>Small Scheduler</small></a>
 | 
<a href=<? echo $site_base; ?>MonthSchedule&<? echo "month=".$month."&day=".$today."&year=".$year; ?>><small>Month Scheduler</small></a></center>
</center></div>
%%
This is a screenshot of the ##dayschedule.php## output...
http://gmbowen.educ.unb.ca/wikitest/dayschedule.jpg

This final action show a month-view with all of the entries. It should be saved into the actions directory as ##monthscheduler.php## and for proper functioning with ##scheduler.php## the action should be placed on a page called ""MonthSchedule"".
%%(php)
<?php
// Month Scheduler Version 1.0c - Jan 7, 2005 - bad word function call
// The original parts of this script were developed by G. Michael Bowen And Mark Kasper for a SSHRC research project using wikka wiki.
// As far as it is possible to tell (because the code exists all over the web), we provide credit for the original calendar code
// to Marcus Kazmierczak which was released at www.blazonry.com, although this script builds considerably on that code.
// Code additions copyright GMBowen & Mark Kasper, 2004. Released to public domain under GPL. Modify, improve, change as you wish.
// There are two complementary actions. dayschedule.php allows anyone to designate an owner & date to see their schedule (see line 140)
// and it should be placed on a page named "DaySchedule". The other action, scheduler.php, is a small version of the calendar action
// which allows easy and fast entering of data on different days.
?>
<div align="center">
<P><TABLE BORDER=0 width=100%>
<TR>
<TD>
<P>
<?php
$month = (!isset($_GET['month'])) ? date("n",mktime()) : $_GET['month'];
$year = (!isset($_GET['year'])) ? date("Y",mktime()) : $_GET['year'];
$today = (!isset($_GET['day'])) ? date("d",mktime()) : $_GET['day'];

$site_base = $this->GetConfigValue("base_url");
$thispage=$this->GetPageTag();
$username = $this->GetUserName();

// badword array for replacing badwords (not initialized as currently using added function in wakka.php)
//$badwords = Array ('/motherfucker/i', '/cunt/i', '/fuck/i', '/cocksucker/i', '/bitch/i', '/son of a bitch/i', '/asshole/i', '/shit/i', '/fag/i', '/wank/i', '/dick/i', '/pussy/i', '/bastard/i', '/molester/i', '/molezter/i', '/cock/i');
//$changeto = '****';

// gets username
$username = $this->GetUserName();

// kasper
// NOTE VERY IMPORTANT, if the table is totally empty the function will not work, you
// must add one in maually for this function to work.
// I could add it in the code but very messy, will come up with better way.

$dayschedule = $_POST['dayscheduleX'];
include_once("./scripts/badwordfunction.php");
$dayschedule = BadWordFunction($dayschedule);
$dayschedule = addslashes($dayschedule); // for single quotes to work


// replace above function call with line below if wakka.php doesn't have a bad word function code in it
//$dayschedule = preg_replace($badwords, $changeto, $dayschedule);

$query = "select * from ".$this->config['table_prefix']."scheduler";
$result = mysql_query($query);

if ($_POST['save']){
// Kasper added to delete the empty schedule
$del = "delete from ".$this->config['table_prefix']."scheduler where dayschedule = ''";
$delresult = mysql_query($del);
$up = 0;
while ($row = mysql_fetch_object($result))
{
if($row->user == $username && $row->month == $month && $row->day == $today && $row->year == $year)
{
$up = 1;
$ro = $row->id;
}
}

if($up == 1)
{
$query = "UPDATE ".$this->config['table_prefix']."scheduler SET dayschedule='$dayschedule' WHERE user='$username' AND id='$ro'";
$result = mysql_query($query);
}else{
$query = "INSERT into ".$this->config['table_prefix']."scheduler (user,dayschedule,month,day,year) VALUES ('$username','$dayschedule','$month','$today','$year')";
$result = mysql_query($query);
}
}
// end kasper
?>
<table>
<tr>
<td valign="top">
<?php
/*== get what weekday the first is on ==*/
$tmpd = getdate(mktime(0,0,0,$month,1,$year));
$monthname = $tmpd["month"];
$firstwday= $tmpd["wday"];
$lastday = mk_getLastDayofMonth($month,$year);
?>
<table cellpadding="2" cellspacing="0" border="1">
<tr>
<td colspan="7">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="20"><a href="<?php echo $this->href("", "", "month="); echo (($month-1)<1) ? 12 : $month-1 ; ?>&year=<?php echo (($month-1)<1) ? $year-1 : $year ; ?>"><<<</a></td>
<td align="center"><font size="2"><strong><? echo $username ?>'s Calendar for <?php echo "$monthname $year"; ?></strong></font></td>
<td width="20"><a href="<?php echo $this->href("", "", "month="); echo (($month+1)>12) ? 1 : $month+1 ; ?>&year=<?php echo (($month+1)>12) ? $year+1 : $year ; ?>">>>></a></td>
</tr>
</table>
</td>
</tr>
<tr BGCOLOR="#DDccbb">
<td>Sunday</td>
<td>Monday</td>
<td>Tuesday</td>
<td>Wednesday</td>
<td>Thursday</td>
<td>Friday</td>
<td>Saturday</td>
</tr>
<?php
$day = 1;
$wday = $firstwday;
$firstweek = true;

/*== loop through all the days of the month ==*/
while ( $day <= $lastday)
{
/*== set up blank days for first week ==*/
if ($firstweek) {
print " <tr>";
for ($i=1; $i<=$firstwday; $i++)
{ print " <td VALIGN=top ALIGN=left HEIGHT=70><font size=\"2\"> </font></td>"; }
$firstweek = false;
}

/*== Sunday start week with <tr> ==*/
if ($wday==0) { print " <tr>\n"; }

/*== check for event ==*/
print " <td VALIGN=top ALIGN=left WIDTH=150 HEIGHT=70>";
if($day<10) {
if($month<10) {
$tag = "$year:0$month:0$day";
} else {
$tag = "$year:$month:0$day";
}
} else {
if($month<10) {
$tag = "$year:0$month:$day";
} else {
$tag = "$year:$month:$day";
}
}

$todaydate = date("Y:m:d",mktime());
if($tag==$todaydate)
{
$font1 = "<font color=\"#FF0000\"><b>";
$font2 = "</b></font>";
$token="yes";
}
else
{
$font1 = "";
$font2 = "";
$token="no";
}
// code to determine what data should be entered into each cell
$thisdayschedule = $this->LoadSingle("SELECT dayschedule FROM ".$this->config["table_prefix"]."scheduler WHERE user='".$username."' AND day='".$day."' AND month='".$month."' AND year='".$year."'");
$dayoutput = str_replace("\n", "<br> ", $thisdayschedule[dayschedule]);
if ($token=="yes")
{
$printme="<a href=".$site_base."DaySchedule&month=".$month."&day=".$today."&year=".$year."><small>[Print Day]</small></a>";
}
else
{
$printme="";
}
print "<table width=\"100%\"><TR BGCOLOR=\"#E4DFDA\"><td><a href=".$site_base.$thispage."&day=$day&month=$month&year=$year#EntryBox> $font1$day$font2</a> $printme</td</tr><tr><td><small>$dayoutput</small></td></tr></table>";
print "</td>\n";

/*== Saturday week with </tr> ==*/
if ($wday==6) { print " </tr>\n"; }

$wday++;
$wday = $wday % 7;
$day++;
}
?>
</tr>
</table>

</td>
</tr>
</table>
<?php
/*== get the last day of the month ==*/
function mk_getLastDayofMonth($mon,$year)
{
for ($tday=28; $tday <= 31; $tday++)
{
$tdate = getdate(mktime(0,0,0,$mon,$tday,$year));
if ($tdate["mon"] != $mon) break;
}
$tday--;
return $tday;
}
?>
<!-- Comment below 3 lines out if you don't want to link to the formatted schedule page & scheduler page.-->
<center><a href=<? echo $site_base; ?>DaySchedule&<? echo "month=".$month."&day=".$today."&year=".$year; ?>><small>Formatted Day Page</small></a>
 | 
<a href=<? echo $site_base; ?>Scheduler&<? echo "month=".$month."&day=".$today."&year=".$year; ?>><small>Small Monthly Calendar</small></a></center>

</TD>
</tr><tr>
<TD WIDTH=500>
<P>
<?
if ($user = $this->GetUser())
{
$dayschedule = str_replace("\n", ",", $_POST['dayschedule']);

// title over textarea box
$printowner = $username."'s Schedule for ";
$dayschedule = $this->LoadSingle("SELECT dayschedule FROM ".$this->config["table_prefix"]."scheduler WHERE user='".$username."' AND day='".$today."' AND month='".$month."' AND year='".$year."'");
// replaced a comma with XXZXX below....I don't know what the purpose of the code is...
$dayschedule = str_replace("XXZXX", "\n", $dayschedule[dayschedule]);
$output = str_replace(",", " ", $dayschedule[dayschedule]);
?>
<center><A NAME=EntryBox></A>
<a href="<?php echo $this->href("", "", "day="); echo (($today-1)<1) ? $lastday : $today-1 ; ?>&year=<?php echo $year; ?>&month=<?php echo $month; ?>"><<</a>
<b><? echo "$printowner$monthname $today, $year:"; ?></b>
<a href="<?php echo $this->href("", "", "day="); echo (($today+1)>$lastday) ? 1 : $today+1 ; ?>&year=<?php echo $year; ?>&month=<?php echo $month; ?>">>></a>
<center><form action="" method="post">
<textarea cols="65" rows="12" name="dayscheduleX"><?php echo $dayschedule; ?></textarea>
<input type="submit" value="Submit" />
<input type="hidden" name="save" value="true" />
</form></center>
</center>
<?
}
else
{
echo "<em>The Scheduler only works for logged-in users.</em>";
}
?>
</P>
</TD>
</TR>
</TABLE>
</div>
%%
The following is a screen shot of the monthscheduler.
http://gmbowen.educ.unb.ca/wikitest/monthview.jpg

====Task Manager====
The task manager has two components. One is called mytasks.php which shows the task list of the logged in user & allows you to edit your task lists. The other is a (highly) modified version called usertasks.php which can be used to look at the task list of other users. It allows multiple instances of the action on the same page (so you can keep the task lists of all 3 people on the project in one page at once). It **REQUIRES** the usertasksfunctions.php file to be placed in a directory called "scripts" in the wiki root directory. The functions in it have been re-named from those in mytasks.php so you can have mytasks.php & usertasks.php on the same page (but only ONE copy of mytasks.php).
http://gmbowen.educ.unb.ca/wikitest/taskmanager.jpg

**Note that** there is a function code conflict in the mytasks.php action that causes problems if two copies are put on one page. JavaWoman steered me towards include_once() and require_once() which I implemented in wikkaforum & usertasks.php which works quite well. I'll work at implementing it here for the mytasks.php manager code in the coming week.

~&-replaced every //wakka_task// with //".$this->config["table_prefix"]."task//. Remember that it is possible to freely choose the table_prefix and the standard is //wikka_// The form used now prevents the necessity of renaming the file manually.
~&-set the table prefix for the creation-sql-command to wikka_ (default for wikka) and added a note.
~&--NilsLindenberg

Save the below code as ##mytasks.php## and place in the actions directory (REMEMBER, it needs the Bad Word Function included in ##wakka.php## for now...the code is at the bottom of the page).
%%(php)
<?
// This {{action}} script for derivations of wakka wiki is heavily modified from a standalone single-script package
// produced by and provided by the author identified in the text box below....although it is released by her as a "free to use"
// script, no mention is made of any problems with commercial use. If you intend on using this action script modified from the
// geniusbug code, especially for commercial purposes, you should contact the original author for permission to use the original
// components. All modifications of the original script by G. Michael Bowen & Mark Kasper are provided under a GPL license.
// Ongoing attribution of authorial contributions in any future modifications would be appreciated.
////////////////////////////////////////
// GBTask Task Manager //
// Naomi C. Martinson //
// 2002 © http://www.geniusbug.com //
// Don't remove this message //
// Contact: naomi@geniusbug.com //
////////////////////////////////////////
if ($this->method == "show") {
global $linktm;
$linktm = $this->config["base_url"].$this->MiniHref($method, $tag);
$delete_id = $_REQUEST['delete_id'];
$edit_id = $_REQUEST['edit_id'];
$task_id = $_REQUEST['task_id'];
$add_id = $_POST['add_id'];
$task_title = $_POST['task_title'];
$task_content = $_POST['task_content'];
$task_status = $_POST['task_status'];
$order1 = $_REQUEST['order1'];
$dir1 = $_REQUEST['dir1'];

$task_owner = $this->GetUserName();

// kasper
if($_REQUEST['tm_page'] == '' || $_REQUEST['tm_page'] == NULL){$tm_page = '1';}else{$tm_page = $_REQUEST['tm_page'];}

$update_id = $_POST[update_id];
$tm_direction = $_REQUEST[dir];
$keyword = $_POST[keyword];
if ($items == '' || $items =='0') { $items = 10;}
$items_per_page = $items;
session_start();

session_register("records_page");
$records_page = $items_per_page;

if(isset($tm_order)){
session_register("list_order");
$list_order = $tm_order;
}

if(isset($tm_direction)){
session_register("list_dir");
$list_dir = $tm_direction;
}

if(isset($set_theme)){
session_register("theme");
$theme = $set_theme;
}

if (isset($showsource)) {
show_source($HTTP_SERVER_VARS["SCRIPT_FILENAME"]);
exit;
}

//delete statement
if (strlen($delete_id) > 0){
$strSQL = "UPDATE ".$this->config["table_prefix"]."task SET task_delete = '1' WHERE task_id = ".$delete_id;
mysql_query($strSQL);
}

if (strlen($update_id) > 0){

// Bad Word Filter For Messages - Just erase the below line if you want people to be able to enter bad words.
$task_content = BadWordFunc($task_content);
$task_title = BadWordFunc($task_title);

$strSQL = "UPDATE ".$this->config["table_prefix"]."task SET user = '".$task_owner."', task_title = '".$task_title."', task_content = '".$task_content."', task_status = '".$task_status."' WHERE task_id=".$update_id;
mysql_query($strSQL);

//redirect sending a header to the server
header("Location: ".$linktm."&tm_page=".$tm_page);
exit;
}

$delete_id = $_REQUEST['delete_id'];
$edit_id = $_REQUEST['edit_id'];
//$tm_page = $_REQUEST['tm_page'];
$task_id = $_REQUEST['task_id'];
$add_id = $_POST['add_id'];
$task_title = $_POST['task_title'];
$task_content = $_POST['task_content'];
$task_status = $_POST['task_status'];
//$task_owner = $this->GetPageOwner();

//add statement
if (strlen($add_id) > 0){
$task_timestamp = date("Y-m-d H:i:s",mktime());

//$task_status = "Incomplete";

// Bad Word Filter For Messages - Just erase the below line if you want people to be able to enter bad words.
$task_content = BadWordFunc($task_content);
$task_title = BadWordFunc($task_title);

$strSQL = "INSERT Into ".$this->config["table_prefix"]."task (user, task_timestamp, task_title, task_content, task_status) VALUES ('$task_owner','$task_timestamp', '$task_title', '$task_content', '$task_status')";
mysql_query($strSQL);

//redirect sending a header to the server
header("Location: ".$linktm."&tm_page=".$tm_page);
exit;
}

//resume to 10 items per page
if(!isset($records_page)){
$records_page = 10;
}

// GMB Changed below line to include "where" statement

$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE user = '$task_owner' AND task_delete = '0'";
$query = mysql_query($strSQL);

$total_records = mysql_num_rows($query);
mysql_free_result($query);

if (!isset($tm_page)) {
$tm_page=1;
}
$num_pages = ceil($total_records / $records_page);
for ($i=1;$i<=$num_pages;$i++) {
$tm_page_nav = $tm_page_nav."[<a href=\"".$linktm."&tm_page=".$i."\">".$i."</a>] \n";
}

//header
echo "<html><head>\n";
//echo "<style type=\"text/css\">\n";
echo "<!-- \n";
echo "body {color:gray; font-size:10px; font-family:verdana,arial;}\n";
echo "td {color:gray; font-size:10px; font-family:verdana,arial;}\n";
echo "--> \n";
echo "</style>\n";
echo "</head>\n";
echo "<body bgcolor=\"white\">\n";

echo "<table width=90% cellpadding=0 cellspacing=0 border=0 align=center><tr><td bgcolor=white align=\"center\" valign=top>\n";

//html header, search form items, per page form
echo "<form method=post action=\"".$linktm."\">\n";
echo "<span style='color:gray; font-size:10px; font-family:verdana,arial;'> Task Owner: $task_owner </span>";
echo "<table width=75% cellpadding=0 cellspacing=0 border=0 valign=bottom><tr>\n";
echo "<td bgcolor=\"#949AE7\" valign=bottom><img src=\"images/trs.gif\" width=1 height=1></td>\n";
echo "</tr></table>\n";
echo "<table width=75% cellpadding=0 cellspacing=0 border=0><tr>\n";
echo "<td bgcolor=\"E9EBF3\">
<table width=100%><tr>
<td align=left>
<span style='color:gray; font-size:10px; font-family:verdana,arial;'> <!-- Page Owner: $task_owner -->
Pages: $tm_page_nav <a href=\"$linktm#tip1\"><font color=\"red\"><b><u>*</u></b></font></a> (Pg: $tm_page)</td>
<td align=center><a href=\"$linktm\"><b>
<span style='color:gray; font-size:10px; font-family:verdana,arial;'>
[HOME]</b></a>  <a href=\"".$linktm."&task_id=ALL&tm_page=$tm_page&order1=task_title&dir1=DESC\"><b><span style='color:gray; font-size:10px; font-family:verdana,arial;'>[SHOW ALL]</b></a></td>
<td align=right><input type=text size=15 value=\"keyword\" name=\"keyword\"><input type=submit value=\"Search\"></td>
</tr></table>
</td>\n";
echo "</tr></table>\n";
echo "</form>\n";

//search function
function get_results($keyword, $linktm, $tm_page, $task_owner, $owner) {
//search the database
$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE task_delete = '0' AND user = '$task_owner' AND task_title LIKE '%".$keyword."%' OR task_content LIKE '%".$keyword."%'";
$results = mysql_query($strSQL);

if (mysql_num_rows($results) > 0) {

echo "<br>Your keyword is: <b>".$keyword."</b><P>\n";
echo "<table width=75% cellpadding=4 cellspacing=2 border=0>\n";
while($mykey = mysql_fetch_array($results)){

//list the results
echo "<tr>\n";
echo "<td bgcolor=\"#E9E9E9\" align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>\n";

switch ($mykey["task_status"]) {
case "Incomplete":
echo "<font color=red>".$mykey["task_status"]."</font>\n";
break;

case "In Progress":
echo "<font color=blue>".$mykey["task_status"]."</font>\n";
break;

case "Complete":
echo "<font color=green>".$mykey["task_status"]."</font>\n";
break;
}

echo "</nobr></font></td>\n";
echo "<td bgcolor=\"#F3F0F9\" align=left valign=top width=75%><a href=\"".$linktm."&task_id=".$mykey["task_id"]."&tm_page=$page\">".$mykey["task_title"]."</a> (posted on:".$mykey["task_timestamp"].")</td>\n";
echo "</tr>\n";
}
echo "</table>\n";
}else{
echo "<P><font color=red>SORRY, NO MATCH!</font><P>\n";
}
mysql_free_result($results);
}

//view item after search function
function item($task_id, $linktm, $tm_page, $task_owner, $owner, $order1, $dir1) {
if($task_id == 'ALL'){

$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE task_delete = '0' AND user='$task_owner' ORDER By $order1 $dir1"; //kasper AND task_id =".$task_id;
$query = mysql_query($strSQL);

echo "<table width=75% cellpadding=4 cellspacing=2 border=0>\n";
echo "<tr>";
echo "<td bgcolor=\"#BBBDD9\" width=112px valign=top><b>STATUS <a href=\"".$linktm."&task_id=ALL&order1=task_title&dir1=DESC&num=\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=ALL&order1=task_title&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top><b>TASK</b> <a href=\"".$linktm."&task_id=ALL&order1=task_status&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=ALL&order1=task_status&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" width=192px valign=top><b>ENTERED ON</b> <a href=\"".$linktm."&task_id=ALL&order1=task_timestamp&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=ALL&order1=task_timestamp&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "
</tr>
</table>";


while ($item = mysql_fetch_object($query)){

echo "<table width=76% cellpadding=4 cellspacing=2 border=0><tr><td>\n";
echo "<table width=100% cellpadding=1 cellspacing=1 border=0>\n";
echo "<tr><td bgcolor=\"#E9E9E9\" width=120px align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>  \n";

switch ($item->task_status) {
case "Incomplete":
echo "<font color=red>".$item->task_status."</font>\n";
break;

case "In Progress":
echo "<font color=blue>".$item->task_status."</font>\n";
break;

case "Complete":
echo "<font color=green>".$item->task_status."</font>\n";
break;
}

echo "</nobr></font></td>\n";
echo "<td bgcolor=\"#BBBDD9\" align=left valign=top ><font color=white><b>  ".strtoupper($item->task_title)."</b></font></td>";
echo "<td width=200px bgcolor=\"#E9E9E9\" align=left valign=top ><center><font color=black>".$item->task_timestamp."</font></center></td></tr></table>\n";
echo "<table width=100% cellpadding=1 cellspacing=1 border=0><tr><td colspan=3 bgcolor=\"#E9E9E9\" align=left valign=top colspan=2>    ".str_replace("\n", "<br>", $item->task_content)."</td></tr>\n";
echo "</table></tr></td></table>\n";
}
}
else
{
$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE task_delete = '0' AND user='$task_owner' AND task_id =".$task_id;
$query = mysql_query($strSQL);
$item = mysql_fetch_array($query);
echo "<table width=75% cellpadding=4 cellspacing=2 border=0>\n";
echo "<td width=5% bgcolor=\"#E9E9E9\" align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>\n";

switch ($item["task_status"]) {
case "Incomplete":
echo "<font color=red>".$item["task_status"]."</font>\n";
break;

case "In Progress":
echo "<font color=blue>".$item["task_status"]."</font>\n";
break;

case "Complete":
echo "<font color=green>".$item["task_status"]."</font>\n";
break;
}
echo "</nobr></font></td>\n";
echo "<td bgcolor=\"#BBBDD9\" align=left valign=top width=75%><font color=white><b>".strtoupper($item["task_title"])."</b> (posted on: ".$item["task_timestamp"].")</font></td></tr>\n";
echo "<tr><td bgcolor=\"#F3F0F9\" align=left valign=top colspan=2>".str_replace("\n", "<br>", $item["task_content"])."</td></tr>\n";

echo "<tr><td bgcolor=\"#F3F0F9\" align=left valign=top colspan=2><nobr><a href=\"".$linktm."&edit_id=".$item["task_id"]."&tm_page=$tm_page\"><b>EDIT</b></a> | \n";
echo "<a href=\"javascript: if(confirm('Are you sure you want to delete this item?')){ window.self.location='$linktm&delete_id=".$item["task_id"]."&tm_page=$tm_page' }\"><b>DELETE</b></a></nobr></td></tr>\n";

echo "</table>\n";
}
}

//list items function
function list_todo($tm_order, $tm_direction, $linktm, $tm_page, $records_page, $task_timestamp, $task_status, $task_owner, $owner) {

if (!isset($tm_order)) {
$tm_order = "task_timestamp";
}

if (!isset($tm_direction)) {
$tm_direction = "DESC";
}

$begin = (($tm_page-1)*$records_page);
$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE task_delete = '0' AND user = '$task_owner' ORDER By $tm_order $tm_direction LIMIT $begin,$records_page";
$query = mysql_query($strSQL);

//ECHO 'START of list of items in the cell header information';

echo "<table width=75% cellpadding=2 cellspacing=2 border=0>\n";
echo "<tr>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top>\n";
echo "<b>TASK <a href=\"".$linktm."&order=task_title&dir=DESC&num=\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&order=task_title&dir=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top>\n";
echo "<b>ENTERED ON</b> <a href=\"".$linktm."&order=task_timestamp&dir=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&order=task_timestamp&dir=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top>\n";
echo "<b>STATUS</b> <a href=\"".$linktm."&order=task_status&dir=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&order=$task_status&dir=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";

echo "<td bgcolor=\"#BBBDD9\" valign=top><b>MODIFY</b> <img src=\"images/trs.gif\" width=11 height=16 border=0></td>\n";

echo "</tr>\n";

//ECHO 'START of list of items after HEADER information (why is this in the wrong place??)';
//list todo items
while ($todo = mysql_fetch_array($query)) {
echo "<tr>\n";
echo "<td align=left bgcolor=\"#F3F0F9\" valign=top><span title=\"Description: ".$todo["task_content"]."\">".$todo["task_title"]."</span></td>\n";

echo "<td bgcolor=\"#F3F0F9\" valign=top>".$todo["task_timestamp"]."</td>\n";

//items status case
switch ($todo["task_status"]) {
case "Incomplete":
echo "<td bgcolor=\"#E9E9E9\" valign=top><font color=red>".$todo["task_status"]."</font></td>\n";
break;

case "In Progress":
echo "<td bgcolor=\"#E9E9E9\" valign=top><font color=blue>".$todo["task_status"]."</font></td>\n";
break;

case "Complete":
echo "<td bgcolor=\"#E9E9E9\" valign=top><font color=green>".$todo["task_status"]."</font></td>\n";
break;
}

//modify action

echo "<td bgcolor=\"#F3F0F9\" valign=top><nobr>[<a href=\"".$linktm."&task_id=".$todo["task_id"]."&tm_page=$tm_page\"><b>view</b></a>|<a href=\"".$linktm."&edit_id=".$todo["task_id"]."&tm_page=$tm_page\"><b>edit</b></a></font>|";
echo "<a href=\"javascript: if(confirm('Are you sure you want to delete this item?')){ window.self.location='$linktm&delete_id=".$todo["task_id"]."&tm_page=$tm_page' }\"><b>delete</b></a>]</nobr></td>\n";

echo "</tr>\n";
}
echo "</table>\n";
mysql_free_result($query);

//add todo item form


echo "<form method=post action=\"$linktm\">\n";
echo "<input type=hidden name=\"add_id\" value=1>\n";
echo "<input type=hidden name=\"page\" value=\"$page\">\n";
echo "<table width=75% cellpadding=4 cellspacing=1 border=0>\n";
echo "<tr><td bgcolor=\"#DADBEB\" align=right valign=top>\n";
echo "<font color=\"#000000\"><b>\n";
echo "NEW TITLE: </b></font></td>\n";
echo "<td bgcolor=\"#DADBEB\" align=left valign=top>\n";
echo "<input type=text size=30 name=\"task_title\"></td>\n";
echo "</tr><tr>\n";
echo "<td bgcolor=\"#DADBEB\" align=right valign=top>\n";
echo "<font color=\"#000000\"><b>\n";
echo "DESCRIPTION: </b></font></td>\n";
echo "<td bgcolor=\"#DADBEB\" align=left valign=top>\n";
echo "<textarea rows=10 cols=60 name=\"task_content\"></textarea> </td>\n";
echo "</tr><tr>\n";
echo "<td bgcolor=\"#DADBEB\" align=right valign=top>\n";
echo "<font color=\"#000000\"><b>\n";
echo "SELECT STATUS: </b></font></td>\n";
echo "<td bgcolor=\"#DADBEB\" align=left valign=top>\n";

echo "<select name=task_status>\n";
echo "<option selected>Incomplete</option>\n";
echo "<option>In Progress</option>\n";
echo "<option>Complete</option>\n";
echo "</select> </td>\n";
echo "</tr><tr>\n";
echo "<td bgcolor=\"#DADBEB\" align=left valign=bottom>
<span style='color:gray; font-size:10px; font-family:verdana,arial;'>
Modified from code<br> © <a href=\"http://www.geniusbug.com\" target=\"_new\">geniusbug</a>\n";
echo "</td>\n";
echo "<td bgcolor=\"#DADBEB\" align=left valign=top>
<span style='color:gray; font-size:10px; font-family:verdana,arial;'>\n";
echo "<input type=submit value=\"Add\"><div align=\"right\"><a name=\"tip1\"><font color=red><b><u>*</u></b></font></a> Each page holds ".$records_page." items.</div></td>\n";
echo "</form>\n";
echo "</td><tr>\n";
echo "</table>\n";
}

//edit item function
function edit_todo($edit_id, $linktm, $tm_page, $edittodo, $task_status, $task_owner, $owner) {
$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE user = '$task_owner' AND task_id = ".$edit_id;
$query = mysql_query($strSQL);
$edittodo = mysql_fetch_array($query);


//edit item form

echo "<table width=75% cellpadding=4 cellspacing=1 border=0>\n";
echo "<div align=left> EDITING: <b>".strtoupper($edittodo["task_title"])." </b></div>\n";
echo "<form method=post action=\"$linktm\">\n";
echo "<input type=hidden name=\"update_id\" value=\"".$edittodo["task_id"]."\">\n";
echo "<input type=hidden name=\"page\" value=\"$tm_page\">\n";
echo "<tr><td bgcolor=\"#DADBEB\" align=right valign=top>\n";
echo "<font color=\"#000000\"><b>\n";
echo "TITLE: </b></font></td>\n";
echo "<td bgcolor=\"#DADBEB\" align=left valign=top>\n";
echo "<input type=text size=30 name=\"task_title\" value=\"".$edittodo["task_title"]."\"> </td>\n";
echo "</tr><tr>\n";
echo "<td bgcolor=\"#DADBEB\" align=right valign=top>\n";
echo "<font color=\"#000000\"><b>\n";
echo "DESCRIPTION: </b></font></td>\n";
echo "<td bgcolor=\"#DADBEB\" align=left valign=top>\n";
echo "<textarea rows=15 cols=40 name=\"task_content\">".$edittodo["task_content"]."</textarea> </td>\n";
echo "</tr><tr>\n";
echo "<td bgcolor=\"#DADBEB\" align=right valign=top>\n";
echo "<font color=\"#000000\"><b>\n";
echo "SELECT STATUS: </b></font></td>\n";
echo "<td bgcolor=\"#DADBEB\" align=left valign=top>\n";
echo "<select name=\"task_status\">\n";

if ($edittodo["task_status"] == "Incomplete") {
echo "<option selected>Incomplete</option>\n";
}else{
echo "<option>Incomplete</option>\n";
}

if ($edittodo["task_status"] == "In Progress") {
echo "<option selected>In Progress</option>\n";
}else{
echo "<option>In Progress</option>\n";
}

if ($edittodo["task_status"] == "Complete") {
echo "<option selected>Complete</option>\n";
}else{
echo "<option>Complete</option>\n";
}

echo "</select> </td>\n";
echo "</tr><tr>\n";
echo "<td bgcolor=\"#DADBEB\" valign=top>\n";
echo "  </td>\n";
echo "<td bgcolor=\"#DADBEB\" align=left valign=top>\n";
echo "<input type=submit value=\"Update\">\n";
echo "</form>\n";
echo "</td><tr>\n";
echo "</table>\n";

mysql_free_result($query);
}

//organize events order
if (strlen($edit_id) > 0) {
edit_todo($edit_id, $linktm, $tm_page, $edittodo, $task_status, $task_owner, $owner);

}elseif(strlen($keyword) > 0) {
get_results($keyword, $linktm, $tm_page, $task_owner, $owner);

}elseif(strlen($task_id) > 0) {
item($task_id, $linktm, $tm_page, $task_owner, $owner, $order1, $dir1);

}else{
list_todo($list_order, $list_dir, $linktm, $tm_page, $records_page, $task_timestamp, $task_status, $task_owner, $owner);
}

$fd = fopen ($HTTP_SERVER_VARS["SCRIPT_FILENAME"], "r");

$line=0;
if($fd){
while (!feof ($fd)) {
$buffer = fgets($fd, 4096);
$line++;
}
fclose ($fd);

}
echo "</table>";
echo "</body>";
echo "</html>";
}
?>
%%

**NOTE** that ##usertasks.php## also **requires** the file ##usertasksfunctions.php## (code farther below) to be placed in a directory called ##scripts## in the wikka root.

The following code is for ##usertasks.php## which should be placed in the actions directory...it allows you to look at others' schedules using the parameter="username" as in ""{{usertasks owner="username"}}""...you can place several copies of it on the same page to see task lists for several people (like all members of a working group) at once.
%%(php)
<?
<?
// usertasks.php Version 2.0 - January 7, 2005 - removed code for editing, removed functions
// USE: {{usertasks [owner="UserName"] [items="#"]}}, owner & items parameters are optional
// Multiple instances may occur on a single page.
// REQUIRES usertasksfunctions.php which should be placed in the "scripts" directory in the wikka root
// Owner parameter is to allow seeing someone else's to-do list, items parameter is for # items on a page (default 10)
// Modified by GmBowen for use in wikka wiki for a SSHRC researh project. Modifications copyright 2005, provided under a GPL license.
// Ongoing attribution of authorial contribution in any future modifications would be appreciated.
// This {{action}} script for derivations of wakka wiki is heavily modified from a standalone single-script package
// produced by and provided by the author identified in the text box below....although it is released by her as a "free to use"
// script, no mention is made of any problems with commercial use. If you intend on using this action script modified from the
// geniusbug code, especially for commercial purposes, you should contact the original author for permission to use
// the original components.
////////////////////////////////////////
// GBTask Task Manager //
// Naomi C. Martinson //
// 2002 © http://www.geniusbug.com //
// Don't remove this message //
// Contact: naomi@geniusbug.com //
////////////////////////////////////////
$table=$this->config["table_prefix"];
global $linktm, $use;
$linktm = $this->config["base_url"].$this->MiniHref($method, $tag);
$task_id = $_REQUEST['task_id'];
$task_title = $_POST['task_title'];
$task_content = $_POST['task_content'];
$task_status = $_POST['task_status'];
$order1 = $_REQUEST['order1'];
$dir1 = $_REQUEST['dir1'];
$dir = $_REQUEST['dir'];

if($owner != NULL){$task_owner = $owner; }else { $task_owner = $this->GetPageOwner();}

if($_REQUEST['tm_page'] == '' || $_REQUEST['tm_page'] == NULL){$tm_page = '1';}else{$tm_page = $_REQUEST['tm_page'];}

$tm_direction = $_REQUEST[dir];
$tm_order = $_REQUEST[order];
$keyword = $_POST[keyword];
if ($items == '' || $items =='0') { $items = 10;}
$items_per_page = $items;
session_start();

session_register("records_page");
$records_page = $items_per_page;

if(isset($tm_order)){
session_register("list_order");
$list_order = $tm_order;
}

if(isset($tm_direction)){
session_register("list_dir");
$list_dir = $tm_direction;
}

if(isset($set_theme)){
session_register("theme");
$theme = $set_theme;
}

if (isset($showsource)) {
show_source($HTTP_SERVER_VARS["SCRIPT_FILENAME"]);
exit;
}



$task_id = $_REQUEST['task_id'];
$add_id = $_POST['add_id'];
$task_title = $_POST['task_title'];
$task_content = $_POST['task_content'];
$task_status = $_POST['task_status'];

//resume to 10 items per page
if(!isset($records_page)){
$records_page = 10;
}

$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE user = '$task_owner' AND task_delete = '0'";
$query = mysql_query($strSQL);

$total_records = mysql_num_rows($query);
mysql_free_result($query);

if (!isset($tm_page)) {
$tm_page=1;
}
$num_pages = ceil($total_records / $records_page);
for ($i=1;$i<=$num_pages;$i++) {
$tm_page_nav = $tm_page_nav."[<a href=\"".$linktm."&tm_page=".$i."\">".$i."</a>] \n";
}

echo "<table width=95% cellpadding=0 cellspacing=0 border=0 align=center><tr><td bgcolor=white align=\"center\" valign=top>\n";

//html header, search form items, per page form
echo "<form method=post action=\"".$linktm."\">\n";
echo "<span style='color:gray; font-size:10px; font-family:verdana,arial;'> <strong>Task Owner: $task_owner </strong></span>";
echo "<table width=75% cellpadding=0 cellspacing=0 border=0 valign=bottom><tr>\n";
echo "<td bgcolor=\"#949AE7\" valign=bottom><img src=\"images/trs.gif\" width=1 height=1></td>\n";
echo "</tr></table>\n";
echo "<table width=75% cellpadding=0 cellspacing=0 border=0><tr>\n";
echo "<td bgcolor=\"E9EBF3\">
<table width=100%><tr>
<td align=left>
<span style='color:gray; font-size:10px; font-family:verdana,arial;'> <!-- Page Owner: $task_owner -->
Pages: $tm_page_nav (Pg: $tm_page)</td>
<td align=center><a href=\"$linktm\"><b>
<span style='color:gray; font-size:10px; font-family:verdana,arial;'>
[HOME]</b></a>  SHOW:[<a href=\"".$linktm."&task_id=ALL&tm_page=$tm_page&order1=task_title&dir1=DESC\"><b><span style='color:gray; font-size:10px; font-family:verdana,arial;'>ALL</b></a>|<a href=\"".$linktm."&task_id=INCOMPLETE&tm_page=$tm_page&order1=task_title&dir1=DESC\"><b><span style='color:gray; font-size:10px; font-family:verdana,arial;'>INCOMPLETE</b></a>|<a href=\"".$linktm."&task_id=INPROGRESS&tm_page=$tm_page&order1=task_title&dir1=DESC\"><b><span style='color:gray; font-size:10px; font-family:verdana,arial;'>IN PROGRESS</b></a>|<a href=\"".$linktm."&task_id=COMPLETE&tm_page=$tm_page&order1=task_title&dir1=DESC\"><b><span style='color:gray; font-size:10px; font-family:verdana,arial;'>COMPLETE</b></a>]
</td>
<td align=right><input type=text size=10 value=\"keyword\" name=\"keyword\"><input type=submit value=\"Search\"></td>
</tr></table>
</td>\n";
echo "</tr></table>\n";
echo "</form>\n";

// functions include
include_once("./scripts/usertasksfunctions.php");

//organize events order
if (strlen($keyword) > 0) {
get_results2($keyword, $linktm, $tm_page, $task_owner, $owner, $table);

}elseif(strlen($task_id) > 0) {
item2($task_id, $linktm, $tm_page, $task_owner, $owner, $order1, $dir1, $table);

}else{
list_todo2($list_order, $list_dir, $linktm, $tm_page, $records_page, $task_timestamp, $task_status, $task_owner, $owner, $table);
}

$fd = fopen ($HTTP_SERVER_VARS["SCRIPT_FILENAME"], "r");

$line=0;
if($fd){
while (!feof ($fd)) {
$buffer = fgets($fd, 4096);
$line++;
}
fclose ($fd);

}
echo "</table>";
?>
%%

In addition the following file (##usertasksfunctions.php##) must be placed in a directory called ##scripts## in the wikka root.
%%(php)
<?
// usertasksfunctions.php Version 1.0 - January 7, 2005
// USE: REQUIRED for usertasks.php
// Modifications for use in wikka wiki by GmBowen copyright 2005, provided under a GPL license.
// Ongoing attribution of authorial contribution in any future modifications would be appreciated.
// The functions in this script derive from GBTask produced by and provided by the author identified in the text box below
// ....although it is released by her as a "free to use" script, no mention is made of any problems with commercial use.
// If you intend on using this action script modified from the geniusbug code, especially for commercial purposes,
// you should contact the original author for permission to use the original components.
////////////////////////////////////////
// GBTask Task Manager //
// Naomi C. Martinson //
// 2002 © http://www.geniusbug.com //
// Don't remove this message //
// Contact: naomi@geniusbug.com //
////////////////////////////////////////

//search function
function get_results2($keyword, $linktm, $tm_page, $task_owner, $owner, $table) {
//search the database
$strSQL = "SELECT * From ".$table."task WHERE task_delete = '0' AND user = '$task_owner' AND task_title LIKE '%".$keyword."%' OR task_content LIKE '%".$keyword."%'";
$results = mysql_query($strSQL);

if (mysql_num_rows($results) > 0) {

echo "<br>Your keyword is: <b>".$keyword."</b><P>\n";
echo "<table width=75% cellpadding=4 cellspacing=2 border=0>\n";
while($mykey = mysql_fetch_array($results)){

//list the results
echo "<tr>\n";
echo "<td bgcolor=\"#E9E9E9\" align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>\n";

switch ($mykey["task_status"]) {
case "Incomplete":
echo "<font color=red>".$mykey["task_status"]."</font>\n";
break;

case "In Progress":
echo "<font color=blue>".$mykey["task_status"]."</font>\n";
break;

case "Complete":
echo "<font color=green>".$mykey["task_status"]."</font>\n";
break;
}

echo "</nobr></font></td>\n";

echo "<td bgcolor=\"#F3F0F9\" align=left valign=top width=75%><a href=\"".$linktm."&task_id=".$mykey["task_id"]."&tm_page=$page\">".$mykey["task_title"]."</a> X(posted:".$mykey["task_timestamp"].")</td>\n";
echo "</tr>\n";
}
echo "</table>\n";
}else{
echo "<P><font color=red>SORRY, NO MATCH!</font><P>\n";
}
mysql_free_result($results);
}

//view item after search function
function item2($task_id, $linktm, $tm_page, $task_owner, $owner, $order1, $dir1, $table) {
if($task_id == 'ALL'){

$strSQL = "SELECT * From ".$table."task WHERE task_delete = '0' AND user='$task_owner' ORDER By $order1 $dir1"; //kasper AND task_id =".$task_id;
$query = mysql_query($strSQL);

echo "<table width=75% cellpadding=4 cellspacing=2 border=0>\n";
echo "<tr>";
echo "<td bgcolor=\"#BBBDD9\" width=112px valign=top><b>STATUS <a href=\"".$linktm."&task_id=ALL&order1=task_status&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=ALL&order1=task_status&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top><b>TASK</b> <a href=\"".$linktm."&task_id=ALL&order1=task_title&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=ALL&order1=task_title&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" width=192px valign=top><b>ENTERED ON</b> <a href=\"".$linktm."&task_id=ALL&order1=task_timestamp&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=ALL&order1=task_timestamp&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "
</tr>
</table>";


while ($item = mysql_fetch_object($query)){

echo "<table width=76% cellpadding=4 cellspacing=2 border=0><tr><td>\n";
echo "<table width=100% cellpadding=1 cellspacing=1 border=0>\n";
echo "<tr><td bgcolor=\"#E9E9E9\" width=120px align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>  \n";

switch ($item->task_status) {
case "Incomplete":
echo "<font color=red>".$item->task_status."</font>\n";
break;

case "In Progress":
echo "<font color=blue>".$item->task_status."</font>\n";
break;

case "Complete":
echo "<font color=green>".$item->task_status."</font>\n";
break;
}

echo "</nobr></font></td>\n";
echo "<td bgcolor=\"#BBBDD9\" align=left valign=top ><font color=white><b>  ".strtoupper($item->task_title)."</b></font></td>";
echo "<td width=200px bgcolor=\"#E9E9E9\" align=left valign=top ><center><font color=black>".$item->task_timestamp."</font></center></td></tr></table>\n";
echo "<table width=100% cellpadding=1 cellspacing=1 border=0><tr><td colspan=3 bgcolor=\"#E9E9E9\" align=left valign=top colspan=2>    ".str_replace("\n", "<br>", $item->task_content)."</td></tr>\n";
echo "</table></tr></td></table>\n";
}
}
elseif ($task_id == 'INCOMPLETE'){

$strSQL = "SELECT * From ".$table."task WHERE task_delete = '0' AND user='$task_owner' AND task_status='Incomplete' ORDER By $order1 $dir1"; //kasper AND task_id =".$task_id;
$query = mysql_query($strSQL);

echo "<table width=75% cellpadding=4 cellspacing=2 border=0>\n";
echo "<tr>";
echo "<td bgcolor=\"#BBBDD9\" width=112px valign=top><b>STATUS <a href=\"".$linktm."&task_id=INCOMPLETE&order1=task_status&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=INCOMPLETE&order1=task_status&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top><b>TASK</b> <a href=\"".$linktm."&task_id=INCOMPLETE&order1=task_title&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=INCOMPLETE&order1=task_title&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" width=192px valign=top><b>ENTERED ON</b> <a href=\"".$linktm."&task_id=INCOMPLETE&order1=task_timestamp&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=INCOMPLETE&order1=task_timestamp&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "
</tr>
</table>";


while ($item = mysql_fetch_object($query)){

echo "<table width=76% cellpadding=4 cellspacing=2 border=0><tr><td>\n";
echo "<table width=100% cellpadding=1 cellspacing=1 border=0>\n";
echo "<tr><td bgcolor=\"#E9E9E9\" width=120px align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>  \n";

switch ($item->task_status) {
case "Incomplete":
echo "<font color=red>".$item->task_status."</font>\n";
break;

case "In Progress":
echo "<font color=blue>".$item->task_status."</font>\n";
break;

case "Complete":
echo "<font color=green>".$item->task_status."</font>\n";
break;
}

echo "</nobr></font></td>\n";
echo "<td bgcolor=\"#BBBDD9\" align=left valign=top ><font color=white><b>  ".strtoupper($item->task_title)."</b></font></td>";
echo "<td width=200px bgcolor=\"#E9E9E9\" align=left valign=top ><center><font color=black>".$item->task_timestamp."</font></center></td></tr></table>\n";
echo "<table width=100% cellpadding=1 cellspacing=1 border=0><tr><td colspan=3 bgcolor=\"#E9E9E9\" align=left valign=top colspan=2>    ".str_replace("\n", "<br>", $item->task_content)."</td></tr>\n";
echo "</table></tr></td></table>\n";
}
}
elseif ($task_id == 'INPROGRESS'){

$strSQL = "SELECT * From ".$table."task WHERE task_delete = '0' AND user='$task_owner' AND task_status='In Progress' ORDER By $order1 $dir1"; //kasper AND task_id =".$task_id;
$query = mysql_query($strSQL);

echo "<table width=75% cellpadding=4 cellspacing=2 border=0>\n";
echo "<tr>";
echo "<td bgcolor=\"#BBBDD9\" width=112px valign=top><b>STATUS <a href=\"".$linktm."&task_id=INPROGRESS&order1=task_status&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=INPROGRESS&order1=task_status&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top><b>TASK</b> <a href=\"".$linktm."&task_id=INPROGRESS&order1=task_title&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=INPROGRESS&order1=task_title&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" width=192px valign=top><b>ENTERED ON</b> <a href=\"".$linktm."&task_id=INPROGRESS&order1=task_timestamp&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=INPROGRESS&order1=task_timestamp&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "
</tr>
</table>";


while ($item = mysql_fetch_object($query)){

echo "<table width=76% cellpadding=4 cellspacing=2 border=0><tr><td>\n";
echo "<table width=100% cellpadding=1 cellspacing=1 border=0>\n";
echo "<tr><td bgcolor=\"#E9E9E9\" width=120px align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>  \n";

switch ($item->task_status) {
case "Incomplete":
echo "<font color=red>".$item->task_status."</font>\n";
break;

case "In Progress":
echo "<font color=blue>".$item->task_status."</font>\n";
break;

case "Complete":
echo "<font color=green>".$item->task_status."</font>\n";
break;
}

echo "</nobr></font></td>\n";
echo "<td bgcolor=\"#BBBDD9\" align=left valign=top ><font color=white><b>  ".strtoupper($item->task_title)."</b></font></td>";
echo "<td width=200px bgcolor=\"#E9E9E9\" align=left valign=top ><center><font color=black>".$item->task_timestamp."</font></center></td></tr></table>\n";
echo "<table width=100% cellpadding=1 cellspacing=1 border=0><tr><td colspan=3 bgcolor=\"#E9E9E9\" align=left valign=top colspan=2>    ".str_replace("\n", "<br>", $item->task_content)."</td></tr>\n";
echo "</table></tr></td></table>\n";
}
}
elseif ($task_id == 'COMPLETE'){

$strSQL = "SELECT * From ".$table."task WHERE task_delete = '0' AND user='$task_owner' AND task_status='Complete' ORDER By $order1 $dir1"; //kasper AND task_id =".$task_id;
$query = mysql_query($strSQL);

echo "<table width=75% cellpadding=4 cellspacing=2 border=0>\n";
echo "<tr>";
echo "<td bgcolor=\"#BBBDD9\" width=112px valign=top><b>STATUS <a href=\"".$linktm."&task_id=COMPLETE&order1=task_status&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=COMPLETE&order1=task_status&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top><b>TASK</b> <a href=\"".$linktm."&task_id=COMPLETE&order1=task_title&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=COMPLETE&order1=task_title&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" width=192px valign=top><b>ENTERED ON</b> <a href=\"".$linktm."&task_id=COMPLETE&order1=task_timestamp&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=COMPLETE&order1=task_timestamp&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "
</tr>
</table>";


while ($item = mysql_fetch_object($query)){

echo "<table width=76% cellpadding=4 cellspacing=2 border=0><tr><td>\n";
echo "<table width=100% cellpadding=1 cellspacing=1 border=0>\n";
echo "<tr><td bgcolor=\"#E9E9E9\" width=120px align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>  \n";

switch ($item->task_status) {
case "Incomplete":
echo "<font color=red>".$item->task_status."</font>\n";
break;

case "In Progress":
echo "<font color=blue>".$item->task_status."</font>\n";
break;

case "Complete":
echo "<font color=green>".$item->task_status."</font>\n";
break;
}

echo "</nobr></font></td>\n";
echo "<td bgcolor=\"#BBBDD9\" align=left valign=top ><font color=white><b>  ".strtoupper($item->task_title)."</b></font></td>";
echo "<td width=200px bgcolor=\"#E9E9E9\" align=left valign=top ><center><font color=black>".$item->task_timestamp."</font></center></td></tr></table>\n";
echo "<table width=100% cellpadding=1 cellspacing=1 border=0><tr><td colspan=3 bgcolor=\"#E9E9E9\" align=left valign=top colspan=2>    ".str_replace("\n", "<br>", $item->task_content)."</td></tr>\n";
echo "</table></tr></td></table>\n";
}
}
else
{
$strSQL = "SELECT * From ".$table."task WHERE task_delete = '0' AND user='$task_owner' AND task_id =".$task_id;
$query = mysql_query($strSQL);
$item = mysql_fetch_array($query);
echo "<table width=75% cellpadding=4 cellspacing=2 border=0>\n";
echo "<td width=5% bgcolor=\"#E9E9E9\" align=left valign=top><font color=white><img src=\"images/trs.gif\" width=70 height=1><br><nobr>\n";

switch ($item["task_status"]) {
case "Incomplete":
echo "<font color=red>".$item["task_status"]."</font>\n";
break;

case "In Progress":
echo "<font color=blue>".$item["task_status"]."</font>\n";
break;

case "Complete":
echo "<font color=green>".$item["task_status"]."</font>\n";
break;
}
echo "</nobr></font></td>\n";
echo "<td bgcolor=\"#BBBDD9\" align=left valign=top width=75%><font color=black><b>".strtoupper($item["task_title"])."</b> (posted: ".$item["task_timestamp"].")</font></td></tr>\n";
echo "<tr><td bgcolor=\"#F3F0F9\" align=left valign=top colspan=2>".str_replace("\n", "<br>", $item["task_content"])."</td></tr>\n";
echo "</table>\n";
}
}

//list items function
function list_todo2($tm_order, $tm_direction, $linktm, $tm_page, $records_page, $task_timestamp, $task_status, $task_owner, $owner, $table) {

if (!isset($tm_order)) {
$tm_order = "task_timestamp";
}

if (!isset($tm_direction)) {
$tm_direction = "DESC";
}

$begin = (($tm_page-1)*$records_page);
$strSQL = "SELECT * From ".$table."task WHERE task_delete = '0' AND user = '$task_owner' ORDER By $tm_order $tm_direction LIMIT $begin,$records_page";
$query = mysql_query($strSQL);

//ECHO 'START of list of items in the cell header information';

echo "<table width=75% cellpadding=2 cellspacing=2 border=0>\n";
echo "<tr>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top>\n";
echo "<b>TASK <a href=\"".$linktm."&order=task_title&dir=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&order=task_title&dir=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top width=192px>\n";
echo "<b>ENTERED ON</b> <a href=\"".$linktm."&order=task_timestamp&dir=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&order=task_timestamp&dir=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top width=112px >\n";
echo "<b>STATUS</b> <a href=\"".$linktm."&order=task_status&dir=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&order=task_status&dir=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top width=112px><b>View?</b> <img src=\"images/trs.gif\" width=11 height=16 border=0></td>\n";
echo "</tr>\n";

//ECHO 'START of list of items after HEADER information (why is this in the wrong place??)';
//list todo items
while ($todo = mysql_fetch_array($query)) {
echo "<tr>\n";
echo "<td align=left bgcolor=\"#F3F0F9\" valign=top><span title=\"Description: ".$todo["task_content"]."\">".$todo["task_title"]."</span></td>\n";
echo "<td bgcolor=\"#F3F0F9\" valign=top>".$todo["task_timestamp"]."</td>\n";

//items status case
switch ($todo["task_status"]) {
case "Incomplete":
echo "<td bgcolor=\"#E9E9E9\" valign=top><font color=red>".$todo["task_status"]."</font></td>\n";
break;

case "In Progress":
echo "<td bgcolor=\"#E9E9E9\" valign=top><font color=blue>".$todo["task_status"]."</font></td>\n";
break;

case "Complete":
echo "<td bgcolor=\"#E9E9E9\" valign=top><font color=green>".$todo["task_status"]."</font></td>\n";
break;
}
echo "<td bgcolor=\"#F3F0F9\" valign=top><nobr>[<a href=\"".$linktm."&task_id=".$todo["task_id"]."&tm_page=$tm_page\"><b>view</b></a>]";
echo "</tr>\n";
}
echo "</table>\n";
mysql_free_result($query);
}
?>
%%

Ultimately, it is intended that a text entry box and a submit button will be added to this code for entering user names so the schedule of any user can be easily obtained without editing the page.

**Remember**, multiple copies of mytasks.php cannot be on the same page at once.

And, of course, you need to create a new table in your database....
''Remember that you may need to replace wikka_ (first line) with your wikkas table prefix''
%%(sql)
CREATE TABLE `wikka_task` (
`task_id` int(11) NOT NULL auto_increment,
`user` text NOT NULL,
`task_timestamp` datetime NOT NULL default '0000-00-00 00:00:00',
`task_title` varchar(255) NOT NULL default '',
`task_content` text NOT NULL,
`task_status` varchar(255) default NULL,
`task_delete` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`task_id`)

) TYPE=MyISAM;
%%
----
The mytasks.php function on this page use a "bad word function" that should be placed in the wakka.php file in the wiki root directory. The following code needs to be placed in the wakka.php file (just after the microtime function which starts "function getmicrotime" and ends with a "}". This code is placed immediately after the "}".

%%(php)
//GMB remove bad word filter
function BadWordFunc($RemoveBadWordText) {
$RemoveBadWordText = eregi_replace("fuc?k|[kc]unt|motherfucker|cocksucker|bitch|son of a bitch|asshole|shit|fag|wank|dick|pu[zs]?[zs][yi]|bastard|s[kc]rew|mole[zs]ter|mole[sz]t|coc?k", "", $RemoveBadWordText);
return $RemoveBadWordText;
%%
----


Revision [4749]

Edited on 2005-01-17 14:43:06 by NilsLindenberg [cat. changed]
Additions:
CategoryUserContributions
Deletions:
CategoryDevelopment


Revision [4254]

Edited on 2005-01-08 04:04:48 by GmBowen [updated code for usertasks.php to prevent function conflicts]
Additions:
The task manager has two components. One is called mytasks.php which shows the task list of the logged in user & allows you to edit your task lists. The other is a (highly) modified version called usertasks.php which can be used to look at the task list of other users. It allows multiple instances of the action on the same page (so you can keep the task lists of all 3 people on the project in one page at once). It **REQUIRES** the usertasksfunctions.php file to be placed in a directory called "scripts" in the wiki root directory. The functions in it have been re-named from those in mytasks.php so you can have mytasks.php & usertasks.php on the same page (but only ONE copy of mytasks.php).
**Note that** there is a function code conflict in the mytasks.php action that causes problems if two copies are put on one page. JavaWoman steered me towards include_once() and require_once() which I implemented in wikkaforum & usertasks.php which works quite well. I'll work at implementing it here for the mytasks.php manager code in the coming week.
Save the below code as ##mytasks.php## and place in the actions directory (REMEMBER, it needs the Bad Word Function included in ##wakka.php## for now...the code is at the bottom of the page).
if ($this->method == "show") {
**NOTE** that ##usertasks.php## also **requires** the file ##usertasksfunctions.php## (code farther below) to be placed in a directory called ##scripts## in the wikka root.
The following code is for ##usertasks.php## which should be placed in the actions directory...it allows you to look at others' schedules using the parameter="username" as in ""{{usertasks owner="username"}}""...you can place several copies of it on the same page to see task lists for several people (like all members of a working group) at once.
// usertasks.php Version 2.0 - January 7, 2005 - removed code for editing, removed functions
// USE: {{usertasks [owner="UserName"] [items="#"]}}, owner & items parameters are optional
// Multiple instances may occur on a single page.
// REQUIRES usertasksfunctions.php which should be placed in the "scripts" directory in the wikka root
// Owner parameter is to allow seeing someone else's to-do list, items parameter is for # items on a page (default 10)
// Modified by GmBowen for use in wikka wiki for a SSHRC researh project. Modifications copyright 2005, provided under a GPL license.
// Ongoing attribution of authorial contribution in any future modifications would be appreciated.
// geniusbug code, especially for commercial purposes, you should contact the original author for permission to use
// the original components.
$table=$this->config["table_prefix"];
$dir = $_REQUEST['dir'];
$tm_order = $_REQUEST[order];
echo "<table width=95% cellpadding=0 cellspacing=0 border=0 align=center><tr><td bgcolor=white align=\"center\" valign=top>\n";
echo "<span style='color:gray; font-size:10px; font-family:verdana,arial;'> <strong>Task Owner: $task_owner </strong></span>";
Pages: $tm_page_nav (Pg: $tm_page)</td>
[HOME]</b></a>  SHOW:[<a href=\"".$linktm."&task_id=ALL&tm_page=$tm_page&order1=task_title&dir1=DESC\"><b><span style='color:gray; font-size:10px; font-family:verdana,arial;'>ALL</b></a>|<a href=\"".$linktm."&task_id=INCOMPLETE&tm_page=$tm_page&order1=task_title&dir1=DESC\"><b><span style='color:gray; font-size:10px; font-family:verdana,arial;'>INCOMPLETE</b></a>|<a href=\"".$linktm."&task_id=INPROGRESS&tm_page=$tm_page&order1=task_title&dir1=DESC\"><b><span style='color:gray; font-size:10px; font-family:verdana,arial;'>IN PROGRESS</b></a>|<a href=\"".$linktm."&task_id=COMPLETE&tm_page=$tm_page&order1=task_title&dir1=DESC\"><b><span style='color:gray; font-size:10px; font-family:verdana,arial;'>COMPLETE</b></a>]
</td>
<td align=right><input type=text size=10 value=\"keyword\" name=\"keyword\"><input type=submit value=\"Search\"></td>
// functions include
include_once("./scripts/usertasksfunctions.php");
if (strlen($keyword) > 0) {
get_results2($keyword, $linktm, $tm_page, $task_owner, $owner, $table);
item2($task_id, $linktm, $tm_page, $task_owner, $owner, $order1, $dir1, $table);
list_todo2($list_order, $list_dir, $linktm, $tm_page, $records_page, $task_timestamp, $task_status, $task_owner, $owner, $table);
In addition the following file (##usertasksfunctions.php##) must be placed in a directory called ##scripts## in the wikka root.
// usertasksfunctions.php Version 1.0 - January 7, 2005
// USE: REQUIRED for usertasks.php
// Modifications for use in wikka wiki by GmBowen copyright 2005, provided under a GPL license.
// Ongoing attribution of authorial contribution in any future modifications would be appreciated.
// The functions in this script derive from GBTask produced by and provided by the author identified in the text box below
// ....although it is released by her as a "free to use" script, no mention is made of any problems with commercial use.
// If you intend on using this action script modified from the geniusbug code, especially for commercial purposes,
// you should contact the original author for permission to use the original components.
function get_results2($keyword, $linktm, $tm_page, $task_owner, $owner, $table) {
$strSQL = "SELECT * From ".$table."task WHERE task_delete = '0' AND user = '$task_owner' AND task_title LIKE '%".$keyword."%' OR task_content LIKE '%".$keyword."%'";
echo "<td bgcolor=\"#F3F0F9\" align=left valign=top width=75%><a href=\"".$linktm."&task_id=".$mykey["task_id"]."&tm_page=$page\">".$mykey["task_title"]."</a> X(posted:".$mykey["task_timestamp"].")</td>\n";
function item2($task_id, $linktm, $tm_page, $task_owner, $owner, $order1, $dir1, $table) {
$strSQL = "SELECT * From ".$table."task WHERE task_delete = '0' AND user='$task_owner' ORDER By $order1 $dir1"; //kasper AND task_id =".$task_id;
elseif ($task_id == 'INCOMPLETE'){
$strSQL = "SELECT * From ".$table."task WHERE task_delete = '0' AND user='$task_owner' AND task_status='Incomplete' ORDER By $order1 $dir1"; //kasper AND task_id =".$task_id;
echo "<td bgcolor=\"#BBBDD9\" width=112px valign=top><b>STATUS <a href=\"".$linktm."&task_id=INCOMPLETE&order1=task_status&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=INCOMPLETE&order1=task_status&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top><b>TASK</b> <a href=\"".$linktm."&task_id=INCOMPLETE&order1=task_title&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=INCOMPLETE&order1=task_title&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" width=192px valign=top><b>ENTERED ON</b> <a href=\"".$linktm."&task_id=INCOMPLETE&order1=task_timestamp&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=INCOMPLETE&order1=task_timestamp&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
elseif ($task_id == 'INPROGRESS'){
$strSQL = "SELECT * From ".$table."task WHERE task_delete = '0' AND user='$task_owner' AND task_status='In Progress' ORDER By $order1 $dir1"; //kasper AND task_id =".$task_id;
echo "<td bgcolor=\"#BBBDD9\" width=112px valign=top><b>STATUS <a href=\"".$linktm."&task_id=INPROGRESS&order1=task_status&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=INPROGRESS&order1=task_status&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top><b>TASK</b> <a href=\"".$linktm."&task_id=INPROGRESS&order1=task_title&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=INPROGRESS&order1=task_title&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" width=192px valign=top><b>ENTERED ON</b> <a href=\"".$linktm."&task_id=INPROGRESS&order1=task_timestamp&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=INPROGRESS&order1=task_timestamp&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
elseif ($task_id == 'COMPLETE'){
$strSQL = "SELECT * From ".$table."task WHERE task_delete = '0' AND user='$task_owner' AND task_status='Complete' ORDER By $order1 $dir1"; //kasper AND task_id =".$task_id;
echo "<td bgcolor=\"#BBBDD9\" width=112px valign=top><b>STATUS <a href=\"".$linktm."&task_id=COMPLETE&order1=task_status&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=COMPLETE&order1=task_status&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top><b>TASK</b> <a href=\"".$linktm."&task_id=COMPLETE&order1=task_title&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=COMPLETE&order1=task_title&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" width=192px valign=top><b>ENTERED ON</b> <a href=\"".$linktm."&task_id=COMPLETE&order1=task_timestamp&dir1=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&task_id=COMPLETE&order1=task_timestamp&dir1=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
$strSQL = "SELECT * From ".$table."task WHERE task_delete = '0' AND user='$task_owner' AND task_id =".$task_id;
echo "<td bgcolor=\"#BBBDD9\" align=left valign=top width=75%><font color=black><b>".strtoupper($item["task_title"])."</b> (posted: ".$item["task_timestamp"].")</font></td></tr>\n";
function list_todo2($tm_order, $tm_direction, $linktm, $tm_page, $records_page, $task_timestamp, $task_status, $task_owner, $owner, $table) {
$strSQL = "SELECT * From ".$table."task WHERE task_delete = '0' AND user = '$task_owner' ORDER By $tm_order $tm_direction LIMIT $begin,$records_page";
echo "<b>TASK <a href=\"".$linktm."&order=task_title&dir=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&order=task_title&dir=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top width=192px>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top width=112px >\n";
echo "<b>STATUS</b> <a href=\"".$linktm."&order=task_status&dir=DESC\"><img src=\"images/up.gif\" width=11 height=16 border=0></a> <a href=\"".$linktm."&order=task_status&dir=ASC\"><img src=\"images/down.gif\" width=11 height=16 border=0></a></td>\n";
echo "<td bgcolor=\"#BBBDD9\" valign=top width=112px><b>View?</b> <img src=\"images/trs.gif\" width=11 height=16 border=0></td>\n";
echo "<td bgcolor=\"#F3F0F9\" valign=top><nobr>[<a href=\"".$linktm."&task_id=".$todo["task_id"]."&tm_page=$tm_page\"><b>view</b></a>]";
**Remember**, multiple copies of mytasks.php cannot be on the same page at once.
The mytasks.php function on this page use a "bad word function" that should be placed in the wakka.php file in the wiki root directory. The following code needs to be placed in the wakka.php file (just after the microtime function which starts "function getmicrotime" and ends with a "}". This code is placed immediately after the "}".
Deletions:
The task manager has two components. One is called mytasks.php which shows the task list of the logged in user. The other is a modified version called usertasks.php which can be used to look at the task list of other users.
**Note that** there is a function code conflict in the task manager that causes problems if two copies are put on one page. This will probably **affect your "history" & "revisions" and cause them to "crash" (WSOD)**. A (now temporary) solution for dealing with the history/revisions conflict was proposed by DarTar (which involved putting %%if ($this->method == "show") {%% before the code (closing it with a } of course). JavaWoman steered me towards include_once() and require_once() which I implemented in wikkaforum and which work quite well. I'll work at implementing it here for the task manager code in the coming week.
In addition, I'm going to develop a textbox/submit button feature so that the galleries of different users can be seen without having to multiply edit/save the page. Feel free to play with this yourself.
Save the below code as ##mytasks.php## and place in the actions directory
The following code is for ##usertasks.php## which should be placed in the actions directory...it allows you to look at others' schedules
// components. All modifications of the original script by G. Michael Bowen are provided under a GPL license. Ongoing attribution
// of authorial contribution in any future modifications would be appreciated.
// use of usertasks.php....{{usertasks owner="username"}}
// GBTask Task Manager //
// Don't remove this message //
// kasper this breaks apart the share string for each user
$tok = strtok($share, " \n\t");
while ($tok) {
if($tok == $this->GetUserName() || $tok == "ALL") { $use = 'true';}
$tok = strtok(" \n\t");
if(strtoupper($this->GetUserName()) == strtoupper($this->GetPageOwner())){ $use = 'true';}
global $use;
if( $use == 'true'){
if($owner == ''){
global $use;
if($use == 'true'){
}}
if($owner == ''){
global $use;
if($use == 'true'){
}}
if($owner == '')
{
global $use;
if($use == 'true'){
}}
**Remember**, neither of these can be on the same page at the same time, nor can there be more than one copy of these on any one page....consider yourself warned. A temporary solution for preventing problems with history/revisions are proposed at the top of the page. JavaWoman steered me towards include_once() & require_once() and these will be the "real" solution which I'll implement in coming weeks.
All of the functions on this page user a "bad word function" that is placed in the wakka.php file in the wiki root directory. The following code needs to be placed in the wakka.php file (just after the microtime function which starts "function getmicrotime" and ends with a "}". This code is placed immediately after the "}".


Revision [4243]

Edited on 2005-01-08 01:25:34 by NilsLindenberg [replaced last wakka_task + information (taskmanager)]
Additions:
~&-replaced every //wakka_task// with //".$this->config["table_prefix"]."task//. Remember that it is possible to freely choose the table_prefix and the standard is //wikka_// The form used now prevents the necessity of renaming the file manually.
~&-set the table prefix for the creation-sql-command to wikka_ (default for wikka) and added a note.
~&--NilsLindenberg
''Remember that you may need to replace wikka_ (first line) with your wikkas table prefix''
CREATE TABLE `wikka_task` (
Deletions:
$strSQL = "SELECT * From wakka_task WHERE user = '$task_owner' AND task_id = ".$edit_id;
CREATE TABLE `wakka_task` (


Revision [4242]

Edited on 2005-01-08 01:00:35 by NilsLindenberg [replaced every wakka_task in the taskmanager functions with ".$this->config["table_pref]
Additions:
$strSQL = "UPDATE ".$this->config["table_prefix"]."task SET task_delete = '1' WHERE task_id = ".$delete_id;
$strSQL = "UPDATE ".$this->config["table_prefix"]."task SET user = '".$task_owner."', task_title = '".$task_title."', task_content = '".$task_content."', task_status = '".$task_status."' WHERE task_id=".$update_id;
$strSQL = "INSERT Into ".$this->config["table_prefix"]."task (user, task_timestamp, task_title, task_content, task_status) VALUES ('$task_owner','$task_timestamp', '$task_title', '$task_content', '$task_status')";
$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE user = '$task_owner' AND task_delete = '0'";
$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE task_delete = '0' AND user = '$task_owner' AND task_title LIKE '%".$keyword."%' OR task_content LIKE '%".$keyword."%'";
$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE task_delete = '0' AND user='$task_owner' ORDER By $order1 $dir1"; //kasper AND task_id =".$task_id;
$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE task_delete = '0' AND user='$task_owner' AND task_id =".$task_id;
$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE task_delete = '0' AND user = '$task_owner' ORDER By $tm_order $tm_direction LIMIT $begin,$records_page";
$strSQL = "UPDATE ".$this->config["table_prefix"]."task SET task_delete = '1' WHERE task_id = ".$delete_id;
$strSQL = "UPDATE ".$this->config["table_prefix"]."task SET user = '".$task_owner."', task_title = '".$task_title."', task_content = '".$task_content."', task_status = '".$task_status."' WHERE task_id=".$update_id;
$strSQL = "INSERT Into ".$this->config["table_prefix"]."task (user, task_timestamp, task_title, task_content, task_status) VALUES ('$task_owner','$task_timestamp', '$task_title', '$task_content', '$task_status')";
$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE user = '$task_owner' AND task_delete = '0'";
$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE task_delete = '0' AND user = '$task_owner' AND task_title LIKE '%".$keyword."%' OR task_content LIKE '%".$keyword."%'";
$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE task_delete = '0' AND user='$task_owner' ORDER By $order1 $dir1"; //kasper AND task_id =".$task_id;
$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE task_delete = '0' AND user='$task_owner' AND task_id =".$task_id;
$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE task_delete = '0' AND user = '$task_owner' ORDER By $tm_order $tm_direction LIMIT $begin,$records_page";
$strSQL = "SELECT * From ".$this->config["table_prefix"]."task WHERE user = '$task_owner' AND task_id = ".$edit_id;
Deletions:
$strSQL = "UPDATE wakka_task SET task_delete = '1' WHERE task_id = ".$delete_id;
$strSQL = "UPDATE wakka_task SET user = '".$task_owner."', task_title = '".$task_title."', task_content = '".$task_content."', task_status = '".$task_status."' WHERE task_id=".$update_id;
$strSQL = "INSERT Into wakka_task (user, task_timestamp, task_title, task_content, task_status) VALUES ('$task_owner','$task_timestamp', '$task_title', '$task_content', '$task_status')";
$strSQL = "SELECT * From wakka_task WHERE user = '$task_owner' AND task_delete = '0'";
$strSQL = "SELECT * From wakka_task WHERE task_delete = '0' AND user = '$task_owner' AND task_title LIKE '%".$keyword."%' OR task_content LIKE '%".$keyword."%'";
$strSQL = "SELECT * From wakka_task WHERE task_delete = '0' AND user='$task_owner' ORDER By $order1 $dir1"; //kasper AND task_id =".$task_id;
$strSQL = "SELECT * From wakka_task WHERE task_delete = '0' AND user='$task_owner' AND task_id =".$task_id;
$strSQL = "SELECT * From wakka_task WHERE task_delete = '0' AND user = '$task_owner' ORDER By $tm_order $tm_direction LIMIT $begin,$records_page";
$strSQL = "UPDATE wakka_task SET task_delete = '1' WHERE task_id = ".$delete_id;
$strSQL = "UPDATE wakka_task SET user = '".$task_owner."', task_title = '".$task_title."', task_content = '".$task_content."', task_status = '".$task_status."' WHERE task_id=".$update_id;
$strSQL = "INSERT Into wakka_task (user, task_timestamp, task_title, task_content, task_status) VALUES ('$task_owner','$task_timestamp', '$task_title', '$task_content', '$task_status')";
$strSQL = "SELECT * From wakka_task WHERE user = '$task_owner' AND task_delete = '0'";
$strSQL = "SELECT * From wakka_task WHERE task_delete = '0' AND user = '$task_owner' AND task_title LIKE '%".$keyword."%' OR task_content LIKE '%".$keyword."%'";
$strSQL = "SELECT * From wakka_task WHERE task_delete = '0' AND user='$task_owner' ORDER By $order1 $dir1"; //kasper AND task_id =".$task_id;
$strSQL = "SELECT * From wakka_task WHERE task_delete = '0' AND user='$task_owner' AND task_id =".$task_id;
$strSQL = "SELECT * From wakka_task WHERE task_delete = '0' AND user = '$task_owner' ORDER By $tm_order $tm_direction LIMIT $begin,$records_page";


Revision [4213]

Edited on 2005-01-07 17:17:26 by GmBowen [update of month/day/entry scheduler code (to include bad word filter)]
Additions:
{{lastedit show="3"}}
One use of Wikka is as a Personal Information Manager. For some things the free-form writing nature of a wiki is useful (and, dare-I-say, liberating). However, as some of our usage at this site suggests, there are tools that can be developed AS actions in wikka that can make some aspects of information management a bit easier. In the past six months I've modified/developed two tools (with more forthcoming) with this purpose. One tool is a collection of actions so that schedules can be kept and organized on line. Its components include a "rapid entry" tool (##scheduler.php##, which should be kept on a page called ""ScheDuler""), a monthly schedule view (##monthschedule.php## which should be kept on a page called ""MonthSchedule"") and a day view (##dayview.php## which should be kept on a page called ""DaySchedule""). These actions depend on a function which must be included as a file in the ##scripts## directory. A year-view calendar is also available at GmBowenCalendar.
The other available action is a task manager (based on gbtask). The badwordfunction is at the bottom of the page (and currently is needed by the task manager & must be included in wikka.php).
These actions rely on a "bad word function" which must be placed as a file called ##badwordfunction.php## located in a directory called ##scripts## located in the wiki root directory.
//remove bad word filter
//Must be called badwordfunction.php and be placed in a directory called "scripts" in wakka root.
function BadWordFunction($RemoveBadWordText) {
// Scheduler Version 1.1f - Jan 7, 2005 - bad word function call
include_once("./scripts/badwordfunction.php");
$dayschedule = BadWordFunction($dayschedule);
// Month Scheduler Version 1.0c - Jan 7, 2005 - bad word function call
include_once("./scripts/badwordfunction.php");
$dayschedule = BadWordFunction($dayschedule);
Deletions:
{{lastedit}}
One use of Wikka is as a Personal Information Manager. For some things the free-form writing nature of a wiki is useful (and, dare-I-say, liberating). However, as some of our usage at this site suggests, there are tools that can be developed AS actions in wikka that can make some aspects of information management a bit easier. In the past six months I've modified/developed two tools (with more forthcoming) with this purpose. One tool is a collection of actions so that schedules can be kept and organized on line. Its components include a "rapid entry" tool (##scheduler.php##, which should be kept on a page called ""ScheDuler""), a monthly schedule view (##monthschedule.php## which should be kept on a page called ""MonthSchedule"") and a day view (##dayview.php## which should be kept on a page called ""DaySchedule""). A year-view calendar is also available at GmBowenCalendar. The other available action is a task manager (based on gbtask). The badwordfunction is at the bottom of the page (and currently is needed by both scripts). [**NOTE:** I recognize that the badwordfunction should be incorporated using an "include" statement as well so that it doesn't have to be edited into wakka.php....and I've played with it and not been able to get it working at ALL. grrrr. Any advice on what needs to be done, packaging it as a class etc, that might get it working would be appreciated. I think I both need to know how to "save" the badwordfunction in a standalone file AND how to call it successfully from the action.]
// Scheduler Version 1.1e - arrow bars for navigating days to monthly maximum added
$dayschedule = BadWordFunc($dayschedule);
// Month Scheduler Version 1.0b - Jan 6, 2005 adding anchors to improve entry
$dayschedule = BadWordFunc($dayschedule);


Revision [4204]

Edited on 2005-01-07 16:06:24 by GmBowen [further update of comments on function conflicts]
Additions:
One use of Wikka is as a Personal Information Manager. For some things the free-form writing nature of a wiki is useful (and, dare-I-say, liberating). However, as some of our usage at this site suggests, there are tools that can be developed AS actions in wikka that can make some aspects of information management a bit easier. In the past six months I've modified/developed two tools (with more forthcoming) with this purpose. One tool is a collection of actions so that schedules can be kept and organized on line. Its components include a "rapid entry" tool (##scheduler.php##, which should be kept on a page called ""ScheDuler""), a monthly schedule view (##monthschedule.php## which should be kept on a page called ""MonthSchedule"") and a day view (##dayview.php## which should be kept on a page called ""DaySchedule""). A year-view calendar is also available at GmBowenCalendar. The other available action is a task manager (based on gbtask). The badwordfunction is at the bottom of the page (and currently is needed by both scripts). [**NOTE:** I recognize that the badwordfunction should be incorporated using an "include" statement as well so that it doesn't have to be edited into wakka.php....and I've played with it and not been able to get it working at ALL. grrrr. Any advice on what needs to be done, packaging it as a class etc, that might get it working would be appreciated. I think I both need to know how to "save" the badwordfunction in a standalone file AND how to call it successfully from the action.]
Deletions:
One use of Wikka is as a Personal Information Manager. For some things the free-form writing nature of a wiki is useful (and, dare-I-say, liberating). However, as some of our usage at this site suggests, there are tools that can be developed AS actions in wikka that can make some aspects of information management a bit easier. In the past six months I've modified/developed two tools (with more forthcoming) with this purpose. One tool is a collection of actions so that schedules can be kept and organized on line. Its components include a "rapid entry" tool (##scheduler.php##, which should be kept on a page called ""ScheDuler""), a monthly schedule view (##monthschedule.php## which should be kept on a page called ""MonthSchedule"") and a day view (##dayview.php## which should be kept on a page called ""DaySchedule""). A year-view calendar is also available at GmBowenCalendar. The other available action is a task manager (based on gbtask). The badwordfunction is at the bottom of the page (and currently is needed by both scripts).


Revision [4201]

Edited on 2005-01-07 15:40:48 by GmBowen [update of comments on function conflicts]
Additions:
One use of Wikka is as a Personal Information Manager. For some things the free-form writing nature of a wiki is useful (and, dare-I-say, liberating). However, as some of our usage at this site suggests, there are tools that can be developed AS actions in wikka that can make some aspects of information management a bit easier. In the past six months I've modified/developed two tools (with more forthcoming) with this purpose. One tool is a collection of actions so that schedules can be kept and organized on line. Its components include a "rapid entry" tool (##scheduler.php##, which should be kept on a page called ""ScheDuler""), a monthly schedule view (##monthschedule.php## which should be kept on a page called ""MonthSchedule"") and a day view (##dayview.php## which should be kept on a page called ""DaySchedule""). A year-view calendar is also available at GmBowenCalendar. The other available action is a task manager (based on gbtask). The badwordfunction is at the bottom of the page (and currently is needed by both scripts).
**Note that** there is a function code conflict in the task manager that causes problems if two copies are put on one page. This will probably **affect your "history" & "revisions" and cause them to "crash" (WSOD)**. A (now temporary) solution for dealing with the history/revisions conflict was proposed by DarTar (which involved putting %%if ($this->method == "show") {%% before the code (closing it with a } of course). JavaWoman steered me towards include_once() and require_once() which I implemented in wikkaforum and which work quite well. I'll work at implementing it here for the task manager code in the coming week.
In addition, I'm going to develop a textbox/submit button feature so that the galleries of different users can be seen without having to multiply edit/save the page. Feel free to play with this yourself.
**Remember**, neither of these can be on the same page at the same time, nor can there be more than one copy of these on any one page....consider yourself warned. A temporary solution for preventing problems with history/revisions are proposed at the top of the page. JavaWoman steered me towards include_once() & require_once() and these will be the "real" solution which I'll implement in coming weeks.
Deletions:
One use of Wikka is as a Personal Information Manager. For some things the free-form writing nature of a wiki is useful (and, dare-I-say, liberating). However, as some of our usage at this site suggests, there are tools that can be developed AS actions in wikka that can make some aspects of information management a bit easier. In the past six months I've modified/developed two tools (with more forthcoming) with this purpose. One tool is a collection of actions so that schedules can be kept and organized on line. Its components include a "rapid entry" tool (##scheduler.php##, which should be kept on a page called ""ScheDuler""), a monthly schedule view (##monthschedule.php## which should be kept on a page called ""MonthSchedule"") and a day view (##dayview.php## which should be kept on a page called ""DaySchedule""). A year-view calendar is also available at GmBowenCalendar. The other available action is a task manager (based on gbtask).
**Note that** there is a function code conflict in the task manager that causes problems if two copies are put on one page. This will probably **affect your "history" & "revisions" and cause them to "crash" (WSOD)**. Suggestions for dealing with this are found below...++At my site I'm taking care of this by modifying the handlers/pages/history.php file. The history feature "crashes" because it essentially places two versions of the action on the page at the same time. I've taken care of this by having a search & replace done before the version comparison and replacing ""{{text}}"" with ""||text||"" for the sake of differences being shown in the history depiction. This is done by adding the following lines to the history.php file.....++
++%%(php)++
++ $bodyB = explode("\n", $pageB["body"]); //add following three lines++
++$brackets = Array ('/{{/i', '/}}/i');++
++$changeto = '||';++
++$bodyB = preg_replace($brackets, $changeto, $bodyB);++
++%% ++
++and ++
++%%(php)++
++ $bodyA = explode("\n", $pageA["body"]); //add the following three lines++
++$brackets = Array ('/{{/i', '/}}/i');++
++$changeto = '||';++
++$bodyA = preg_replace($brackets, $changeto, $bodyA);++
++%%++
++I'm sure a similar trick will work with revisions.php, but I haven't figured it out yet.++
See a more graceful solution than the above as suggested by the combination of Nils & DarTar (which involved putting %%if ($this->method == "show") {%% before the code (closing it with a } of course) at WikkaForum.
I'll keep working away at trying to figure out why this conflict happens.......it might be the functions defined in the code & a conflict between them....and if it is I'll try and move them to ##wakka.php##. In addition, I'm going to develop a textbox/submit button feature so that the galleries of different users can be seen without having to multiply edit/save the page. Feel free to play with this yourself.
**Remember**, neither of these can be on the same page at the same time, nor can there be more than one copy of these on any one page....consider yourself warned. As Nils points out below, this is a function code problem....
~''the problem is that you have three or four functions beeing defined in both of the files, which will give you a "can't redefine function error for each of them. Move them into another file and require_once it, or put them into wikka.php to solve this.'' --NilsLindenberg
~~''Putting supporting functions in a separate file to be included is a good idea - but putting supporting functions for an //extension// into wikka.php is **not**: extensions, or parts of them, don't belong in the core. What we really need is another "branch" in the WikkaCodeStructure for supporting functions for extensions, so they'd all be in one place and extension developers will know where to put, and find, such files. --JavaWoman''
~~~''I couldn't agree with you more JW about needing a new "branch" for this stuff and an easier way to do includes on function additions. I'm always nervous editing wakka.php (which I've done to add in a bad word function, a search comment function, etc.)....usually with success tho'. But I think an easier way of adding new actions with new functions would be a big improvement....and would increase the ease of developing plugins (or whatever we're going to call them) for wikka. --GmBowen''
(**see WikkaForum for an example of how to include these functions in wikka.php**....wrapping them in a class (as in that example) may offer some advantages. -- GmBowen
''Eerr, Mike, they shouldn't be included in wikka.php but instead in the action(s) which need them; that will keep your core fast, too. To avoid conflicts, the trick is to use include_once() or require_once(). --JavaWoman'')
~~Hiya JW. I am **quite** happy to release code that uses that approach if it stops the function conflicts (**//believe me//**, I want to stop those conflicts). ++I would change all of the code I've released here @ wikka that suffers from that problem (rather than suggesting a wakka.php edit) and remove suggestions for other approaches if I could figure out how to get the include/require_once approaches working...but I've just not been able to get it working :(. I can do an "include" on the functions statement (class) & the page will work fine if there's just one version of the action (so I know the include is working), but if I try something like++
++""{{wikkaforum topic="Test Discussion Forum" share="ColeBowen"}}""++
++""{{wikkaforum topic="Test Discussion Forum" share="ColeBowen" page="SandBox4"}}""++
++...which is the type of functionality I'd like to have...then the page breaks. (WSOD...just like when the functions are IN the action code) So far, I've only been able to get using two action statements working on the same page by putting the function code into wakka.php....I've spent AGES working on this with WikkaForum both because I've wanted to address your concerns and I think it's a really useful contribution that I want to be easy for people to implement (without editing wakka.php). So, I'm stuck....if you have any ideas I'd appreciate them because I'd sure for the code to operate the way you suggest is best for wikka. Cheers.++ I've finally figured out how to get this working...I'll modify the WikkaForums code now and the rest in a short while. Thanks for the help JW -- GmBowen


Revision [4197]

Edited on 2005-01-07 15:15:59 by GmBowen [further reply to JW]
Additions:
~~Hiya JW. I am **quite** happy to release code that uses that approach if it stops the function conflicts (**//believe me//**, I want to stop those conflicts). ++I would change all of the code I've released here @ wikka that suffers from that problem (rather than suggesting a wakka.php edit) and remove suggestions for other approaches if I could figure out how to get the include/require_once approaches working...but I've just not been able to get it working :(. I can do an "include" on the functions statement (class) & the page will work fine if there's just one version of the action (so I know the include is working), but if I try something like++
++""{{wikkaforum topic="Test Discussion Forum" share="ColeBowen"}}""++
++""{{wikkaforum topic="Test Discussion Forum" share="ColeBowen" page="SandBox4"}}""++
++...which is the type of functionality I'd like to have...then the page breaks. (WSOD...just like when the functions are IN the action code) So far, I've only been able to get using two action statements working on the same page by putting the function code into wakka.php....I've spent AGES working on this with WikkaForum both because I've wanted to address your concerns and I think it's a really useful contribution that I want to be easy for people to implement (without editing wakka.php). So, I'm stuck....if you have any ideas I'd appreciate them because I'd sure for the code to operate the way you suggest is best for wikka. Cheers.++ I've finally figured out how to get this working...I'll modify the WikkaForums code now and the rest in a short while. Thanks for the help JW -- GmBowen
Deletions:
~~Hiya JW. I am **quite** happy to release code that uses that approach if it stops the function conflicts (**//believe me//**, I want to stop those conflicts). I would change all of the code I've released here @ wikka that suffers from that problem (rather than suggesting a wakka.php edit) and remove suggestions for other approaches if I could figure out how to get the include/require_once approaches working...but I've just not been able to get it working :(. I can do an "include" on the functions statement (class) & the page will work fine if there's just one version of the action (so I know the include is working), but if I try something like
""{{wikkaforum topic="Test Discussion Forum" share="ColeBowen"}}""
""{{wikkaforum topic="Test Discussion Forum" share="ColeBowen" page="SandBox4"}}""
...which is the type of functionality I'd like to have...then the page breaks. (WSOD...just like when the functions are IN the action code) So far, I've only been able to get using two action statements working on the same page by putting the function code into wakka.php....I've spent AGES working on this with WikkaForum both because I've wanted to address your concerns and I think it's a really useful contribution that I want to be easy for people to implement (without editing wakka.php). So, I'm stuck....if you have any ideas I'd appreciate them because I'd sure for the code to operate the way you suggest is best for wikka. Cheers. -- GmBowen


Revision [4195]

Edited on 2005-01-07 15:02:53 by GmBowen [reply to JW....basically, I've tried & I'm stuck :(]
Additions:
~~Hiya JW. I am **quite** happy to release code that uses that approach if it stops the function conflicts (**//believe me//**, I want to stop those conflicts). I would change all of the code I've released here @ wikka that suffers from that problem (rather than suggesting a wakka.php edit) and remove suggestions for other approaches if I could figure out how to get the include/require_once approaches working...but I've just not been able to get it working :(. I can do an "include" on the functions statement (class) & the page will work fine if there's just one version of the action (so I know the include is working), but if I try something like
""{{wikkaforum topic="Test Discussion Forum" share="ColeBowen"}}""
""{{wikkaforum topic="Test Discussion Forum" share="ColeBowen" page="SandBox4"}}""
...which is the type of functionality I'd like to have...then the page breaks. (WSOD...just like when the functions are IN the action code) So far, I've only been able to get using two action statements working on the same page by putting the function code into wakka.php....I've spent AGES working on this with WikkaForum both because I've wanted to address your concerns and I think it's a really useful contribution that I want to be easy for people to implement (without editing wakka.php). So, I'm stuck....if you have any ideas I'd appreciate them because I'd sure for the code to operate the way you suggest is best for wikka. Cheers. -- GmBowen


Revision [4124]

Edited on 2005-01-07 07:54:03 by JavaWoman [comment about including functions]
Additions:
(**see WikkaForum for an example of how to include these functions in wikka.php**....wrapping them in a class (as in that example) may offer some advantages. -- GmBowen
''Eerr, Mike, they shouldn't be included in wikka.php but instead in the action(s) which need them; that will keep your core fast, too. To avoid conflicts, the trick is to use include_once() or require_once(). --JavaWoman'')
Deletions:
(**see WikkaForum for an example of how to include these functions in wikka.php**....wrapping them in a class (as in that example) may offer some advantages. -- GmBowen)


Revision [4119]

Edited on 2005-01-07 02:57:42 by GmBowen [updated code for scheduler & month-schedule view action]
Additions:
// Scheduler Version 1.1e - arrow bars for navigating days to monthly maximum added
// Month Scheduler Version 1.0b - Jan 6, 2005 adding anchors to improve entry
// As far as it is possible to tell (because the code exists all over the web), we provide credit for the original calendar code
// to Marcus Kazmierczak which was released at www.blazonry.com, although this script builds considerably on that code.
// and it should be placed on a page named "DaySchedule". The other action, scheduler.php, is a small version of the calendar action
// which allows easy and fast entering of data on different days.
print "<table width=\"100%\"><TR BGCOLOR=\"#E4DFDA\"><td><a href=".$site_base.$thispage."&day=$day&month=$month&year=$year#EntryBox> $font1$day$font2</a> $printme</td</tr><tr><td><small>$dayoutput</small></td></tr></table>";
<center><A NAME=EntryBox></A>
<a href="<?php echo $this->href("", "", "day="); echo (($today-1)<1) ? $lastday : $today-1 ; ?>&year=<?php echo $year; ?>&month=<?php echo $month; ?>"><<</a>
Deletions:
// Scheduler Version 1.1d - arrow bars for navigating days to monthly maximum added
</div>%%
// Month Scheduler Version 1.0 - Jan 6, 2005
// and the should be placed on a page named "DaySchedule". The other action, scheduler.php, is a small version of the calendar action
// which allows easy and fast entering of data on different days.
print "<table width=\"100%\"><TR BGCOLOR=\"#E4DFDA\"><td><a href=".$site_base.$thispage."&day=$day&month=$month&year=$year> $font1$day$font2</a> $printme</td</tr><tr><td><small>$dayoutput</small></td></tr></table>";


Revision [4117]

Edited on 2005-01-07 02:18:32 by GmBowen [updated code for scheduler & a new month-schedule view action & replaced bad word function]
Additions:
All of the functions on this page user a "bad word function" that is placed in the wakka.php file in the wiki root directory. The following code needs to be placed in the wakka.php file (just after the microtime function which starts "function getmicrotime" and ends with a "}". This code is placed immediately after the "}".
//GMB remove bad word filter
function BadWordFunc($RemoveBadWordText) {
$RemoveBadWordText = eregi_replace("fuc?k|[kc]unt|motherfucker|cocksucker|bitch|son of a bitch|asshole|shit|fag|wank|dick|pu[zs]?[zs][yi]|bastard|s[kc]rew|mole[zs]ter|mole[sz]t|coc?k", "", $RemoveBadWordText);
return $RemoveBadWordText;


Revision [4116]

Edited on 2005-01-07 02:05:22 by GmBowen [updated code for scheduler & a new month-schedule view action]
Additions:
One use of Wikka is as a Personal Information Manager. For some things the free-form writing nature of a wiki is useful (and, dare-I-say, liberating). However, as some of our usage at this site suggests, there are tools that can be developed AS actions in wikka that can make some aspects of information management a bit easier. In the past six months I've modified/developed two tools (with more forthcoming) with this purpose. One tool is a collection of actions so that schedules can be kept and organized on line. Its components include a "rapid entry" tool (##scheduler.php##, which should be kept on a page called ""ScheDuler""), a monthly schedule view (##monthschedule.php## which should be kept on a page called ""MonthSchedule"") and a day view (##dayview.php## which should be kept on a page called ""DaySchedule""). A year-view calendar is also available at GmBowenCalendar. The other available action is a task manager (based on gbtask).
**Note that** there is a function code conflict in the task manager that causes problems if two copies are put on one page. This will probably **affect your "history" & "revisions" and cause them to "crash" (WSOD)**. Suggestions for dealing with this are found below...++At my site I'm taking care of this by modifying the handlers/pages/history.php file. The history feature "crashes" because it essentially places two versions of the action on the page at the same time. I've taken care of this by having a search & replace done before the version comparison and replacing ""{{text}}"" with ""||text||"" for the sake of differences being shown in the history depiction. This is done by adding the following lines to the history.php file.....++
Save the below code as ##mytasks.php## and place in the actions directory
Ultimately, it is intended that a text entry box and a submit button will be added to this code for entering user names so the schedule of any user can be easily obtained without editing the page.
**Remember**, neither of these can be on the same page at the same time, nor can there be more than one copy of these on any one page....consider yourself warned. As Nils points out below, this is a function code problem....
(**see WikkaForum for an example of how to include these functions in wikka.php**....wrapping them in a class (as in that example) may offer some advantages. -- GmBowen)
or use it to keep a to-do list, or even a diary for the day. The schedule for a day can be viewed with the entry tool, in the monthly view, or in the day view. The day viewer is formatted for printing out usable schedules, & you can designate a specific user with it and see somebody else's schedule (I intend on modifying this so that there will be an easy-to-use text entry box for entering user names).
below code added to actions directory as ##scheduler.php##. The action should be placed on a page called "ScheDule".
// Scheduler Version 1.1d - arrow bars for navigating days to monthly maximum added
// As far as it is possible to tell (because the code exists all over the web), we provide credit to the original calendar code for the
// to Marcus Kazmierczak and released at www.blazonry.com, although this script builds considerably on that code.
// There are two complementary actions. dayschedule.php allows anyone to designate an owner & date to see their schedule (see line 140)
// and the should be placed on a page named "DaySchedule". The other action, monthschedule.php, is a
// larger version of the dayschedule action which shows entries for an entire month on one page.
<table BGCOLOR="#DDccbb">
<tr BGCOLOR="#ffffff">
<tr BGCOLOR="#ffffff">
<tr BGCOLOR="#DDccbb">
print " <tr BGCOLOR=\"#ffffff\">";
if ($wday==0) { print " <tr BGCOLOR=\"#ffffff\">\n"; }
<center><a href=<? echo $site_base; ?>DaySchedule&<? echo "month=".$month."&day=".$today."&year=".$year; ?>><small>Day Schedule</small></a>
 | 
<a href=<? echo $site_base; ?>MonthSchedule&<? echo "month=".$month."&day=".$today."&year=".$year; ?>><small>Month Schedule</small></a></center>
</div>%%
The following is the action which shows a formatted output for a selected day....the current day (by default) or for any other day (using a link from the ##scheduler.php## & ##monthview.php## actions)....it should be saved into the actions directory as ##dayschedule.php## and for proper functioning with ##scheduler.php## should be placed on a page called ""DaySchedule"".
// DaySchedule Version 1c -- Jan 6, 2005
// This action should be placed on a page called "DaySchedule" to work with the scheduler.
$lastday = getLastDayofMonth($month,$year);
function getLastDayofMonth($mon,$year)
$printowner = $username."'s entries for ";
<center> <a href="<?php echo $this->href("", "", "day="); echo (($today-1)<1) ? $lastday : $today-1 ; ?>&year=<?php echo $year; ?>&month=<?php echo $month; ?>"><<</a>
<TABLE class='box' width='600' border='1' CELLSPACING='1' CELLPADDING='7' BGCOLOR='#DDccbb'>
<center><a href=<? echo $site_base; ?>ScheDuler&<? echo "month=".$month."&day=".$today."&year=".$year; ?>><small>Small Scheduler</small></a>
 | 
<a href=<? echo $site_base; ?>MonthSchedule&<? echo "month=".$month."&day=".$today."&year=".$year; ?>><small>Month Scheduler</small></a></center>
</center></div>
This final action show a month-view with all of the entries. It should be saved into the actions directory as ##monthscheduler.php## and for proper functioning with ##scheduler.php## the action should be placed on a page called ""MonthSchedule"".
// Month Scheduler Version 1.0 - Jan 6, 2005
// As far as it is possible to tell (because the code exists all over the web), we provide credit to the original calendar code for the
// to Marcus Kazmierczak and released at www.blazonry.com, although this script builds considerably on that code.
// There are two complementary actions. dayschedule.php allows anyone to designate an owner & date to see their schedule (see line 140)
// and the should be placed on a page named "DaySchedule". The other action, scheduler.php, is a small version of the calendar action
// which allows easy and fast entering of data on different days.
<P><TABLE BORDER=0 width=100%>
// must add one in maually for this function to work.
<td align="center"><font size="2"><strong><? echo $username ?>'s Calendar for <?php echo "$monthname $year"; ?></strong></font></td>
<tr BGCOLOR="#DDccbb">
<td>Sunday</td>
<td>Monday</td>
<td>Tuesday</td>
<td>Wednesday</td>
<td>Thursday</td>
<td>Friday</td>
<td>Saturday</td>
{ print " <td VALIGN=top ALIGN=left HEIGHT=70><font size=\"2\"> </font></td>"; }
print " <td VALIGN=top ALIGN=left WIDTH=150 HEIGHT=70>";
$token="yes";
$token="no";
// code to determine what data should be entered into each cell
$thisdayschedule = $this->LoadSingle("SELECT dayschedule FROM ".$this->config["table_prefix"]."scheduler WHERE user='".$username."' AND day='".$day."' AND month='".$month."' AND year='".$year."'");
$dayoutput = str_replace("\n", "<br> ", $thisdayschedule[dayschedule]);
if ($token=="yes")
$printme="<a href=".$site_base."DaySchedule&month=".$month."&day=".$today."&year=".$year."><small>[Print Day]</small></a>";
$printme="";
print "<table width=\"100%\"><TR BGCOLOR=\"#E4DFDA\"><td><a href=".$site_base.$thispage."&day=$day&month=$month&year=$year> $font1$day$font2</a> $printme</td</tr><tr><td><small>$dayoutput</small></td></tr></table>";
<!-- Comment below 3 lines out if you don't want to link to the formatted schedule page & scheduler page.-->
<center><a href=<? echo $site_base; ?>DaySchedule&<? echo "month=".$month."&day=".$today."&year=".$year; ?>><small>Formatted Day Page</small></a>
 | 
<a href=<? echo $site_base; ?>Scheduler&<? echo "month=".$month."&day=".$today."&year=".$year; ?>><small>Small Monthly Calendar</small></a></center>
</TD>
</tr><tr>
<center> <a href="<?php echo $this->href("", "", "day="); echo (($today-1)<1) ? $lastday : $today-1 ; ?>&year=<?php echo $year; ?>&month=<?php echo $month; ?>"><<</a>
<center><form action="" method="post">
</form></center>
</center>
The following is a screen shot of the monthscheduler.
http://gmbowen.educ.unb.ca/wikitest/monthview.jpg
Deletions:
One use of Wikka is as a Personal Information Manager. For some things the free-form writing nature of a wiki is useful (and, dare-I-say, liberating). However, as some of our usage at this site suggests, there are tools that can be developed AS actions in wikka that can make some aspects of information management a bit easier. In the past six months we've modified/developed two tools (with more forthcoming) with this purpose. One is a scheduler (based on the calendar tool elsewhere), and the other is a task manager (based on gbtask).
**Note that** the conflict that stops two copies of the task manager actions being on the same page will probably **affect your "history" & "revisions" and cause them to "crash" (WSOD)**. ++At my site I'm taking care of this by modifying the handlers/pages/history.php file. The history feature "crashes" because it essentially places two versions of the action on the page at the same time. I've taken care of this by having a search & replace done before the version comparison and replacing ""{{text}}"" with ""||text||"" for the sake of differences being shown in the history depiction. This is done by adding the following lines to the history.php file.....++
save as ##mytasks.php## and place in the actions directory
Ultimately, it is intended that a text entry box and a submit button will be added to this code so the schedule of any user can be easily obtained without editing the page.
I've not been able to figure out why, but neither of these can be on the same page at the same time, nor can there be more than one copy of these on any one page....consider yourself warned.
(see WikkaForum for an example of how to include these functions in wikka.php....wrapping them in a class (as in that example) may offer some advantages. -- GmBowen)
or use it to keep a to-do list, or even a diary for the day. Right now one has to go to the scheduler to view the output, but I'm going to work on a "dayschedule" action which will allow a user to see the schedule (or other input) for any day for any user.....that will allow users to coordinate schedules or activities a bit more easily.
below code added to actions directory as ##scheduler.php##
// As far as it is possible to tell (because the code exists all over the web), we provide credit for the original calendar code
// to Marcus Kazmierczak and released at www.blazonry.com, although the code in this script builds considerably on that code.
// Version 1.1e - arrow bars for navigating days to monthly maximum added
// A complementary action, showschedule.php allows anyone to designate an owner & date to see their schedule (see line 130)
<center><a href=<? echo $site_base; ?>DaySchedule&<? echo "month=".$month."&day=".$today."&year=".$year; ?>><small>Formatted Schedule Page</small></a></center>
The following is a complementary action for scheduler.php. It is intended to provide a formatted output for the current day (by default) or for any other day (using a **new** link from the scheduler.php action)....it should be saved into the actions directory as ##dayschedule.php## and for proper functioning with ##scheduler.php## should be placed on a page called ""DaySchedule"".
// Version 1 -- Jan 2, 2005
// This action should be placed on a page called "DaySchedule" to work with the scheduler
$printowner = $username."'s schedule for ";
<b><? echo "$printowner $monthname $today, $year"; ?>...</b>
<TABLE class='box' width='500' border='1' CELLSPACING='1' CELLPADDING='7' BGCOLOR='#DDccbb'>


Revision [4080]

Edited on 2005-01-06 17:17:20 by GmBowen [minor code update for scheduler]
Additions:
// As far as it is possible to tell (because the code exists all over the web), we provide credit for the original calendar code
// Version 1.1e - arrow bars for navigating days to monthly maximum added
// A complementary action, showschedule.php allows anyone to designate an owner & date to see their schedule (see line 130)
<br><a href="<?php echo $this->href("", "", "day="); echo (($today-1)<1) ? $lastday : $today-1 ; ?>&year=<?php echo $year; ?>&month=<?php echo $month; ?>"><<</a>
<a href="<?php echo $this->href("", "", "day="); echo (($today+1)>$lastday) ? 1 : $today+1 ; ?>&year=<?php echo $year; ?>&month=<?php echo $month; ?>">>></a>
Deletions:
// As far as it is possible to tell (because the code exists all over the web), we provide credit to the original calendar code for the
// Version 1.1d - link to dayschedule.php action added (for formatted output of any day's schedule)
// A complementary action, showschedule.php allows anyone to designate an owner & date to see their schedule (in development) (see line 130)
<br><a href="<?php echo $this->href("", "", "day="); echo (($today-1)<1) ? 31 : $today-1 ; ?>&year=<?php echo $year; ?>&month=<?php echo $month; ?>"><<</a>
<a href="<?php echo $this->href("", "", "day="); echo (($today+1)>31) ? 1 : $today+1 ; ?>&year=<?php echo $year; ?>&month=<?php echo $month; ?>">>></a>


Revision [4051]

Edited on 2005-01-06 03:34:21 by GmBowen [reply to JW and modification of instructions]
Additions:
{{lastedit}}
**Note that** the conflict that stops two copies of the task manager actions being on the same page will probably **affect your "history" & "revisions" and cause them to "crash" (WSOD)**. ++At my site I'm taking care of this by modifying the handlers/pages/history.php file. The history feature "crashes" because it essentially places two versions of the action on the page at the same time. I've taken care of this by having a search & replace done before the version comparison and replacing ""{{text}}"" with ""||text||"" for the sake of differences being shown in the history depiction. This is done by adding the following lines to the history.php file.....++
++%%(php)++
++ $bodyB = explode("\n", $pageB["body"]); //add following three lines++
++$brackets = Array ('/{{/i', '/}}/i');++
++$changeto = '||';++
++$bodyB = preg_replace($brackets, $changeto, $bodyB);++
++%% ++
++and ++
++%%(php)++
++ $bodyA = explode("\n", $pageA["body"]); //add the following three lines++
++$brackets = Array ('/{{/i', '/}}/i');++
++$changeto = '||';++
++$bodyA = preg_replace($brackets, $changeto, $bodyA);++
++%%++
++I'm sure a similar trick will work with revisions.php, but I haven't figured it out yet.++
See a more graceful solution than the above as suggested by the combination of Nils & DarTar (which involved putting %%if ($this->method == "show") {%% before the code (closing it with a } of course) at WikkaForum.
Deletions:
**Note that** the conflict that stops two copies of the task manager actions being on the same page will probably **affect your "history" and cause it to "crash"**. At my site I'm taking care of this by modifying the handlers/pages/history.php file. The history feature "crashes" because it essentially places two versions of the action on the page at the same time. I've taken care of this by having a search & replace done before the version comparison and replacing ""{{text}}"" with ""||text||"" for the sake of differences being shown in the history depiction. This is done by adding the following lines to the history.php file.....
$bodyB = explode("\n", $pageB["body"]); //add following three lines
$brackets = Array ('/{{/i', '/}}/i');
$changeto = '||';
$bodyB = preg_replace($brackets, $changeto, $bodyB);
%%
and
$bodyA = explode("\n", $pageA["body"]); //add the following three lines
$brackets = Array ('/{{/i', '/}}/i');
$changeto = '||';
$bodyA = preg_replace($brackets, $changeto, $bodyA);
I'm sure a similar trick will work with revisions.php, but I haven't figured it out yet.


Revision [4050]

Edited on 2005-01-06 03:28:18 by GmBowen [reply to & agreement with JW]
Additions:
~~~''I couldn't agree with you more JW about needing a new "branch" for this stuff and an easier way to do includes on function additions. I'm always nervous editing wakka.php (which I've done to add in a bad word function, a search comment function, etc.)....usually with success tho'. But I think an easier way of adding new actions with new functions would be a big improvement....and would increase the ease of developing plugins (or whatever we're going to call them) for wikka. --GmBowen''
(see WikkaForum for an example of how to include these functions in wikka.php....wrapping them in a class (as in that example) may offer some advantages. -- GmBowen)


Revision [4028]

Edited on 2005-01-05 21:53:55 by JavaWoman [comment about including supporting functions]
Additions:
~~''Putting supporting functions in a separate file to be included is a good idea - but putting supporting functions for an //extension// into wikka.php is **not**: extensions, or parts of them, don't belong in the core. What we really need is another "branch" in the WikkaCodeStructure for supporting functions for extensions, so they'd all be in one place and extension developers will know where to put, and find, such files. --JavaWoman''


Revision [3982]

Edited on 2005-01-04 22:13:06 by NilsLindenberg [reply to Mike]
Additions:
~''the problem is that you have three or four functions beeing defined in both of the files, which will give you a "can't redefine function error for each of them. Move them into another file and require_once it, or put them into wikka.php to solve this.'' --NilsLindenberg


Revision [3905]

Edited on 2005-01-03 00:56:47 by GmBowen [updated scheduler.php, added formatted output action & screenshot]
Additions:
This is a screenshot of the ##dayschedule.php## output...
http://gmbowen.educ.unb.ca/wikitest/dayschedule.jpg


Revision [3904]

Edited on 2005-01-03 00:52:39 by GmBowen [modified dayscheduler.php code & added new action for formatted output from scheduler]
Additions:
// Version 1.1d - link to dayschedule.php action added (for formatted output of any day's schedule)
<!-- Comment line below out if you don't want to link to the formatted schedule page-->
<center><a href=<? echo $site_base; ?>DaySchedule&<? echo "month=".$month."&day=".$today."&year=".$year; ?>><small>Formatted Schedule Page</small></a></center>
// replaced a comma with XXZXX below....I don't know what the purpose of the code is...
$dayschedule = str_replace("XXZXX", "\n", $dayschedule[dayschedule]);
</div>
The following is a complementary action for scheduler.php. It is intended to provide a formatted output for the current day (by default) or for any other day (using a **new** link from the scheduler.php action)....it should be saved into the actions directory as ##dayschedule.php## and for proper functioning with ##scheduler.php## should be placed on a page called ""DaySchedule"".
// This script was developed by G. Michael Bowen for a SSHRC research project using wikka wiki.
// This action complements the scheduler.php action showing the day schedule for that user.
// Version 1 -- Jan 2, 2005
// This action should be placed on a page called "DaySchedule" to work with the scheduler
// Code copyright GMBowen. Released to public domain under GPL. Modify, improve, change as you wish.
// $monthname = $month;
$tmpd = getdate(mktime(0,0,0,$month,1,$year));
$monthname = $tmpd["month"];
$user = $username;
$dayschedule = $this->LoadSingle("SELECT dayschedule FROM ".$this->config["table_prefix"]."scheduler WHERE user='".$username."' AND day='".$today."' AND month='".$month."' AND year='".$year."'");
$printout = str_replace("\n", "<HR></TD></TR><TR ALIGN='left'><TD>", $dayschedule[dayschedule]);
$printowner = $username."'s schedule for ";
<b><? echo "$printowner $monthname $today, $year"; ?>...</b>
<TABLE class='box' width='500' border='1' CELLSPACING='1' CELLPADDING='7' BGCOLOR='#DDccbb'>
<P><TABLE class='box' width='100%' border='0' CELLSPACING='0' CELLPADDING='2' BGCOLOR='#ffffff'>
<TR ALIGN='left'>
if(!empty($printout))
{
echo $printout;
}
else
{
echo "There are no entries on this day.";
}
echo "<em>Showing the day schedule only works for logged-in users.</em>";
</div>
Deletions:
// Version 1.1c - arrow bars for navigating days added (altho' max at 31 for all months)
<!-- Line below commented out until action to show Todays Schedule is completed
<center><a href=/wiki/wakka.php?wakka=TodaysSchedule>Todays Schedule</a></center>
-->
$dayschedule = str_replace(",", "\n", $dayschedule[dayschedule]);
</div>%%
All of the functions on this page user a "bad word function" that is placed in the wakka.php file. The following code needs to be placed in the wakka.php file (just after the microtime function which ends around row 25)
// GMB remove bad word filter
function BadWordFunc($RemoveBadWordText) {
$RemoveBadWordText = eregi_replace("fuc?k|[kc]unt|motherfucker|cocksucker|bitch|son of a bitch|asshole|shit|fag|wank|dick|pu[zs]?[zs][yi]|bastard|s[kc]rew|mole[zs]ter|mole[sz]t|coc?k", "****", $RemoveBadWordText);
return $RemoveBadWordText;


Revision [3209]

Edited on 2004-12-15 00:13:16 by GmBowen [update of scheduler (now accepts single quotes) & formatting of page]
Additions:
=====Tools To Use Wiki As a Pim=====
CategoryDevelopment
Deletions:
%%


Revision [3204]

Edited on 2004-12-14 23:20:32 by GmBowen [minor upgrade of scheduler action (so it'd accept single quotes)]
Additions:
// Version 1.1c - arrow bars for navigating days added (altho' max at 31 for all months)
$dayschedule = addslashes($dayschedule); // for single quotes to work
</div>%%
Deletions:
// Version 1.1b - arrow bars for navigating days added (altho' max at 31 for all months)
</div>


Revision [3198]

Edited on 2004-12-14 22:10:13 by GmBowen [minor edit to scheduler code to improve functionality]
Additions:
// As far as it is possible to tell (because the code exists all over the web), we provide credit to the original calendar code for the
// to Marcus Kazmierczak and released at www.blazonry.com, although the code in this script builds considerably on that code.
// Version 1.1b - arrow bars for navigating days added (altho' max at 31 for all months)
$thispage=$this->GetPageTag();
print "<a href=".$site_base.$thispage."&day=$day&month=$month&year=$year>$font1$day$font2</a>";
Deletions:
// As far as it is possible to tell (because the code exists all over the web), we credit the original calendar code
// to Marcus Kazmierczak now released at www.blazonry.com, although the code in this script builds considerably on that code.
// Version 1.1 - arrow bars for navigating days added (altho' max at 31 for all months)
print "<a href=".$site_base."Scheduler&day=$day&month=$month&year=$year>$font1$day$font2</a>";


Revision [3065]

Edited on 2004-12-10 04:59:29 by GmBowen [first releases of scheduler and task manager]
Additions:
**Note that** the conflict that stops two copies of the task manager actions being on the same page will probably **affect your "history" and cause it to "crash"**. At my site I'm taking care of this by modifying the handlers/pages/history.php file. The history feature "crashes" because it essentially places two versions of the action on the page at the same time. I've taken care of this by having a search & replace done before the version comparison and replacing ""{{text}}"" with ""||text||"" for the sake of differences being shown in the history depiction. This is done by adding the following lines to the history.php file.....
$bodyB = explode("\n", $pageB["body"]); //add following three lines
$brackets = Array ('/{{/i', '/}}/i');
$changeto = '||';
$bodyB = preg_replace($brackets, $changeto, $bodyB);
%%
and
$bodyA = explode("\n", $pageA["body"]); //add the following three lines
$brackets = Array ('/{{/i', '/}}/i');
$changeto = '||';
$bodyA = preg_replace($brackets, $changeto, $bodyA);
I'm sure a similar trick will work with revisions.php, but I haven't figured it out yet.
I'll keep working away at trying to figure out why this conflict happens.......it might be the functions defined in the code & a conflict between them....and if it is I'll try and move them to ##wakka.php##. In addition, I'm going to develop a textbox/submit button feature so that the galleries of different users can be seen without having to multiply edit/save the page. Feel free to play with this yourself.
Deletions:
**Note that** the conflict that stops two copies of the task manager actions being on the same page will probably **affect your "history" and cause it to "crash"**. At my site I'm taking care of this in two ways.....for the mytasks.php action I'm going to use the action I developed that will automatically erase the history of a page. For the other action which allows a user to see the tasks of other users, I'm going to develop a textbox/submit button feature that will allow me to place the action on a single page and use that same action that automatically erases a pages history. I'm still working on what causes the conflict....it might be the functions defined in the code & a conflict between them....and if it is I'll try and move them to ##wakka.php##. Feel free to play with this yourself.


Revision [3064]

Edited on 2004-12-10 02:29:55 by GmBowen [first releases of task manager and scheduler actions]
Additions:
**Note that** the conflict that stops two copies of the task manager actions being on the same page will probably **affect your "history" and cause it to "crash"**. At my site I'm taking care of this in two ways.....for the mytasks.php action I'm going to use the action I developed that will automatically erase the history of a page. For the other action which allows a user to see the tasks of other users, I'm going to develop a textbox/submit button feature that will allow me to place the action on a single page and use that same action that automatically erases a pages history. I'm still working on what causes the conflict....it might be the functions defined in the code & a conflict between them....and if it is I'll try and move them to ##wakka.php##. Feel free to play with this yourself.
Deletions:
**Note that** the conflict that stops two copies of the task manager actions being on the same page will probably **affect your "history" and cause it to "crash"**. At my site I'm taking care of this in two ways.....for the mytasks.php action I'm going to use the history that will automatically erase history that I developed. For the other action which allows a user to see the tasks of other users, I'm going to develop a textbox/submit button feature that will allow me to place the action on a single page and use that same action that automatically erases a page history. I'm still working on what causes the conflict....it might be the functions in the code....and if it is I'll try and move them to ##wakka.php##. Feel free to play with this yourself.


Revision [3063]

Edited on 2004-12-10 02:27:52 by GmBowen [first release versions of scheduler and task manager]
Additions:
**Note that** the conflict that stops two copies of the task manager actions being on the same page will probably **affect your "history" and cause it to "crash"**. At my site I'm taking care of this in two ways.....for the mytasks.php action I'm going to use the history that will automatically erase history that I developed. For the other action which allows a user to see the tasks of other users, I'm going to develop a textbox/submit button feature that will allow me to place the action on a single page and use that same action that automatically erases a page history. I'm still working on what causes the conflict....it might be the functions in the code....and if it is I'll try and move them to ##wakka.php##. Feel free to play with this yourself.
Deletions:
**Note that** the conflict that stops two versions of the task manager actions will probably affect your "history" and cause it to "crash". At my site I'm taking care of this in two ways.....for the mytasks.php action I'm going to use the history that will automatically erase history that I developed. For the other action which allows a user to see the tasks of other users, I'm going to develop a textbox/submit button feature that will allow me to place the action on a single page and use that same action that automatically erases a page history. I'm still working on what causes the conflict....it might be the functions in the code....and if it is I'll try and move them to ##wakka.php##. Feel free to play with this yourself.


Revision [3062]

Edited on 2004-12-10 02:26:49 by GmBowen [first version of task manager and scheduler....]
Additions:
**Note that** the conflict that stops two versions of the task manager actions will probably affect your "history" and cause it to "crash". At my site I'm taking care of this in two ways.....for the mytasks.php action I'm going to use the history that will automatically erase history that I developed. For the other action which allows a user to see the tasks of other users, I'm going to develop a textbox/submit button feature that will allow me to place the action on a single page and use that same action that automatically erases a page history. I'm still working on what causes the conflict....it might be the functions in the code....and if it is I'll try and move them to ##wakka.php##. Feel free to play with this yourself.


Revision [3060]

Edited on 2004-12-09 22:53:34 by JavaWoman [adding a few language selectors for highlighting]
Additions:
%%(sql)
%%(sql)


Revision [3059]

Edited on 2004-12-09 22:21:36 by GmBowen [added badword function addin for wakka.php for scheduler & task manager]
Additions:
All of the functions on this page user a "bad word function" that is placed in the wakka.php file. The following code needs to be placed in the wakka.php file (just after the microtime function which ends around row 25)
// GMB remove bad word filter
function BadWordFunc($RemoveBadWordText) {
$RemoveBadWordText = eregi_replace("fuc?k|[kc]unt|motherfucker|cocksucker|bitch|son of a bitch|asshole|shit|fag|wank|dick|pu[zs]?[zs][yi]|bastard|s[kc]rew|mole[zs]ter|mole[sz]t|coc?k", "****", $RemoveBadWordText);
return $RemoveBadWordText;


Revision [3053]

Edited on 2004-12-09 21:33:50 by GmBowen [first submission of scheduler and task manager]
Additions:
http://gmbowen.educ.unb.ca/wikitest/taskmanager.jpg


Revision [3052]

The oldest known version of this page was created on 2004-12-09 21:23:50 by GmBowen [first submission of scheduler and task manager]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki