<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>Add maxevents parameter to monthlist Block</title> 
  <pubDate>Fri, 10 Apr 2026 08:50:57 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/3905</link> 
  <atom:link rel="self" type="application/rss+xml" title="Add maxevents parameter to monthlist Block" href="https://bugs.horde.org/ticket/3905/rss" /> 
  <description>Add maxevents parameter to monthlist Block</description> 
 
   
   
  <item> 
   <title>The following patch adds a maxevents parameter to the monthl</title> 
   <description>The following patch adds a maxevents parameter to the monthlist Block, which allows you to limit the total number of events displayed in the block.





--- monthlist.php       (revision 67)

+++ monthlist.php       (working copy)

@@ -23,7 +23,10 @@

                                             &#039;default&#039; =&gt; &#039;__all&#039;),

                         &#039;months&#039;   =&gt; array(&#039;name&#039; =&gt; _(&quot;Months Ahead&quot;),

                                             &#039;type&#039; =&gt; &#039;int&#039;,

-                                            &#039;default&#039; =&gt; 2));

+                                            &#039;default&#039; =&gt; 2),

+                        &#039;maxevents&#039; =&gt; array(&#039;name&#039; =&gt; _(&quot;Maximum number of events to display (0 = no limit)&quot;),

+                                             &#039;type&#039; =&gt; &#039;int&#039;,

+                                             &#039;default&#039; =&gt; 0));

         $params[&#039;calendar&#039;][&#039;values&#039;][&#039;__all&#039;] = _(&quot;All Visible&quot;);

         foreach (Kronolith::listCalendars() as $id =&gt; $cal) {

             $params[&#039;calendar&#039;][&#039;values&#039;][$id] = $cal-&gt;get(&#039;name&#039;);

@@ -79,6 +82,7 @@

                                     $endDate-&gt;mday, $endDate-&gt;month, $endDate-&gt;year);

 

         /* Loop through the days. */

+        $totalevents = 0;

         for ($i = 0; $i &lt; $days; $i++) {

             $day = &amp;new Kronolith_Day($startDate-&gt;month, $today + $i);

             $today_stamp = $day-&gt;getStamp();

@@ -86,6 +90,10 @@

                 continue;

             }

 

+            if(($this-&gt;_params[&#039;maxevents&#039;] &gt; 0) &amp;&amp; ($totalevents &gt;= $this-&gt;_params[&#039;maxevents&#039;])) {

+                break;

+            }

+

             $firstevent = true;

 

             /* Output month header. */

@@ -156,6 +164,8 @@

                     $html .= &#039;&lt;/strong&gt;&#039;;

                 }

                 $html .= &#039;&lt;/td&gt;&lt;/tr&gt;&#039;;

+

+                $totalevents++;

             }

         }</description> 
   <pubDate>Tue, 09 May 2006 15:43:49 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/3905#t20000</link> 
  </item> 
   
  <item> 
   <title>Committed, thanks.</title> 
   <description>Committed, thanks.</description> 
   <pubDate>Tue, 09 May 2006 21:48:26 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/3905#t20015</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
