The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Can it really be that difficult ?
I would like to display customfields information within the calendar month view, I have managed to edit the template to show all the fields but of course it also shows the : ; { etc
However I wish to only show 2 or 3 of the fields and not all - can this be done and if so how ?!?! Many Thanks Darrin |
#2
|
|||
|
|||
you are trying to show a serialized array.
In your php script, first do: PHP Code:
|
#3
|
|||
|
|||
Hi Marco, thanks for replying
I have looked through calendar.php and notice that these lines exist $eventfields = unserialize($eventinfo['customfields']); and $eventcustomfields = unserialize($eventinfo['customfields']); Would I be right to think I therefore dont need to add the line to calendar.php and then only edit the template, if not please advise, if you could be more specific to say for example display the third item in the serialization it would be most helpful Regards Darrin |
#4
|
|||
|
|||
If the data you need is already unserialized, you don't need to do it again.
You will just need something like "$eventfields['fieldname']" in your template. To find out which fields are in the array, TEMPORARY add the following line to your php-script, just after the unserialize: PHP Code:
|
#5
|
|||
|
|||
Thanks again Marco, will give that a try, I did notice however that when using ' within the template I get a parse error, what would be the correct format for the template when I have worked out what the variable is ?
Regards Darrin |
#6
|
|||
|
|||
Sorry just leave out the quotes.
|
#7
|
|||
|
|||
Right, managed to get the eventfields to display but ONLY when viewing the posting and not in calendar month view by doing what you said - see screenshot
Entered $eventfields[1] and $eventfield[field1] into the calendar monthly view template - see below - but still did not display, I left the $event[customfields] in just for reference HTML Code:
<div class="smallfont" style="margin-bottom:$stylevar[cellpadding]px; padding-bottom:1px; border-bottom:1px solid"> <if condition="$show['holiday']"> <!--<strong>»</strong>--> <a href="calendar.php?$session[sessionurl]do=getinfo&day=$year-$month-$day&c=$calendarid" title="$event[preview]"><strong>$event[title]</strong></a> <else /> <if condition="$show['subscribed']"> <img class="inlineimg" src="$stylevar[imgdir_misc]/subscribed_event.gif" alt="$vbphrase[event_notification]" /> <else /> <!--<strong>»</strong>--> </if> <a href="calendar.php?$session[sessionurl]do=getinfo&e=$event[eventid]&day=$year-$month-$day&c=$calendarid" title="$event[preview]">$event[title]</a> $event[customfields] $eventfields[1] $eventfields[field1] </if> </div> Regards Darrin |
#8
|
|||
|
|||
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:
PHP Code:
Find (or any other place): Code:
<a href="calendar.php?$session[sessionurl]do=getinfo&e=$event[eventid]&day=$year-$month-$day&c=$calendarid" title="$event[preview]">$event[title]</a> 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) --> Many thanks to MarcoH64 |
#9
|
|||
|
|||
Ok I got this to work. Thank you very much guys! I am similarly trying to get the same type thing to show up in the weekly view. I have tried adding
$customfield=unserialize($event['customfields']); to the calendar.php file in a similar place for the weekly view, but it didn't work. Any ideas on how to make the custom field show up in weekly view? Thanks! |
#10
|
|||
|
|||
To update this, you need to add the line of code to about line 493.
I had troubles searching for the line above, here it is again. search for: Code:
$event['title'] = htmlspecialchars_uni($event['title']); Code:
// Start Hack custom field on calendar month view (MarcoH64) $customfield=unserialize($event['customfields']); // End Hack custom field on calendar month view (MarcoH64) |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|