Log in

View Full Version : Inserting custom calendar fields


gvtexas
12-09-2004, 05:37 PM
I asked this over at vBulletin community with no response. Hoping someone here might have the answer:

+++++++++

I'm in the right place in the template but can't get the right syntax to insert the custom fields of the calendar into the event link for the weekly view. I've tried (where X is the verified field id):

$post[fieldx]
$post[customfieldx]
$post[calendarcustomfieldx]
$post[customcalendarfieldx]

Also, this code:

<if condition="$show['customfields']">
$customfields
</if>...shows the customfields on the individual events listing, but when I insert that code into the calendar_weekly_event template nothing shows (and I know I'm in the right place).

??

Thx.
Gary

Plaz
12-17-2004, 02:09 PM
I need this exact mod as well. Did you ever get a solution for this Gary? Or does anyone know how to do this?

DarrinM
01-28-2005, 11:43 AM
Did you get any further with this ?

coolegg
02-03-2005, 11:11 PM
Hopefully I am not hijacking this thread, but I am in a very similar situation... I am looking to access my event custom fields individually so I can use them in conditionals in the calendar_showeventsbit template, but can't figure out the syntax needed to access them. I am starting to wonder if this can even be done (easily). Any ideas anyone?

I figured $eventinfo[field1] would do the trick, but not.

DarrinM
02-09-2005, 08:48 AM
MarcoH64 Kindly provided a fix for me and I am posting this for anyone else who requires it

Edit 'includes/functions_calendar.php'.

Find:

$event['title'] = htmlspecialchars_uni($event['title']);

Add after:

// Start Hack custom field on calendar month view (MarcoH64)
$customfield=unserialize($event['customfields']);
// End Hack custom field on calendar month view (MarcoH64)



Now edit the template 'calendar_monthly_event':

Find (or any other place):

<a href="calendar.php?$session[sessionurl]do=getinfo&amp;e=$event[eventid]&amp;day=$year-$month-$day&amp;c=$calendarid" title="$event[preview]">$event[title]</a>


And add below (please change it to suit your needs/fieldnumbers):

<!-- Start Hack custom field on calendar month view (MarcoH64) -->
<br />$customfield[1] -
<if condition="$customfield['2'] == 'OFF'"><font color="red"><else /><font color="green"></if>
$customfield[2]
</font color></if>
<!-- EndHack custom field on calendar month view (MarcoH64) -->

Note: "OFF" is one of my custom fields drop down options, yours of course will be different

Many thanks to MarcoH64