Differences

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

Link to this comparison view

Last revisionBoth sides next revision
public:dokuwiki_goes_mobile [2010/04/25 15:57] – created Nicopublic:dokuwiki_goes_mobile [2012/03/24 12:03] Nico
Line 6: Line 6:
 ===== Fix dokuwiki ===== ===== Fix dokuwiki =====
 The main trick here is that dokuwiki uses a special function, ismobiledevice() to set a global environment variable called "ismobile". This function is called in inc/common.php; unfortunatly, the templating stuff is handled by inc/init.php, which is called before. We need to fix it. The main trick here is that dokuwiki uses a special function, ismobiledevice() to set a global environment variable called "ismobile". This function is called in inc/common.php; unfortunatly, the templating stuff is handled by inc/init.php, which is called before. We need to fix it.
-==== doku.php ==== 
-Swap the 2 following include lines to load common.php before init.php: 
-<code> 
-require_once(DOKU_INC.'inc/common.php'); 
-require_once(DOKU_INC.'inc/init.php'); 
-</code> 
 ==== inc/init.php ==== ==== inc/init.php ====
 Add the following somewhere before the template definition stuff: Add the following somewhere before the template definition stuff:
 <code> <code>
 +require_once(DOKU_INC.'inc/common.php');
 if (clientismobile()) if (clientismobile())
     $conf['template'] = 'dokumobile';     $conf['template'] = 'dokumobile';
 </code> </code>
-==== lib/exe/css.phplib/exe/js.php ==== + 
-these files don't call common.phpso let's add it (before init.php):+Of courseif you installed [[http://www.dokuwiki.org/template:minimal_mobile|minimal_mobile]]the last line will be: 
 <code> <code>
-require_once(DOKU_INC.'inc/common.php'); +    $conf['template'] = 'minimal_mobile';
-require_once(DOKU_INC.'inc/init.php');+
 </code> </code>