[EventCalendar] EC3 - Include Only Posts That Match "Events"Category And "category x" in Upcoming Events List Widget

Joe jlindsay at fanningcommunications.com
Wed Apr 4 21:41:01 BST 2012


Peter,

Thanks, you got me into the right spot.

I copied the function and changed the name of the function to
ec3_get_majorevents() and then made the same function call change to the
widget.php file.

I¹m now working inside that function to include only posts that meet the
criteria of also being in the Major Events category (cat_id=²4²).

I¹ll post a solution as soon as I¹m done. A lot of people have been looking
for this.

Joe


On 4/4/12 3:12 PM, "Dr. Peter Troxler" <peter.troxler at gmx.net> wrote:

> Joe
> 
> I see Š widget.php it is pulling the ec3_get_events() function which is
> defined in template-functions.php from line 356
> 
> so you could clone that function to ec3_get_majorevents() and either modify
> the SQL statement in there or the foreach loop as suggested earlier
> 
> / Peter
> 
> On 4 Apr 2012, at 21:57 , Joe wrote:
> 
>> Re: [EventCalendar] EC3 - Include Only Posts That Match "Events"Category And
>> "category x" in Upcoming Events List Widget
>> Peter,
>> 
>> Exactly on point. The problem is in the way the EC3 upcoming event list
>> widget is coded. I cannot find in the code where to place any code that
>> defines that the post must also match (&&) the ³major Events² category. I
>> believe it is in the widget.php file in the section between lines 102 and
>> 143:
>> 
>>   /** Upcoming Events widget. */  function ec3_widget_list($args)  {
>> extract($args);    $options = get_option('ec3_widget_list');        echo
>> $before_widget . $before_title;    echo
>> ec3_widget_title($options['title'],'Upcoming Events');    echo $after_title;
>> ec3_get_events(                  $options['limit'],
>> EC3_DEFAULT_TEMPLATE_EVENT,      EC3_DEFAULT_TEMPLATE_DAY,
>> get_option('date_format')          );    echo $after_widget;  }   function
>> ec3_widget_list_control()  {    $options = $newoptions =
>> get_option('ec3_widget_list');    if ( $_POST["ec3_list_submit"] )    {
>> $newoptions['title'] = strip_tags(stripslashes($_POST["ec3_list_title"]));
>> $newoptions['limit'] = strip_tags(stripslashes($_POST["ec3_limit"]));    }
>> if ( $options != $newoptions )    {      $options = $newoptions;
>> update_option('ec3_widget_list', $options);    }      $title =
>> ec3_widget_title($options['title'],'Upcoming Events');    $limit =
>> $options['limit'];            $ec3_limit_title =      __("Examples: '5', '5
>> days', '5d'. To display recent past events, use a negative number: '-5'.");
>> ?> 
>> Where in this code (if this is indeed the spot for that change) do I put it
>> and how should the code be written?
>> 
>> Joe
>> 
>> 
>> On 4/4/12 2:46 PM, "Dr. Peter Troxler" <peter.troxler at gmx.net
>> <x-msg://1204/peter.troxler@gmx.net> > wrote:
>> 
>>> the typical approach would be to clone the widget and add code to its loop
>>> that skips events that are only "events" and not "major events".  not a very
>>> efficient approach, but works.
>>> 
>>> / pt
>>> 
>>> On 4 Apr 2012, at 21:41 , Joe wrote:
>>> 
>>>> EC3 - Include Only Posts That Match "Events" Category And "category x" in
>>>> Upcoming Events List Widget
>>>> All,
>>>> 
>>>> I¹ve been scouring sites and the code and cannot figure this out.
>>>> 
>>>> I want the ³Upcoming Event² list (using the widget in the sidebar) to
>>>> display only posts that match the ³Events² category (the one used for all
>>>> event posts) AND another category, ³Major Events².
>>>> 
>>>> Essentially, I only want the ³Major Events² to show in the Upcoming Events
>>>> list in the sidebar.
>>>> 
>>>> Why not use the Category Posts Widget to only show ³Major Events²? - I
>>>> tried that. And it does show posts from the ³Major Event² category. The
>>>> problem is, the list sorts by post date, not the date of the event. I
>>>> scoured the EC3 code trying to find the variable that controls the event
>>>> date to try to add it as a sort option to the category list, but cannot
>>>> find where that variable is defined in the EC3 code and can be recalled.
>>>> 
>>>> I need a solution that either:
>>>> 1. Adds the EC3 event date variable to the Category Posts widget for
>>>> sorting.
>>>> 
>>>> Or
>>>> 
>>>> 2. Lets me filter the ³Upcoming Events² posts by using the additional
>>>> category designation to exclude some Event posts.
>>>> 
>>>> Any help (or even a pointing in the right direction) would be appreciated.
>>>> 
>>>> Joe
>>>> _______________________________________________
>>>> Blog: http://wpcal.firetree.net/
>>>> EventCalendar at firetree.net <x-msg://1204/EventCalendar@firetree.net>
>>>> mailing list
>>>> Unsubscribe: http://penguin.firetree.net/eventcalendar
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> Blog: http://wpcal.firetree.net/
>>> EventCalendar at firetree.net <x-msg://1204/EventCalendar@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 mailing list
> Unsubscribe: http://penguin.firetree.net/eventcalendar

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://penguin.firetree.net/pipermail/eventcalendar/attachments/20120404/39b859bc/attachment.htm>


More information about the EventCalendar mailing list