[EventCalendar] Several months display?

Rick Boatright rboatright at gmail.com
Thu Oct 16 22:50:04 UTC 2008


oh arrrgggh.   Sorry about that.  (actually I used CSDIFF, but it can also
produce unified diff. )

here you go

--- template-functions_old.php    2008-10-16 17:03:47.443600000 -0500
+++ template-functions.php    2008-10-16 17:01:40.827600000 -0500
@@ -76,10 +76,10 @@

   // Previous
   $prev=$date->prev_month();
-  echo "\t<td id='prev'><a id='ec3_prev' href='" . $prev->month_link() .
"'"
+  echo "\t<td id='prev_n$ec3->call_count'><a
id='ec3_prev_n$ec3->call_count' href='" . $prev->month_link() . "'"
      . '>&laquo;&nbsp;' . $prev->month_abbrev() . "</a></td>\n";

-  echo "\t<td><img id='ec3_spinner' style='display:none' src='"
+  echo "\t<td><img id='ec3_spinner_n$ec3->call_count' style='display:none'
src='"
      . $ec3->myfiles . "/ec_load.gif' alt='spinner' />\n";
   // iCalendar link.
   $webcal=get_option('home') . "/?ec3_ical";
@@ -87,7 +87,7 @@
   // It's hard to guess on other platforms, so stick to http://
   if(strstr($_SERVER['HTTP_USER_AGENT'],'Mac OS X'))
       $webcal=preg_replace('/^http:/','webcal:',$webcal);
-  echo "\t    <a id='ec3_publish' href='$webcal'"
+  echo "\t    <a id='ec3_publish" . "_n$ec3->call_count' href='$webcal'"
      . " title='" . __('Subscribe to iCalendar.','ec3') ."'>\n"
      . "\t     <img src='$ec3->myfiles/publish.gif' alt='iCalendar' />\n"
      . "\t    </a>\n";
@@ -95,7 +95,7 @@

   // Next
   $next=$date->plus_months($num_months);
-  echo "\t<td id='next'><a id='ec3_next' href='" . $next->month_link() .
"'"
+  echo "\t<td id='next_n$ec3->call_count'><a
id='ec3_next_n$ec3->call_count' href='" . $next->month_link() . "'"
      . '>' . $next->month_abbrev() . "&nbsp;&raquo;</a></td>\n";

   echo "</tr></tbody></table>\n";
@@ -204,7 +204,7 @@
   // Table start.
   $title=
     sprintf(__('View posts for %1$s
%2$s'),$date->month_name(),$date->year_num);
-  echo "<table id='" . $date->month_id() . "'>\n<caption>"
+  echo "<table id='" . $date->month_id() . "_n" . $ec3->call_count .
"'>\n<caption>"
     . '<a href="' . $date->month_link() . '" title="' . $title . '">'
     . $date->month_name() . ' ' . $date->year_num . "</a></caption>\n";
   echo $thead;
@@ -233,7 +233,7 @@
     }
     // insert day
     $day_id = $date->day_id();
-    echo "<td id='$day_id'";
+    echo "<td id='$day_id" . "_n$ec3->call_count'";

     if(array_key_exists($day_id,$calendar_days))
     {
@@ -287,14 +287,18 @@
   // a unique ID, so it can't be duplicated.
   // Simple fix for problem: Just ignore all calls after the first.
   $ec3->call_count++;
-  if($ec3->call_count>1)
-  {
-    echo "<!-- You can only have one Event Calendar on each page. -->\n";
-    return;
-  }
-
-  echo "<div id='wp-calendar'>\n";
-
+
+ //Attempt to fix multiple calendar identity problems - RBoatright
+ // if($ec3->call_count>1)
+ // {
+ //   echo "<!-- You can only have one Event Calendar on each page. -->\n";
+ //   return;
+ // }
+
+  echo "<div class='wp-calendar'>\n";
+  //add unique dive for each call
+  echo "<div id='Calendar-number_n$ec3->call_count'>\n";
+
   $this_month = new ec3_Date();

   // Display navigation panel.
@@ -322,8 +326,8 @@
   if(1==$ec3->navigation)
     ec3_get_calendar_nav(new ec3_Date(),$ec3->num_months);

-  echo "</div>\n";
-
+  echo "</div>\n"; //calendar-count
+  echo "</div>\n"; //wp-calendar
   if(!$ec3->disable_popups)
     echo "\t<script type='text/javascript' src='"
     .    $ec3->myfiles . "/popup.js'></script>\n";



On Thu, Oct 16, 2008 at 5:32 PM, Alex Tingle <alex at firetree.net> wrote:

> Rick,
>
> If you use the command-line 'diff' program, then make sure you give it the
> '-u' option. That switches it to 'unified' diff format, which is generally
> preferred these days.
>
> unix%  diff -u OLDFILE NEWFILE > PATCH.diff
>
> -Alex
>
> --
>
> Rick Boatright wrote:
> > it _is_ possible to edit template_functions.php to provide multiple
> > calendars.
> >
> > If you don't CARE about valid xhtml (bad idea, but some people may not)
> you
> > can just comment out the if statement that kills multiple instances.
> >
> > If you _do_ care, the following diff will add a "uniqifier" to each id in
> a
> > calender for each call.  -- this works and verifies, although it's a
> little
> > ugly....
> >
> > (this diff is against 3.2.dev)
> >
> > Rick
> >
> > ---
> >>   echo "\t    <a id='ec3_publish' href='$webcal'"
> > 98c98
> > <   echo "\t<td id='next_n$ec3->call_count'><a
> > id='ec3_next_n$ec3->call_count' href='" . $next->month_link() . "'"
> > ---
> >>   echo "\t<td id='next'><a id='ec3_next' href='" . $next->month_link() .
> > "'"
> > 207c207
> > <   echo "<table id='" . $date->month_id() . "_n" . $ec3->call_count .
> > "'>\n<caption>"
> > ---
> >>   echo "<table id='" . $date->month_id() . "'>\n<caption>"
> > 236c236
> > <     echo "<td id='$day_id" . "_n$ec3->call_count'";
> > ---
> >>     echo "<td id='$day_id'";
> > 289a290,294
> >>   if($ec3->call_count>1)
> >>   {
> >>     echo "<!-- You can only have one Event Calendar on each page.
> -->\n";
> >>     return;
> >>   }
> > 291,300c296
> > <  //Attempt to fix multiple calendar identity problems - RBoatright
> > <  // if($ec3->call_count>1)
> > <  // {
> > <  //   echo "<!-- You can only have one Event Calendar on each page.
> > -->\n";
> > <  //   return;
> > <  // }
> > <
> > <   echo "<div class='wp-calendar'>\n";
> > <   //add unique dive for each call
> > <   echo "<div id='Calendar-number_n$ec3->call_count'>\n";
> > ---
> >>   echo "<div id='wp-calendar'>\n";
> > 329,330c325,326
> > <   echo "</div>\n"; //calendar-count
> > <   echo "</div>\n"; //wp-calendar
> > ---
> >>   echo "</div>\n";
> >>
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Blog: http://wpcal.firetree.net/
> > EventCalendar at firetree.net mailing list
> > Unsubscribe: http://penguin.firetree.net/eventcalendar
>
>
> --
> :: Let me solve your problems: http://www.firetree.net/consulting/
> :: alex.tingle AT firetree.net  +44-7901-552763
>
>
> _______________________________________________
> 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/20081016/7825ecb7/attachment.htm


More information about the EventCalendar mailing list