Witajcie.

Słuchajcie, może ktoś kojarzy wtyczkę Kieran O'Shea - Kalendarz wydarzeń do wordpressa.
Chcę zrobić jedną modyfikację i próbuję analizować kod ale słabo mi idzie.

Co chcę uzyskać?
Chcę z daty wyciągnąć dzień tygodnia - rozpoznać który to dzień tygodnia - i na tej podstawie dodać do daty słownie, np. "wtorek"

A szukam w tym, nie wiem czy to wystarczające:
  1. function upcoming_events($cat_list = '')
  2. {
  3. global $wpdb;
  4.  
  5. // Find out if we should be displaying upcoming events
  6. $display = $wpdb->get_var("SELECT config_value FROM ".WP_CALENDAR_CONFIG_TABLE." WHERE config_item='display_upcoming'",0,0);
  7.  
  8. if ($display == 'true')
  9. {
  10. // Get number of days we should go into the future
  11. $future_days = $wpdb->get_var("SELECT config_value FROM ".WP_CALENDAR_CONFIG_TABLE." WHERE config_item='display_upcoming_days'",0,0);
  12. $day_count = 1;
  13.  
  14. $output = '';
  15. while ($day_count < $future_days+1)
  16. {
  17. list($y,$m,$d) = explode("-",date("Y-m-d",mktime($day_count*24,0,0,date("m",ctwo()),date("d",ctwo()),date("Y",ctwo()))));
  18. $events = grab_events($y,$m,$d,'upcoming',$cat_list);
  19. usort($events, "time_cmp");
  20. if (count($events) != 0) {
  21. $output .= '<li>'.date_i18n(get_option('date_format'),mktime($day_count*24,0,0,date("m",ctwo()),date("d",ctwo()),date("Y",ctwo()))).'<ul class="elo">';
  22. }
  23. foreach($events as $event)
  24. {
  25. if ($event->event_time == '00:00:00') {
  26. $time_string = ' '.__('all day','calendar');
  27. }
  28. else {
  29. $time_string = ' '.__('o','calendar').' '.date(get_option('time_format'), strtotime(stripslashes($event->event_time)));
  30. }
  31. $output .= '<li>'.draw_event($event).$time_string.'</li>';
  32. }
  33. if (count($events) != 0) {
  34. $output .= '</ul></li>';
  35. }
  36. $day_count = $day_count+1;
  37. }
  38.  
  39. if ($output != '')
  40. {
  41. $visual = '<ul class="upcoming">';
  42. $visual .= $output;
  43. $visual .= '</ul>';
  44. return $visual;
  45. }
  46. }
  47. }


Dajcie znać, jak znajdziecie jakiś trop :-)