[EventCalendar] How to format ec3_the_schedule()
Unwork Studio
studio at unwork.co.uk
Wed May 21 16:24:13 UTC 2008
Hi Mark,
Yes, I seem to have sorted it - not entirely sure how but it involved
deleting some lines of code and changing alot of the the if/else
stuff. Ended up with this;
if($s->allday) //all day
{
if($date_start!=$date_end)
{
$result.=sprintf($format_single,$date_start,$time_start); //
no idea what this does
}
elseif($date_start!=$current)
{
$current=$date_start;
$result.=sprintf($format_single, "$date_start / All day"); //
this changes the all day output
}
}
else
{
if($date_start!=$date_end)//same day
{
$current=$date_start;
$result.=sprintf($format_range,
"$date_start / $time_start","$date_end /
$time_end",__('to','ec3'));
} // this effects Several Days and times
else
{
if($date_start!=$current)
{
$current=$date_start;
$result.=sprintf($format_single,
"$date_start / $time_start to $time_end");
} //The offending piece of code
}
}
}
return sprintf($format_wrapper,$result);
}
Which, combined with edited schedule definitions;
define('EC3_DEFAULT_FORMAT_SINGLE','<tr><td class="ec3_only">Event
Date & Time: %s </td></tr>'); //only effects all day setting now
define('EC3_DEFAULT_FORMAT_RANGE','<tr><td class="ec3_start">Event
Start Date & Time: %1$s</td>'.'</tr><tr><td class="ec3_end">Event End
Date & Time: %2$s</td></tr>');
define('EC3_DEFAULT_FORMAT_WRAPPER','<table class="ec3_schedule">%s</
table>');
Seemed to have done the trick. I'm sure this is a ridiculous way of
doing things but I'm no programmer and I'm now very happy with the
results! Thanks for your input ... this plugin has solved a sizeable
problem for me!
Cheers,
Jason
On 21 May 2008, at 16:21, Mark Naylor wrote:
> Looked at the site couldn't see the fault?
> Have you tried the example string at the bottom of the page I gave?
>
> <?php ec3_the_schedule('%1$s ','','<div class="ec3_the_schedule" >%s
> </div>');?>
>
> Thats what I use and there are no problematic tables appearing in my
> output.
>
> example
>
> http://www.spondonoffroad.co.uk/2008-events/red-hall-farm-stoke/
>
> Mark
>
>
>
> -----Original Message-----
> From: eventcalendar-bounces at firetree.net on behalf of Unwork Studio
> Sent: Wed 5/21/2008 3:30 PM
> To: Support for EventCalendar plugin
> Subject: Re: [EventCalendar] How to format ec3_the_schedule()
>
> Thanks for looking at this Mark.
>
> Having abandoned trying to change the format on your advice- I've now
> been messing with the $result formats and I'm having a bit more
> success but still cannot figure out what the hell is going on with the
> code! It works fine when you have an all day event, or an event over
> several days but trying to put a start and end time on the same day
> event keeps spitting out the dates/times twice. It's driving me nuts!
>
> Using this as an example:
>
> http://www.unwork.co.uk/tetsudo/?p=45
>
> It's perfect, apart from there should be just the top 2 lines not the
> bottom 2 as well. WHERE ARE THEY COMING FROM?
>
> Grrrrr,
>
> Jason
>
> On 21 May 2008, at 12:42, Mark Naylor wrote:
>
>> jason,
>> your barking up the wrong tree trying to change the existing format
>> within the plugin.
>> (been there done that)
>> I wrote the little guide for ec3_the_schedule and agrree that the
>> examples could be better,
>> Try putting blanks in for the output of each one, when you get it
>> just giving you raw data, then you have cracked it.
>> I have to fix this on my blog, but I have been ignoring it.
>> I'll have a go and let you know what the result is.
>> Mark
>>
>>
>> -----Original Message-----
>> From: eventcalendar-bounces at firetree.net on behalf of Unwork Studio
>> Sent: Wed 21/05/2008 10:35
>> To: Support for EventCalendar plugin
>> Subject: Re: [EventCalendar] How to format ec3_the_schedule()
>>
>> Hi,
>>
>> Thanks for replying ...
>>
>> I've read the documentation and also spent many hours trying to
>> change
>> the output but this does not seem to make any difference to the fact
>> that it splits the date and time onto separate lines:
>>
>> define('EC3_DEFAULT_FORMAT_SINGLE','<tr><td colspan="3">Event Date/
>> Time: %s</td></tr>');
>>
>> This does not happen with the range format which works fine:
>>
>> define('EC3_DEFAULT_FORMAT_RANGE','<tr><td class="ec3_start">Event
>> Start Date/Time: %1$s</td>'.'</tr><tr><td class="ec3_end">Event End
>> Date/Time: %2$s</td></tr>');
>>
>> Even if I paste the range code into the singe code it still splits
>> the
>> output onto 2 lines exactly as before. I'm stumped!
>>
>> Thanks,
>>
>> Jason
>>
>> This does not happen with the format range
>> On 21 May 2008, at 08:54, Mark Naylor wrote:
>>
>>> http://wpcal.firetree.net/2007/10/25/ec3_the_schedule/
>>>
>>> You can find the details at the bottom.
>>>
>>> -----Original Message-----
>>> From: Unwork Studio <studio at unwork.co.uk>
>>> Sent: 21 May 2008 02:00
>>> To: eventcalendar at firetree.net <eventcalendar at firetree.net>
>>> Subject: [EventCalendar] How to format ec3_the_schedule()
>>>
>>> Hi Everyone,
>>>
>>> I'm have a frustrating problem with the date formatting in the event
>>> post. I've altered it to suit my needs if the event spans several
>>> days
>>> or if it is an all day event, however if it is an event with no end
>>> time ($format_single) it puts the time in a separate <td> tag. To
>>> illustrate my point;
>>>
>>> http://www.unwork.co.uk/tetsudo/?p=45
>>>
>>> I've tried everything I can think of to tinker with the code with no
>>> luck. I assume the offending bit is this;
>>>
>>> define('EC3_DEFAULT_FORMAT_SINGLE','<tr><td colspan="3">%s</td></
>>> tr>');
>>>
>>> Unfortunately the documentation doesn't really explain how the ''%s"
>>> works - anyone have any ideas?
>>>
>>> The result I am looking for can be seen here;
>>>
>>> http://www.unwork.co.uk/tetsudo/?p=47
>>>
>>> Thanks,
>>>
>>> Jason
>>>
>>> _______________________________________________
>>> Blog: http://wpcal.firetree.net/
>>> EventCalendar at firetree.net mailing list
>>> Unsubscribe: http://penguin.firetree.net/eventcalendar
>>>
>>
>>
>> _______________________________________________
>> Blog: http://wpcal.firetree.net/
>> EventCalendar at firetree.net mailing list
>> Unsubscribe: http://penguin.firetree.net/eventcalendar
>>
>>
>> <winmail.dat>_______________________________________________
>> Blog: http://wpcal.firetree.net/
>> EventCalendar at firetree.net mailing list
>> Unsubscribe: http://penguin.firetree.net/eventcalendar
>
>
> _______________________________________________
> Blog: http://wpcal.firetree.net/
> EventCalendar at firetree.net mailing list
> Unsubscribe: http://penguin.firetree.net/eventcalendar
>
>
> <winmail.dat>_______________________________________________
> Blog: http://wpcal.firetree.net/
> EventCalendar at firetree.net mailing list
> Unsubscribe: http://penguin.firetree.net/eventcalendar
More information about the EventCalendar
mailing list