[EventCalendar] EC3 Skips events + custom field image

Sam Drew sam at trinitywebhosting.com
Tue May 11 15:07:06 BST 2010


Hi Giuseppe,

I'm not much for Italian.  I was looking at 
http://www.ciociariaeventi.com/ and I saw two boxes that seemed to be 
what you were talking about.  The one on the left was labeled Oggi and 
had 10 events, the one on the right was labeled Questa Settimana and 
only had one picture/event.  It really didn't seem like I was in the 
right place, but none of the other pages seem to be it either.  I'm glad 
you understand English, or this would  be a very difficult conversation.

Take a look at http://mgachurch.com.  Their list of upcoming events uses 
my code.  The first date for the Prayer Meeting on May 12 is long before 
today, but it still shows up in the list.  I've included a screen shot 
of the Post Edit of the Prayer Meeting Post so you can see some of the 
dates listed for it.  The more recent dates are below my screen shot, 
but I think you can get the picture.  In order to figure out what the 
issue is on your site, I would need access to both your Wordpress 
backend and your mysql.  You probably don't want to give me that and I'm 
not sure I have time for it, anyway.  So, does your post edit have 
something that looks like my screen shot?

Sam
On 11/05/2010 5:12 AM, Ciociaria Eventi wrote:
> Hi Sam,
> I understand for the interval, I will ask a friend of mine to help 
> me... if you look at my site there are 2 boxes under the slider that 
> show today's events, the left one uses the ec3_get_events query and 
> the right one the code provided by you...
>
> Thanks
> Giuseppe
>
> Il giorno 11/mag/10, alle ore 05:15, Sam Drew ha scritto:
>
>> Gisuppe,
>>
>> Find this sentence
>> "The |INTERVAL| keyword and the /|unit|/ specifier are not case 
>> sensitive."
>> on this page 
>> http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html 
>> to see the different values for Interval in the Mysql statement.  You 
>> will have to work with them a bit to get what you want.
>>
>> As far as it not showing events that start before the current date, I 
>> didn't have that problem.  Please double check that you are having 
>> it.  If you are, then I will look further at the code.
>>
>> Thanks,
>>
>> Sam Drew sam at trinitywebhosting.com <mailto:sam at trinitywebhosting.com>
>>
>> Trinity Web Hosting <http://trinitywebhosting.com> -- Your Ministry 
>> Partner on the Internet
>> http://trinitywebhosting.com 1-800-380-9506
>>
>>
>> On 10/05/2010 5:31 PM, Ciociaria Eventi wrote:
>>> Hi Sam,
>>>
>>> this piece of code is awesome! As you can see on my site I did it!
>>> with a little bit of logic I added the custom-field to show the 
>>> events' images...
>>>
>>> but, I think still some problems... the "interval" shows next days, 
>>> not a week or a month... if I set 30 DAY, it shows next 30 days, not 
>>> the May's month...
>>> and it shows only the events that start in these days, not the 
>>> events started in the past and continue for X days...
>>>
>>> Is it possible fix these things or not?
>>>
>>> Thanks a lot!
>>> Giuseppe
>>>
>>>
>>> Il giorno 10/mag/10, alle ore 21:47, Sam Drew ha scritto:
>>>
>>>> Here is a hard coded alternative to EC3_get_events that does not 
>>>> skip events.  I'm sorry I haven't taken the time to put it into a 
>>>> function.  Instead of calling ec3_get_events, put this code into a 
>>>> file and include it.  you can change the "interval" in the Select 
>>>> statement, and the format of the output.
>>>>
>>>> <?php
>>>>
>>>> $dbc=mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) or die ('Could 
>>>> not connect to MySQL');
>>>> mysql_select_db(DB_NAME, $dbc);
>>>> $q="SELECT wp_posts.post_title as title, wp_ec3_schedule.start as 
>>>> start, wp_ec3_schedule.post_id as post_id
>>>> FROM wp_ec3_schedule INNER JOIN wp_posts ON wp_ec3_schedule.post_id 
>>>> = id WHERE
>>>> start <= curdate( ) + INTERVAL 7 DAY
>>>> AND start >= curdate( ) AND post_status='publish' ORDER BY start ASC" ;
>>>>
>>>> $r = mysql_query ($q);
>>>> $thisevent = mysql_fetch_array($r);
>>>> $current_month=substr($thisevent['start'],5,2);
>>>> switch ($current_month) {
>>>>     case '01' :
>>>>         $thismonth = 'January';
>>>>         break;
>>>>     case '02' :
>>>>         $thismonth = 'February';
>>>>         break;
>>>>     case '03' :
>>>>         $thismonth = 'March';
>>>>         break;
>>>>     case '04' :
>>>>         $thismonth = 'April';
>>>>         break;
>>>>     case '05' :
>>>>         $thismonth = 'May';
>>>>         break;
>>>>     case '06' :
>>>>         $thismonth = 'June';
>>>>         break;
>>>>     case '07' :
>>>>         $thismonth = 'July';
>>>>         break;
>>>>     case '08' :
>>>>         $thismonth = 'August';
>>>>         break;
>>>>     case '09' :
>>>>         $thismonth = 'September';
>>>>         break;
>>>>     case '10' :
>>>>         $thismonth = 'October';
>>>>         break;
>>>>     case '11' :
>>>>         $thismonth = 'November';
>>>>         break;
>>>>     case '12' :
>>>>         $thismonth = 'December';
>>>>         break;
>>>>     }
>>>>
>>>>
>>>> echo "<ul class='ec3_events'>";
>>>> echo "<li class='ec3_list ec3_list_month'>$thismonth\n<ul>\n";
>>>> $permalink = get_permalink($thisevent['post_id']);
>>>> $thistitle = $thisevent['title'];
>>>> $current_date = substr($thisevent['start'],8,2);
>>>> echo " <li><a href='$permalink'>$current_date:$thistitle</a></li>\n";
>>>>
>>>> while($thisevent = mysql_fetch_array($r)){
>>>>
>>>>       // Month changed?
>>>>
>>>>       if(substr($thisevent['start'],5,2) != $current_month)
>>>>       {
>>>>         $current_month=substr($thisevent['start'],5,2);
>>>>         switch ($current_month) {
>>>>             case '01' :
>>>>                 $thismonth = 'January';
>>>>                 break;
>>>>             case '02' :
>>>>                 $thismonth = 'February';
>>>>                 break;
>>>>             case '03' :
>>>>                 $thismonth = 'March';
>>>>                 break;
>>>>             case '04' :
>>>>                 $thismonth = 'April';
>>>>                 break;
>>>>             case '05' :
>>>>                 $thismonth = 'May';
>>>>                 break;
>>>>             case '06' :
>>>>                 $thismonth = 'June';
>>>>                 break;
>>>>             case '07' :
>>>>                 $thismonth = 'July';
>>>>                 break;
>>>>             case '08' :
>>>>                 $thismonth = 'August';
>>>>                 break;
>>>>             case '09' :
>>>>                 $thismonth = 'September';
>>>>                 break;
>>>>             case '10' :
>>>>                 $thismonth = 'October';
>>>>                 break;
>>>>             case '11' :
>>>>                 $thismonth = 'November';
>>>>                 break;
>>>>             case '12' :
>>>>                 $thismonth = 'December';
>>>>                 break;
>>>>             }
>>>>
>>>>         echo "</ul></li>\n";
>>>>         echo "<li class='ec3_list ec3_list_month'>$thismonth\n<ul>\n";
>>>>     }
>>>>
>>>>     $permalink = get_permalink($thisevent['post_id']);
>>>>     $thistitle = $thisevent['title'];
>>>>     $current_date = substr($thisevent['start'],8,2);
>>>>     echo " <li><a 
>>>> href='$permalink'>$current_date:$thistitle</a></li>\n";
>>>> }
>>>>
>>>>
>>>> echo "</ul></li></ul>\n";
>>>>
>>>> ?>
>>>>
>>>> Sam Drew
>>>> On 09/05/2010 4:30 AM, Ciociaria Eventi wrote:
>>>>> Hi dbm,
>>>>>
>>>>> with '60' ec3 shows more events, but it starts from january as you 
>>>>> can see... another example: in the "Today' Events" box, it shows 
>>>>> 10 events, but if you see in the calendar page, I have 22 events...
>>>>>
>>>>> Thanks
>>>>>
>>>>>
>>>>> Il giorno 09/mag/10, alle ore 09:26, dbm ha scritto:
>>>>>
>>>>>> Try changing 30 days to 60 events see if that works.
>>>>>>
>>>>>> <?php
>>>>>> ec3_get_events(
>>>>>> '60', // limit
>>>>>>> '%DATE%: <a href="%LINK%">%TITLE%</a>', // template_event
>>>>>>> ''                              // template_day
>>>>>>> );
>>>>>>> ?>
>>>>>>
>>>>>> On May 9, 2010, at 12:55 AM, Ciociaria Eventi wrote:
>>>>>>
>>>>>>> Hi Sam,
>>>>>>>
>>>>>>> for May I have 54 events (most of all start in May, the others 
>>>>>>> started in the past months) and as you can see in the home top 
>>>>>>> right box called "Eventi del Mese" (Month's Events), EC3 shows 
>>>>>>> only 9 events... I use this query
>>>>>>>
>>>>>>> <?php
>>>>>>> ec3_get_events(
>>>>>>> '30 days',                           // limit
>>>>>>> '%DATE%: <a href="%LINK%">%TITLE%</a>', // template_event
>>>>>>> ''                              // template_day
>>>>>>> );
>>>>>>> ?>
>>>>>>>
>>>>>>> Giuseppe
>>>>>>>
>>>>>>> Il giorno 08/mag/10, alle ore 16:20, Sam Drew ha scritto:
>>>>>>>
>>>>>>>> How is your site skipping events?  Is it repeated events that 
>>>>>>>> are missing?
>>>>>>>>
>>>>>>>> Sam Drew sam at trinitywebhosting.com 
>>>>>>>> <mailto:sam at trinitywebhosting.com>
>>>>>>>>
>>>>>>>> Trinity Web Hosting <http://trinitywebhosting.com> -- Your 
>>>>>>>> Ministry Partner on the Internet
>>>>>>>> http://trinitywebhosting.com 1-800-380-9506
>>>>>>>>
>>>>>>>>
>>>>>>>> On 07/05/2010 3:22 PM, Ciociaria Eventi wrote:
>>>>>>>>>
>>>>>>>>> Hi to everyone, I hope someone can help me...
>>>>>>>>>
>>>>>>>>> I have a site <http://www.ciociariaeventi.com/> where I post 
>>>>>>>>> events of a small italian province... now, this site is 
>>>>>>>>> becoming "popular" in this area and i need to redesign it... 
>>>>>>>>> the problem is I'm not a programmer, I'm a designer...
>>>>>>>>>
>>>>>>>>> 1. I'm trying something, and I used the /ec3_get_events/ query 
>>>>>>>>> to show event for "this month" or "this week", but seems that 
>>>>>>>>> ec3 loses or skips events... how I can fix it?
>>>>>>>>>
>>>>>>>>> 2. I want to show the image associated with the event, for 
>>>>>>>>> image I use custom-field... is it possible to use the 
>>>>>>>>> custom-field with ec3 query? if yes, how?
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>>
>>>>>>>>> Giuseppe
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> 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 <mailto:EventCalendar at firetree.net> 
>>>>>>>> mailing list
>>>>>>>> Unsubscribe: http://penguin.firetree.net/eventcalendar
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Blog: http://wpcal.firetree.net/
>>>>>>> EventCalendar at firetree.net <mailto:EventCalendar at firetree.net> 
>>>>>>> mailing list
>>>>>>> Unsubscribe: http://penguin.firetree.net/eventcalendar
>>>>>>
>>>>>> _______________________________________________
>>>>>> Blog: http://wpcal.firetree.net/
>>>>>> EventCalendar at firetree.net <mailto: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
>>>>>    
>>>> _______________________________________________
>>>> Blog: http://wpcal.firetree.net/
>>>> EventCalendar at firetree.net <mailto: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
>>>    
>> _______________________________________________
>> Blog: http://wpcal.firetree.net/
>> EventCalendar at firetree.net <mailto: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
>    
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://penguin.firetree.net/pipermail/eventcalendar/attachments/20100511/7cdaede8/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: screen.jpg
Type: image/jpeg
Size: 74437 bytes
Desc: not available
URL: <http://penguin.firetree.net/pipermail/eventcalendar/attachments/20100511/7cdaede8/attachment-0001.jpg>


More information about the EventCalendar mailing list