<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -109,36 +109,43 @@ class syntax_plugin_blog_blog extends DokuWiki_Syntax_Plugin {
             msg($this-&gt;getLang('missing_includeplugin'), -1);
             return false;
         }
+
         if ($mode == 'xhtml') {
             // prevent caching to ensure the included pages are always fresh
             $renderer-&gt;info['cache'] = false;
 
             // show new entry form
             $perm_create = (auth_quickaclcheck($ns.':*') &gt;= AUTH_CREATE);
-            if ($perm_create &amp;&amp; $formpos == 'top')
+            if ($perm_create &amp;&amp; $formpos == 'top') {
                 $renderer-&gt;doc .= $this-&gt;_newEntryForm($ns);
+            }
 
             // current section level
             $clevel = 0;
             preg_match_all('|&lt;div class=&quot;level(\d)&quot;&gt;|i', $renderer-&gt;doc, $matches, PREG_SET_ORDER);
             $n = count($matches)-1;
             if ($n &gt; -1) $clevel = $matches[$n][1];
-            $include-&gt;setLevel($clevel);
 
             // close current section
             if ($clevel) $renderer-&gt;doc .= '&lt;/div&gt;'.DOKU_LF;
             $renderer-&gt;doc .= '&lt;div class=&quot;hfeed&quot;&gt;'.DOKU_LF;
         }
 
+        // we need our own renderer
+        $include_renderer =&amp; p_get_renderer('xhtml');
+        $include_renderer-&gt;smileys   = getSmileys();
+        $include_renderer-&gt;entities  = getEntities();
+        $include_renderer-&gt;acronyms  = getAcronyms();
+        $include_renderer-&gt;interwiki = getInterwiki();
+
         // now include the blog entries
         foreach ($entries as $entry) {
-            if (!$include-&gt;setPage($entry)) continue; // returns false if include recursion
             if ($mode == 'xhtml') {
-                $include-&gt;setFlags($flags);
-                $include-&gt;renderXHTML($renderer, $info);
+                if(auth_quickaclcheck($entry['id'] &gt;= AUTH_READ)) {
+                    $renderer-&gt;doc .= $this-&gt;render_XHTML($include, $include_renderer, $entry['id'], $clevel, $flags);
+                }
             } elseif ($mode == 'metadata') {
                 $renderer-&gt;meta['relation']['haspart'][$entry['id']] = true;
-                $include-&gt;pages = array(); // clear filechain - important!
             }
         }
 
@@ -151,8 +158,9 @@ class syntax_plugin_blog_blog extends DokuWiki_Syntax_Plugin {
             $renderer-&gt;doc .= $this-&gt;_browseEntriesLinks($more, $first, $num);
 
             // show new entry form
-            if ($perm_create &amp;&amp; $formpos == 'bottom')
+            if ($perm_create &amp;&amp; $formpos == 'bottom') {
                 $renderer-&gt;doc .= $this-&gt;_newEntryForm($ns);
+            }
         }
 
         return true;
@@ -161,6 +169,29 @@ class syntax_plugin_blog_blog extends DokuWiki_Syntax_Plugin {
     /* ---------- (X)HTML Output Functions ---------- */
 
     /**
+     * Returns the XHTML output including the footer etc. for use with the blog plugin
+     * FIXME remove after blogtng plugin officially replaces the blog plugin?
+     *
+     * @author Michael Klier &lt;chi@chimeric.de&gt;
+     */
+    function render_XHTML(&amp;$include, &amp;$renderer, $page, $lvl, $set_flags) {
+        if(!$include-&gt;includes[$page]) {
+            $renderer-&gt;doc = '';
+            $include-&gt;includes[$page];
+            $flags = $include-&gt;get_flags($set_flags);
+            $ins = $include-&gt;_get_instructions($page, '', 'page', $lvl, $flags);
+            foreach($ins as $i) {
+                call_user_func_array(array(&amp;$renderer, $i[0]),$i[1]);
+            }
+            // Post process and return the output
+            $data = array($mode, $renderer-&gt;doc);
+            trigger_event('RENDERER_CONTENT_POSTPROCESS',$data);
+            return $renderer-&gt;doc;
+        }
+    }
+
+
+    /**
      * Displays links to older newer entries of the blog namespace
      */
     function _browseEntriesLinks($more, $first, $num) {</diff>
      <filename>syntax/blog.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>47e65d75c3cb79dbc509f35cb41d4d48471ba4d0</id>
    </parent>
  </parents>
  <author>
    <name>Michael Klier</name>
    <login>chimeric</login>
    <email>chi@chimeric.de</email>
  </author>
  <url>http://github.com/dokufreaks/plugin-blog/commit/b8ec0a6a6c9ce3a0b445b58e101cb116fcc0585d</url>
  <id>b8ec0a6a6c9ce3a0b445b58e101cb116fcc0585d</id>
  <committed-date>2009-05-11T04:09:11-07:00</committed-date>
  <authored-date>2009-05-11T04:09:11-07:00</authored-date>
  <message>fixed compatibility issues with latest include plugin

darcs-hash:20090511110911-23886-4911ff041c9ae6c8c6023bf7b36d54268f02f887.gz</message>
  <tree>f973bd966b5347c96bb28ed668204244795f3474</tree>
  <committer>
    <name>Michael Klier</name>
    <login>chimeric</login>
    <email>chi@chimeric.de</email>
  </committer>
</commit>
