This topic is locked

How to add a new field to calendar monthly or weekly List page

3/6/2011 7:37:50 PM
Calendar Template tips and tricks
admin

[size="4"]Monthly List page[/size]

  1. Add a new field to calcalendar table. Lets assume this field name is URL and it contains the URL associated with event. Modify SQL query of calmonthly view adding this new field there.
  2. Make sure this field appears on calmonthly List page. This can be done on 'Choose fields' screen.
  3. Then you need to modify Calmonthly, 'List page: before display' event.

    See changes in bold:
    $strRow.="</b>";

    if($_REQUEST["a"]<>"year")

    $strRow.="</a>";
    if($datatmp2["URL"])

    $strRow.="<div align=center><a href='".$datatmp2["URL"]."'>Link</a></div>";

    $strRow.="</td></tr></table></td></tr>"."\r\n";

    if ($_SESSION[$kolstr]<=5)

    $strRow.="<tr><td colspan=3 height=1></td></tr>"."\r\n";

    $strRow.="</table>"."\r\n";


[size="4"]Weekly List page[/size]

  1. Add a new field to calcalendar table. Lets assume this field name is URL and it contains the URL associated with event. Modify SQL query of calmonthly view adding this new field there.
  2. Make sure this field appears on calmonthly List page. This can be done on 'Choose fields' screen.
  3. Modify BeforeDisplay event of calweekly List page for this purpose.
    Find the following line:

$strtmp=$datatmp2["Description"];


and replace it with this one:

$strtmp="<a href='".$datatmp2["URL"]."'>Link</a>&nbsp;&nbsp;".$datatmp2["Description"];


This example assumes that your new field name is "URL". Replace it with your field name.

M
mitzi 12/6/2012

Hi, How add "EndTime" to the monthly and weekly table views.

I tried to follow your explanation but failed to find the $strRow line in the Before display codes.Can you please direct me correctly?

admin 1/2/2013

Similar example for ASPRunnerPro 7.2, adding End Time to calweekly view.
Proceed to Events screen, calweekly table, List page, 'Before display' event.

Line 121 should read:

strRow=strRow & "<font face=Arial>Start Time:&nbsp;" & rstmp2("TimeField") & "</font>&nbsp;"



Add a new line right after that:

strRow=strRow & "<font face=Arial>End Time:&nbsp;" & rstmp2("EndTime") & "</font>&nbsp;"


This is it.

S
Sergej 4/24/2015

Hi, all,

Seems this tip is no more appliable. I cannot find any of the lines on the specified place in the latest version of Calendar template. Can Anyone help me?

Best,

Sergej