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

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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

#1 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 16102
  • Joined: 03-February 03
  • Gender:Male

Posted 07 March 2011 - 12:37 AM

Monthly List page

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:

Quote

$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";



Weekly List page

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.
Best regards,
Sergey Kornilov
0

#2 User is offline   mitzi 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 55
  • Joined: 02-December 12

Posted 06 December 2012 - 04:06 PM

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?
0

#3 User is offline   admin 

  • Administrator
  • PipPipPip
  • Group: Admin
  • Posts: 16102
  • Joined: 03-February 03
  • Gender:Male

Posted 02 January 2013 - 07:32 PM

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.
Best regards,
Sergey Kornilov
0

#4 User is offline   Sergej 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 111
  • Joined: 09-December 11

Posted 24 April 2015 - 10:01 AM

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
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users