vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Inserting custom calendar fields (https://vborg.vbsupport.ru/showthread.php?t=72673)

gvtexas 12-09-2004 05:37 PM

Inserting custom calendar fields
 
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:

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:

PHP Code:

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

Add after:

PHP Code:

// 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):

Code:

<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):

Code:

<!-- 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


All times are GMT. The time now is 07:51 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02696 seconds
  • Memory Usage 1,720KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete