DokuWiki

It's better when it's simple

User Tools

Site Tools


tips:stickyexporthtml

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tips:stickyexporthtml [2009-03-12 03:28] – minor changes 190.1.20.183tips:stickyexporthtml [2010-11-17 09:55] (current) – [Change #1] 188.195.45.26
Line 15: Line 15:
 ==== Change #1 ==== ==== Change #1 ====
  
-In xhtml.php, internallink function, around line 530, insert this code before the "output formatted" comment near the end of the function:+In **inc/parser/xhtml.php**, internallink function, around line 530, insert this code before the "output formatted" comment near the end of the function:
 <code php> <code php>
         global $ACT;         global $ACT;
Line 30: Line 30:
 That change adds the "export_xhtml" action to the link "action" field if that was the action by which the current page was loaded.  You don't need to handle "export_html" separately, because it gets translated to "export_xhtml" somewhere else. That change adds the "export_xhtml" action to the link "action" field if that was the action by which the current page was loaded.  You don't need to handle "export_html" separately, because it gets translated to "export_xhtml" somewhere else.
  
 +And this runs for different actions:
 +<code php>
 +     if ($ACT == 'export_html' || $ACT == 'export_xhtml' || $ACT == 'export_xhtmlbody') {
 +</code>
 ==== Change #2 ==== ==== Change #2 ====
  
Line 41: Line 45:
 ==== Change #3 ==== ==== Change #3 ====
  
-In parserutils.php, p_cached_xhtml function, around line 130, change:+In **inc/parserutils.php**, p_cached_xhtml function, around line 130, change:
 <code php> <code php>
   $cache  = getCacheName($file.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT'],'.xhtml');   $cache  = getCacheName($file.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT'],'.xhtml');
Line 49: Line 53:
   global $ACT;   global $ACT;
   $cache  = getCacheName($file.$ACT.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT'],'.xhtml');   $cache  = getCacheName($file.$ACT.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT'],'.xhtml');
 +</code>
 +or in **inc/cache.php** change to:
 +<code php>
 +    if ($mode == 'html' || $mode == 'xhtml' || $mode == 'xhtmlbody') {
 +     parent::cache($file.$mode.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT'],'.'.$mode);
 +    } else {
 +     parent::cache($file.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT'],'.'.$mode);
 +    }
 </code> </code>
 The idea is to use a different cache file for "export_html" vs. not.  Without this change I found that once you'd loaded a page with "export_html", subsequent attempts to load the page normally would result in the HTML-only version. The idea is to use a different cache file for "export_html" vs. not.  Without this change I found that once you'd loaded a page with "export_html", subsequent attempts to load the page normally would result in the HTML-only version.
 +
 +
 +
tips/stickyexporthtml.txt · Last modified: 2010-11-17 09:55 by 188.195.45.26

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki